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

@@ -10,6 +10,7 @@ export class SaleEstimateTransfromer extends Transformer {
*/
public includeAttributes = (): string[] => {
return [
'formattedSubtotal',
'formattedAmount',
'formattedEstimateDate',
'formattedExpirationDate',
@@ -76,6 +77,15 @@ export class SaleEstimateTransfromer extends Transformer {
});
};
/**
* Retrieves the formatted invoice subtotal.
* @param {ISaleEstimate} estimate
* @returns {string}
*/
protected formattedSubtotal = (estimate: ISaleEstimate): string => {
return formatNumber(estimate.amount, { money: false });
};
/**
* Retrieves the entries of the sale estimate.
* @param {ISaleEstimate} estimate