From f709f330ce655903b8e276158f2498ae4a8e4647 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Mon, 6 May 2019 19:50:17 +0530 Subject: [PATCH] feat: show generate txt button for payment entry --- .../doctype/payment_order/payment_order.js | 4 ++-- .../doctype/payment_order/payment_order.json | 17 ++++++++++++++++- .../doctype/payment_order/regional/india.js | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/payment_order/payment_order.js b/erpnext/accounts/doctype/payment_order/payment_order.js index 5b4f9fbd1a..f0071b83f2 100644 --- a/erpnext/accounts/doctype/payment_order/payment_order.js +++ b/erpnext/accounts/doctype/payment_order/payment_order.js @@ -13,7 +13,7 @@ frappe.ui.form.on('Payment Order', { } // payment Entry - if (frm.doc.docstatus==1) { + if (frm.doc.docstatus===1 && frm.doc.payment_order_type==='Payment Request') { frm.add_custom_button(__('Create Payment Entries'), function() { frm.trigger("make_payment_records"); @@ -99,4 +99,4 @@ frappe.ui.form.on('Payment Order', { dialog.show(); }, -}); +}); \ No newline at end of file diff --git a/erpnext/accounts/doctype/payment_order/payment_order.json b/erpnext/accounts/doctype/payment_order/payment_order.json index 85192db194..006974194a 100644 --- a/erpnext/accounts/doctype/payment_order/payment_order.json +++ b/erpnext/accounts/doctype/payment_order/payment_order.json @@ -7,10 +7,12 @@ "field_order": [ "naming_series", "company", + "payment_order_type", "party", "column_break_2", "posting_date", "bank", + "bank_account", "section_break_5", "references", "amended_from" @@ -50,6 +52,7 @@ "label": "Posting Date" }, { + "fetch_from": "Company.default_bank", "fieldname": "bank", "fieldtype": "Link", "in_list_view": 1, @@ -76,10 +79,22 @@ "options": "Payment Order", "print_hide": 1, "read_only": 1 + }, + { + "fieldname": "bank_account", + "fieldtype": "Link", + "label": "Bank Account", + "options": "Bank Account" + }, + { + "fieldname": "payment_order_type", + "fieldtype": "Select", + "label": "Payment Order Type", + "options": "\nPayment Request\nPayment Entry" } ], "is_submittable": 1, - "modified": "2019-05-05 22:26:22.170326", + "modified": "2019-05-06 16:40:11.397341", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Order", diff --git a/erpnext/accounts/doctype/payment_order/regional/india.js b/erpnext/accounts/doctype/payment_order/regional/india.js index 598223d2a7..28d2a2a677 100644 --- a/erpnext/accounts/doctype/payment_order/regional/india.js +++ b/erpnext/accounts/doctype/payment_order/regional/india.js @@ -1,6 +1,6 @@ frappe.ui.form.on('Payment Order', { refresh: function(frm) { - if (frm.doc.docstatus==1) { + if (frm.doc.docstatus==1 && frm.doc.payment_order_type==='Payment Request') { frm.add_custom_button(__('Generate Text File'), function() { frm.trigger("generate_text_and_download_file");