From c2a49211a5bdeb1d5ae4418fa8e0f793119c7d88 Mon Sep 17 00:00:00 2001 From: shreyas Date: Thu, 5 May 2016 15:56:48 +0530 Subject: [PATCH] [Fix] Payment Tool, Fetch due date when user does 'Get Outstanding Vouchers' --- erpnext/accounts/doctype/payment_tool/payment_tool.js | 4 ++++ .../doctype/payment_tool_detail/payment_tool_detail.json | 6 +++--- erpnext/accounts/utils.py | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/payment_tool/payment_tool.js b/erpnext/accounts/doctype/payment_tool/payment_tool.js index c77fa7931a..8d8e0ced0a 100644 --- a/erpnext/accounts/doctype/payment_tool/payment_tool.js +++ b/erpnext/accounts/doctype/payment_tool/payment_tool.js @@ -146,6 +146,10 @@ frappe.ui.form.on("Payment Tool", "get_outstanding_vouchers", function(frm) { c.total_amount = d.invoice_amount; c.outstanding_amount = d.outstanding_amount; + if (in_list(['Sales Invoice', 'Purchase Invoice'], d.voucher_type)){ + c.due_date = d.due_date + } + if (frm.doc.set_payment_amount) { c.payment_amount = d.outstanding_amount; } diff --git a/erpnext/accounts/doctype/payment_tool_detail/payment_tool_detail.json b/erpnext/accounts/doctype/payment_tool_detail/payment_tool_detail.json index ff34a4ac71..66447b00d1 100644 --- a/erpnext/accounts/doctype/payment_tool_detail/payment_tool_detail.json +++ b/erpnext/accounts/doctype/payment_tool_detail/payment_tool_detail.json @@ -18,7 +18,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_list_view": 1, + "in_list_view": 0, "label": "Against Voucher Type", "length": 0, "no_copy": 0, @@ -70,7 +70,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_list_view": 0, + "in_list_view": 1, "label": "Due Date", "length": 0, "no_copy": 0, @@ -194,7 +194,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-05-05 05:37:41.206708", + "modified": "2016-05-05 06:22:24.736160", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Tool Detail", diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 06197eb61f..48668fa679 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -473,7 +473,8 @@ def get_outstanding_invoices(party_type, party, account, condition=None): 'posting_date': d.posting_date, 'invoice_amount': flt(d.invoice_amount), 'payment_amount': flt(d.payment_amount), - 'outstanding_amount': flt(d.invoice_amount - d.payment_amount, precision) + 'outstanding_amount': flt(d.invoice_amount - d.payment_amount, precision), + 'due_date': frappe.db.get_value(d.voucher_type, d.voucher_no, "due_date") }) return outstanding_invoices