diff --git a/models/baseModels/Payment/Payment.ts b/models/baseModels/Payment/Payment.ts index 21121331..05244169 100644 --- a/models/baseModels/Payment/Payment.ts +++ b/models/baseModels/Payment/Payment.ts @@ -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 = { diff --git a/schemas/app/Invoice.json b/schemas/app/Invoice.json index 6e281fbb..a82f9e0f 100644 --- a/schemas/app/Invoice.json +++ b/schemas/app/Invoice.json @@ -125,6 +125,12 @@ "label": "Notes", "placeholder": "Add invoice terms", "fieldtype": "Text" + }, + { + "fieldname": "attachment", + "placeholder": "Add attachment", + "label": "Attachment", + "fieldtype": "Attachment" } ], "keywordFields": ["name", "party"] diff --git a/schemas/app/JournalEntry.json b/schemas/app/JournalEntry.json index ea65318b..cf0210a8 100644 --- a/schemas/app/JournalEntry.json +++ b/schemas/app/JournalEntry.json @@ -101,6 +101,12 @@ "create": true, "required": true, "default": "JV-" + }, + { + "fieldname": "attachment", + "placeholder": "Add attachment", + "label": "Attachment", + "fieldtype": "Attachment" } ], "keywordFields": ["name", "entryType"] diff --git a/schemas/app/Payment.json b/schemas/app/Payment.json index f2deae3a..c9e44c3e 100644 --- a/schemas/app/Payment.json +++ b/schemas/app/Payment.json @@ -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"] diff --git a/src/pages/InvoiceForm.vue b/src/pages/InvoiceForm.vue index 1c9e13e5..f2c792ca 100644 --- a/src/pages/InvoiceForm.vue +++ b/src/pages/InvoiceForm.vue @@ -104,6 +104,14 @@ @change="(value) => doc.set('account', value)" :read-only="doc?.submitted" /> +
diff --git a/src/pages/JournalEntryForm.vue b/src/pages/JournalEntryForm.vue index 796250ef..23eb6739 100644 --- a/src/pages/JournalEntryForm.vue +++ b/src/pages/JournalEntryForm.vue @@ -85,6 +85,14 @@ @change="(value) => doc.set('referenceDate', value)" :read-only="doc.submitted" /> +
diff --git a/src/pages/QuickEditForm.vue b/src/pages/QuickEditForm.vue index 2f69d828..bcb49ac5 100644 --- a/src/pages/QuickEditForm.vue +++ b/src/pages/QuickEditForm.vue @@ -76,6 +76,7 @@