mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
incr: update print templates to display correct currency
This commit is contained in:
parent
6ee1365e45
commit
25236560df
@ -1,15 +1,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import { fyo } from 'src/initFyo';
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Base',
|
name: 'Base',
|
||||||
props: { doc: Object, printSettings: Object },
|
props: { doc: Object, printSettings: Object },
|
||||||
data: () => ({ party: null, companyAddress: null, partyAddress: null }),
|
data: () => ({ party: null, companyAddress: null, partyAddress: null }),
|
||||||
methods: {
|
|
||||||
format(row, fieldname) {
|
|
||||||
const value = row.get(fieldname);
|
|
||||||
return fyo.format(value, fyo.getField(row.schemaName, fieldname));
|
|
||||||
},
|
|
||||||
},
|
|
||||||
async mounted() {
|
async mounted() {
|
||||||
await this.printSettings.loadLink('address');
|
await this.printSettings.loadLink('address');
|
||||||
this.companyAddress = this.printSettings.getLink('address');
|
this.companyAddress = this.printSettings.getLink('address');
|
||||||
@ -17,8 +10,49 @@ export default {
|
|||||||
await this.doc.loadLink('party');
|
await this.doc.loadLink('party');
|
||||||
this.party = this.doc.getLink('party');
|
this.party = this.doc.getLink('party');
|
||||||
this.partyAddress = this.party.getLink('address')?.addressDisplay ?? null;
|
this.partyAddress = this.party.getLink('address')?.addressDisplay ?? null;
|
||||||
|
|
||||||
|
if (this.fyo.store.isDevelopment) {
|
||||||
|
window.bt = this;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getFormattedField(fieldname, doc) {
|
||||||
|
doc ??= this.doc;
|
||||||
|
const field = doc.fieldMap[fieldname];
|
||||||
|
const value = doc.get(fieldname);
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
return this.getFormattedChildDocList(fieldname);
|
||||||
|
}
|
||||||
|
return this.fyo.format(value, field, doc);
|
||||||
|
},
|
||||||
|
getFormattedChildDocList(fieldname) {
|
||||||
|
const formattedDocs = [];
|
||||||
|
for (const childDoc of this.doc?.[fieldname] ?? {}) {
|
||||||
|
formattedDocs.push(this.getFormattedChildDoc(childDoc));
|
||||||
|
}
|
||||||
|
return formattedDocs;
|
||||||
|
},
|
||||||
|
getFormattedChildDoc(childDoc) {
|
||||||
|
const formattedChildDoc = {};
|
||||||
|
for (const field of childDoc?.schema?.fields) {
|
||||||
|
if (field.meta) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
formattedChildDoc[field.fieldname] = this.getFormattedField(
|
||||||
|
field.fieldname,
|
||||||
|
childDoc
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return formattedChildDoc;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
currency() {
|
||||||
|
return this.doc.isMultiCurrency
|
||||||
|
? this.doc.currency
|
||||||
|
: this.fyo.singles.SystemSettings.currency;
|
||||||
|
},
|
||||||
isSalesInvoice() {
|
isSalesInvoice() {
|
||||||
return this.doc.schemaName === 'SalesInvoice';
|
return this.doc.schemaName === 'SalesInvoice';
|
||||||
},
|
},
|
||||||
@ -28,6 +62,46 @@ export default {
|
|||||||
totalDiscount() {
|
totalDiscount() {
|
||||||
return this.doc.getTotalDiscount();
|
return this.doc.getTotalDiscount();
|
||||||
},
|
},
|
||||||
|
formattedTotalDiscount() {
|
||||||
|
if (!this.totalDiscount?.float) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
const totalDiscount = this.fyo.format(this.totalDiscount, {
|
||||||
|
fieldname: 'Total Discount',
|
||||||
|
fieldtype: 'Currency',
|
||||||
|
currency: this.currency,
|
||||||
|
});
|
||||||
|
|
||||||
|
return `- ${totalDiscount}`;
|
||||||
|
},
|
||||||
|
printObject() {
|
||||||
|
return {
|
||||||
|
isSalesInvoice: this.isSalesInvoice,
|
||||||
|
font: this.printSettings.font,
|
||||||
|
color: this.printSettings.color,
|
||||||
|
showHSN: this.showHSN,
|
||||||
|
displayLogo: this.printSettings.displayLogo,
|
||||||
|
discountAfterTax: this.doc.discountAfterTax,
|
||||||
|
logo: this.printSettings.logo,
|
||||||
|
companyName: this.fyo.singles.AccountingSettings.companyName,
|
||||||
|
email: this.printSettings.email,
|
||||||
|
phone: this.printSettings.phone,
|
||||||
|
address: this.companyAddress?.addressDisplay,
|
||||||
|
gstin: this.fyo.singles?.AccountingSettings?.gstin,
|
||||||
|
invoiceName: this.doc.name,
|
||||||
|
date: this.getFormattedField('date'),
|
||||||
|
partyName: this.party?.name,
|
||||||
|
partyAddress: this.partyAddress,
|
||||||
|
partyGSTIN: this.party?.gstin,
|
||||||
|
terms: this.doc.terms,
|
||||||
|
netTotal: this.getFormattedField('netTotal'),
|
||||||
|
items: this.getFormattedField('items'),
|
||||||
|
taxes: this.getFormattedField('taxes'),
|
||||||
|
grandTotal: this.getFormattedField('grandTotal'),
|
||||||
|
totalDiscount: this.formattedTotalDiscount,
|
||||||
|
};
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,36 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="bg-white border h-full"
|
class="bg-white border h-full"
|
||||||
:style="{ 'font-family': printSettings.font }"
|
:style="{ 'font-family': printObject.font }"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div class="px-6 pt-6" v-if="printSettings">
|
<div class="px-6 pt-6">
|
||||||
<div class="flex text-sm text-gray-900 border-b pb-4">
|
<div class="flex text-sm text-gray-900 border-b pb-4">
|
||||||
<div class="w-1/3">
|
<div class="w-1/3">
|
||||||
<div v-if="printSettings.displayLogo">
|
<div v-if="printObject.displayLogo">
|
||||||
<img
|
<img
|
||||||
class="h-12 max-w-32 object-contain"
|
class="h-12 max-w-32 object-contain"
|
||||||
:src="printSettings.logo"
|
:src="printObject.logo"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-xl text-gray-700 font-semibold" v-else>
|
<div class="text-xl text-gray-700 font-semibold" v-else>
|
||||||
{{ fyo.singles.AccountingSettings.companyName }}
|
{{ printObject.companyName }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-1/3">
|
<div class="w-1/3">
|
||||||
<div>{{ printSettings.email }}</div>
|
<div>{{ printObject.email }}</div>
|
||||||
<div class="mt-1">{{ printSettings.phone }}</div>
|
<div class="mt-1">{{ printObject.phone }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-1/3">
|
<div class="w-1/3">
|
||||||
<div v-if="companyAddress">{{ companyAddress.addressDisplay }}</div>
|
<div v-if="printObject.address">
|
||||||
<div
|
{{ printObject.address }}
|
||||||
v-if="
|
|
||||||
fyo.singles.AccountingSettings &&
|
|
||||||
fyo.singles.AccountingSettings.gstin
|
|
||||||
"
|
|
||||||
>
|
|
||||||
GSTIN: {{ fyo.singles.AccountingSettings.gstin }}
|
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="printObject.gstin">GSTIN: {{ printObject.gstin }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -38,27 +33,27 @@
|
|||||||
<div class="flex justify-between">
|
<div class="flex justify-between">
|
||||||
<div class="w-1/3">
|
<div class="w-1/3">
|
||||||
<h1 class="text-2xl font-semibold">
|
<h1 class="text-2xl font-semibold">
|
||||||
{{ doc.name }}
|
{{ printObject.invoiceName }}
|
||||||
</h1>
|
</h1>
|
||||||
<div class="py-2 text-base">
|
<div class="py-2 text-base">
|
||||||
{{ fyo.format(doc.date, 'Date') }}
|
{{ printObject.date }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-1/3" v-if="party">
|
<div class="w-1/3" v-if="printObject.partyName">
|
||||||
<div class="py-1 text-right text-lg font-semibold">
|
<div class="py-1 text-right text-lg font-semibold">
|
||||||
{{ party.name }}
|
{{ printObject.partyName }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="partyAddress"
|
v-if="printObject.partyAddress"
|
||||||
class="mt-1 text-xs text-gray-600 text-right"
|
class="mt-1 text-xs text-gray-600 text-right"
|
||||||
>
|
>
|
||||||
{{ partyAddress }}
|
{{ printObject.partyAddress }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="party && party.gstin"
|
v-if="printObject.partyGSTIN"
|
||||||
class="mt-1 text-xs text-gray-600 text-right"
|
class="mt-1 text-xs text-gray-600 text-right"
|
||||||
>
|
>
|
||||||
GSTIN: {{ party.gstin }}
|
GSTIN: {{ printObject.partyGSTIN }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -67,64 +62,67 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="text-gray-600 w-full flex border-b">
|
<div class="text-gray-600 w-full flex border-b">
|
||||||
<div class="py-4 w-5/12">Item</div>
|
<div class="py-4 w-5/12">Item</div>
|
||||||
<div class="py-4 text-right w-2/12" v-if="showHSN">HSN/SAC</div>
|
<div class="py-4 text-right w-2/12" v-if="printObject.showHSN">
|
||||||
|
HSN/SAC
|
||||||
|
</div>
|
||||||
<div class="py-4 text-right w-1/12">Quantity</div>
|
<div class="py-4 text-right w-1/12">Quantity</div>
|
||||||
<div class="py-4 text-right w-3/12">Rate</div>
|
<div class="py-4 text-right w-3/12">Rate</div>
|
||||||
<div class="py-4 text-right w-3/12">Amount</div>
|
<div class="py-4 text-right w-3/12">Amount</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex py-1 text-gray-900 w-full border-b"
|
class="flex py-1 text-gray-900 w-full border-b"
|
||||||
v-for="row in doc.items"
|
v-for="row in printObject.items"
|
||||||
:key="row.name"
|
:key="row.name"
|
||||||
>
|
>
|
||||||
<div class="w-5/12 py-4">{{ row.item }}</div>
|
<div class="w-5/12 py-4">{{ row.item }}</div>
|
||||||
<div class="w-2/12 text-right py-4" v-if="showHSN">
|
<div class="w-2/12 text-right py-4" v-if="printObject.showHSN">
|
||||||
{{ row.hsnCode }}
|
{{ row.hsnCode }}
|
||||||
</div>
|
</div>
|
||||||
<div class="w-1/12 text-right py-4">
|
<div class="w-1/12 text-right py-4">{{ row.quantity }}</div>
|
||||||
{{ format(row, 'quantity') }}
|
<div class="w-3/12 text-right py-4">{{ row.rate }}</div>
|
||||||
</div>
|
<div class="w-3/12 text-right py-4">{{ row.amount }}</div>
|
||||||
<div class="w-3/12 text-right py-4">{{ format(row, 'rate') }}</div>
|
|
||||||
<div class="w-3/12 text-right py-4">
|
|
||||||
{{ format(row, 'amount') }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="px-6 mt-2 flex justify-end text-base">
|
<div class="px-6 mt-2 flex justify-end text-base">
|
||||||
<div class="w-1/2 bg-pink">
|
<div class="w-1/2">
|
||||||
<div class="text-sm tracking-widest text-gray-600 mt-2">Notes</div>
|
<div
|
||||||
|
class="text-sm tracking-widest text-gray-600 mt-2"
|
||||||
|
v-if="printObject.terms"
|
||||||
|
>
|
||||||
|
Notes
|
||||||
|
</div>
|
||||||
<div class="my-4 text-lg whitespace-pre-line">
|
<div class="my-4 text-lg whitespace-pre-line">
|
||||||
{{ doc.terms }}
|
{{ printObject.terms }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-1/2">
|
<div class="w-1/2">
|
||||||
<div class="flex pl-2 justify-between py-3 border-b">
|
<div class="flex pl-2 justify-between py-3 border-b">
|
||||||
<div>{{ t`Subtotal` }}</div>
|
<div>{{ t`Subtotal` }}</div>
|
||||||
<div>{{ fyo.format(doc.netTotal, 'Currency') }}</div>
|
<div>{{ printObject.netTotal }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex pl-2 justify-between py-3 border-b"
|
class="flex pl-2 justify-between py-3 border-b"
|
||||||
v-if="totalDiscount?.float > 0 && !doc.discountAfterTax"
|
v-if="printObject.totalDiscount && !printObject.discountAfterTax"
|
||||||
>
|
>
|
||||||
<div>{{ t`Discount` }}</div>
|
<div>{{ t`Discount` }}</div>
|
||||||
<div>{{ `- ${fyo.format(totalDiscount, 'Currency')}` }}</div>
|
<div>{{ printObject.totalDiscount }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex pl-2 justify-between py-3"
|
class="flex pl-2 justify-between py-3"
|
||||||
v-for="tax in doc.taxes"
|
v-for="tax in printObject.taxes"
|
||||||
:key="tax.name"
|
:key="tax.name"
|
||||||
>
|
>
|
||||||
<div>{{ tax.account }}</div>
|
<div>{{ tax.account }}</div>
|
||||||
<div>{{ fyo.format(tax.amount, 'Currency') }}</div>
|
<div>{{ tax.amount }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex pl-2 justify-between py-3 border-t"
|
class="flex pl-2 justify-between py-3 border-t"
|
||||||
v-if="totalDiscount?.float > 0 && doc.discountAfterTax"
|
v-if="printObject.totalDiscount && printObject.discountAfterTax"
|
||||||
>
|
>
|
||||||
<div>{{ t`Discount` }}</div>
|
<div>{{ t`Discount` }}</div>
|
||||||
<div>{{ `- ${fyo.format(totalDiscount, 'Currency')}` }}</div>
|
<div>{{ printObject.totalDiscount }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="
|
class="
|
||||||
@ -139,7 +137,7 @@
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div>{{ t`Grand Total` }}</div>
|
<div>{{ t`Grand Total` }}</div>
|
||||||
<div>{{ fyo.format(doc.grandTotal, 'Currency') }}</div>
|
<div>{{ printObject.grandTotal }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -147,11 +145,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Base from './BaseTemplate.vue';
|
import BaseTemplate from './BaseTemplate.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Default',
|
name: 'Default',
|
||||||
extends: Base,
|
extends: BaseTemplate,
|
||||||
props: ['doc', 'printSettings'],
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,65 +1,58 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="bg-white border h-full"
|
class="bg-white border h-full"
|
||||||
:style="{ 'font-family': printSettings.font }"
|
:style="{ 'font-family': printObject.font }"
|
||||||
>
|
>
|
||||||
<div class="bg-gray-100 px-12 py-10">
|
<div class="bg-gray-100 px-12 py-10">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<div class="flex items-center rounded h-16">
|
<div class="flex items-center rounded h-16">
|
||||||
<div class="mr-4" v-if="printSettings.displayLogo">
|
<div class="mr-4" v-if="printObject.displayLogo">
|
||||||
<img
|
<img class="h-12 max-w-32 object-contain" :src="printObject.logo" />
|
||||||
class="h-12 max-w-32 object-contain"
|
|
||||||
:src="printSettings.logo"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="font-semibold text-xl"
|
class="font-semibold text-xl"
|
||||||
:style="{ color: printSettings.color }"
|
:style="{ color: printObject.color }"
|
||||||
>
|
>
|
||||||
{{ fyo.singles.AccountingSettings.companyName }}
|
{{ printObject.companyName }}
|
||||||
</div>
|
</div>
|
||||||
<div class="text-sm text-gray-800" v-if="companyAddress">
|
<div class="text-sm text-gray-800" v-if="printObject.address">
|
||||||
{{ companyAddress.addressDisplay }}
|
{{ printObject.address }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="text-sm text-gray-800" v-if="printObject.gstin">
|
||||||
class="text-sm text-gray-800"
|
GSTIN: {{ printObject.gstin }}
|
||||||
v-if="
|
|
||||||
fyo.singles.AccountingSettings &&
|
|
||||||
fyo.singles.AccountingSettings.gstin
|
|
||||||
"
|
|
||||||
>
|
|
||||||
GSTIN: {{ fyo.singles.AccountingSettings.gstin }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-8 text-lg">
|
<div class="mt-8 text-lg">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="w-1/3 font-semibold">
|
<div class="w-1/3 font-semibold">
|
||||||
{{ isSalesInvoice ? 'Invoice' : 'Bill' }}
|
{{ printObject.isSalesInvoice ? 'Invoice' : 'Bill' }}
|
||||||
</div>
|
</div>
|
||||||
<div class="w-2/3 text-gray-800">
|
<div class="w-2/3 text-gray-800">
|
||||||
<div class="font-semibold">
|
<div class="font-semibold">
|
||||||
{{ doc.name }}
|
{{ printObject.invoiceName }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{ fyo.format(doc.date, 'Date') }}
|
{{ printObject.date }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4 flex">
|
<div class="mt-4 flex">
|
||||||
<div class="w-1/3 font-semibold">
|
<div class="w-1/3 font-semibold">
|
||||||
{{ isSalesInvoice ? 'Customer' : 'Supplier' }}
|
{{ printObject.isSalesInvoice ? 'Customer' : 'Supplier' }}
|
||||||
</div>
|
</div>
|
||||||
<div class="w-2/3 text-gray-800" v-if="party">
|
<div class="w-2/3 text-gray-800" v-if="printObject.partyName">
|
||||||
<div class="font-semibold">
|
<div class="font-semibold">
|
||||||
{{ party.name }}
|
{{ printObject.partyName }}
|
||||||
</div>
|
</div>
|
||||||
<div v-if="partyAddress">
|
<div v-if="printObject.partyAddress">
|
||||||
{{ partyAddress }}
|
{{ printObject.partyAddress }}
|
||||||
|
</div>
|
||||||
|
<div v-if="printObject.partyGSTIN">
|
||||||
|
GSTIN: {{ printObject.partyGSTIN }}
|
||||||
</div>
|
</div>
|
||||||
<div v-if="party && party.gstin">GSTIN: {{ party.gstin }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -67,21 +60,23 @@
|
|||||||
<div class="px-12 py-12 text-lg">
|
<div class="px-12 py-12 text-lg">
|
||||||
<div class="mb-4 flex font-semibold">
|
<div class="mb-4 flex font-semibold">
|
||||||
<div class="w-4/12">Item</div>
|
<div class="w-4/12">Item</div>
|
||||||
<div class="w-2/12 text-right" v-if="showHSN">HSN/SAC</div>
|
<div class="w-2/12 text-right" v-if="printObject.showHSN">HSN/SAC</div>
|
||||||
<div class="w-2/12 text-right">Quantity</div>
|
<div class="w-2/12 text-right">Quantity</div>
|
||||||
<div class="w-3/12 text-right">Rate</div>
|
<div class="w-3/12 text-right">Rate</div>
|
||||||
<div class="w-3/12 text-right">Amount</div>
|
<div class="w-3/12 text-right">Amount</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex py-1 text-gray-800"
|
class="flex py-1 text-gray-800"
|
||||||
v-for="row in doc.items"
|
v-for="row in printObject.items"
|
||||||
:key="row.name"
|
:key="row.name"
|
||||||
>
|
>
|
||||||
<div class="w-4/12">{{ row.item }}</div>
|
<div class="w-4/12">{{ row.item }}</div>
|
||||||
<div class="w-2/12 text-right" v-if="showHSN">{{ row.hsnCode }}</div>
|
<div class="w-2/12 text-right" v-if="printObject.showHSN">
|
||||||
<div class="w-2/12 text-right">{{ format(row, 'quantity') }}</div>
|
{{ row.hsnCode }}
|
||||||
<div class="w-3/12 text-right">{{ format(row, 'rate') }}</div>
|
</div>
|
||||||
<div class="w-3/12 text-right">{{ format(row, 'amount') }}</div>
|
<div class="w-2/12 text-right">{{ row.quantity }}</div>
|
||||||
|
<div class="w-3/12 text-right">{{ row.rate }}</div>
|
||||||
|
<div class="w-3/12 text-right">{{ row.amount }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-12">
|
<div class="mt-12">
|
||||||
<div class="flex -mx-3">
|
<div class="flex -mx-3">
|
||||||
@ -89,67 +84,70 @@
|
|||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<div class="text-gray-800">{{ t`Subtotal` }}</div>
|
<div class="text-gray-800">{{ t`Subtotal` }}</div>
|
||||||
<div class="text-xl mt-2">
|
<div class="text-xl mt-2">
|
||||||
{{ fyo.format(doc.netTotal, 'Currency') }}
|
{{ printObject.netTotal }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="text-right"
|
class="text-right"
|
||||||
v-if="totalDiscount?.float > 0 && !doc.discountAfterTax"
|
v-if="printObject.totalDiscount && !printObject.discountAfterTax"
|
||||||
>
|
>
|
||||||
<div class="text-gray-800">{{ t`Discount` }}</div>
|
<div class="text-gray-800">{{ t`Discount` }}</div>
|
||||||
<div class="text-xl mt-2">
|
<div class="text-xl mt-2">
|
||||||
{{ `- ${fyo.format(totalDiscount, 'Currency')}` }}
|
{{ printObject.totalDiscount }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-right" v-for="tax in doc.taxes" :key="tax.name">
|
<div
|
||||||
|
class="text-right"
|
||||||
|
v-for="tax in printObject.taxes"
|
||||||
|
:key="tax.name"
|
||||||
|
>
|
||||||
<div class="text-gray-800">
|
<div class="text-gray-800">
|
||||||
{{ tax.account }}
|
{{ tax.account }}
|
||||||
</div>
|
</div>
|
||||||
<div class="text-xl mt-2">
|
<div class="text-xl mt-2">
|
||||||
{{ fyo.format(tax.amount, 'Currency') }}
|
{{ tax.amount }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="text-right"
|
class="text-right"
|
||||||
v-if="totalDiscount?.float > 0 && !doc.discountAfterTax"
|
v-if="printObject.totalDiscount && printObject.discountAfterTax"
|
||||||
>
|
>
|
||||||
<div class="text-gray-800">{{ t`Discount` }}</div>
|
<div class="text-gray-800">{{ t`Discount` }}</div>
|
||||||
<div class="text-xl mt-2">
|
<div class="text-xl mt-2">
|
||||||
{{ `- ${fyo.format(totalDiscount, 'Currency')}` }}
|
{{ printObject.totalDiscount }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="py-3 px-4 text-right text-white"
|
class="py-3 px-4 text-right text-white"
|
||||||
:style="{ backgroundColor: printSettings.color }"
|
:style="{ backgroundColor: printObject.color }"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div>{{ t`Grand Total` }}</div>
|
<div>{{ t`Grand Total` }}</div>
|
||||||
<div class="text-2xl mt-2 font-semibold">
|
<div class="text-2xl mt-2 font-semibold">
|
||||||
{{ fyo.format(doc.grandTotal, 'Currency') }}
|
{{ printObject.grandTotal }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-12" v-if="doc.terms">
|
<div class="mt-12" v-if="printObject.terms">
|
||||||
<div class="text-lg font-semibold">Notes</div>
|
<div class="text-lg font-semibold">Notes</div>
|
||||||
<div class="mt-4 text-lg whitespace-pre-line">
|
<div class="mt-4 text-lg whitespace-pre-line">
|
||||||
{{ doc.terms }}
|
{{ printObject.terms }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Base from './BaseTemplate.vue';
|
import BaseTemplate from './BaseTemplate.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Business',
|
name: 'Business',
|
||||||
extends: Base,
|
extends: BaseTemplate,
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,65 +1,60 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="bg-white border h-full"
|
class="bg-white border h-full"
|
||||||
:style="{ 'font-family': printSettings.font }"
|
:style="{ 'font-family': printObject.font }"
|
||||||
>
|
>
|
||||||
<div class="flex items-center justify-between px-12 py-10 border-b">
|
<div class="flex items-center justify-between px-12 py-10 border-b">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<div class="flex items-center rounded h-16">
|
<div class="flex items-center rounded h-16">
|
||||||
<div class="mr-4" v-if="printSettings.displayLogo">
|
<div class="mr-4" v-if="printObject.displayLogo">
|
||||||
<img
|
<img class="h-12 max-w-32 object-contain" :src="printObject.logo" />
|
||||||
class="h-12 max-w-32 object-contain"
|
|
||||||
:src="printSettings.logo"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="font-semibold text-xl"
|
class="font-semibold text-xl"
|
||||||
:style="{ color: printSettings.color }"
|
:style="{ color: printObject.color }"
|
||||||
>
|
>
|
||||||
{{ fyo.singles.AccountingSettings.companyName }}
|
{{ printObject.companyName }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{ fyo.format(doc.date, 'Date') }}
|
{{ printObject.date }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<div
|
<div
|
||||||
class="font-semibold text-xl"
|
class="font-semibold text-xl"
|
||||||
:style="{ color: printSettings.color }"
|
:style="{ color: printObject.color }"
|
||||||
>
|
>
|
||||||
{{
|
{{
|
||||||
doc.schemaName === 'SalesInvoice'
|
printObject.isSalesInvoice ? t`Sales Invoice` : t`Purchase Invoice`
|
||||||
? t`Sales Invoice`
|
|
||||||
: t`Purchase Invoice`
|
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{ doc.name }}
|
{{ printObject.invoiceName }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex px-12 py-10 border-b">
|
<div class="flex px-12 py-10 border-b">
|
||||||
<div class="w-1/2" v-if="party">
|
<div class="w-1/2" v-if="printObject.partyName">
|
||||||
<div
|
<div
|
||||||
class="uppercase text-sm font-semibold tracking-widest text-gray-800"
|
class="uppercase text-sm font-semibold tracking-widest text-gray-800"
|
||||||
>
|
>
|
||||||
{{ isSalesInvoice ? 'To' : 'From' }}
|
{{ printObject.isSalesInvoice ? 'To' : 'From' }}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4 text-black leading-relaxed text-lg">
|
<div class="mt-4 text-black leading-relaxed text-lg">
|
||||||
{{ party.name }} <br />
|
{{ printObject.partyName }} <br />
|
||||||
{{ partyAddress ? partyAddress : '' }}
|
{{ printObject.partyAddress ?? '' }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="mt-4 text-black leading-relaxed text-lg"
|
class="mt-4 text-black leading-relaxed text-lg"
|
||||||
v-if="party && party.gstin"
|
v-if="printObject.partyGSTIN"
|
||||||
>
|
>
|
||||||
GSTIN: {{ party.gstin }}
|
GSTIN: {{ printObject.partyGSTIN }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-1/2" v-if="companyAddress">
|
<div class="w-1/2" v-if="printObject.address">
|
||||||
<div
|
<div
|
||||||
class="
|
class="
|
||||||
uppercase
|
uppercase
|
||||||
@ -70,19 +65,16 @@
|
|||||||
ml-8
|
ml-8
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
{{ isSalesInvoice ? 'From' : 'To' }}
|
{{ printObject.isSalesInvoice ? 'From' : 'To' }}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4 ml-8 text-black leading-relaxed text-lg">
|
<div class="mt-4 ml-8 text-black leading-relaxed text-lg">
|
||||||
{{ companyAddress.addressDisplay }}
|
{{ printObject.address }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="mt-4 ml-8 text-black leading-relaxed text-lg"
|
class="mt-4 ml-8 text-black leading-relaxed text-lg"
|
||||||
v-if="
|
v-if="printObject.gstin"
|
||||||
fyo.singles.AccountingSettings &&
|
|
||||||
fyo.singles.AccountingSettings.gstin
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
GSTIN: {{ fyo.singles.AccountingSettings.gstin }}
|
GSTIN: {{ printObject.gstin }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -99,74 +91,79 @@
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div class="w-4/12">Item</div>
|
<div class="w-4/12">Item</div>
|
||||||
<div class="w-2/12 text-right" v-if="showHSN">HSN/SAC</div>
|
<div class="w-2/12 text-right" v-if="printObject.showHSN">HSN/SAC</div>
|
||||||
<div class="w-2/12 text-right">Quantity</div>
|
<div class="w-2/12 text-right">Quantity</div>
|
||||||
<div class="w-3/12 text-right">Rate</div>
|
<div class="w-3/12 text-right">Rate</div>
|
||||||
<div class="w-3/12 text-right">Amount</div>
|
<div class="w-3/12 text-right">Amount</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex py-1 text-lg" v-for="row in doc.items" :key="row.name">
|
<div
|
||||||
|
class="flex py-1 text-lg"
|
||||||
|
v-for="row in printObject.items"
|
||||||
|
:key="row.name"
|
||||||
|
>
|
||||||
<div class="w-4/12">{{ row.item }}</div>
|
<div class="w-4/12">{{ row.item }}</div>
|
||||||
<div class="w-2/12 text-right" v-if="showHSN">{{ row.hsnCode }}</div>
|
<div class="w-2/12 text-right" v-if="printObject.showHSN">
|
||||||
<div class="w-2/12 text-right">{{ format(row, 'quantity') }}</div>
|
{{ row.hsnCode }}
|
||||||
<div class="w-3/12 text-right">{{ format(row, 'rate') }}</div>
|
</div>
|
||||||
<div class="w-3/12 text-right">{{ format(row, 'amount') }}</div>
|
<div class="w-2/12 text-right">{{ row.quantity }}</div>
|
||||||
|
<div class="w-3/12 text-right">{{ row.rate }}</div>
|
||||||
|
<div class="w-3/12 text-right">{{ row.amount }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex px-12 py-10">
|
<div class="flex px-12 py-10">
|
||||||
<div class="w-1/2" v-if="doc.terms">
|
<div class="w-1/2" v-if="printObject.terms">
|
||||||
<div
|
<div
|
||||||
class="uppercase text-sm tracking-widest font-semibold text-gray-800"
|
class="uppercase text-sm tracking-widest font-semibold text-gray-800"
|
||||||
>
|
>
|
||||||
Notes
|
Notes
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4 text-lg whitespace-pre-line">
|
<div class="mt-4 text-lg whitespace-pre-line">
|
||||||
{{ doc.terms }}
|
{{ printObject.terms }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-1/2 text-lg">
|
<div class="w-1/2 text-lg">
|
||||||
<div class="flex pl-2 justify-between py-1">
|
<div class="flex pl-2 justify-between py-1">
|
||||||
<div>{{ t`Subtotal` }}</div>
|
<div>{{ t`Subtotal` }}</div>
|
||||||
<div>{{ fyo.format(doc.netTotal, 'Currency') }}</div>
|
<div>{{ printObject.netTotal }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex pl-2 justify-between py-1"
|
class="flex pl-2 justify-between py-1"
|
||||||
v-if="totalDiscount?.float > 0 && !doc.discountAfterTax"
|
v-if="printObject.totalDiscount && !printObject.discountAfterTax"
|
||||||
>
|
>
|
||||||
<div>{{ t`Discount` }}</div>
|
<div>{{ t`Discount` }}</div>
|
||||||
<div>{{ `- ${fyo.format(totalDiscount, 'Currency')}` }}</div>
|
<div>{{ printObject.totalDiscount }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex pl-2 justify-between py-1"
|
class="flex pl-2 justify-between py-1"
|
||||||
v-for="tax in doc.taxes"
|
v-for="tax in printObject.taxes"
|
||||||
:key="tax.name"
|
:key="tax.name"
|
||||||
>
|
>
|
||||||
<div>{{ tax.account }}</div>
|
<div>{{ tax.account }}</div>
|
||||||
<div>{{ fyo.format(tax.amount, 'Currency') }}</div>
|
<div>{{ tax.amount }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex pl-2 justify-between py-1"
|
class="flex pl-2 justify-between py-1"
|
||||||
v-if="totalDiscount?.float > 0 && doc.discountAfterTax"
|
v-if="printObject.totalDiscount && printObject.discountAfterTax"
|
||||||
>
|
>
|
||||||
<div>{{ t`Discount` }}</div>
|
<div>{{ t`Discount` }}</div>
|
||||||
<div>{{ `- ${fyo.format(totalDiscount, 'Currency')}` }}</div>
|
<div>{{ printObject.totalDiscount }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex pl-2 justify-between py-1 font-semibold"
|
class="flex pl-2 justify-between py-1 font-semibold"
|
||||||
:style="{ color: printSettings.color }"
|
:style="{ color: printObject.color }"
|
||||||
>
|
>
|
||||||
<div>{{ t`Grand Total` }}</div>
|
<div>{{ t`Grand Total` }}</div>
|
||||||
<div>{{ fyo.format(doc.grandTotal, 'Currency') }}</div>
|
<div>{{ printObject.grandTotal }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Base from './BaseTemplate.vue';
|
import BaseTemplate from './BaseTemplate.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Minimal',
|
name: 'Minimal',
|
||||||
extends: Base,
|
extends: BaseTemplate,
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -185,10 +185,14 @@
|
|||||||
<div>{{ tax.account }}</div>
|
<div>{{ tax.account }}</div>
|
||||||
<div>
|
<div>
|
||||||
{{
|
{{
|
||||||
fyo.format(tax.amount, {
|
fyo.format(
|
||||||
|
tax.amount,
|
||||||
|
{
|
||||||
fieldtype: 'Currency',
|
fieldtype: 'Currency',
|
||||||
currency: doc.currency,
|
fieldname: 'amount',
|
||||||
})
|
},
|
||||||
|
tax
|
||||||
|
)
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user