fix: bank transactions report

This commit is contained in:
Ahmed Bouhuolia
2024-07-07 22:11:57 +02:00
parent b7487f19d3
commit 9a5befbee7
28 changed files with 560 additions and 158 deletions

View File

@@ -34,11 +34,12 @@ export default class CashflowTransactionJournalEntries {
currencyCode: transaction.currencyCode,
exchangeRate: transaction.exchangeRate,
transactionType: transformCashflowTransactionType(
transaction.transactionType
),
transactionType: 'CashflowTransaction',
transactionId: transaction.id,
transactionNumber: transaction.transactionNumber,
transactionSubType: transformCashflowTransactionType(
transaction.transactionType
),
referenceNumber: transaction.referenceNo,
note: transaction.description,
@@ -161,12 +162,10 @@ export default class CashflowTransactionJournalEntries {
cashflowTransactionId: number,
trx?: Knex.Transaction
): Promise<void> => {
const transactionTypes = getCashflowAccountTransactionsTypes();
await this.ledgerStorage.deleteByReference(
tenantId,
cashflowTransactionId,
transactionTypes,
'CashflowTransaction',
trx
);
};

View File

@@ -101,6 +101,7 @@ export default class NewCashflowTransactionService {
...fromDTO,
transactionNumber,
currencyCode: cashflowAccount.currencyCode,
exchangeRate: fromDTO?.exchangeRate || 1,
transactionType: transformCashflowTransactionType(
fromDTO.transactionType
),