mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
fix: pdf templates
This commit is contained in:
@@ -62,6 +62,8 @@ export interface ICreditNote {
|
||||
branchId?: number;
|
||||
warehouseId: number;
|
||||
createdAt?: Date;
|
||||
termsConditions: string;
|
||||
note: string;
|
||||
}
|
||||
|
||||
export enum CreditNoteAction {
|
||||
|
||||
@@ -203,53 +203,35 @@ export interface PaymentReceivedPdfTax {
|
||||
export interface PaymentReceivedPdfTemplateAttributes {
|
||||
primaryColor: string;
|
||||
secondaryColor: string;
|
||||
companyName: string;
|
||||
|
||||
showCompanyLogo: boolean;
|
||||
companyLogo: string;
|
||||
companyName: string;
|
||||
|
||||
dueDateLabel: string;
|
||||
showDueDate: boolean;
|
||||
|
||||
dateIssueLabel: string;
|
||||
showDateIssue: boolean;
|
||||
|
||||
invoiceNumberLabel: string;
|
||||
showInvoiceNumber: boolean;
|
||||
|
||||
showBillingToAddress: boolean;
|
||||
showBilledFromAddress: boolean;
|
||||
billedToLabel: string;
|
||||
|
||||
lineItemLabel: string;
|
||||
lineDescriptionLabel: string;
|
||||
lineRateLabel: string;
|
||||
lineTotalLabel: string;
|
||||
|
||||
totalLabel: string;
|
||||
subtotalLabel: string;
|
||||
discountLabel: string;
|
||||
paymentMadeLabel: string;
|
||||
balanceDueLabel: string;
|
||||
|
||||
showTotal: boolean;
|
||||
showSubtotal: boolean;
|
||||
showDiscount: boolean;
|
||||
showTaxes: boolean;
|
||||
showPaymentMade: boolean;
|
||||
showDueAmount: boolean;
|
||||
showBalanceDue: boolean;
|
||||
|
||||
discount: string;
|
||||
|
||||
termsConditionsLabel: string;
|
||||
showTermsConditions: boolean;
|
||||
|
||||
lines: PaymentReceivedPdfLineItem[];
|
||||
taxes: PaymentReceivedPdfTax[];
|
||||
|
||||
statementLabel: string;
|
||||
showStatement: boolean;
|
||||
billedToAddress: string[];
|
||||
billedFromAddress: string[];
|
||||
showBilledFromAddress: boolean;
|
||||
showBillingToAddress: boolean;
|
||||
billedToLabel: string;
|
||||
|
||||
total: string;
|
||||
totalLabel: string;
|
||||
showTotal: boolean;
|
||||
|
||||
subtotal: string;
|
||||
subtotalLabel: string;
|
||||
showSubtotal: boolean;
|
||||
|
||||
lines: Array<{
|
||||
invoiceNumber: string;
|
||||
invoiceAmount: string;
|
||||
paidAmount: string;
|
||||
}>;
|
||||
|
||||
showPaymentReceivedNumber: boolean;
|
||||
paymentReceivedNumberLabel: string;
|
||||
paymentReceivedNumebr: string;
|
||||
|
||||
paymentReceivedDate: string;
|
||||
showPaymentReceivedDate: boolean;
|
||||
paymentReceivedDateLabel: string;
|
||||
}
|
||||
|
||||
@@ -155,3 +155,57 @@ export interface ISaleReceiptMailPresend {
|
||||
saleReceiptId: number;
|
||||
messageOptions: SaleReceiptMailOptsDTO;
|
||||
}
|
||||
|
||||
export interface ISaleReceiptBrandingTemplateAttributes {
|
||||
primaryColor: string;
|
||||
secondaryColor: string;
|
||||
showCompanyLogo: boolean;
|
||||
companyLogo: string;
|
||||
companyName: string;
|
||||
|
||||
// Address
|
||||
billedToAddress: string[];
|
||||
billedFromAddress: string[];
|
||||
showBilledFromAddress: boolean;
|
||||
showBilledToAddress: boolean;
|
||||
billedToLabel: string;
|
||||
|
||||
// Total
|
||||
total: string;
|
||||
totalLabel: string;
|
||||
showTotal: boolean;
|
||||
|
||||
// Subtotal
|
||||
subtotal: string;
|
||||
subtotalLabel: string;
|
||||
showSubtotal: boolean;
|
||||
|
||||
// Customer Note
|
||||
showCustomerNote: boolean;
|
||||
customerNote: string;
|
||||
customerNoteLabel: string;
|
||||
|
||||
// Terms & Conditions
|
||||
showTermsConditions: boolean;
|
||||
termsConditions: string;
|
||||
termsConditionsLabel: string;
|
||||
|
||||
// Lines
|
||||
lines: Array<{
|
||||
item: string;
|
||||
description: string;
|
||||
rate: string;
|
||||
quantity: string;
|
||||
total: string;
|
||||
}>;
|
||||
|
||||
// Receipt Number
|
||||
showReceiptNumber: boolean;
|
||||
receiptNumberLabel: string;
|
||||
receiptNumebr: string;
|
||||
|
||||
// Receipt Date
|
||||
receiptDate: string;
|
||||
showReceiptDate: boolean;
|
||||
receiptDateLabel: string;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,23 @@
|
||||
import { CreditNotePdfTemplateAttributes } from "@/interfaces";
|
||||
import CreditNote from "@/models/CreditNote";
|
||||
import { CreditNotePdfTemplateAttributes, ICreditNote } from '@/interfaces';
|
||||
|
||||
|
||||
export const transformCreditNoteToPdfTemplate = (creditNote: CreditNote): Partial<CreditNotePdfTemplateAttributes> {
|
||||
export const transformCreditNoteToPdfTemplate = (
|
||||
creditNote: ICreditNote
|
||||
): Partial<CreditNotePdfTemplateAttributes> => {
|
||||
return {
|
||||
creditNoteDate: creditNote.formattedCreditNoteDate,
|
||||
creditNoteNumebr: creditNote.creditNoteNumber,
|
||||
|
||||
total: creditNote.formattedAmount,
|
||||
subtotal: creditNote.formattedSubtotal,
|
||||
|
||||
lines: creditNote.entries?.map((entry) => ({
|
||||
item: entry.item.name,
|
||||
description: entry.description,
|
||||
rate: entry.rateFormatted,
|
||||
quantity: entry.quantityFormatted,
|
||||
total: entry.totalFormatted,
|
||||
})),
|
||||
customerNote: creditNote.note,
|
||||
termsConditions: creditNote.termsConditions,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user