mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
feat: PDF templates company/customer address
This commit is contained in:
@@ -10,11 +10,14 @@ import {
|
||||
} from '@/constants/PdfTemplates';
|
||||
|
||||
export interface PaymentReceivedPaperTemplateProps extends PaperTemplateProps {
|
||||
billedToAddress?: string;
|
||||
showBilledToAddress?: boolean;
|
||||
// Customer address
|
||||
showCustomerAddress?: boolean;
|
||||
customerAddress?: string;
|
||||
|
||||
// Company address
|
||||
showCompanyAddress?: boolean;
|
||||
companyAddress?: string;
|
||||
|
||||
billedFromAddress?: string;
|
||||
showBilledFromAddress?: boolean;
|
||||
billedToLabel?: string;
|
||||
|
||||
// Total.
|
||||
@@ -56,10 +59,14 @@ export function PaymentReceivedPaperTemplate({
|
||||
// # Company name
|
||||
companyName = 'Bigcapital Technology, Inc.',
|
||||
|
||||
billedToAddress = DefaultPdfTemplateAddressBilledTo,
|
||||
billedFromAddress = DefaultPdfTemplateAddressBilledFrom,
|
||||
showBilledFromAddress,
|
||||
showBilledToAddress,
|
||||
// # Customer address
|
||||
showCustomerAddress = true,
|
||||
customerAddress = DefaultPdfTemplateAddressBilledTo,
|
||||
|
||||
// # Company address
|
||||
showCompanyAddress = true,
|
||||
companyAddress = DefaultPdfTemplateAddressBilledFrom,
|
||||
|
||||
billedToLabel = 'Billed To',
|
||||
|
||||
total = '$1000.00',
|
||||
@@ -109,16 +116,16 @@ export function PaymentReceivedPaperTemplate({
|
||||
</PaperTemplate.TermsList>
|
||||
|
||||
<PaperTemplate.AddressesGroup>
|
||||
{showBilledFromAddress && (
|
||||
{showCompanyAddress && (
|
||||
<PaperTemplate.Address>
|
||||
<strong>{companyName}</strong>
|
||||
<Box dangerouslySetInnerHTML={{ __html: billedFromAddress }} />
|
||||
<Box dangerouslySetInnerHTML={{ __html: companyAddress }} />
|
||||
</PaperTemplate.Address>
|
||||
)}
|
||||
{showBilledToAddress && (
|
||||
|
||||
{showCustomerAddress && (
|
||||
<PaperTemplate.Address>
|
||||
<strong>{billedToLabel}</strong>
|
||||
<Box dangerouslySetInnerHTML={{ __html: billedToAddress }} />
|
||||
<Box dangerouslySetInnerHTML={{ __html: customerAddress }} />
|
||||
</PaperTemplate.Address>
|
||||
)}
|
||||
</PaperTemplate.AddressesGroup>
|
||||
|
||||
@@ -21,8 +21,10 @@ export const initialValues = {
|
||||
companyName: 'Bigcapital Technology, Inc.',
|
||||
|
||||
// Addresses
|
||||
showBilledFromAddress: true,
|
||||
showBillingToAddress: true,
|
||||
showCustomerAddress: true,
|
||||
showCompanyAddress: true,
|
||||
customerAddress: '',
|
||||
companyAddress: '',
|
||||
billedToLabel: 'Billed To',
|
||||
|
||||
// Entries
|
||||
|
||||
Reference in New Issue
Block a user