feat: wip preview invoice payment mail

This commit is contained in:
Ahmed Bouhuolia
2024-10-29 21:14:46 +02:00
parent 12189f018d
commit e10c530b4b
13 changed files with 301 additions and 81 deletions

View File

@@ -33,7 +33,7 @@ export class SaleInvoicePdf {
* Retrieve sale invoice pdf content.
* @param {number} tenantId - Tenant Id.
* @param {ISaleInvoice} saleInvoice -
* @returns {Promise<Buffer>}
* @returns {Promise<[Buffer, string]>}
*/
public async saleInvoicePdf(
tenantId: number,

View File

@@ -48,11 +48,14 @@ export class SendSaleInvoiceMailCommon {
tenantId,
saleInvoice.customerId
);
const formatArgs = await this.getInvoiceFormatterArgs(tenantId, invoiceId);
return {
...contactMailDefaultOptions,
attachInvoice: true,
subject: defaultSubject,
message: defaultMessage,
attachInvoice: true,
formatArgs,
};
}
@@ -103,7 +106,11 @@ export class SendSaleInvoiceMailCommon {
tenantId,
invoiceId
);
const commonArgs =
await this.contactMailNotification.getCommonFormatArgs(tenantId);
return {
...commonArgs,
CustomerName: invoice.customer.displayName,
InvoiceNumber: invoice.invoiceNo,
InvoiceDueAmount: invoice.dueAmountFormatted,

View File

@@ -15,9 +15,8 @@ import {
parseMailOptions,
validateRequiredMailOptions,
} from '@/services/MailNotification/utils';
import events from '@/subscribers/events';
import { EventPublisher } from '@/lib/EventPublisher/EventPublisher';
import { ParsedNumberSearch } from 'libphonenumber-js';
import events from '@/subscribers/events';
@Service()
export class SendSaleInvoiceMail {