mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
feat: mail receipt preview
This commit is contained in:
@@ -32,6 +32,7 @@ export class GetPaymentReceivedMailState {
|
||||
.findById(paymentId)
|
||||
.withGraphFetched('customer')
|
||||
.withGraphFetched('entries.invoice')
|
||||
.withGraphFetched('pdfTemplate')
|
||||
.throwIfNotFound();
|
||||
|
||||
const mailOptions =
|
||||
|
||||
@@ -26,7 +26,10 @@ export class GetPaymentReceivedMailStateTransformer extends PaymentReceiveTransf
|
||||
'total',
|
||||
'totalFormatted',
|
||||
|
||||
'paymentNo',
|
||||
'subtotal',
|
||||
'subtotalFormatted',
|
||||
|
||||
'paymentNumber',
|
||||
|
||||
'entries',
|
||||
|
||||
@@ -87,6 +90,17 @@ export class GetPaymentReceivedMailStateTransformer extends PaymentReceiveTransf
|
||||
return this.formatMoney(payment.paymentAmount);
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the payment amount.
|
||||
* @param payment
|
||||
* @returns {number}
|
||||
*/
|
||||
protected total = (payment) => {
|
||||
return this.formatNumber(payment.amount, {
|
||||
money: false,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the formatted payment amount.
|
||||
* @returns {string}
|
||||
@@ -95,6 +109,34 @@ export class GetPaymentReceivedMailStateTransformer extends PaymentReceiveTransf
|
||||
return this.formatMoney(payment.total);
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the payment amount.
|
||||
* @param payment
|
||||
* @returns {number}
|
||||
*/
|
||||
protected subtotal = (payment) => {
|
||||
return this.formatNumber(payment.amount, {
|
||||
money: false,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the formatted payment amount.
|
||||
* @returns {string}
|
||||
*/
|
||||
protected subtotalFormatted = (payment) => {
|
||||
return this.formatMoney(payment.total);
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the payment number.
|
||||
* @param payment
|
||||
* @returns {string}
|
||||
*/
|
||||
protected paymentNumber = (payment) => {
|
||||
return payment.paymentReceiveNo;
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the payment entries.
|
||||
* @param {IPaymentReceived} payment
|
||||
|
||||
Reference in New Issue
Block a user