feat: Assign default PDF template automatically

This commit is contained in:
Ahmed Bouhuolia
2024-10-02 18:18:57 +02:00
parent cbc60b3c73
commit b23112bc92
30 changed files with 501 additions and 46 deletions

View File

@@ -28,6 +28,7 @@ import { SaleInvoiceNotifyBySms } from './SaleInvoiceNotifyBySms';
import { SendInvoiceMailReminder } from './SendSaleInvoiceMailReminder';
import { SendSaleInvoiceMail } from './SendSaleInvoiceMail';
import { GetSaleInvoiceMailReminder } from './GetSaleInvoiceMailReminder';
import { GetSaleInvoiceState } from './GetSaleInvoiceState';
@Service()
export class SaleInvoiceApplication {
@@ -73,6 +74,9 @@ export class SaleInvoiceApplication {
@Inject()
private getSaleInvoiceReminderService: GetSaleInvoiceMailReminder;
@Inject()
private getSaleInvoiceStateService: GetSaleInvoiceState;
/**
* Creates a new sale invoice with associated GL entries.
* @param {number} tenantId
@@ -169,6 +173,16 @@ export class SaleInvoiceApplication {
);
}
/**
* Retrieves the sale invoice state.
* @param {number} tenantId
* @param {number} saleInvoiceId
* @returns
*/
public getSaleInvoiceState(tenantId: number) {
return this.getSaleInvoiceStateService.getSaleInvoiceState(tenantId);
}
/**
* Mark the given sale invoice as delivered.
* @param {number} tenantId