mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
feat: PDF templates company/customer address
This commit is contained in:
@@ -185,23 +185,10 @@ export const defaultEstimatePdfBrandingAttributes = {
|
||||
|
||||
companyName: '',
|
||||
|
||||
billedToAddress: [
|
||||
'Bigcapital Technology, Inc.',
|
||||
'131 Continental Dr Suite 305 Newark,',
|
||||
'Delaware 19713',
|
||||
'United States',
|
||||
'+1 762-339-5634',
|
||||
'ahmed@bigcapital.app',
|
||||
],
|
||||
billedFromAddress: [
|
||||
'131 Continental Dr Suite 305 Newark,',
|
||||
'Delaware 19713',
|
||||
'United States',
|
||||
'+1 762-339-5634',
|
||||
'ahmed@bigcapital.app',
|
||||
],
|
||||
showBilledFromAddress: true,
|
||||
showBilledToAddress: true,
|
||||
customerAddress: '',
|
||||
companyAddress: '',
|
||||
showCustomerAddress: true,
|
||||
showCompanyAddress: true,
|
||||
billedToLabel: 'Billed To',
|
||||
|
||||
total: '$1000.00',
|
||||
|
||||
@@ -2,12 +2,16 @@ import { Inject, Service } from 'typedi';
|
||||
import { mergePdfTemplateWithDefaultAttributes } from './utils';
|
||||
import { GetPdfTemplate } from '@/services/PdfTemplate/GetPdfTemplate';
|
||||
import { defaultEstimatePdfBrandingAttributes } from '../Estimates/constants';
|
||||
import { GetOrganizationBrandingAttributes } from '@/services/PdfTemplate/GetOrganizationBrandingAttributes';
|
||||
|
||||
@Service()
|
||||
export class SaleEstimatePdfTemplate {
|
||||
@Inject()
|
||||
private getPdfTemplateService: GetPdfTemplate;
|
||||
|
||||
@Inject()
|
||||
private getOrgBrandingAttrs: GetOrganizationBrandingAttributes;
|
||||
|
||||
/**
|
||||
* Retrieves the estimate pdf template.
|
||||
* @param {number} tenantId
|
||||
@@ -19,9 +23,19 @@ export class SaleEstimatePdfTemplate {
|
||||
tenantId,
|
||||
estimateTemplateId
|
||||
);
|
||||
// Retreives the organization branding attributes.
|
||||
const commonOrgBrandingAttrs =
|
||||
await this.getOrgBrandingAttrs.getOrganizationBrandingAttributes(
|
||||
tenantId
|
||||
);
|
||||
|
||||
const orgainizationBrandingAttrs = {
|
||||
...defaultEstimatePdfBrandingAttributes,
|
||||
...commonOrgBrandingAttrs,
|
||||
};
|
||||
const attributes = mergePdfTemplateWithDefaultAttributes(
|
||||
template.attributes,
|
||||
defaultEstimatePdfBrandingAttributes
|
||||
orgainizationBrandingAttrs
|
||||
);
|
||||
return {
|
||||
...template,
|
||||
|
||||
Reference in New Issue
Block a user