Merge pull request #1385 from Gadha2311/terms-condition

feat: Added Terms and Conditions section to print template
This commit is contained in:
Able k Saju
2025-11-05 12:15:43 +05:30
committed by GitHub
13 changed files with 88 additions and 2 deletions
+1
View File
@@ -17,6 +17,7 @@ export default class SystemSettings extends Doc {
version?: string;
instanceId?: string;
darkMode?: boolean;
displayTermsAndConditions?: boolean;
validations: ValidationMap = {
displayPrecision(value: DocValue) {
@@ -13,7 +13,11 @@ export class PrintSettings extends Doc {
displayLogo?: boolean;
displayTime?: boolean;
displayDescription?: boolean;
displaytermsandconditions?: boolean;
termsAndConditions?: string;
posPrintWidth?: number;
amountInWords?: boolean;
override hidden: HiddenMap = {};
override hidden: HiddenMap = {
termsAndConditions: () => !this.displaytermsandconditions,
};
}
+12
View File
@@ -133,12 +133,24 @@
"fieldtype": "Check",
"section": "Customizations"
},
{
"fieldname": "displaytermsandconditions",
"label": "Display Terms and Conditions",
"fieldtype": "Check",
"section": "Customizations"
},
{
"fieldname": "posPrintWidth",
"label": "Pos Print Width",
"fieldtype": "Float",
"default": 8,
"section": "Customizations"
},
{
"fieldname": "termsAndConditions",
"label": "Terms and Conditions",
"fieldtype": "Text",
"section": "Customizations"
}
]
}
+7
View File
@@ -141,6 +141,13 @@
"default": false,
"description": "Sets the theme of the app.",
"section": "Theme"
},
{
"fieldname": "displayTermsAndConditions",
"label": "Display Terms and Conditions",
"fieldtype": "Check",
"default": false,
"section": "Customizations"
}
],
"quickEditFields": [
@@ -23,6 +23,7 @@
field.fieldtype === 'Table' ? 'col-span-2 text-base' : '',
field.fieldtype === 'AttachImage' ? 'row-span-2' : '',
field.fieldtype === 'Check' ? 'mt-auto' : 'mb-auto',
field.fieldname === 'termsAndConditions' ? 'col-span-2' : '',
]"
>
<Table
@@ -4,6 +4,7 @@
:scale="Math.max(scale, 0.1)"
:width="width"
:height="height"
:show-overflow="true"
class="mx-auto shadow-lg border"
>
<ErrorBoundary
@@ -2,7 +2,7 @@
<div class="overflow-hidden" :style="outerContainerStyle">
<div
:style="innerContainerStyle"
:class="showOverflow ? 'overflow-auto no-scrollbar' : ''"
:class="showOverflow ? 'overflow-auto no-scrollbar' : 'overflow-visible'"
>
<slot></slot>
</div>
+2
View File
@@ -38,6 +38,8 @@ const printSettingsFields = [
'address',
'companyName',
'amountInWords',
'displaytermsandconditions',
'termsAndConditions',
];
const accountingSettingsFields = ['gstin', 'taxId'];
+11
View File
@@ -153,4 +153,15 @@
</div>
</section>
</footer>
<!-- Terms and Conditions -->
<section
class="mt-8 px-6"
v-if="print.displaytermsandconditions && print.termsAndConditions"
>
<h3 class="text-lg font-semibold">{{ t`Terms and Conditions` }}</h3>
<p class="mt-4 text-lg whitespace-pre-line">
{{ print.termsAndConditions }}
</p>
</section>
</main>
+11
View File
@@ -122,5 +122,16 @@
<p class="mt-4 text-lg whitespace-pre-line">{{ doc.terms }}</p>
</section>
<!-- Terms and Conditions -->
<section
class="mt-12"
v-if="print.displaytermsandconditions && print.termsAndConditions"
>
<h3 class="text-lg font-semibold">{{t`Terms and Conditions`}}</h3>
<p class="mt-4 text-lg whitespace-pre-line">
{{ print.termsAndConditions }}
</p>
</section>
</footer>
</main>
+11
View File
@@ -107,5 +107,16 @@
<p class="mt-4 text-lg whitespace-pre-line">{{ doc.terms }}</p>
</section>
<!-- Terms and Conditions -->
<section
class="mt-12"
v-if="print.displaytermsandconditions && print.termsAndConditions"
>
<h3 class="text-lg font-semibold">{{t`Terms and Conditions`}}</h3>
<p class="mt-4 text-lg whitespace-pre-line">
{{ print.termsAndConditions }}
</p>
</section>
</footer>
</main>
+12
View File
@@ -132,9 +132,21 @@
<h3 class="text-lg font-semibold">{{t`Notes`}}</h3>
<p class="mt-4 text-lg whitespace-pre-line">{{ doc.terms }}</p>
</section>
<div v-if="print.amountInWords" class="flex justify-end mt-10">
<h3 class="text-lg font-semibold mr-2">{{t`Grand Total In Words`}}:</h3>
<p>{{doc.grandTotalInWords}}</p>
</div>
<!-- Terms and Conditions -->
<section
class="mt-12"
v-if="print.displaytermsandconditions && print.termsAndConditions"
>
<h3 class="text-lg font-semibold">{{t`Terms and Conditions`}}</h3>
<p class="mt-4 text-lg whitespace-pre-line">
{{ print.termsAndConditions }}
</p>
</section>
</footer>
</main>
+13
View File
@@ -177,4 +177,17 @@
</div>
</section>
</footer>
<!-- Terms and Conditions -->
<section
class="px-12 py-10"
v-if="print.displaytermsandconditions && print.termsAndConditions"
>
<h3 class="uppercase text-sm tracking-widest font-semibold text-gray-800">
{{ t`Terms and Conditions` }}
</h3>
<p class="mt-4 text-lg whitespace-pre-line">
{{ print.termsAndConditions }}
</p>
</section>
</main>