From e2529ad11655ba06edfdb2fb4d8d80510ffdec3e Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 6 May 2020 23:32:35 +0530 Subject: [PATCH] fix: allow parital payments to invoices --- models/doctype/Payment/Payment.js | 5 ++--- src/sidebarConfig.js | 10 ++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/models/doctype/Payment/Payment.js b/models/doctype/Payment/Payment.js index 92405cfc..034344a6 100644 --- a/models/doctype/Payment/Payment.js +++ b/models/doctype/Payment/Payment.js @@ -20,7 +20,7 @@ module.exports = { fieldname: 'date', label: 'Posting Date', fieldtype: 'Date', - defaultValue: new Date().toISOString() + default: new Date().toISOString() }, { fieldname: 'account', @@ -102,8 +102,7 @@ module.exports = { label: 'Amount', fieldtype: 'Currency', required: 1, - readOnly: 1, - formula: doc => doc.getSum('for', 'amount') + default: doc => doc.getSum('for', 'amount') }, { fieldname: 'writeoff', diff --git a/src/sidebarConfig.js b/src/sidebarConfig.js index 3c9a3448..7dd6bec3 100644 --- a/src/sidebarConfig.js +++ b/src/sidebarConfig.js @@ -42,6 +42,11 @@ const config = { route: '/list/Item', doctype: 'Item' }, + { + label: _('Payments'), + route: '/list/Payment', + doctype: 'Payment' + }, { label: _('Journal Entry'), route: '/list/JournalEntry', @@ -71,6 +76,11 @@ const config = { route: '/list/Item', doctype: 'Item' }, + { + label: _('Payments'), + route: '/list/Payment', + doctype: 'Payment' + }, { label: _('Journal Entry'), route: '/list/JournalEntry',