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:
parent
819e6821e1
commit
7886e1c9dc
@ -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 = {
|
||||
|
@ -125,6 +125,12 @@
|
||||
"label": "Notes",
|
||||
"placeholder": "Add invoice terms",
|
||||
"fieldtype": "Text"
|
||||
},
|
||||
{
|
||||
"fieldname": "attachment",
|
||||
"placeholder": "Add attachment",
|
||||
"label": "Attachment",
|
||||
"fieldtype": "Attachment"
|
||||
}
|
||||
],
|
||||
"keywordFields": ["name", "party"]
|
||||
|
@ -101,6 +101,12 @@
|
||||
"create": true,
|
||||
"required": true,
|
||||
"default": "JV-"
|
||||
},
|
||||
{
|
||||
"fieldname": "attachment",
|
||||
"placeholder": "Add attachment",
|
||||
"label": "Attachment",
|
||||
"fieldtype": "Attachment"
|
||||
}
|
||||
],
|
||||
"keywordFields": ["name", "entryType"]
|
||||
|
@ -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"]
|
||||
|
@ -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 />
|
||||
|
||||
|
@ -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 />
|
||||
|
||||
|
@ -76,6 +76,7 @@
|
||||
|
||||
<!-- Rest of the form -->
|
||||
<TwoColumnForm
|
||||
class="w-full"
|
||||
ref="form"
|
||||
v-if="doc"
|
||||
:doc="doc"
|
||||
|
Loading…
Reference in New Issue
Block a user