mirror of
https://github.com/frappe/books.git
synced 2026-08-24 02:24:17 -05:00
feat: Added Terms and Conditions section to print template
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -133,6 +133,18 @@
|
||||
"fieldtype": "Check",
|
||||
"section": "Customizations"
|
||||
},
|
||||
{
|
||||
"fieldname": "displaytermsandconditions",
|
||||
"label": "Display Terms and Conditions",
|
||||
"fieldtype": "Check",
|
||||
"section": "Customizations"
|
||||
},
|
||||
{
|
||||
"fieldname": "termsAndConditions",
|
||||
"label": "Terms and Conditions",
|
||||
"fieldtype": "Text",
|
||||
"section": "Customizations"
|
||||
},
|
||||
{
|
||||
"fieldname": "posPrintWidth",
|
||||
"label": "Pos Print Width",
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -38,6 +38,8 @@ const printSettingsFields = [
|
||||
'address',
|
||||
'companyName',
|
||||
'amountInWords',
|
||||
'displaytermsandconditions',
|
||||
'termsAndConditions',
|
||||
];
|
||||
const accountingSettingsFields = ['gstin', 'taxId'];
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user