mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
fix: formatted money attributes
This commit is contained in:
@@ -74,6 +74,9 @@ export class PaymentReceivedResponseDto {
|
||||
@ApiProperty({ description: 'The formatted amount', example: '100.00' })
|
||||
formattedAmount: string;
|
||||
|
||||
@ApiProperty({ description: 'The formatted total', example: '100.00 USD' })
|
||||
formattedTotal: string;
|
||||
|
||||
@ApiProperty({ description: 'The currency code', example: 'USD' })
|
||||
currencyCode: string;
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ export class PaymentReceiveTransfromer extends Transformer {
|
||||
public includeAttributes = (): string[] => {
|
||||
return [
|
||||
'subtotalFormatted',
|
||||
'formatttedTotal',
|
||||
'formattedPaymentDate',
|
||||
'formattedCreatedAt',
|
||||
'formattedAmount',
|
||||
@@ -45,7 +46,18 @@ export class PaymentReceiveTransfromer extends Transformer {
|
||||
protected subtotalFormatted = (payment: PaymentReceived): string => {
|
||||
return this.formatNumber(payment.amount, {
|
||||
currencyCode: payment.currencyCode,
|
||||
money: false,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the formatted total.
|
||||
* @param {PaymentReceived} payment
|
||||
* @returns {string}
|
||||
*/
|
||||
protected formatttedTotal = (payment: PaymentReceived): string => {
|
||||
return this.formatNumber(payment.amount, {
|
||||
currencyCode: payment.currencyCode,
|
||||
money: true,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -66,7 +78,7 @@ export class PaymentReceiveTransfromer extends Transformer {
|
||||
* @returns {string}
|
||||
*/
|
||||
protected formattedExchangeRate = (payment: PaymentReceived): string => {
|
||||
return this.formatNumber(payment.exchangeRate, { money: false });
|
||||
return this.formatNumber(payment.exchangeRate);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user