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

@@ -1,5 +1,6 @@
import { pickBy } from 'lodash';
import { InvoicePdfTemplateAttributes, ISaleInvoice } from '@/interfaces';
import { contactAddressTextFormat } from '@/utils/address-text-format';
export const mergePdfTemplateWithDefaultAttributes = (
brandingTemplate?: Record<string, any>,
@@ -42,5 +43,7 @@ export const transformInvoiceToPdfTemplate = (
label: tax.name,
amount: tax.taxRateAmountFormatted,
})),
customerAddress: contactAddressTextFormat(invoice.customer),
};
};