[Fix] Payment Tool, Fetch due date when user does 'Get Outstanding Vouchers'
diff --git a/erpnext/accounts/doctype/payment_tool/payment_tool.js b/erpnext/accounts/doctype/payment_tool/payment_tool.js
index c77fa79..8d8e0ce 100644
--- a/erpnext/accounts/doctype/payment_tool/payment_tool.js
+++ b/erpnext/accounts/doctype/payment_tool/payment_tool.js
@@ -146,6 +146,10 @@
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 ff34a4a..66447b0 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 06197eb..48668fa 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -473,7 +473,8 @@
'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