mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
feat: Assign default pdf template automatically
This commit is contained in:
@@ -67,6 +67,7 @@ function CreditNoteForm({
|
||||
newCreditNote,
|
||||
createCreditNoteMutate,
|
||||
editCreditNoteMutate,
|
||||
creditNoteState,
|
||||
} = useCreditNoteFormContext();
|
||||
|
||||
// Credit number.
|
||||
@@ -85,6 +86,7 @@ function CreditNoteForm({
|
||||
currency_code: base_currency,
|
||||
terms_conditions: defaultTo(creditTermsConditions, ''),
|
||||
note: defaultTo(creditCustomerNotes, ''),
|
||||
pdf_template_id: creditNoteState?.defaultTemplateId,
|
||||
...newCreditNote,
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -85,7 +85,7 @@ function CreditNoteFormProvider({ creditNoteId, ...props }) {
|
||||
|
||||
// Fetches branding templates of invoice.
|
||||
const { data: brandingTemplates, isLoading: isBrandingTemplatesLoading } =
|
||||
useGetPdfTemplates({ resource: 'PaymentReceive' });
|
||||
useGetPdfTemplates({ resource: 'CreditNote' });
|
||||
|
||||
// Fetches the credit note state.
|
||||
const { data: creditNoteState, isLoading: isCreditNoteStateLoading } =
|
||||
|
||||
Reference in New Issue
Block a user