From b86bdc1fc25d4eb9600a7005017c4b0184c12b73 Mon Sep 17 00:00:00 2001 From: AbleKSaju <126228406+AbleKSaju@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:18:41 +0530 Subject: [PATCH] feat: add option to enable/disable amount in words in print settings --- models/baseModels/PrintSettings/PrintSettings.ts | 1 + schemas/app/PrintSettings.json | 6 ++++++ src/utils/printTemplates.ts | 1 + templates/Business.template.html | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/models/baseModels/PrintSettings/PrintSettings.ts b/models/baseModels/PrintSettings/PrintSettings.ts index b369bd1a..e2cae51f 100644 --- a/models/baseModels/PrintSettings/PrintSettings.ts +++ b/models/baseModels/PrintSettings/PrintSettings.ts @@ -11,5 +11,6 @@ export class PrintSettings extends Doc { color?: string; font?: string; displayLogo?: boolean; + amountInWords?: boolean; override hidden: HiddenMap = {}; } diff --git a/schemas/app/PrintSettings.json b/schemas/app/PrintSettings.json index 345c3f46..d7eed41d 100644 --- a/schemas/app/PrintSettings.json +++ b/schemas/app/PrintSettings.json @@ -114,6 +114,12 @@ "label": "Display Logo in Invoice", "fieldtype": "Check", "section": "Customizations" + }, + { + "fieldname": "amountInWords", + "label": "Display Amount In Words", + "fieldtype": "Check", + "section": "Customizations" } ] } diff --git a/src/utils/printTemplates.ts b/src/utils/printTemplates.ts index a2837fba..d1012090 100644 --- a/src/utils/printTemplates.ts +++ b/src/utils/printTemplates.ts @@ -29,6 +29,7 @@ const printSettingsFields = [ 'phone', 'address', 'companyName', + 'amountInWords', ]; const accountingSettingsFields = ['gstin', 'taxId']; diff --git a/templates/Business.template.html b/templates/Business.template.html index 890fa4cb..41480bea 100644 --- a/templates/Business.template.html +++ b/templates/Business.template.html @@ -126,7 +126,7 @@
{{ doc.terms }}
-{{doc.grandTotalInWords}}