diff --git a/packages/server/resources/views/modules/credit-note-standard.pug b/packages/server/resources/views/modules/credit-note-standard.pug index f580b8fc9..ae201b305 100644 --- a/packages/server/resources/views/modules/credit-note-standard.pug +++ b/packages/server/resources/views/modules/credit-note-standard.pug @@ -134,9 +134,9 @@ block content div(class=`${prefix}-root`) div(class=`${prefix}-big-title`) Credit Note - if showCompanyLogo + if showCompanyLogo && companyLogoUri div(class=`${prefix}-logo-wrap`) - img(src=companyLogo alt=`Company Logo`) + img(src=companyLogoUri alt=`Company Logo`) div(class=`${prefix}-terms-list`) if showCreditNoteNumber @@ -155,6 +155,7 @@ block content strong #{companyName} each address in billedFromAddress div #{address} + if showBilledToAddress div(class=`${prefix}-address`) strong #{billedToLabel} @@ -187,12 +188,12 @@ block content div(class=`${prefix}-totals__item-amount`) #{totalLabel}: div(class=`${prefix}-totals__item-label`) #{total} - if showCustomerNote + if showCustomerNote && customerNote div(class=`${prefix}-statement`) div(class=`${prefix}-statement__label`) #{customerNoteLabel}: div(class=`${prefix}-statement__value`) #{customerNote} - if showTermsConditions + if showTermsConditions && termsConditions div(class=`${prefix}-statement`) div(class=`${prefix}-statement__label`) #{termsConditionsLabel}: div(class=`${prefix}-statement__value`) #{termsConditions} diff --git a/packages/server/resources/views/modules/estimate-regular.pug b/packages/server/resources/views/modules/estimate-regular.pug index a908cb6f1..d245990ee 100644 --- a/packages/server/resources/views/modules/estimate-regular.pug +++ b/packages/server/resources/views/modules/estimate-regular.pug @@ -135,9 +135,9 @@ block content div(class=`${prefix}-root`, style=`--invoice-primary-color: ${primaryColor}; --invoice-secondary-color: ${secondaryColor};`) h1(class=`${prefix}-big-title`) Estimate - if showCompanyLogo + if showCompanyLogo && companyLogoUri div(class=`${prefix}-logo-wrap`) - img(alt="", src=companyLogo) + img(alt="Company logo", src=companyLogoUri) //- Terms List div(class=`${prefix}-terms`) diff --git a/packages/server/resources/views/modules/invoice-standard.pug b/packages/server/resources/views/modules/invoice-standard.pug index ba9339637..6c8ca5f70 100644 --- a/packages/server/resources/views/modules/invoice-standard.pug +++ b/packages/server/resources/views/modules/invoice-standard.pug @@ -144,9 +144,9 @@ block content //- Title and company logo h1(class=`${prefix}-big-title`) Invoice - if showCompanyLogo + if showCompanyLogo && companyLogoUri div(class=`${prefix}-logo-wrap`) - img(alt="", src=companyLogo) + img(alt="Company logo", src=companyLogoUri) //- Invoice details div(class=`${prefix}-details`) diff --git a/packages/server/resources/views/modules/payment-receive-standard.pug b/packages/server/resources/views/modules/payment-receive-standard.pug index 36ba86ed2..ec6dae598 100644 --- a/packages/server/resources/views/modules/payment-receive-standard.pug +++ b/packages/server/resources/views/modules/payment-receive-standard.pug @@ -124,9 +124,9 @@ block content div(class=`${prefix}-root`) div(class=`${prefix}-big-title`) Payment - if showCompanyLogo + if showCompanyLogo && companyLogoUri div(class=`${prefix}-logo-wrap`) - img(src=companyLogo alt="Company Logo") + img(src=companyLogoUri alt="Company Logo") div(class=`${prefix}-terms-list`) if showPaymentReceivedNumber diff --git a/packages/server/resources/views/modules/receipt-regular.pug b/packages/server/resources/views/modules/receipt-regular.pug index 2aa504031..39185c1d7 100644 --- a/packages/server/resources/views/modules/receipt-regular.pug +++ b/packages/server/resources/views/modules/receipt-regular.pug @@ -128,9 +128,10 @@ block content //- Title and company logo h1(class=`${prefix}-big-title`) Receipt - if showCompanyLogo + //- Company Logo + if showCompanyLogo && companyLogoUri div(class=`${prefix}-logo-wrap`) - img(src=companyLogo alt=`Company Logo`) + img(src=companyLogoUri alt=`Company Logo`) //- Terms List div(class=`${prefix}-terms-list`) @@ -186,13 +187,13 @@ block content span(class=`${prefix}-totals__line__amount`)= total //- Customer Note Section - if showCustomerNote + if showCustomerNote && customerNote div(class=`${prefix}-statement`) div(class=`${prefix}-statement__label`)= customerNoteLabel div(class=`${prefix}-statement__value`)= customerNote //- Terms & Conditions Section - if showTermsConditions + if showTermsConditions && termsConditions div(class=`${prefix}-statement`) div(class=`${prefix}-statement__label`)= termsConditionsLabel div(class=`${prefix}-statement__value`)= termsConditions diff --git a/packages/server/src/services/CreditNotes/constants.ts b/packages/server/src/services/CreditNotes/constants.ts index 9691a4b77..db44e5968 100644 --- a/packages/server/src/services/CreditNotes/constants.ts +++ b/packages/server/src/services/CreditNotes/constants.ts @@ -68,10 +68,16 @@ export const DEFAULT_VIEWS = [ ]; export const defaultCreditNoteBrandingAttributes = { + // # Colors primaryColor: '', secondaryColor: '', + + // # Company logo showCompanyLogo: true, - companyLogo: '', + companyLogoKey: '', + companyLogoUri: '', + + // # Company name companyName: 'Bigcapital Technology, Inc.', // Address diff --git a/packages/server/src/services/Sales/Estimates/constants.ts b/packages/server/src/services/Sales/Estimates/constants.ts index a5f9a9520..e4783e0f9 100644 --- a/packages/server/src/services/Sales/Estimates/constants.ts +++ b/packages/server/src/services/Sales/Estimates/constants.ts @@ -177,8 +177,12 @@ export const SaleEstimatesSampleData = [ export const defaultEstimatePdfBrandingAttributes = { primaryColor: '#000', secondaryColor: '#000', + + // # Company logo showCompanyLogo: true, - companyLogo: '', + companyLogoUri: '', + companyLogoKey: '', + companyName: '', billedToAddress: [ diff --git a/packages/server/src/services/Sales/Invoices/constants.ts b/packages/server/src/services/Sales/Invoices/constants.ts index 42859077c..f1da02b03 100644 --- a/packages/server/src/services/Sales/Invoices/constants.ts +++ b/packages/server/src/services/Sales/Invoices/constants.ts @@ -170,7 +170,8 @@ export const defaultInvoicePdfTemplateAttributes = { companyName: 'Bigcapital Technology, Inc.', showCompanyLogo: true, - companyLogo: '', + companyLogoKey: '', + companyLogoUri: '', dueDateLabel: 'Date due', showDueDate: true, diff --git a/packages/server/src/services/Sales/PaymentReceived/constants.ts b/packages/server/src/services/Sales/PaymentReceived/constants.ts index 3d9b6af88..c9fef7c5f 100644 --- a/packages/server/src/services/Sales/PaymentReceived/constants.ts +++ b/packages/server/src/services/Sales/PaymentReceived/constants.ts @@ -47,12 +47,18 @@ export const PaymentsReceiveSampleData = [ ]; export const defaultPaymentReceivedPdfTemplateAttributes = { + // # Colors primaryColor: '#000', secondaryColor: '#000', + + // # Company logo showCompanyLogo: true, - companyLogo: '', + companyLogoUri: '', + + // # Company name companyName: 'Bigcapital Technology, Inc.', + // Address billedToAddress: [ 'Bigcapital Technology, Inc.', '131 Continental Dr Suite 305 Newark,', @@ -72,10 +78,12 @@ export const defaultPaymentReceivedPdfTemplateAttributes = { showBillingToAddress: true, billedToLabel: 'Billed To', + // Total total: '$1000.00', totalLabel: 'Total', showTotal: true, + // Subtotal subtotal: '1000/00', subtotalLabel: 'Subtotal', showSubtotal: true, @@ -87,10 +95,12 @@ export const defaultPaymentReceivedPdfTemplateAttributes = { paidAmount: '$1000.00', }, ], + // Payment received number showPaymentReceivedNumber: true, paymentReceivedNumberLabel: 'Payment Number', paymentReceivedNumebr: '346D3D40-0001', + // Payment date. paymentReceivedDate: 'September 3, 2024', showPaymentReceivedDate: true, paymentReceivedDateLabel: 'Payment Date', diff --git a/packages/server/src/services/Sales/Receipts/constants.ts b/packages/server/src/services/Sales/Receipts/constants.ts index 491369c74..0b2f38bc1 100644 --- a/packages/server/src/services/Sales/Receipts/constants.ts +++ b/packages/server/src/services/Sales/Receipts/constants.ts @@ -69,10 +69,13 @@ export const SaleReceiptsSampleData = [ export const defaultSaleReceiptBrandingAttributes = { primaryColor: '', secondaryColor: '', - showCompanyLogo: true, - companyLogo: '', companyName: 'Bigcapital Technology, Inc.', + // # Company logo + showCompanyLogo: true, + companyLogoUri: '', + companyLogoKey: '', + // # Address billedToAddress: [ 'Bigcapital Technology, Inc.', diff --git a/packages/webapp/src/containers/Sales/PaymentsReceived/PaymentReceivedCustomize/constants.ts b/packages/webapp/src/containers/Sales/PaymentsReceived/PaymentReceivedCustomize/constants.ts index 1cdcc1b76..e9aef8a0e 100644 --- a/packages/webapp/src/containers/Sales/PaymentsReceived/PaymentReceivedCustomize/constants.ts +++ b/packages/webapp/src/containers/Sales/PaymentsReceived/PaymentReceivedCustomize/constants.ts @@ -8,7 +8,7 @@ export const initialValues = { // Company logo. showCompanyLogo: true, companyLogoUri: '', - companyLogokey: '', + companyLogoKey: '', // Top details. showPaymentReceivedNumber: true, diff --git a/packages/webapp/src/containers/Sales/Receipts/ReceiptCustomize/ReceiptCustomizeContent.tsx b/packages/webapp/src/containers/Sales/Receipts/ReceiptCustomize/ReceiptCustomizeContent.tsx index fb1a0e06c..298e8f879 100644 --- a/packages/webapp/src/containers/Sales/Receipts/ReceiptCustomize/ReceiptCustomizeContent.tsx +++ b/packages/webapp/src/containers/Sales/Receipts/ReceiptCustomize/ReceiptCustomizeContent.tsx @@ -1,5 +1,5 @@ import { useFormikContext } from 'formik'; -import { ElementCustomize } from '../../../ElementCustomize/ElementCustomize'; +import { ElementCustomize } from '@/containers/ElementCustomize/ElementCustomize'; import { ReceiptCustomizeGeneralField } from './ReceiptCustomizeFieldsGeneral'; import { ReceiptCustomizeFieldsContent } from './ReceiptCustomizeFieldsContent'; import { ReceiptPaperTemplate } from './ReceiptPaperTemplate'; @@ -20,10 +20,10 @@ export function ReceiptCustomizeContent() { return ( - templateId={templateId} - initialValues={initialValues} - onSuccess={handleFormSuccess} resource={'SaleReceipt'} + templateId={templateId} + defaultValues={initialValues} + onSuccess={handleFormSuccess} >