mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
feat: PDF templates company/customer address
This commit is contained in:
@@ -14,10 +14,12 @@ import {
|
||||
|
||||
export interface CreditNotePaperTemplateProps extends PaperTemplateProps {
|
||||
// Address
|
||||
billedToAddress?: string;
|
||||
billedFromAddress?: string;
|
||||
showBilledToAddress?: boolean;
|
||||
showBilledFromAddress?: boolean;
|
||||
showCustomerAddress?: boolean;
|
||||
customerAddress?: string;
|
||||
|
||||
showCompanyAddress?: boolean;
|
||||
companyAddress?: string;
|
||||
|
||||
billedToLabel?: string;
|
||||
|
||||
// Total
|
||||
@@ -72,11 +74,12 @@ export function CreditNotePaperTemplate({
|
||||
companyName = 'Bigcapital Technology, Inc.',
|
||||
|
||||
// Address
|
||||
billedToAddress = DefaultPdfTemplateAddressBilledTo,
|
||||
billedFromAddress = DefaultPdfTemplateAddressBilledFrom,
|
||||
showCustomerAddress = true,
|
||||
customerAddress = DefaultPdfTemplateAddressBilledTo,
|
||||
|
||||
showCompanyAddress = true,
|
||||
companyAddress = DefaultPdfTemplateAddressBilledFrom,
|
||||
|
||||
showBilledFromAddress = true,
|
||||
showBilledToAddress = true,
|
||||
billedToLabel = 'Billed To',
|
||||
|
||||
// Total
|
||||
@@ -141,16 +144,16 @@ export function CreditNotePaperTemplate({
|
||||
</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>
|
||||
|
||||
@@ -11,9 +11,10 @@ export const initialValues = {
|
||||
companyLogoUri: '',
|
||||
|
||||
// Address
|
||||
showBilledToAddress: true,
|
||||
showBilledFromAddress: true,
|
||||
billedToLabel: 'Bill To',
|
||||
showCustomerAddress: true,
|
||||
showCompanyAddress: true,
|
||||
companyAddress: '',
|
||||
billedToLabel: 'Billed To',
|
||||
|
||||
// Entries
|
||||
itemNameLabel: 'Item',
|
||||
|
||||
@@ -32,11 +32,11 @@ export interface EstimatePaperTemplateProps extends PaperTemplateProps {
|
||||
companyName?: string;
|
||||
|
||||
// Address
|
||||
showBilledToAddress?: boolean;
|
||||
billedToAddress?: string;
|
||||
showCustomerAddress?: boolean;
|
||||
customerAddress?: string;
|
||||
|
||||
showBilledFromAddress?: boolean;
|
||||
billedFromAddress?: string;
|
||||
showCompanyAddress?: boolean;
|
||||
companyAddress?: string;
|
||||
billedToLabel?: string;
|
||||
|
||||
// Totals
|
||||
@@ -77,10 +77,10 @@ export function EstimatePaperTemplate({
|
||||
companyName,
|
||||
|
||||
// # Address
|
||||
billedToAddress = DefaultPdfTemplateAddressBilledTo,
|
||||
billedFromAddress = DefaultPdfTemplateAddressBilledFrom,
|
||||
showBilledFromAddress = true,
|
||||
showBilledToAddress = true,
|
||||
customerAddress = DefaultPdfTemplateAddressBilledTo,
|
||||
companyAddress = DefaultPdfTemplateAddressBilledFrom,
|
||||
showCompanyAddress = true,
|
||||
showCustomerAddress = true,
|
||||
billedToLabel = 'Billed To',
|
||||
|
||||
// #Total
|
||||
@@ -151,16 +151,15 @@ export function EstimatePaperTemplate({
|
||||
</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>
|
||||
|
||||
@@ -24,8 +24,10 @@ export const initialValues = {
|
||||
companyName: 'Bigcapital Technology, Inc.',
|
||||
|
||||
// Addresses
|
||||
showBilledFromAddress: true,
|
||||
showBilledToAddress: true,
|
||||
showCustomerAddress: true,
|
||||
showCompanyAddress: true,
|
||||
customerAddress: '',
|
||||
companyAddress: '',
|
||||
billedToLabel: 'Billed To',
|
||||
|
||||
// Entries
|
||||
@@ -45,6 +47,7 @@ export const initialValues = {
|
||||
showCustomerNote: true,
|
||||
customerNoteLabel: 'Customer Note',
|
||||
|
||||
// Terms & Conditions
|
||||
showTermsConditions: true,
|
||||
termsConditionsLabel: 'Terms & Conditions',
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -14,10 +14,12 @@ import {
|
||||
|
||||
export interface ReceiptPaperTemplateProps extends PaperTemplateProps {
|
||||
// Addresses
|
||||
billedToAddress?: string;
|
||||
billedFromAddress?: string;
|
||||
showBilledFromAddress?: boolean;
|
||||
showBilledToAddress?: boolean;
|
||||
showCustomerAddress?: boolean;
|
||||
customerAddress?: string;
|
||||
|
||||
showCompanyAddress?: boolean;
|
||||
companyAddress?: string;
|
||||
|
||||
billedToLabel?: string;
|
||||
|
||||
// Total
|
||||
@@ -73,10 +75,12 @@ export function ReceiptPaperTemplate({
|
||||
companyName = 'Bigcapital Technology, Inc.',
|
||||
|
||||
// # Address
|
||||
billedToAddress = DefaultPdfTemplateAddressBilledTo,
|
||||
billedFromAddress = DefaultPdfTemplateAddressBilledFrom,
|
||||
showBilledFromAddress = true,
|
||||
showBilledToAddress = true,
|
||||
showCustomerAddress = true,
|
||||
customerAddress = DefaultPdfTemplateAddressBilledTo,
|
||||
|
||||
showCompanyAddress = true,
|
||||
companyAddress = DefaultPdfTemplateAddressBilledFrom,
|
||||
|
||||
billedToLabel = 'Billed To',
|
||||
|
||||
total = '$1000.00',
|
||||
@@ -135,16 +139,16 @@ export function ReceiptPaperTemplate({
|
||||
</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>
|
||||
|
||||
@@ -22,8 +22,10 @@ export const initialValues = {
|
||||
companyName: 'Bigcapital Technology, Inc.',
|
||||
|
||||
// Addresses
|
||||
showBilledFromAddress: true,
|
||||
showBilledToAddress: true,
|
||||
showCompanyAddress: true,
|
||||
showCustomerAddress: true,
|
||||
companyAddress: '',
|
||||
customerAddress: '',
|
||||
billedToLabel: 'Billed To',
|
||||
|
||||
// Entries
|
||||
|
||||
Reference in New Issue
Block a user