From 3fa552a19b9587bac3084e1d09be22d65c11b624 Mon Sep 17 00:00:00 2001 From: AbleKSaju <126228406+AbleKSaju@users.noreply.github.com> Date: Mon, 12 Aug 2024 17:14:25 +0530 Subject: [PATCH 1/2] feat: discount field in Sales Quote Print template --- src/utils/printTemplates.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/printTemplates.ts b/src/utils/printTemplates.ts index 33edb566..3653e8c8 100644 --- a/src/utils/printTemplates.ts +++ b/src/utils/printTemplates.ts @@ -56,8 +56,8 @@ export async function getPrintTemplatePropValues( ...printValues, ...accountingValues, }; - - if (doc.schemaName?.endsWith('Invoice')) { + const discountSchema = ['Invoice', 'Quote']; + if (discountSchema.some(value => doc.schemaName?.endsWith(value))) { (values.doc as PrintTemplateData).totalDiscount = formattedTotalDiscount(doc); (values.doc as PrintTemplateData).showHSN = showHSN(doc); From add19ef6928751907f33c69d42796b067aa3e8d2 Mon Sep 17 00:00:00 2001 From: AbleKSaju <126228406+AbleKSaju@users.noreply.github.com> Date: Mon, 12 Aug 2024 17:36:09 +0530 Subject: [PATCH 2/2] fix: format --- src/utils/printTemplates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/printTemplates.ts b/src/utils/printTemplates.ts index 3653e8c8..94f63471 100644 --- a/src/utils/printTemplates.ts +++ b/src/utils/printTemplates.ts @@ -57,7 +57,7 @@ export async function getPrintTemplatePropValues( ...accountingValues, }; const discountSchema = ['Invoice', 'Quote']; - if (discountSchema.some(value => doc.schemaName?.endsWith(value))) { + if (discountSchema.some((value) => doc.schemaName?.endsWith(value))) { (values.doc as PrintTemplateData).totalDiscount = formattedTotalDiscount(doc); (values.doc as PrintTemplateData).showHSN = showHSN(doc);