mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-06-03 00:19:01 +00:00
- Added English translations for customer types in `customer.json`. - Updated `Model.ts` to improve deletion logic by filtering dependent relations. - Introduced `BillPaymentBillSyncSubscriber` to handle bill payment events. - Enhanced `CreateBillPaymentService` and `EditBillPaymentService` to fetch entries after insertion/updating. - Updated `SaleInvoiceCostGLEntries` to include item entry details in GL entries. - Refactored various components in the webapp for consistency in naming conventions.
26 lines
902 B
TypeScript
26 lines
902 B
TypeScript
import { Injectable } from '@nestjs/common';
|
|
import { OnEvent } from '@nestjs/event-emitter';
|
|
import { events } from '@/common/events/events';
|
|
import { IInventoryCostLotsGLEntriesWriteEvent } from '@/modules/InventoryCost/types/InventoryCost.types';
|
|
import { SaleInvoiceCostGLEntries } from '../SaleInvoiceCostGLEntries';
|
|
|
|
@Injectable()
|
|
export class InvoiceCostGLEntriesSubscriber {
|
|
constructor(private readonly invoiceCostEntries: SaleInvoiceCostGLEntries) { }
|
|
|
|
/**
|
|
* Writes the invoices cost GL entries once the inventory cost lots be written.
|
|
* @param {IInventoryCostLotsGLEntriesWriteEvent}
|
|
*/
|
|
@OnEvent(events.inventory.onCostLotsGLEntriesWrite)
|
|
async writeInvoicesCostEntriesOnCostLotsWritten({
|
|
trx,
|
|
startingDate,
|
|
}: IInventoryCostLotsGLEntriesWriteEvent) {
|
|
await this.invoiceCostEntries.writeInventoryCostJournalEntries(
|
|
startingDate,
|
|
trx,
|
|
);
|
|
}
|
|
}
|