mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 23:30:32 +00:00
feat: invoice pdf customize
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import { Stack } from '@/components';
|
import { Stack } from '@/components';
|
||||||
|
import {
|
||||||
|
ElementCustomizeContentItemFieldGroup,
|
||||||
|
ElementCustomizeFieldsGroup,
|
||||||
|
} from '@/containers/ElementCustomize/ElementCustomizeFieldsGroup';
|
||||||
import { Classes } from '@blueprintjs/core';
|
import { Classes } from '@blueprintjs/core';
|
||||||
|
import { fieldsGroups } from './constants';
|
||||||
|
|
||||||
export function CreditNoteCustomizeContentFields() {
|
export function CreditNoteCustomizeContentFields() {
|
||||||
return (
|
return (
|
||||||
@@ -16,7 +21,24 @@ export function CreditNoteCustomizeContentFields() {
|
|||||||
</p>
|
</p>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Stack></Stack>
|
<Stack>
|
||||||
|
{fieldsGroups.map((group) => (
|
||||||
|
<ElementCustomizeFieldsGroup label={group.label}>
|
||||||
|
{group.fields.map((item, index) => (
|
||||||
|
<ElementCustomizeContentItemFieldGroup
|
||||||
|
key={index}
|
||||||
|
inputGroupProps={{
|
||||||
|
name: item.enableKey,
|
||||||
|
label: item.label,
|
||||||
|
}}
|
||||||
|
switchProps={{
|
||||||
|
name: item.labelKey,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</ElementCustomizeFieldsGroup>
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,18 +5,22 @@ export interface CreditNotePaperTemplateProps extends PaperTemplateProps {
|
|||||||
billedToAddress?: Array<string>;
|
billedToAddress?: Array<string>;
|
||||||
billedFromAddress?: Array<string>;
|
billedFromAddress?: Array<string>;
|
||||||
|
|
||||||
|
// Total
|
||||||
total?: string;
|
total?: string;
|
||||||
showTotal?: boolean;
|
showTotal?: boolean;
|
||||||
totalLabel?: string;
|
totalLabel?: string;
|
||||||
|
|
||||||
|
// Subtotal;
|
||||||
subtotal?: string;
|
subtotal?: string;
|
||||||
showSubtotal?: boolean;
|
showSubtotal?: boolean;
|
||||||
subtotalLabel?: string;
|
subtotalLabel?: string;
|
||||||
|
|
||||||
|
// Customer Note.
|
||||||
showCustomerNote?: boolean;
|
showCustomerNote?: boolean;
|
||||||
customerNote?: string;
|
customerNote?: string;
|
||||||
customerNoteLabel?: string;
|
customerNoteLabel?: string;
|
||||||
|
|
||||||
|
// Terms & Conditions
|
||||||
showTermsConditions?: boolean;
|
showTermsConditions?: boolean;
|
||||||
termsConditions?: string;
|
termsConditions?: string;
|
||||||
termsConditionsLabel?: string;
|
termsConditionsLabel?: string;
|
||||||
@@ -29,10 +33,12 @@ export interface CreditNotePaperTemplateProps extends PaperTemplateProps {
|
|||||||
total: string;
|
total: string;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
// Date issue.
|
||||||
creditNoteDateLabel?: string;
|
creditNoteDateLabel?: string;
|
||||||
showCreditNoteDate?: boolean;
|
showCreditNoteDate?: boolean;
|
||||||
creditNoteDate?: string;
|
creditNoteDate?: string;
|
||||||
|
|
||||||
|
// Credit Number.
|
||||||
creditNoteNumebr?: string;
|
creditNoteNumebr?: string;
|
||||||
creditNoteNumberLabel?: string;
|
creditNoteNumberLabel?: string;
|
||||||
showCreditNoteNumber?: boolean;
|
showCreditNoteNumber?: boolean;
|
||||||
|
|||||||
@@ -8,52 +8,78 @@ 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',
|
||||||
|
|
||||||
// Top details.
|
|
||||||
showInvoiceNumber: true,
|
|
||||||
invoiceNumberLabel: 'Invoice number',
|
|
||||||
|
|
||||||
showDateIssue: true,
|
|
||||||
dateIssueLabel: 'Date of Issue',
|
|
||||||
|
|
||||||
showDueDate: true,
|
|
||||||
dueDateLabel: 'Due Date',
|
|
||||||
|
|
||||||
// Company name
|
|
||||||
companyName: 'Bigcapital Technology, Inc.',
|
|
||||||
|
|
||||||
// Addresses
|
|
||||||
showBilledFromAddress: true,
|
|
||||||
showBillingToAddress: true,
|
|
||||||
billedToLabel: 'Billed To',
|
|
||||||
|
|
||||||
// Entries
|
// Entries
|
||||||
itemNameLabel: 'Item',
|
itemNameLabel: 'Item',
|
||||||
itemDescriptionLabel: 'Description',
|
itemDescriptionLabel: 'Description',
|
||||||
itemRateLabel: 'Rate',
|
itemRateLabel: 'Rate',
|
||||||
itemTotalLabel: 'Total',
|
itemTotalLabel: 'Total',
|
||||||
|
|
||||||
// Totals
|
// Total
|
||||||
showSubtotal: true,
|
|
||||||
subtotalLabel: 'Subtotal',
|
|
||||||
|
|
||||||
showDiscount: true,
|
|
||||||
discountLabel: 'Discount',
|
|
||||||
|
|
||||||
showTaxes: true,
|
|
||||||
|
|
||||||
showTotal: true,
|
showTotal: true,
|
||||||
totalLabel: 'Total',
|
totalLabel: 'Total',
|
||||||
|
|
||||||
paymentMadeLabel: 'Payment Made',
|
// Subtotal
|
||||||
showPaymentMade: true,
|
showSubtotal: true,
|
||||||
|
subtotalLabel: 'Subtotal',
|
||||||
|
|
||||||
dueAmountLabel: 'Due Amount',
|
// Customer Note.
|
||||||
showDueAmount: true,
|
showCustomerNote: true,
|
||||||
|
customerNoteLabel: 'Customer Note',
|
||||||
|
|
||||||
// Footer paragraphs.
|
// Terms & Conditions
|
||||||
termsConditionsLabel: 'Terms & Conditions',
|
|
||||||
showTermsConditions: true,
|
showTermsConditions: true,
|
||||||
|
termsConditionsLabel: 'Terms & Conditions',
|
||||||
|
|
||||||
statementLabel: 'Statement',
|
// Date issue.
|
||||||
showStatement: true,
|
creditNoteDateLabel: 'Issue of Date',
|
||||||
|
showCreditNoteDate: true,
|
||||||
|
|
||||||
|
// Credit Number.
|
||||||
|
creditNoteNumberLabel: 'Credit Note #',
|
||||||
|
showCreditNoteNumber: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const fieldsGroups = [
|
||||||
|
{
|
||||||
|
label: 'Header',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
labelKey: 'creditNoteDateLabel',
|
||||||
|
enableKey: 'showCreditNoteDate',
|
||||||
|
label: 'Issue of Date',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
labelKey: 'creditNoteNumberLabel',
|
||||||
|
enableKey: 'showCreditNoteNumber',
|
||||||
|
label: 'Credit Note #',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Totals',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
labelKey: 'subtotalLabel',
|
||||||
|
enableKey: 'showSubtotal',
|
||||||
|
label: 'Subtotal',
|
||||||
|
},
|
||||||
|
{ labelKey: 'totalLabel', enableKey: 'showTotal', label: 'Total' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Footer',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
labelKey: 'termsConditionsLabel',
|
||||||
|
enableKey: 'showTermsConditions',
|
||||||
|
label: 'Terms & Conditions',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
labelKey: 'customerNoteLabel',
|
||||||
|
enableKey: 'showCustomerNote',
|
||||||
|
label: 'Customer Note',
|
||||||
|
labelPlaceholder: 'Customer Note',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -1,5 +1,39 @@
|
|||||||
|
|
||||||
|
|
||||||
export interface CreditNoteCustomizeValues {
|
export interface CreditNoteCustomizeValues {
|
||||||
|
// Colors
|
||||||
}
|
primaryColor?: string;
|
||||||
|
secondaryColor?: string;
|
||||||
|
|
||||||
|
// Company Logo
|
||||||
|
showCompanyLogo?: boolean;
|
||||||
|
companyLogo?: string;
|
||||||
|
|
||||||
|
// Entries
|
||||||
|
itemNameLabel?: string;
|
||||||
|
itemDescriptionLabel?: string;
|
||||||
|
itemRateLabel?: string;
|
||||||
|
itemTotalLabel?: string;
|
||||||
|
|
||||||
|
// Total
|
||||||
|
showTotal?: boolean;
|
||||||
|
totalLabel?: string;
|
||||||
|
|
||||||
|
// Subtotal
|
||||||
|
showSubtotal?: boolean;
|
||||||
|
subtotalLabel?: string;
|
||||||
|
|
||||||
|
// Customer Note.
|
||||||
|
showCustomerNote?: boolean;
|
||||||
|
customerNoteLabel?: string;
|
||||||
|
|
||||||
|
// Terms & Conditions
|
||||||
|
showTermsConditions?: boolean;
|
||||||
|
termsConditionsLabel?: string;
|
||||||
|
|
||||||
|
// Date issue.
|
||||||
|
creditNoteDateLabel?: string;
|
||||||
|
showCreditNoteDate?: boolean;
|
||||||
|
|
||||||
|
// Credit Number.
|
||||||
|
creditNoteNumberLabel?: string;
|
||||||
|
showCreditNoteNumber?: boolean;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import * as R from 'ramda';
|
||||||
import { Box } from '@/components';
|
import { Box } from '@/components';
|
||||||
import { Classes } from '@blueprintjs/core';
|
import { Classes } from '@blueprintjs/core';
|
||||||
import { InvoicePaperTemplate } from './InvoicePaperTemplate';
|
import { useFormikContext } from 'formik';
|
||||||
|
import {
|
||||||
|
InvoicePaperTemplate,
|
||||||
|
InvoicePaperTemplateProps,
|
||||||
|
} from './InvoicePaperTemplate';
|
||||||
import { ElementCustomize } from '../../../ElementCustomize/ElementCustomize';
|
import { ElementCustomize } from '../../../ElementCustomize/ElementCustomize';
|
||||||
import { InvoiceCustomizeGeneralField } from './InvoiceCustomizeGeneralFields';
|
import { InvoiceCustomizeGeneralField } from './InvoiceCustomizeGeneralFields';
|
||||||
import { InvoiceCustomizeContentFields } from './InvoiceCutomizeContentFields';
|
import { InvoiceCustomizeContentFields } from './InvoiceCutomizeContentFields';
|
||||||
@@ -18,7 +23,7 @@ export default function InvoiceCustomizeContent() {
|
|||||||
onSubmit={handleFormSubmit}
|
onSubmit={handleFormSubmit}
|
||||||
>
|
>
|
||||||
<ElementCustomize.PaperTemplate>
|
<ElementCustomize.PaperTemplate>
|
||||||
<InvoicePaperTemplate />
|
<InvoicePaperTemplateFormConnected />
|
||||||
</ElementCustomize.PaperTemplate>
|
</ElementCustomize.PaperTemplate>
|
||||||
|
|
||||||
<ElementCustomize.FieldsTab id={'general'} label={'General'}>
|
<ElementCustomize.FieldsTab id={'general'} label={'General'}>
|
||||||
@@ -36,3 +41,16 @@ export default function InvoiceCustomizeContent() {
|
|||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const withFormikProps = <P extends object>(
|
||||||
|
Component: React.ComponentType<P>,
|
||||||
|
) => {
|
||||||
|
return (props: Omit<P, keyof InvoicePaperTemplateProps>) => {
|
||||||
|
const { values } = useFormikContext<InvoicePaperTemplateProps>();
|
||||||
|
|
||||||
|
return <Component {...(props as P)} {...values} />;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export const InvoicePaperTemplateFormConnected =
|
||||||
|
R.compose(withFormikProps)(InvoicePaperTemplate);
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
import clsx from 'classnames';
|
import React from 'react';
|
||||||
import * as R from 'ramda';
|
|
||||||
import { useFormikContext } from 'formik';
|
|
||||||
import styles from './InvoicePaperTemplate.module.scss';
|
|
||||||
import { PaperTemplate } from './PaperTemplate';
|
import { PaperTemplate } from './PaperTemplate';
|
||||||
import { Group, Stack } from '@/components';
|
import { Group, Stack } from '@/components';
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
interface PapaerLine {
|
interface PapaerLine {
|
||||||
item?: string;
|
item?: string;
|
||||||
@@ -19,7 +15,7 @@ interface PaperTax {
|
|||||||
amount: string;
|
amount: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PaperTemplateProps {
|
export interface InvoicePaperTemplateProps {
|
||||||
primaryColor?: string;
|
primaryColor?: string;
|
||||||
secondaryColor?: string;
|
secondaryColor?: string;
|
||||||
|
|
||||||
@@ -92,7 +88,7 @@ interface PaperTemplateProps {
|
|||||||
billedToAddress?: Array<string | React.ReactNode>;
|
billedToAddress?: Array<string | React.ReactNode>;
|
||||||
}
|
}
|
||||||
|
|
||||||
function InvoicePaperTemplateRoot({
|
export function InvoicePaperTemplate({
|
||||||
primaryColor,
|
primaryColor,
|
||||||
secondaryColor,
|
secondaryColor,
|
||||||
|
|
||||||
@@ -183,7 +179,7 @@ function InvoicePaperTemplateRoot({
|
|||||||
'+1 762-339-5634',
|
'+1 762-339-5634',
|
||||||
'ahmed@bigcapital.app',
|
'ahmed@bigcapital.app',
|
||||||
],
|
],
|
||||||
}: PaperTemplateProps) {
|
}: InvoicePaperTemplateProps) {
|
||||||
return (
|
return (
|
||||||
<PaperTemplate
|
<PaperTemplate
|
||||||
primaryColor={primaryColor}
|
primaryColor={primaryColor}
|
||||||
@@ -290,17 +286,3 @@ function InvoicePaperTemplateRoot({
|
|||||||
</PaperTemplate>
|
</PaperTemplate>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const withFormikProps = <P extends object>(
|
|
||||||
Component: React.ComponentType<P>,
|
|
||||||
) => {
|
|
||||||
return (props: Omit<P, keyof PaperTemplateProps>) => {
|
|
||||||
const { values } = useFormikContext<PaperTemplateProps>();
|
|
||||||
|
|
||||||
return <Component {...(props as P)} {...values} />;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const InvoicePaperTemplate = R.compose(withFormikProps)(
|
|
||||||
InvoicePaperTemplateRoot,
|
|
||||||
);
|
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import { Stack } from '@/components';
|
import { Stack } from '@/components';
|
||||||
import { Classes } from '@blueprintjs/core';
|
import { Classes } from '@blueprintjs/core';
|
||||||
|
import { fieldsGroups } from './constants';
|
||||||
|
import {
|
||||||
|
ElementCustomizeContentItemFieldGroup,
|
||||||
|
ElementCustomizeFieldsGroup,
|
||||||
|
} from '@/containers/ElementCustomize/ElementCustomizeFieldsGroup';
|
||||||
|
|
||||||
export function PaymentReceivedCustomizeContentFields() {
|
export function PaymentReceivedCustomizeContentFields() {
|
||||||
return (
|
return (
|
||||||
@@ -16,7 +21,24 @@ export function PaymentReceivedCustomizeContentFields() {
|
|||||||
</p>
|
</p>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Stack></Stack>
|
<Stack>
|
||||||
|
{fieldsGroups.map((group) => (
|
||||||
|
<ElementCustomizeFieldsGroup label={group.label}>
|
||||||
|
{group.fields.map((item, index) => (
|
||||||
|
<ElementCustomizeContentItemFieldGroup
|
||||||
|
key={index}
|
||||||
|
inputGroupProps={{
|
||||||
|
name: item.enableKey,
|
||||||
|
label: item.label,
|
||||||
|
}}
|
||||||
|
switchProps={{
|
||||||
|
name: item.labelKey,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</ElementCustomizeFieldsGroup>
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,23 @@
|
|||||||
import { Group, Stack } from '@/components';
|
import { Group, Stack } from '@/components';
|
||||||
import { PaperTemplate, PaperTemplateProps } from '../../Invoices/InvoiceCustomize/PaperTemplate';
|
import {
|
||||||
|
PaperTemplate,
|
||||||
|
PaperTemplateProps,
|
||||||
|
} from '../../Invoices/InvoiceCustomize/PaperTemplate';
|
||||||
|
|
||||||
export interface PaymentReceivedPaperTemplateProps extends PaperTemplateProps {
|
export interface PaymentReceivedPaperTemplateProps extends PaperTemplateProps {
|
||||||
billedToAddress?: Array<string>;
|
billedToAddress?: Array<string>;
|
||||||
billedFromAddress?: Array<string>;
|
showBillingToAddress?: boolean;
|
||||||
|
|
||||||
|
billedFromAddress?: Array<string>;
|
||||||
|
showBilledFromAddress?: boolean;
|
||||||
|
billedToLabel?: string;
|
||||||
|
|
||||||
|
// Total.
|
||||||
total?: string;
|
total?: string;
|
||||||
showTotal?: boolean;
|
showTotal?: boolean;
|
||||||
totalLabel?: string;
|
totalLabel?: string;
|
||||||
|
|
||||||
|
// Subtotal.
|
||||||
subtotal?: string;
|
subtotal?: string;
|
||||||
showSubtotal?: boolean;
|
showSubtotal?: boolean;
|
||||||
subtotalLabel?: string;
|
subtotalLabel?: string;
|
||||||
@@ -19,10 +28,12 @@ export interface PaymentReceivedPaperTemplateProps extends PaperTemplateProps {
|
|||||||
invoiceNumber: string;
|
invoiceNumber: string;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
// Issue date.
|
||||||
paymentReceivedDateLabel?: string;
|
paymentReceivedDateLabel?: string;
|
||||||
showPaymentReceivedDate?: boolean;
|
showPaymentReceivedDate?: boolean;
|
||||||
paymentReceivedDate?: string;
|
paymentReceivedDate?: string;
|
||||||
|
|
||||||
|
// Payment received number.
|
||||||
paymentReceivedNumebr?: string;
|
paymentReceivedNumebr?: string;
|
||||||
paymentReceivedNumberLabel?: string;
|
paymentReceivedNumberLabel?: string;
|
||||||
showPaymentReceivedNumber?: boolean;
|
showPaymentReceivedNumber?: boolean;
|
||||||
@@ -49,6 +60,9 @@ export function PaymentReceivedPaperTemplate({
|
|||||||
'+1 762-339-5634',
|
'+1 762-339-5634',
|
||||||
'ahmed@bigcapital.app',
|
'ahmed@bigcapital.app',
|
||||||
],
|
],
|
||||||
|
showBilledFromAddress,
|
||||||
|
showBillingToAddress,
|
||||||
|
|
||||||
total = '$1000.00',
|
total = '$1000.00',
|
||||||
totalLabel = 'Total',
|
totalLabel = 'Total',
|
||||||
showTotal = true,
|
showTotal = true,
|
||||||
@@ -96,8 +110,12 @@ export function PaymentReceivedPaperTemplate({
|
|||||||
</PaperTemplate.TermsList>
|
</PaperTemplate.TermsList>
|
||||||
|
|
||||||
<Group spacing={10}>
|
<Group spacing={10}>
|
||||||
<PaperTemplate.Address items={billedToAddress} />
|
{showBillingToAddress && (
|
||||||
<PaperTemplate.Address items={billedFromAddress} />
|
<PaperTemplate.Address items={billedToAddress} />
|
||||||
|
)}
|
||||||
|
{showBilledFromAddress && (
|
||||||
|
<PaperTemplate.Address items={billedFromAddress} />
|
||||||
|
)}
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
|
|||||||
@@ -9,14 +9,11 @@ export const initialValues = {
|
|||||||
'https://cdn-development.mercury.com/demo-assets/avatars/mercury-demo-dark.png',
|
'https://cdn-development.mercury.com/demo-assets/avatars/mercury-demo-dark.png',
|
||||||
|
|
||||||
// Top details.
|
// Top details.
|
||||||
showInvoiceNumber: true,
|
showPaymentReceivedNumber: true,
|
||||||
invoiceNumberLabel: 'Invoice number',
|
paymentReceivedNumberLabel: 'Payment number',
|
||||||
|
|
||||||
showDateIssue: true,
|
showPaymentReceivedDate: true,
|
||||||
dateIssueLabel: 'Date of Issue',
|
paymentReceivedDateLabel: 'Date of Issue',
|
||||||
|
|
||||||
showDueDate: true,
|
|
||||||
dueDateLabel: 'Due Date',
|
|
||||||
|
|
||||||
// Company name
|
// Company name
|
||||||
companyName: 'Bigcapital Technology, Inc.',
|
companyName: 'Bigcapital Technology, Inc.',
|
||||||
@@ -36,26 +33,8 @@ export const initialValues = {
|
|||||||
showSubtotal: true,
|
showSubtotal: true,
|
||||||
subtotalLabel: 'Subtotal',
|
subtotalLabel: 'Subtotal',
|
||||||
|
|
||||||
showDiscount: true,
|
|
||||||
discountLabel: 'Discount',
|
|
||||||
|
|
||||||
showTaxes: true,
|
|
||||||
|
|
||||||
showTotal: true,
|
showTotal: true,
|
||||||
totalLabel: 'Total',
|
totalLabel: 'Total',
|
||||||
|
|
||||||
paymentMadeLabel: 'Payment Made',
|
|
||||||
showPaymentMade: true,
|
|
||||||
|
|
||||||
dueAmountLabel: 'Due Amount',
|
|
||||||
showDueAmount: true,
|
|
||||||
|
|
||||||
// Footer paragraphs.
|
|
||||||
termsConditionsLabel: 'Terms & Conditions',
|
|
||||||
showTermsConditions: true,
|
|
||||||
|
|
||||||
statementLabel: 'Statement',
|
|
||||||
showStatement: true,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fieldsGroups = [
|
export const fieldsGroups = [
|
||||||
@@ -63,19 +42,14 @@ export const fieldsGroups = [
|
|||||||
label: 'Header',
|
label: 'Header',
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
labelKey: 'invoiceNumberLabel',
|
labelKey: 'paymentReceivedNumberLabel',
|
||||||
enableKey: 'showInvoiceNumber',
|
enableKey: 'showPaymentReceivedNumber',
|
||||||
label: 'Invoice No.',
|
label: 'Payment No.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
labelKey: 'dateIssueLabel',
|
labelKey: 'paymentReceivedDateLabel',
|
||||||
enableKey: 'showDateIssue',
|
enableKey: 'showPaymentReceivedDate',
|
||||||
label: 'Issue Date',
|
label: 'Payment Date',
|
||||||
},
|
|
||||||
{
|
|
||||||
labelKey: 'dueDateLabel',
|
|
||||||
enableKey: 'showDueDate',
|
|
||||||
label: 'Due Date',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
enableKey: 'showBillingToAddress',
|
enableKey: 'showBillingToAddress',
|
||||||
@@ -96,39 +70,7 @@ export const fieldsGroups = [
|
|||||||
enableKey: 'showSubtotal',
|
enableKey: 'showSubtotal',
|
||||||
label: 'Subtotal',
|
label: 'Subtotal',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
labelKey: 'discountLabel',
|
|
||||||
enableKey: 'showDiscount',
|
|
||||||
label: 'Discount',
|
|
||||||
},
|
|
||||||
{ enableKey: 'showTaxes', label: 'Taxes' },
|
|
||||||
{ labelKey: 'totalLabel', enableKey: 'showTotal', label: 'Total' },
|
{ labelKey: 'totalLabel', enableKey: 'showTotal', label: 'Total' },
|
||||||
{
|
|
||||||
labelKey: 'paymentMadeLabel',
|
|
||||||
enableKey: 'showPaymentMade',
|
|
||||||
label: 'Payment Made',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
labelKey: 'dueAmountLabel',
|
|
||||||
enableKey: 'showDueAmount',
|
|
||||||
label: 'Due Amount',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Footer',
|
|
||||||
fields: [
|
|
||||||
{
|
|
||||||
labelKey: 'termsConditionsLabel',
|
|
||||||
enableKey: 'showTermsConditions',
|
|
||||||
label: 'Terms & Conditions',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
labelKey: 'statementLabel',
|
|
||||||
enableKey: 'showStatement',
|
|
||||||
label: 'Statement',
|
|
||||||
labelPlaceholder: 'Statement',
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -8,10 +8,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',
|
||||||
|
|
||||||
// Top details.
|
// Receipt Number
|
||||||
showReceiptNumber: true,
|
showReceiptNumber: true,
|
||||||
receiptNumberLabel: 'Receipt number',
|
receiptNumberLabel: 'Receipt number',
|
||||||
|
|
||||||
|
// Receipt Date
|
||||||
showReceiptDate: true,
|
showReceiptDate: true,
|
||||||
receiptDateLabel: 'Date of Issue',
|
receiptDateLabel: 'Date of Issue',
|
||||||
|
|
||||||
@@ -29,17 +30,19 @@ export const initialValues = {
|
|||||||
itemRateLabel: 'Rate',
|
itemRateLabel: 'Rate',
|
||||||
itemTotalLabel: 'Total',
|
itemTotalLabel: 'Total',
|
||||||
|
|
||||||
// Totals
|
// Subtotal
|
||||||
showSubtotal: true,
|
showSubtotal: true,
|
||||||
subtotalLabel: 'Subtotal',
|
subtotalLabel: 'Subtotal',
|
||||||
|
|
||||||
|
// Total
|
||||||
showTotal: true,
|
showTotal: true,
|
||||||
totalLabel: 'Total',
|
totalLabel: 'Total',
|
||||||
|
|
||||||
// Footer paragraphs.
|
// Terms & Conditions
|
||||||
termsConditionsLabel: 'Terms & Conditions',
|
termsConditionsLabel: 'Terms & Conditions',
|
||||||
showTermsConditions: true,
|
showTermsConditions: true,
|
||||||
|
|
||||||
|
// Customer Note
|
||||||
customerNoteLabel: 'Customer Note',
|
customerNoteLabel: 'Customer Note',
|
||||||
showCustomerNote: true,
|
showCustomerNote: true,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user