mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
feat: average rate cost method.
This commit is contained in:
@@ -117,7 +117,8 @@ export default class BillSubscriber {
|
||||
this.logger.info('[bill] writing the inventory transactions', { tenantId });
|
||||
this.billsService.recordInventoryTransactions(
|
||||
tenantId,
|
||||
bill,
|
||||
bill.id,
|
||||
bill.billDate,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -129,7 +130,8 @@ export default class BillSubscriber {
|
||||
this.logger.info('[bill] overwriting the inventory transactions.', { tenantId });
|
||||
this.billsService.recordInventoryTransactions(
|
||||
tenantId,
|
||||
bill,
|
||||
bill.id,
|
||||
bill.billDate,
|
||||
true,
|
||||
);
|
||||
}
|
||||
@@ -145,4 +147,19 @@ export default class BillSubscriber {
|
||||
billId,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedules items cost compute jobs once the inventory transactions created
|
||||
* of the bill transaction.
|
||||
*/
|
||||
@On(events.bill.onInventoryTransactionsCreated)
|
||||
public async handleComputeItemsCosts({ tenantId, billId }) {
|
||||
this.logger.info('[bill] trying to compute the bill items cost.', {
|
||||
tenantId, billId,
|
||||
});
|
||||
await this.billsService.scheduleComputeBillItemsCost(
|
||||
tenantId,
|
||||
billId,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user