fix: pdf template customization

This commit is contained in:
Ahmed Bouhuolia
2024-09-17 18:19:28 +02:00
parent bb0d91a9cb
commit 5f40d50852
16 changed files with 74 additions and 41 deletions

View File

@@ -3,5 +3,20 @@ import { EstimatePdfBrandingAttributes } from './constants';
export const transformEstimateToPdfTemplate = (
estimate
): Partial<EstimatePdfBrandingAttributes> => {
return {};
return {
expirationDate: estimate.formattedExpirationDate,
estimateNumebr: estimate.estimateNumber,
estimateDate: estimate.formattedEstimateDate,
lines: estimate.entries.map((entry) => ({
item: entry.item.name,
description: entry.description,
rate: entry.rateFormatted,
quantity: entry.quantityFormatted,
total: entry.totalFormatted,
})),
total: estimate.formattedSubtotal,
subtotal: estimate.formattedSubtotal,
customerNote: estimate.customerNote,
termsConditions: estimate.termsConditions,
};
};