fix: payment receive subtotal shouldn't be rounded

This commit is contained in:
Ahmed Bouhuolia
2024-02-06 10:54:41 +02:00
parent 528d447443
commit 374f1acf8a
3 changed files with 20 additions and 10 deletions

View File

@@ -10,6 +10,7 @@ export class PaymentReceiveTransfromer extends Transformer {
*/
public includeAttributes = (): string[] => {
return [
'subtotalFormatted',
'formattedPaymentDate',
'formattedAmount',
'formattedExchangeRate',
@@ -26,6 +27,18 @@ export class PaymentReceiveTransfromer extends Transformer {
return this.formatDate(payment.paymentDate);
};
/**
* Retrieve the formatted payment subtotal.
* @param {IPaymentReceive} payment
* @returns {string}
*/
protected subtotalFormatted = (payment: IPaymentReceive): string => {
return formatNumber(payment.amount, {
currencyCode: payment.currencyCode,
money: false,
});
};
/**
* Retrieve formatted payment amount.
* @param {ISaleInvoice} invoice