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

@@ -12,6 +12,7 @@ export class SaleReceiptTransformer extends Transformer {
*/
public includeAttributes = (): string[] => {
return [
'formattedSubtotal',
'formattedAmount',
'formattedReceiptDate',
'formattedClosedAtDate',
@@ -37,6 +38,15 @@ export class SaleReceiptTransformer extends Transformer {
return this.formatDate(receipt.closedAt);
};
/**
* Retrieves the estimate formatted subtotal.
* @param {ISaleReceipt} receipt
* @returns {string}
*/
protected formattedSubtotal = (receipt: ISaleReceipt): string => {
return formatNumber(receipt.amount, { money: false });
};
/**
* Retrieve formatted invoice amount.
* @param {ISaleReceipt} estimate