fix: Decimal amounts are rounded when create a new transaction on some transactions types

This commit is contained in:
Ahmed Bouhuolia
2024-02-06 20:31:48 +02:00
parent 374f1acf8a
commit 0f678e61c5
12 changed files with 62 additions and 19 deletions

View File

@@ -14,6 +14,7 @@ export class CreditNoteTransformer extends Transformer {
'formattedCreditNoteDate',
'formattedAmount',
'formattedCreditsUsed',
'formattedSubtotal',
'entries',
];
};
@@ -60,6 +61,15 @@ export class CreditNoteTransformer extends Transformer {
});
};
/**
* Retrieves the formatted subtotal.
* @param {ICreditNote} credit
* @returns {string}
*/
protected formattedSubtotal = (credit): string => {
return formatNumber(credit.amount, { money: false });
};
/**
* Retrieves the entries of the credit note.
* @param {ICreditNote} credit