2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +00:00

fix(InvoiceForm): Move customer field to left

- and Date to right
- Remove party address information
This commit is contained in:
Faris Ansari 2019-12-11 14:40:27 +05:30
parent f701bba627
commit 159134a850

View File

@ -80,23 +80,24 @@
</div> </div>
</div> </div>
<div class="mt-8 px-6"> <div class="mt-8 px-6">
<div class="flex justify-between"> <h1 class="text-2xl font-semibold">
{{ doc._notInserted ? _('New Invoice') : doc.name }}
</h1>
<div class="flex justify-between mt-2">
<div class="w-1/3"> <div class="w-1/3">
<h1 class="text-2xl font-semibold">
{{ doc._notInserted ? _('New Invoice') : doc.name }}
</h1>
<FormControl <FormControl
class="mt-2" class="text-base"
input-class="bg-gray-100 rounded-lg px-3 py-2 text-base" input-class="bg-gray-100 p-2 text-lg font-semibold"
:df="meta.getField('date')" :df="meta.getField(partyField.fieldname)"
:value="doc.date" :value="doc[partyField.fieldname]"
:placeholder="'Date'" :placeholder="partyField.label"
@change="value => doc.set('date', value)" @change="value => doc.set(partyField.fieldname, value)"
@new-doc="party => doc.set(partyField.fieldname, party.name)"
:read-only="doc.submitted" :read-only="doc.submitted"
/> />
<FormControl <FormControl
class="mt-2 text-base" class="mt-2 text-base"
input-class="bg-gray-100 rounded-lg px-3 py-2 text-base" input-class="bg-gray-100 px-3 py-2 text-base"
:df="meta.getField('account')" :df="meta.getField('account')"
:value="doc.account" :value="doc.account"
:placeholder="'Account'" :placeholder="'Account'"
@ -106,27 +107,13 @@
</div> </div>
<div class="w-1/3"> <div class="w-1/3">
<FormControl <FormControl
class="text-base" input-class="bg-gray-100 px-3 py-2 text-base text-right"
input-class="bg-gray-100 rounded-lg p-2 text-right text-lg font-semibold" :df="meta.getField('date')"
:df="meta.getField(partyField.fieldname)" :value="doc.date"
:value="doc[partyField.fieldname]" :placeholder="'Date'"
:placeholder="partyField.label" @change="value => doc.set('date', value)"
@change="value => doc.set(partyField.fieldname, value)"
@new-doc="party => doc.set(partyField.fieldname, party.name)"
:read-only="doc.submitted" :read-only="doc.submitted"
/> />
<div
v-if="partyDoc"
class="mt-1 text-xs text-gray-600 text-right"
>
{{ partyDoc.addressDisplay }}
</div>
<div
v-if="partyDoc && partyDoc.gstin"
class="mt-1 text-xs text-gray-600 text-right"
>
GSTIN: {{ partyDoc.gstin }}
</div>
</div> </div>
</div> </div>
</div> </div>
@ -204,7 +191,6 @@ export default {
data() { data() {
return { return {
doc: null, doc: null,
partyDoc: null,
printSettings: null, printSettings: null,
companyName: null companyName: null
}; };
@ -276,12 +262,6 @@ export default {
} }
throw error; throw error;
} }
this.doc.on('change', ({ changed }) => {
if (changed === this.partyField.fieldname) {
this.fetchPartyDoc();
}
});
this.fetchPartyDoc();
this.printSettings = await frappe.getSingle('PrintSettings'); this.printSettings = await frappe.getSingle('PrintSettings');
this.companyName = ( this.companyName = (
await frappe.getSingle('AccountingSettings') await frappe.getSingle('AccountingSettings')
@ -309,14 +289,6 @@ export default {
handleError(e) { handleError(e) {
handleErrorWithDialog(e, this.doc); handleErrorWithDialog(e, this.doc);
}, },
async fetchPartyDoc() {
if (this.doc[this.partyField.fieldname]) {
this.partyDoc = await frappe.getDoc(
'Party',
this.doc[this.partyField.fieldname]
);
}
},
openInvoiceSettings() { openInvoiceSettings() {
openSettings('Invoice'); openSettings('Invoice');
}, },