mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 07:10:33 +00:00
fix: Add mising address in branding templates customize
This commit is contained in:
@@ -5,8 +5,12 @@ import {
|
|||||||
} from '../../Invoices/InvoiceCustomize/PaperTemplate';
|
} from '../../Invoices/InvoiceCustomize/PaperTemplate';
|
||||||
|
|
||||||
export interface CreditNotePaperTemplateProps extends PaperTemplateProps {
|
export interface CreditNotePaperTemplateProps extends PaperTemplateProps {
|
||||||
|
// Address
|
||||||
billedToAddress?: Array<string>;
|
billedToAddress?: Array<string>;
|
||||||
billedFromAddress?: Array<string>;
|
billedFromAddress?: Array<string>;
|
||||||
|
showBilledToAddress?: boolean;
|
||||||
|
showBilledFromAddress?: boolean;
|
||||||
|
billedToLabel?: string;
|
||||||
|
|
||||||
// Total
|
// Total
|
||||||
total?: string;
|
total?: string;
|
||||||
@@ -28,6 +32,7 @@ export interface CreditNotePaperTemplateProps extends PaperTemplateProps {
|
|||||||
termsConditions?: string;
|
termsConditions?: string;
|
||||||
termsConditionsLabel?: string;
|
termsConditionsLabel?: string;
|
||||||
|
|
||||||
|
// Lines
|
||||||
lines?: Array<{
|
lines?: Array<{
|
||||||
item: string;
|
item: string;
|
||||||
description: string;
|
description: string;
|
||||||
@@ -52,7 +57,9 @@ export function CreditNotePaperTemplate({
|
|||||||
secondaryColor,
|
secondaryColor,
|
||||||
showCompanyLogo = true,
|
showCompanyLogo = true,
|
||||||
companyLogo,
|
companyLogo,
|
||||||
|
companyName = 'Bigcapital Technology, Inc.',
|
||||||
|
|
||||||
|
// Address
|
||||||
billedToAddress = [
|
billedToAddress = [
|
||||||
'Bigcapital Technology, Inc.',
|
'Bigcapital Technology, Inc.',
|
||||||
'131 Continental Dr Suite 305 Newark,',
|
'131 Continental Dr Suite 305 Newark,',
|
||||||
@@ -68,18 +75,26 @@ export function CreditNotePaperTemplate({
|
|||||||
'+1 762-339-5634',
|
'+1 762-339-5634',
|
||||||
'ahmed@bigcapital.app',
|
'ahmed@bigcapital.app',
|
||||||
],
|
],
|
||||||
|
showBilledToAddress = true,
|
||||||
|
showBilledFromAddress = true,
|
||||||
|
billedToLabel = 'Billed To',
|
||||||
|
|
||||||
|
// Total
|
||||||
total = '$1000.00',
|
total = '$1000.00',
|
||||||
totalLabel = 'Total',
|
totalLabel = 'Total',
|
||||||
showTotal = true,
|
showTotal = true,
|
||||||
|
|
||||||
|
// Subtotal
|
||||||
subtotal = '1000/00',
|
subtotal = '1000/00',
|
||||||
subtotalLabel = 'Subtotal',
|
subtotalLabel = 'Subtotal',
|
||||||
showSubtotal = true,
|
showSubtotal = true,
|
||||||
|
|
||||||
|
// Customer note
|
||||||
showCustomerNote = true,
|
showCustomerNote = true,
|
||||||
customerNote = 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.',
|
customerNote = 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.',
|
||||||
customerNoteLabel = 'Customer Note',
|
customerNoteLabel = 'Customer Note',
|
||||||
|
|
||||||
|
// Terms & conditions
|
||||||
showTermsConditions = true,
|
showTermsConditions = true,
|
||||||
termsConditions = 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.',
|
termsConditions = 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.',
|
||||||
termsConditionsLabel = 'Terms & Conditions',
|
termsConditionsLabel = 'Terms & Conditions',
|
||||||
@@ -93,10 +108,12 @@ export function CreditNotePaperTemplate({
|
|||||||
total: '$1000.00',
|
total: '$1000.00',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
// Credit note number.
|
||||||
showCreditNoteNumber = true,
|
showCreditNoteNumber = true,
|
||||||
creditNoteNumberLabel = 'Credit Note Number',
|
creditNoteNumberLabel = 'Credit Note Number',
|
||||||
creditNoteNumebr = '346D3D40-0001',
|
creditNoteNumebr = '346D3D40-0001',
|
||||||
|
|
||||||
|
// Credit note date.
|
||||||
creditNoteDate = 'September 3, 2024',
|
creditNoteDate = 'September 3, 2024',
|
||||||
showCreditNoteDate = true,
|
showCreditNoteDate = true,
|
||||||
creditNoteDateLabel = 'Credit Note Date',
|
creditNoteDateLabel = 'Credit Note Date',
|
||||||
@@ -116,7 +133,6 @@ export function CreditNotePaperTemplate({
|
|||||||
{creditNoteNumebr}
|
{creditNoteNumebr}
|
||||||
</PaperTemplate.TermsItem>
|
</PaperTemplate.TermsItem>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{showCreditNoteDate && (
|
{showCreditNoteDate && (
|
||||||
<PaperTemplate.TermsItem label={creditNoteDateLabel}>
|
<PaperTemplate.TermsItem label={creditNoteDateLabel}>
|
||||||
{creditNoteDate}
|
{creditNoteDate}
|
||||||
@@ -125,8 +141,16 @@ export function CreditNotePaperTemplate({
|
|||||||
</PaperTemplate.TermsList>
|
</PaperTemplate.TermsList>
|
||||||
|
|
||||||
<Group spacing={10}>
|
<Group spacing={10}>
|
||||||
<PaperTemplate.Address items={billedToAddress} />
|
{showBilledFromAddress && (
|
||||||
<PaperTemplate.Address items={billedFromAddress} />
|
<PaperTemplate.Address
|
||||||
|
items={[<strong>{companyName}</strong>, ...billedFromAddress]}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{showBilledToAddress && (
|
||||||
|
<PaperTemplate.Address
|
||||||
|
items={[<strong>{billedToLabel}</strong>, ...billedToAddress]}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ export const initialValues = {
|
|||||||
companyLogo:
|
companyLogo:
|
||||||
'https://cdn-development.mercury.com/demo-assets/avatars/mercury-demo-dark.png',
|
'https://cdn-development.mercury.com/demo-assets/avatars/mercury-demo-dark.png',
|
||||||
|
|
||||||
|
// Address
|
||||||
|
showBilledToAddress: true,
|
||||||
|
showBilledFromAddress: true,
|
||||||
|
billedToLabel: 'Bill To',
|
||||||
|
|
||||||
// Entries
|
// Entries
|
||||||
itemNameLabel: 'Item',
|
itemNameLabel: 'Item',
|
||||||
itemDescriptionLabel: 'Description',
|
itemDescriptionLabel: 'Description',
|
||||||
@@ -55,6 +60,15 @@ export const fieldsGroups = [
|
|||||||
enableKey: 'showCreditNoteNumber',
|
enableKey: 'showCreditNoteNumber',
|
||||||
label: 'Credit Note #',
|
label: 'Credit Note #',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
enableKey: 'showBilledToAddress',
|
||||||
|
labelKey: 'billedToLabel',
|
||||||
|
label: 'Bill To',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
enableKey: 'showBilledFromAddress',
|
||||||
|
label: 'Billed From',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export interface EstimatePaperTemplateProps extends PaperTemplateProps {
|
|||||||
|
|
||||||
showBilledFromAddress?: boolean;
|
showBilledFromAddress?: boolean;
|
||||||
billedFromAddress?: Array<string>;
|
billedFromAddress?: Array<string>;
|
||||||
|
billedToLabel?: string;
|
||||||
|
|
||||||
// Totals
|
// Totals
|
||||||
total?: string;
|
total?: string;
|
||||||
@@ -77,6 +78,7 @@ export function EstimatePaperTemplate({
|
|||||||
],
|
],
|
||||||
showBilledFromAddress = true,
|
showBilledFromAddress = true,
|
||||||
showBilledToAddress = true,
|
showBilledToAddress = true,
|
||||||
|
billedToLabel = 'Billed To',
|
||||||
|
|
||||||
total = '$1000.00',
|
total = '$1000.00',
|
||||||
totalLabel = 'Total',
|
totalLabel = 'Total',
|
||||||
@@ -151,7 +153,9 @@ export function EstimatePaperTemplate({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{showBilledToAddress && (
|
{showBilledToAddress && (
|
||||||
<PaperTemplate.Address items={billedToAddress} />
|
<PaperTemplate.Address
|
||||||
|
items={[<strong>{billedToLabel}</strong>, ...billedToAddress]}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import { initialValues } from './constants';
|
|||||||
export function InvoiceCustomizeContent() {
|
export function InvoiceCustomizeContent() {
|
||||||
const { payload, name } = useDrawerContext();
|
const { payload, name } = useDrawerContext();
|
||||||
const { closeDrawer } = useDrawerActions();
|
const { closeDrawer } = useDrawerActions();
|
||||||
|
|
||||||
const templateId = payload?.templateId || null;
|
const templateId = payload?.templateId || null;
|
||||||
|
|
||||||
const handleSuccess = () => {
|
const handleSuccess = () => {
|
||||||
|
|||||||
@@ -214,7 +214,9 @@ export function InvoicePaperTemplate({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{showBillingToAddress && (
|
{showBillingToAddress && (
|
||||||
<PaperTemplate.Address items={billedToAddress} />
|
<PaperTemplate.Address
|
||||||
|
items={[<strong>{billedToLabel}</strong>, ...billedToAddress]}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user