2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 14:50:56 +00:00

feat: add attachment field to Invs., Pays. and JEs

This commit is contained in:
18alantom 2022-10-13 17:28:53 +05:30
parent 819e6821e1
commit 7886e1c9dc
7 changed files with 39 additions and 0 deletions

View File

@ -543,6 +543,9 @@ export class Payment extends Transactional {
referenceId: () => this.paymentMethod === 'Cash',
clearanceDate: () => this.paymentMethod === 'Cash',
amountPaid: () => this.writeoff?.isZero() ?? true,
attachment: () =>
!(this.attachment || !(this.isSubmitted || this.isCancelled)),
for: () => !((this.isSubmitted || this.isCancelled) && this.for?.length),
};
static filters: FiltersMap = {

View File

@ -125,6 +125,12 @@
"label": "Notes",
"placeholder": "Add invoice terms",
"fieldtype": "Text"
},
{
"fieldname": "attachment",
"placeholder": "Add attachment",
"label": "Attachment",
"fieldtype": "Attachment"
}
],
"keywordFields": ["name", "party"]

View File

@ -101,6 +101,12 @@
"create": true,
"required": true,
"default": "JV-"
},
{
"fieldname": "attachment",
"placeholder": "Add attachment",
"label": "Attachment",
"fieldtype": "Attachment"
}
],
"keywordFields": ["name", "entryType"]

View File

@ -133,6 +133,12 @@
"fieldtype": "Table",
"target": "PaymentFor",
"required": false
},
{
"fieldname": "attachment",
"placeholder": "Add attachment",
"label": "Attachment",
"fieldtype": "Attachment"
}
],
"quickEditFields": [
@ -149,6 +155,7 @@
"amount",
"writeoff",
"amountPaid",
"attachment",
"for"
],
"keywordFields": ["name", "party", "paymentType"]

View File

@ -104,6 +104,14 @@
@change="(value) => doc.set('account', value)"
:read-only="doc?.submitted"
/>
<FormControl
v-if="doc.attachment || !(doc.isSubmitted || doc.isCancelled)"
:border="true"
:df="getField('attachment')"
:value="doc.attachment"
@change="(value) => doc.set('attachment', value)"
:read-only="doc?.submitted"
/>
</div>
<hr />

View File

@ -85,6 +85,14 @@
@change="(value) => doc.set('referenceDate', value)"
:read-only="doc.submitted"
/>
<FormControl
v-if="doc.attachment || !(doc.isSubmitted || doc.isCancelled)"
:border="true"
:df="getField('attachment')"
:value="doc.attachment"
@change="(value) => doc.set('attachment', value)"
:read-only="doc?.submitted"
/>
</div>
<hr />

View File

@ -76,6 +76,7 @@
<!-- Rest of the form -->
<TwoColumnForm
class="w-full"
ref="form"
v-if="doc"
:doc="doc"