mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 04:10:32 +00:00
fix: auto increment serial transactions
This commit is contained in:
@@ -29,6 +29,7 @@ import { CreditNotesImportable } from './commands/CreditNotesImportable';
|
||||
import { CreditNoteInventoryTransactionsSubscriber } from './subscribers/CreditNoteInventoryTransactionsSubscriber';
|
||||
import { RefundSyncCreditNoteBalanceSubscriber } from './subscribers/RefundSyncCreditNoteBalanceSubscriber';
|
||||
import { DeleteCustomerLinkedCreditSubscriber } from './subscribers/DeleteCustomerLinkedCreditSubscriber';
|
||||
import { CreditNoteAutoSerialSubscriber } from './subscribers/CreditNoteAutoSerialSubscriber';
|
||||
import { CreditNoteInventoryTransactions } from './commands/CreditNotesInventoryTransactions';
|
||||
import { InventoryCostModule } from '../InventoryCost/InventoryCost.module';
|
||||
import { CreditNoteRefundsModule } from '../CreditNoteRefunds/CreditNoteRefunds.module';
|
||||
@@ -71,6 +72,7 @@ import { CreditNotesApplyInvoiceModule } from '../CreditNotesApplyInvoice/Credit
|
||||
CreditNoteInventoryTransactionsSubscriber,
|
||||
RefundSyncCreditNoteBalanceSubscriber,
|
||||
DeleteCustomerLinkedCreditSubscriber,
|
||||
CreditNoteAutoSerialSubscriber,
|
||||
],
|
||||
exports: [
|
||||
CreateCreditNoteService,
|
||||
|
||||
@@ -5,17 +5,17 @@ import { ICreditNoteCreatedPayload } from '../types/CreditNotes.types';
|
||||
import { events } from '@/common/events/events';
|
||||
|
||||
@Injectable()
|
||||
export default class CreditNoteAutoSerialSubscriber {
|
||||
export class CreditNoteAutoSerialSubscriber {
|
||||
constructor(
|
||||
private readonly creditNoteIncrementService: CreditNoteAutoIncrementService,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Auto serial increment once credit note created.
|
||||
* @param {ICreditNoteCreatedPayload} payload -
|
||||
*/
|
||||
@OnEvent(events.creditNote.onCreated)
|
||||
async autoSerialIncrementOnceCreated({}: ICreditNoteCreatedPayload) {
|
||||
async autoSerialIncrementOnceCreated({ }: ICreditNoteCreatedPayload) {
|
||||
await this.creditNoteIncrementService.incrementSerialNumber();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user