mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: rendering pdf templates on the server-side
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
transformAttachmentsToForm,
|
||||
transformAttachmentsToRequest,
|
||||
} from '@/containers/Attachments/utils';
|
||||
import { convertBrandingTemplatesToOptions } from '@/containers/BrandingTemplates/BrandingTemplatesSelectFields';
|
||||
|
||||
// Default payment receive entry.
|
||||
export const defaultPaymentReceiveEntry = {
|
||||
@@ -44,10 +45,11 @@ export const defaultPaymentReceive = {
|
||||
statement: '',
|
||||
amount: '',
|
||||
currency_code: '',
|
||||
branch_id: '',
|
||||
exchange_rate: 1,
|
||||
entries: [],
|
||||
attachments: [],
|
||||
branch_id: '',
|
||||
pdf_template_id: '',
|
||||
};
|
||||
|
||||
export const defaultRequestPaymentEntry = {
|
||||
@@ -303,3 +305,12 @@ export const getExceededAmountFromValues = (values) => {
|
||||
|
||||
return totalAmount - totalApplied;
|
||||
};
|
||||
|
||||
export const usePaymentReceivedFormBrandingTemplatesOptions = () => {
|
||||
const { brandingTemplates } = usePaymentReceiveFormContext();
|
||||
|
||||
return React.useMemo(
|
||||
() => convertBrandingTemplatesToOptions(brandingTemplates),
|
||||
[brandingTemplates],
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user