2
0
mirror of https://github.com/frappe/books.git synced 2025-02-03 04:28:32 +00:00

fix: party address doesn't show in print

This commit is contained in:
18alantom 2022-06-06 13:33:07 +05:30
parent 8981dc3230
commit 82336e18bc
5 changed files with 31 additions and 23 deletions

View File

@ -3,7 +3,7 @@ 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 }), data: () => ({ party: null, companyAddress: null, partyAddress: null }),
methods: { methods: {
format(row, fieldname) { format(row, fieldname) {
const value = row.get(fieldname); const value = row.get(fieldname);
@ -11,10 +11,12 @@ export default {
}, },
}, },
async mounted() { async mounted() {
await this.doc.loadLink('party');
this.party = this.doc.getLink('party');
await this.printSettings.loadLink('address'); await this.printSettings.loadLink('address');
this.companyAddress = this.printSettings.getLink('address'); this.companyAddress = this.printSettings.getLink('address');
await this.doc.loadLink('party');
this.party = this.doc.getLink('party');
this.partyAddress = this.party.getLink('address')?.addressDisplay ?? null;
}, },
computed: { computed: {
isSalesInvoice() { isSalesInvoice() {

View File

@ -49,10 +49,10 @@
{{ party.name }} {{ party.name }}
</div> </div>
<div <div
v-if="party && party.addressDisplay" v-if="partyAddress"
class="mt-1 text-xs text-gray-600 text-right" class="mt-1 text-xs text-gray-600 text-right"
> >
{{ party.addressDisplay }} {{ partyAddress }}
</div> </div>
<div <div
v-if="party && party.gstin" v-if="party && party.gstin"

View File

@ -25,7 +25,10 @@
</div> </div>
<div <div
class="text-sm text-gray-800" class="text-sm text-gray-800"
v-if="fyo.singles.AccountingSettings && fyo.singles.AccountingSettings.gstin" v-if="
fyo.singles.AccountingSettings &&
fyo.singles.AccountingSettings.gstin
"
> >
GSTIN: {{ fyo.singles.AccountingSettings.gstin }} GSTIN: {{ fyo.singles.AccountingSettings.gstin }}
</div> </div>
@ -53,8 +56,8 @@
<div class="font-semibold"> <div class="font-semibold">
{{ party.name }} {{ party.name }}
</div> </div>
<div> <div v-if="partyAddress">
{{ party.addressDisplay }} {{ partyAddress }}
</div> </div>
<div v-if="party && party.gstin">GSTIN: {{ party.gstin }}</div> <div v-if="party && party.gstin">GSTIN: {{ party.gstin }}</div>
</div> </div>
@ -62,7 +65,7 @@
</div> </div>
</div> </div>
<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">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>
@ -113,14 +116,10 @@
</div> </div>
</div> </div>
<div class="mt-12" v-if="doc.terms"> <div class="mt-12" v-if="doc.terms">
<div <div class="text-lg font-semibold">Notes</div>
class="text-lg font-semibold" <div class="mt-4 text-lg whitespace-pre-line">
> {{ doc.terms }}
Notes </div>
</div>
<div class="mt-4 text-lg whitespace-pre-line">
{{ doc.terms }}
</div>
</div> </div>
</div> </div>
</div> </div>
@ -132,6 +131,6 @@ import Base from './BaseTemplate.vue';
export default { export default {
name: 'Business', name: 'Business',
extends: Base extends: Base,
}; };
</script> </script>

View File

@ -30,7 +30,11 @@
class="font-semibold text-xl" class="font-semibold text-xl"
:style="{ color: printSettings.color }" :style="{ color: printSettings.color }"
> >
{{ doc.schemaName === 'SalesInvoice' ? t`Sales Invoice` : t`Purchase Invoice` }} {{
doc.schemaName === 'SalesInvoice'
? t`Sales Invoice`
: t`Purchase Invoice`
}}
</div> </div>
<div> <div>
{{ doc.name }} {{ doc.name }}
@ -46,7 +50,7 @@
</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 /> {{ party.name }} <br />
{{ party.addressDisplay }} {{ partyAddress ? partyAddress : '' }}
</div> </div>
<div <div
class="mt-4 text-black leading-relaxed text-lg" class="mt-4 text-black leading-relaxed text-lg"
@ -73,7 +77,10 @@
</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="fyo.singles.AccountingSettings && fyo.singles.AccountingSettings.gstin" v-if="
fyo.singles.AccountingSettings &&
fyo.singles.AccountingSettings.gstin
"
> >
GSTIN: {{ fyo.singles.AccountingSettings.gstin }} GSTIN: {{ fyo.singles.AccountingSettings.gstin }}
</div> </div>

View File

@ -99,7 +99,7 @@
text-sm text-gray-600 text-sm text-gray-600
flex flex
justify-between justify-between
overflow-x-scroll overflow-x-auto
" "
> >
<p class="whitespace-nowrap mr-2"> <p class="whitespace-nowrap mr-2">