feat: Hook up customer/company address to pdf templates

This commit is contained in:
Ahmed Bouhuolia
2024-09-29 22:59:14 +02:00
parent 776b69475c
commit 863c7ad99f
29 changed files with 242 additions and 152 deletions

View File

@@ -231,7 +231,6 @@ export const defaultEstimatePdfBrandingAttributes = {
expirationDate: 'September 3, 2024',
};
interface EstimatePdfBrandingLineItem {
item: string;
description: string;
@@ -247,10 +246,13 @@ export interface EstimatePdfBrandingAttributes {
companyLogo: string;
companyName: string;
billedToAddress: string[];
billedFromAddress: string[];
showBilledFromAddress: boolean;
showBilledToAddress: boolean;
// Customer Address
showCustomerAddress: boolean;
customerAddress: string;
// Company Address
showCompanyAddress: boolean;
companyAddress: string;
billedToLabel: string;
total: string;
@@ -282,4 +284,4 @@ export interface EstimatePdfBrandingAttributes {
expirationDateLabel: string;
showExpirationDate: boolean;
expirationDate: string;
}
}

View File

@@ -1,3 +1,4 @@
import { contactAddressTextFormat } from '@/utils/address-text-format';
import { EstimatePdfBrandingAttributes } from './constants';
export const transformEstimateToPdfTemplate = (
@@ -18,5 +19,6 @@ export const transformEstimateToPdfTemplate = (
subtotal: estimate.formattedSubtotal,
customerNote: estimate.customerNote,
termsConditions: estimate.termsConditions,
customerAddress: contactAddressTextFormat(estimate.customer),
};
};