From cce3ac9f79f2761fc00197b3c436762a0885a63c Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sun, 2 Feb 2020 21:25:58 +0530 Subject: [PATCH] fix: Move E-Way bill button under create --- .../accounts/doctype/sales_invoice/regional/india.js | 4 ++-- .../doctype/sales_invoice/regional/india_list.js | 4 ++-- erpnext/regional/india/utils.py | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/regional/india.js b/erpnext/accounts/doctype/sales_invoice/regional/india.js index 48fa364faf..ba6c03b95f 100644 --- a/erpnext/accounts/doctype/sales_invoice/regional/india.js +++ b/erpnext/accounts/doctype/sales_invoice/regional/india.js @@ -25,7 +25,7 @@ frappe.ui.form.on("Sales Invoice", { if(frm.doc.docstatus == 1 && !frm.is_dirty() && !frm.doc.is_return && !frm.doc.ewaybill) { - frm.add_custom_button('e-Way Bill JSON', () => { + frm.add_custom_button('E-Way Bill JSON', () => { var w = window.open( frappe.urllib.get_full_url( "/api/method/erpnext.regional.india.utils.generate_ewb_json?" @@ -36,7 +36,7 @@ frappe.ui.form.on("Sales Invoice", { if (!w) { frappe.msgprint(__("Please enable pop-ups")); return; } - }, __("Make")); + }, __("Create")); } } diff --git a/erpnext/accounts/doctype/sales_invoice/regional/india_list.js b/erpnext/accounts/doctype/sales_invoice/regional/india_list.js index 66d74b4b06..d17582769c 100644 --- a/erpnext/accounts/doctype/sales_invoice/regional/india_list.js +++ b/erpnext/accounts/doctype/sales_invoice/regional/india_list.js @@ -12,7 +12,7 @@ frappe.listview_settings['Sales Invoice'].onload = function (doclist) { for (let doc of selected_docs) { if (doc.docstatus !== 1) { - frappe.throw(__("e-Way Bill JSON can only be generated from a submitted document")); + frappe.throw(__("E-Way Bill JSON can only be generated from a submitted document")); } } @@ -29,5 +29,5 @@ frappe.listview_settings['Sales Invoice'].onload = function (doclist) { }; - doclist.page.add_actions_menu_item(__('Generate e-Way Bill JSON'), action, false); + doclist.page.add_actions_menu_item(__('Generate E-Way Bill JSON'), action, false); }; \ No newline at end of file diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py index 3a187baf9b..266affb6d0 100644 --- a/erpnext/regional/india/utils.py +++ b/erpnext/regional/india/utils.py @@ -358,7 +358,7 @@ def calculate_hra_exemption_for_period(doc): def get_ewb_data(dt, dn): if dt != 'Sales Invoice': - frappe.throw(_('e-Way Bill JSON can only be generated from Sales Invoice')) + frappe.throw(_('E-Way Bill JSON can only be generated from Sales Invoice')) dn = dn.split(',') @@ -381,7 +381,7 @@ def get_ewb_data(dt, dn): elif doc.gst_category in ['Overseas', 'Deemed Export']: data.subSupplyType = 3 else: - frappe.throw(_('Unsupported GST Category for e-Way Bill JSON generation')) + frappe.throw(_('Unsupported GST Category for E-Way Bill JSON generation')) data.docType = 'INV' data.docDate = frappe.utils.formatdate(doc.posting_date, 'dd/mm/yyyy') @@ -537,10 +537,10 @@ def get_item_list(data, doc): def validate_sales_invoice(doc): if doc.docstatus != 1: - frappe.throw(_('e-Way Bill JSON can only be generated from submitted document')) + frappe.throw(_('E-Way Bill JSON can only be generated from submitted document')) if doc.is_return: - frappe.throw(_('e-Way Bill JSON cannot be generated for Sales Return as of now')) + frappe.throw(_('E-Way Bill JSON cannot be generated for Sales Return as of now')) if doc.ewaybill: frappe.throw(_('e-Way Bill already exists for this document')) @@ -550,7 +550,7 @@ def validate_sales_invoice(doc): for fieldname in reqd_fields: if not doc.get(fieldname): - frappe.throw(_('{} is required to generate e-Way Bill JSON').format( + frappe.throw(_('{} is required to generate E-Way Bill JSON').format( doc.meta.get_label(fieldname) ))