diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js index 961dbe1a1e..43e2dd5872 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.js +++ b/erpnext/crm/doctype/opportunity/opportunity.js @@ -90,12 +90,12 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { var frm = cur_frm; if(frm.perm[0].write && doc.docstatus==0) { if(frm.doc.status==="Open") { - frm.add_custom_button("Close", function() { + frm.add_custom_button(__("Close"), function() { frm.set_value("status", "Closed"); frm.save(); }); } else { - frm.add_custom_button("Reopen", function() { + frm.add_custom_button(__("Reopen"), function() { frm.set_value("status", "Open"); frm.save(); }); diff --git a/erpnext/projects/doctype/task/task.js b/erpnext/projects/doctype/task/task.js index 871d14d86a..18f5ca06c8 100644 --- a/erpnext/projects/doctype/task/task.js +++ b/erpnext/projects/doctype/task/task.js @@ -31,12 +31,12 @@ frappe.ui.form.on("Task", { if(frm.perm[0].write) { if(frm.doc.status!=="Closed" && frm.doc.status!=="Cancelled") { - frm.add_custom_button("Close", function() { + frm.add_custom_button(__("Close"), function() { frm.set_value("status", "Closed"); frm.save(); }); } else { - frm.add_custom_button("Reopen", function() { + frm.add_custom_button(__("Reopen"), function() { frm.set_value("status", "Open"); frm.save(); }); diff --git a/erpnext/selling/page/sales_funnel/sales_funnel.js b/erpnext/selling/page/sales_funnel/sales_funnel.js index b3a97967de..a516342c1b 100644 --- a/erpnext/selling/page/sales_funnel/sales_funnel.js +++ b/erpnext/selling/page/sales_funnel/sales_funnel.js @@ -180,6 +180,6 @@ erpnext.SalesFunnel = Class.extend({ context.fillStyle = "black"; context.textBaseline = "middle"; context.font = "1.1em sans-serif"; - context.fillText(title, width + 20, y_mid); + context.fillText(__(title), width + 20, y_mid); } }); diff --git a/erpnext/selling/page/sales_funnel/sales_funnel.py b/erpnext/selling/page/sales_funnel/sales_funnel.py index 78db8735cd..eb3b996c6c 100644 --- a/erpnext/selling/page/sales_funnel/sales_funnel.py +++ b/erpnext/selling/page/sales_funnel/sales_funnel.py @@ -4,6 +4,8 @@ from __future__ import unicode_literals import frappe +from frappe import _ + @frappe.whitelist() def get_funnel_data(from_date, to_date): active_leads = frappe.db.sql("""select count(*) from `tabLead` @@ -26,8 +28,8 @@ def get_funnel_data(from_date, to_date): where docstatus = 1 and (date(`creation`) between %s and %s)""", (from_date, to_date))[0][0] return [ - { "title": "Active Leads / Customers", "value": active_leads, "color": "#B03B46" }, - { "title": "Opportunities", "value": opportunities, "color": "#F09C00" }, - { "title": "Quotations", "value": quotations, "color": "#006685" }, - { "title": "Sales Orders", "value": sales_orders, "color": "#00AD65" } + { "title": _("Active Leads / Customers"), "value": active_leads, "color": "#B03B46" }, + { "title": _("Opportunities"), "value": opportunities, "color": "#F09C00" }, + { "title": _("Quotations"), "value": quotations, "color": "#006685" }, + { "title": _("Sales Orders"), "value": sales_orders, "color": "#00AD65" } ] diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index 4bef0d86a3..de6a85d849 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -46,13 +46,13 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend( if (cint(frappe.defaults.get_default("auto_accounting_for_stock"))) { this.show_general_ledger(); } - if (this.frm.has_perm("submit") && (doc.status !== "Closed") + if (this.frm.has_perm("submit") && (doc.status !== "Closed") && this.frm.doc.__onload && this.frm.doc.__onload.has_return_entry) { cur_frm.add_custom_button(__("Close"), this.close_delivery_note) } } - if(doc.__onload && !doc.__onload.billing_complete && doc.docstatus==1 + if(doc.__onload && !doc.__onload.billing_complete && doc.docstatus==1 && !doc.is_return && doc.status!="Closed") { // show Make Invoice button only if Delivery Note is not created from Sales Invoice var from_sales_invoice = false; @@ -65,7 +65,7 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend( } if(doc.docstatus==1 && doc.status === "Closed" && this.frm.has_perm("submit")) { - cur_frm.add_custom_button(__('Re-open'), this.reopen_delivery_note) + cur_frm.add_custom_button(__('Reopen'), this.reopen_delivery_note) } erpnext.stock.delivery_note.set_print_hide(doc, dt, dn); diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index 93f1b0873a..9a24eed30f 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -60,7 +60,7 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend cur_frm.add_custom_button(__('Invoice'), this.make_purchase_invoice).addClass("btn-primary"); } - if (this.frm.has_perm("submit") && + if (this.frm.has_perm("submit") && this.frm.doc.__onload && this.frm.doc.__onload.has_return_entry) { cur_frm.add_custom_button(__("Close"), this.close_purchase_receipt) } @@ -69,7 +69,7 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend if(this.frm.doc.docstatus==1 && this.frm.doc.status === "Closed" && this.frm.has_perm("submit")) { - cur_frm.add_custom_button(__('Re-open'), this.reopen_purchase_receipt) + cur_frm.add_custom_button(__('Reopen'), this.reopen_purchase_receipt) } this.frm.toggle_reqd("supplier_warehouse", this.frm.doc.is_subcontracted==="Yes"); diff --git a/erpnext/support/doctype/issue/issue.js b/erpnext/support/doctype/issue/issue.js index 28617cb694..21ef5b8f3b 100644 --- a/erpnext/support/doctype/issue/issue.js +++ b/erpnext/support/doctype/issue/issue.js @@ -5,12 +5,12 @@ frappe.ui.form.on("Issue", { "refresh": function(frm) { if(frm.doc.status==="Open") { - frm.add_custom_button("Close", function() { + frm.add_custom_button(__("Close"), function() { frm.set_value("status", "Closed"); frm.save(); }); } else { - frm.add_custom_button("Reopen", function() { + frm.add_custom_button(__("Reopen"), function() { frm.set_value("status", "Open"); frm.save(); });