diff --git a/packages/webapp/src/containers/Sales/Invoices/InvoiceCustomize/constants.ts b/packages/webapp/src/containers/Sales/Invoices/InvoiceCustomize/constants.ts index 1d9a4dcb8..015bb7255 100644 --- a/packages/webapp/src/containers/Sales/Invoices/InvoiceCustomize/constants.ts +++ b/packages/webapp/src/containers/Sales/Invoices/InvoiceCustomize/constants.ts @@ -16,19 +16,17 @@ export const initialValues = { showInvoiceNumber: true, invoiceNumberLabel: 'Invoice number', + // Issue date showDateIssue: true, dateIssueLabel: 'Date of Issue', + // Due date. showDueDate: true, dueDateLabel: 'Due Date', - // Company name - companyName: 'Bigcapital Technology, Inc.', - // Addresses showCustomerAddress: true, showCompanyAddress: true, - companyAddress: '', billedToLabel: 'Billed To', // Entries @@ -41,6 +39,7 @@ export const initialValues = { showSubtotal: true, subtotalLabel: 'Subtotal', + // Discount showDiscount: true, discountLabel: 'Discount', @@ -52,6 +51,7 @@ export const initialValues = { paymentMadeLabel: 'Payment Made', showPaymentMade: true, + // Due amount dueAmountLabel: 'Due Amount', showDueAmount: true, @@ -59,6 +59,7 @@ export const initialValues = { termsConditionsLabel: 'Terms & Conditions', showTermsConditions: true, + // Statement statementLabel: 'Statement', showStatement: true, }; diff --git a/packages/webapp/src/containers/Sales/Invoices/InvoiceCustomize/types.ts b/packages/webapp/src/containers/Sales/Invoices/InvoiceCustomize/types.ts index 6a2d6839e..e67d755ff 100644 --- a/packages/webapp/src/containers/Sales/Invoices/InvoiceCustomize/types.ts +++ b/packages/webapp/src/containers/Sales/Invoices/InvoiceCustomize/types.ts @@ -1,6 +1,8 @@ -import { BrandingTemplateValues } from "@/containers/BrandingTemplates/types"; +import { BrandingState, BrandingTemplateValues } from '@/containers/BrandingTemplates/types'; -export interface InvoiceCustomizeValues extends BrandingTemplateValues { +export interface InvoiceCustomizeState extends BrandingState {} + +export interface InvoiceCustomizeFormValues extends BrandingTemplateValues { // Colors primaryColor?: string; secondaryColor?: string; @@ -14,15 +16,14 @@ export interface InvoiceCustomizeValues extends BrandingTemplateValues { showInvoiceNumber?: boolean; invoiceNumberLabel?: string; + // Date issue showDateIssue?: boolean; dateIssueLabel?: string; + // Due date showDueDate?: boolean; dueDateLabel?: string; - // Company name - companyName?: string; - // Addresses showBilledFromAddress?: boolean; showBillingToAddress?: boolean; @@ -38,6 +39,7 @@ export interface InvoiceCustomizeValues extends BrandingTemplateValues { showSubtotal?: boolean; subtotalLabel?: string; + // Discount showDiscount?: boolean; discountLabel?: string; diff --git a/packages/webapp/src/containers/Sales/Invoices/InvoiceCustomize/utils.ts b/packages/webapp/src/containers/Sales/Invoices/InvoiceCustomize/utils.ts index d9a1979da..081eae5cc 100644 --- a/packages/webapp/src/containers/Sales/Invoices/InvoiceCustomize/utils.ts +++ b/packages/webapp/src/containers/Sales/Invoices/InvoiceCustomize/utils.ts @@ -1,6 +1,5 @@ import { omit } from 'lodash'; -import { useFormikContext } from 'formik'; -import { InvoiceCustomizeValues } from './types'; +import { InvoiceCustomizeFormValues } from './types'; import { CreatePdfTemplateValues, EditPdfTemplateValues, @@ -10,7 +9,7 @@ import { initialValues } from './constants'; import { useBrandingTemplateBoot } from '@/containers/BrandingTemplates/BrandingTemplateBoot'; export const transformToEditRequest = ( - values: InvoiceCustomizeValues, + values: InvoiceCustomizeFormValues, ): EditPdfTemplateValues => { return { templateName: values.templateName, @@ -19,7 +18,7 @@ export const transformToEditRequest = ( }; export const transformToNewRequest = ( - values: InvoiceCustomizeValues, + values: InvoiceCustomizeFormValues, ): CreatePdfTemplateValues => { return { resource: 'SaleInvoice', @@ -28,7 +27,7 @@ export const transformToNewRequest = ( }; }; -export const useInvoiceCustomizeInitialValues = (): InvoiceCustomizeValues => { +export const useInvoiceCustomizeInitialValues = (): InvoiceCustomizeFormValues => { const { pdfTemplate } = useBrandingTemplateBoot(); const defaultPdfTemplate = { @@ -40,6 +39,6 @@ export const useInvoiceCustomizeInitialValues = (): InvoiceCustomizeValues => { ...(transformToForm( defaultPdfTemplate, initialValues, - ) as InvoiceCustomizeValues), + ) as InvoiceCustomizeFormValues), }; }; diff --git a/packages/webapp/src/containers/Sales/PaymentsReceived/PaymentReceivedCustomize/constants.ts b/packages/webapp/src/containers/Sales/PaymentsReceived/PaymentReceivedCustomize/constants.ts index 3cb815980..8ed1551fe 100644 --- a/packages/webapp/src/containers/Sales/PaymentsReceived/PaymentReceivedCustomize/constants.ts +++ b/packages/webapp/src/containers/Sales/PaymentsReceived/PaymentReceivedCustomize/constants.ts @@ -20,7 +20,6 @@ export const initialValues = { // Customer address showCompanyAddress: true, - companyAddress: '', // Company address showCustomerAddress: true, diff --git a/packages/webapp/src/containers/Sales/Receipts/ReceiptCustomize/constants.ts b/packages/webapp/src/containers/Sales/Receipts/ReceiptCustomize/constants.ts index c25da45a5..bf340bbd2 100644 --- a/packages/webapp/src/containers/Sales/Receipts/ReceiptCustomize/constants.ts +++ b/packages/webapp/src/containers/Sales/Receipts/ReceiptCustomize/constants.ts @@ -22,7 +22,6 @@ export const initialValues = { showCustomerAddress: true, // Company address - companyAddress: '', showCompanyAddress: true, billedToLabel: 'Billed To',