feat: compute items cost of inventory adjustments transcations.

This commit is contained in:
a.bouhuolia
2021-01-10 17:41:32 +02:00
parent 097b9fdb3a
commit 8491d44118
20 changed files with 433 additions and 180 deletions

View File

@@ -231,7 +231,6 @@ export default class JournalCommands {
referenceId: expense.id,
date: expense.paymentDate,
userId,
draft: !expense.publishedAt,
};
const paymentJournalEntry = new JournalEntry({
credit: expense.totalAmount,
@@ -330,7 +329,6 @@ export default class JournalCommands {
note: entry.note,
date: manualJournalObj.date,
userId: manualJournalObj.userId,
draft: !manualJournalObj.status,
index: entry.index,
});
if (entry.debit) {
@@ -354,7 +352,7 @@ export default class JournalCommands {
inventoryCostLot: IInventoryLotCost & { item: IItem }
) {
const commonEntry = {
referenceType: 'SaleInvoice',
referenceType: inventoryCostLot.transactionType,
referenceId: inventoryCostLot.transactionId,
date: inventoryCostLot.date,
};