feat(invoices|receipts|estimates|payments): auto-increment backend logic based.

This commit is contained in:
a.bouhuolia
2021-03-07 16:14:59 +02:00
parent c245f4249d
commit 42ce791713
17 changed files with 482 additions and 201 deletions

View File

@@ -50,17 +50,9 @@ export default class SaleInvoiceSubscriber {
@On(events.saleInvoice.onCreated)
public async handleInvoiceNextNumberIncrement({
tenantId,
saleInvoiceId,
saleInvoice,
saleInvoiceDTO,
autoNextNumber,
}) {
if (saleInvoiceDTO.invoiceNo || !autoNextNumber) return;
await this.saleInvoicesService.autoIncrementOrdersService.incrementSettingsNextNumber(
await this.saleInvoicesService.incrementNextInvoiceNumber(
tenantId,
'sales_invoices',
autoNextNumber[1]
);
}
}

View File

@@ -130,9 +130,6 @@ export default class PaymentReceivesSubscriber {
tenantId,
paymentReceiveId,
}) {
await this.settingsService.incrementNextNumber(tenantId, {
key: 'next_number',
group: 'payment_receives',
});
await this.paymentReceivesService.incrementNextPaymentReceiveNumber(tenantId);
}
}