mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
23 lines
736 B
TypeScript
23 lines
736 B
TypeScript
import { EstimatePdfBrandingAttributes } from './constants';
|
|
|
|
export const transformEstimateToPdfTemplate = (
|
|
estimate
|
|
): Partial<EstimatePdfBrandingAttributes> => {
|
|
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,
|
|
};
|
|
};
|