mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
fix: Pdf branding templates request data
This commit is contained in:
@@ -2,12 +2,13 @@ import { useFormikContext } from 'formik';
|
||||
import { ElementCustomize } from '../../../ElementCustomize/ElementCustomize';
|
||||
import { PaymentReceivedCustomizeGeneralField } from './PaymentReceivedCustomizeFieldsGeneral';
|
||||
import { PaymentReceivedCustomizeContentFields } from './PaymentReceivedCustomizeFieldsContent';
|
||||
import { PaymentReceivedCustomizeValues } from './types';
|
||||
import { PaymentReceivedPaperTemplate } from './PaymentReceivedPaperTemplate';
|
||||
import { PaymentReceivedCustomizeValues, PaymentReceivedPreviewState } from './types';
|
||||
import { PaymentReceivedPaperTemplate, PaymentReceivedPaperTemplateProps } from './PaymentReceivedPaperTemplate';
|
||||
import { initialValues } from './constants';
|
||||
import { useDrawerContext } from '@/components/Drawer/DrawerProvider';
|
||||
import { useDrawerActions } from '@/hooks/state';
|
||||
import { BrandingTemplateForm } from '@/containers/BrandingTemplates/BrandingTemplateForm';
|
||||
import { useElementCustomizeContext } from '@/containers/ElementCustomize/ElementCustomizeProvider';
|
||||
|
||||
export function PaymentReceivedCustomizeContent() {
|
||||
const { payload, name } = useDrawerContext();
|
||||
@@ -20,7 +21,7 @@ export function PaymentReceivedCustomizeContent() {
|
||||
};
|
||||
|
||||
return (
|
||||
<BrandingTemplateForm<PaymentReceivedCustomizeValues>
|
||||
<BrandingTemplateForm<PaymentReceivedCustomizeValues, PaymentReceivedPreviewState>
|
||||
templateId={templateId}
|
||||
defaultValues={initialValues}
|
||||
onSuccess={handleSuccess}
|
||||
@@ -43,6 +44,9 @@ export function PaymentReceivedCustomizeContent() {
|
||||
|
||||
function PaymentReceivedPaperTemplateFormConnected() {
|
||||
const { values } = useFormikContext<PaymentReceivedCustomizeValues>();
|
||||
const { brandingState } = useElementCustomizeContext();
|
||||
|
||||
return <PaymentReceivedPaperTemplate {...values} />;
|
||||
const paperTemplateProps: PaymentReceivedPaperTemplateProps = { ...brandingState, ...values };
|
||||
|
||||
return <PaymentReceivedPaperTemplate {...paperTemplateProps} />;
|
||||
}
|
||||
|
||||
@@ -18,9 +18,6 @@ export const initialValues = {
|
||||
showPaymentReceivedDate: true,
|
||||
paymentReceivedDateLabel: 'Date of Issue',
|
||||
|
||||
// Company name
|
||||
companyName: 'Bigcapital Technology, Inc.',
|
||||
|
||||
// Customer address
|
||||
showCompanyAddress: true,
|
||||
companyAddress: '',
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { BrandingTemplateValues } from '@/containers/BrandingTemplates/types';
|
||||
import { BrandingState, BrandingTemplateValues } from '@/containers/BrandingTemplates/types';
|
||||
|
||||
export interface PaymentReceivedPreviewState extends BrandingState {}
|
||||
|
||||
export interface PaymentReceivedCustomizeValues extends BrandingTemplateValues {
|
||||
// Colors
|
||||
@@ -20,15 +22,11 @@ export interface PaymentReceivedCustomizeValues extends BrandingTemplateValues {
|
||||
showDueDate?: boolean;
|
||||
dueDateLabel?: string;
|
||||
|
||||
// # Company name
|
||||
companyName?: string;
|
||||
|
||||
// # Customer address
|
||||
showCustomerAddress?: boolean;
|
||||
|
||||
// # Company address
|
||||
showCompanyAddress?: boolean;
|
||||
companyAddress?: string;
|
||||
billedToLabel?: string;
|
||||
|
||||
// Entries
|
||||
|
||||
Reference in New Issue
Block a user