feat(ManualJournals): Auto-increment.

fix(BillPayment): Validate the opened payment bills.
fix(redux): presist redux state.
fix(useRequestQuery): hook.
This commit is contained in:
a.bouhuolia
2021-03-18 14:23:37 +02:00
parent 4e8bdee97a
commit 9ff8e3159d
79 changed files with 1326 additions and 889 deletions

View File

@@ -23,6 +23,7 @@ export default class AutoIncrementOrdersService {
// Settings service transaction number and prefix.
const autoIncrement = settings.get({ group, key: 'auto_increment' }, false);
const settingNo = settings.get({ group, key: 'next_number' }, '');
const settingPrefix = settings.get({ group, key: 'number_prefix' }, '');
@@ -37,11 +38,12 @@ export default class AutoIncrementOrdersService {
*/
async incrementSettingsNextNumber(tenantId: number, group: string) {
const settings = this.tenancy.settings(tenantId);
const settingNo = settings.get({ group, key: 'next_number' });
const autoIncrement = settings.get({ group, key: 'auto_increment' });
// Can't continue if the auto-increment of the service was disabled.
if (!autoIncrement) return;
if (!autoIncrement) { return; }
settings.set(
{ group, key: 'next_number' },

View File

@@ -522,7 +522,7 @@ export default class PaymentReceiveService {
public async deletePaymentReceive(
tenantId: number,
paymentReceiveId: number,
authorizedUser: ISystemUser
authorizedUser: ISystemUser,
) {
const { PaymentReceive, PaymentReceiveEntry } = this.tenancy.models(
tenantId
@@ -541,6 +541,7 @@ export default class PaymentReceiveService {
// Deletes the payment receive transaction.
await PaymentReceive.query().findById(paymentReceiveId).delete();
// Triggers `onPaymentReceiveDeleted` event.
await this.eventDispatcher.dispatch(events.paymentReceive.onDeleted, {
tenantId,
paymentReceiveId,