feat: show generate txt button for payment entry
diff --git a/erpnext/accounts/doctype/payment_order/payment_order.js b/erpnext/accounts/doctype/payment_order/payment_order.js
index 5b4f9fb..f0071b8 100644
--- a/erpnext/accounts/doctype/payment_order/payment_order.js
+++ b/erpnext/accounts/doctype/payment_order/payment_order.js
@@ -13,7 +13,7 @@
}
// 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 @@
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 85192db..0069741 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 598223d..28d2a2a 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");