feat: add adjustment total in estimates, invoices, and receipts pdf templates

This commit is contained in:
Ahmed Bouhuolia
2024-12-03 23:37:55 +02:00
parent 3a19518440
commit fabc88c81a
12 changed files with 91 additions and 33 deletions

View File

@@ -43,7 +43,7 @@ export interface EstimatePaperTemplateProps extends PaperTemplateProps {
companyAddress?: string;
billedToLabel?: string;
// Totals
// Total
total?: string;
showTotal?: boolean;
totalLabel?: string;
@@ -53,6 +53,11 @@ export interface EstimatePaperTemplateProps extends PaperTemplateProps {
showDiscount?: boolean;
discountLabel?: string;
// # Adjustment
adjustment?: string;
showAdjustment?: boolean;
adjustmentLabel?: string;
// # Subtotal
subtotal?: string;
showSubtotal?: boolean;
@@ -117,6 +122,11 @@ export function EstimatePaperTemplate({
subtotalLabel = 'Subtotal',
showSubtotal = true,
// # Adjustment
adjustment = '',
showAdjustment = true,
adjustmentLabel = 'Adjustment',
// # Customer Note
showCustomerNote = true,
customerNote = DefaultPdfTemplateStatement,
@@ -240,6 +250,12 @@ export function EstimatePaperTemplate({
amount={discount}
/>
)}
{showAdjustment && adjustment && (
<PaperTemplate.TotalLine
label={adjustmentLabel}
amount={adjustment}
/>
)}
{showTotal && (
<PaperTemplate.TotalLine label={totalLabel} amount={total} />
)}