mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
feat: mail receipt preview
This commit is contained in:
@@ -106,7 +106,7 @@ export class GetPaymentReceivedMailStateTransformer extends PaymentReceiveTransf
|
||||
* @returns {string}
|
||||
*/
|
||||
protected totalFormatted = (payment) => {
|
||||
return this.formatMoney(payment.total);
|
||||
return this.formatMoney(payment.amount);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -125,7 +125,7 @@ export class GetPaymentReceivedMailStateTransformer extends PaymentReceiveTransf
|
||||
* @returns {string}
|
||||
*/
|
||||
protected subtotalFormatted = (payment) => {
|
||||
return this.formatMoney(payment.total);
|
||||
return this.formatMoney(payment.amount);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -163,7 +163,7 @@ export class GetPaymentReceivedEntryMailState extends PaymentReceivedEntryTransf
|
||||
* @returns {Array}
|
||||
*/
|
||||
public includeAttributes = (): string[] => {
|
||||
return ['paymentAmountFormatted'];
|
||||
return ['paidAmount', 'invoiceNumber'];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -173,4 +173,22 @@ export class GetPaymentReceivedEntryMailState extends PaymentReceivedEntryTransf
|
||||
public excludeAttributes = (): string[] => {
|
||||
return ['*'];
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param entry
|
||||
* @returns {string}
|
||||
*/
|
||||
public paidAmount = (entry) => {
|
||||
return this.paymentAmountFormatted(entry);
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param entry
|
||||
* @returns {string}
|
||||
*/
|
||||
public invoiceNumber = (entry) => {
|
||||
return entry.invoice.invoiceNo;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,83 @@
|
||||
import { Transformer } from '@/lib/Transformer/Transformer';
|
||||
|
||||
export class GetPaymentReceivedMailTemplateAttrsTransformer extends Transformer {}
|
||||
export class GetPaymentReceivedMailTemplateAttrsTransformer extends Transformer {
|
||||
/**
|
||||
* Included attributes.
|
||||
* @returns {Array}
|
||||
*/
|
||||
public includeAttributes = (): string[] => {
|
||||
return [
|
||||
'companyLogoUri',
|
||||
'companyName',
|
||||
'primaryColor',
|
||||
'total',
|
||||
'totalLabel',
|
||||
'paymentNumberLabel',
|
||||
'paymentNumber',
|
||||
];
|
||||
};
|
||||
|
||||
/**
|
||||
* Exclude all attributes.
|
||||
* @returns {string[]}
|
||||
*/
|
||||
public excludeAttributes = (): string[] => {
|
||||
return ['*'];
|
||||
};
|
||||
|
||||
/**
|
||||
* Company logo uri.
|
||||
* @returns {string}
|
||||
*/
|
||||
public companyLogoUri(): string {
|
||||
return this.options.brandingTemplate?.companyLogoUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Company name.
|
||||
* @returns {string}
|
||||
*/
|
||||
public companyName(): string {
|
||||
return this.context.organization.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Primary color
|
||||
* @returns {string}
|
||||
*/
|
||||
public primaryColor(): string {
|
||||
return this.options?.brandingTemplate?.attributes?.primaryColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total.
|
||||
* @returns {string}
|
||||
*/
|
||||
public total(): string {
|
||||
return this.options.paymentReceived.formattedAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total label.
|
||||
* @returns {string}
|
||||
*/
|
||||
public totalLabel(): string {
|
||||
return 'Total';
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment number label.
|
||||
* @returns
|
||||
*/
|
||||
public paymentNumberLabel(): string {
|
||||
return 'Payment # {paymentNumber}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment number.
|
||||
* @returns {string}
|
||||
*/
|
||||
public paymentNumber(): string {
|
||||
return this.options.paymentReceived.paymentReceiveNumber;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user