mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 12:49:10 +00:00
js translations refactor
This commit is contained in:
@@ -274,7 +274,7 @@ erpnext.POS = Class.extend({
|
|||||||
if(!me.frm.doc[me.party.toLowerCase()] && ((me.frm.doctype == "Quotation" &&
|
if(!me.frm.doc[me.party.toLowerCase()] && ((me.frm.doctype == "Quotation" &&
|
||||||
me.frm.doc.quotation_to == "Customer")
|
me.frm.doc.quotation_to == "Customer")
|
||||||
|| me.frm.doctype != "Quotation")) {
|
|| me.frm.doctype != "Quotation")) {
|
||||||
msgprint("Please select " + me.party + " first.");
|
msgprint("Please select {0} first.", [me.party]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -605,4 +605,4 @@ erpnext.POS = Class.extend({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -61,11 +61,11 @@ erpnext.hr.EmployeeController = frappe.ui.form.Controller.extend({
|
|||||||
var me = this;
|
var me = this;
|
||||||
this.validate_salary_structure(btn, function(r) {
|
this.validate_salary_structure(btn, function(r) {
|
||||||
if(r.message) {
|
if(r.message) {
|
||||||
msgprint(__("Employee") + ' "' + me.frm.doc.name + '": '
|
msgprint(__("Employee {0}:\
|
||||||
+ __("An active Salary Structure already exists. \
|
An active Salary Structure already exists. \
|
||||||
If you want to create new one, please ensure that no active \
|
If you want to create new one, please ensure that no active \
|
||||||
Salary Structure exists for this Employee. \
|
Salary Structure exists for this Employee. \
|
||||||
Go to the active Salary Structure and set \"Is Active\" = \"No\""));
|
Go to the active Salary Structure and set \"Is Active\" = \"No\"", [me.frm.doc.name]));
|
||||||
} else if(!r.exc) {
|
} else if(!r.exc) {
|
||||||
frappe.model.map({
|
frappe.model.map({
|
||||||
source: me.frm.doc,
|
source: me.frm.doc,
|
||||||
|
|||||||
@@ -90,8 +90,7 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
|
|||||||
|
|
||||||
validate_company_and_party: function(party_field) {
|
validate_company_and_party: function(party_field) {
|
||||||
if(!this.frm.doc.quotation_to) {
|
if(!this.frm.doc.quotation_to) {
|
||||||
msgprint(__("Please select a value for" + " " +
|
msgprint(__("Please select a value for {0} quotation_to {1}", [this.frm.doc.doctype, this.frm.doc.name]));
|
||||||
frappe.meta.get_label(this.frm.doc.doctype, "quotation_to", this.frm.doc.name)));
|
|
||||||
return false;
|
return false;
|
||||||
} else if (this.frm.doc.quotation_to == "Lead") {
|
} else if (this.frm.doc.quotation_to == "Lead") {
|
||||||
return true;
|
return true;
|
||||||
@@ -166,4 +165,4 @@ cur_frm.cscript['Declare Order Lost'] = function(){
|
|||||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||||
if(cint(frappe.boot.notification_settings.quotation))
|
if(cint(frappe.boot.notification_settings.quotation))
|
||||||
cur_frm.email_doc(frappe.boot.notification_settings.quotation_message);
|
cur_frm.email_doc(frappe.boot.notification_settings.quotation_message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,7 +181,6 @@ cur_frm.cscript.image = function() {
|
|||||||
if(!cur_frm.doc.description_html)
|
if(!cur_frm.doc.description_html)
|
||||||
cur_frm.cscript.add_image(cur_frm.doc);
|
cur_frm.cscript.add_image(cur_frm.doc);
|
||||||
else {
|
else {
|
||||||
msgprint(__("You may need to update: ") +
|
msgprint(__("You may need to update: {0}", [frappe.meta.get_docfield(cur_frm.doc.doctype, "description_html").label]));
|
||||||
frappe.meta.get_docfield(cur_frm.doc.doctype, "description_html").label);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,8 +78,7 @@ cur_frm.cscript.validate_duplicate_items = function(doc, ps_detail) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(flt(ps_detail[i].qty)<=0) {
|
if(flt(ps_detail[i].qty)<=0) {
|
||||||
msgprint(__("Invalid quantity specified for item ") + ps_detail[i].item_code +
|
msgprint(__("Invalid quantity specified for item {0}. Quantity should be greater than 0.", [ps_detail[i].item_code]));
|
||||||
"."+__(" Quantity should be greater than 0."));
|
|
||||||
validated = false;
|
validated = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -95,9 +94,7 @@ cur_frm.cscript.calc_net_total_pkg = function(doc, ps_detail) {
|
|||||||
for(var i=0; i<ps_detail.length; i++) {
|
for(var i=0; i<ps_detail.length; i++) {
|
||||||
var item = ps_detail[i];
|
var item = ps_detail[i];
|
||||||
if(item.weight_uom != doc.net_weight_uom) {
|
if(item.weight_uom != doc.net_weight_uom) {
|
||||||
msgprint(__("Different UOM for items will lead to incorrect")+
|
msgprint(__("Different UOM for items will lead to incorrect (Total) Net Weight value. Make sure that Net Weight of each item is in the same UOM."));
|
||||||
__("(Total) Net Weight value. Make sure that Net Weight of each item is")+
|
|
||||||
__("in the same UOM."))
|
|
||||||
validated = false;
|
validated = false;
|
||||||
}
|
}
|
||||||
net_weight_pkg += flt(item.net_weight) * flt(item.qty);
|
net_weight_pkg += flt(item.net_weight) * flt(item.qty);
|
||||||
@@ -123,4 +120,4 @@ cur_frm.pformat.net_weight_pkg= function(doc){
|
|||||||
|
|
||||||
cur_frm.pformat.gross_weight_pkg= function(doc){
|
cur_frm.pformat.gross_weight_pkg= function(doc){
|
||||||
return '<table style="width:100%">' + make_row('Gross Weight', doc.gross_weight_pkg) + '</table>'
|
return '<table style="width:100%">' + make_row('Gross Weight', doc.gross_weight_pkg) + '</table>'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(item.qty > item.received_qty) {
|
if(item.qty > item.received_qty) {
|
||||||
msgprint(__("Error") + ": " + __(frappe.meta.get_label(item.doctype, "qty", item.name))
|
msgprint(__("Error: {0} > {1}", [__(frappe.meta.get_label(item.doctype, "qty", item.name)),
|
||||||
+ " > " + __(frappe.meta.get_label(item.doctype, "received_qty", item.name)));
|
__(frappe.meta.get_label(item.doctype, "received_qty", item.name))]))
|
||||||
item.qty = item.rejected_qty = 0.0;
|
item.qty = item.rejected_qty = 0.0;
|
||||||
} else {
|
} else {
|
||||||
item.rejected_qty = flt(item.received_qty - item.qty, precision("rejected_qty", item));
|
item.rejected_qty = flt(item.received_qty - item.qty, precision("rejected_qty", item));
|
||||||
@@ -78,9 +78,8 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
|
|||||||
frappe.model.round_floats_in(item, ["received_qty", "rejected_qty"]);
|
frappe.model.round_floats_in(item, ["received_qty", "rejected_qty"]);
|
||||||
|
|
||||||
if(item.rejected_qty > item.received_qty) {
|
if(item.rejected_qty > item.received_qty) {
|
||||||
msgprint(__("Error") + ": " +
|
msgprint(__("Error: {0} > {1}", [__(frappe.meta.get_label(item.doctype, "rejected_qty", item.name)),
|
||||||
__(frappe.meta.get_label(item.doctype, "rejected_qty", item.name))
|
__(frappe.meta.get_label(item.doctype, "received_qty", item.name))]));
|
||||||
+ " > " + __(frappe.meta.get_label(item.doctype, "received_qty", item.name)));
|
|
||||||
item.qty = item.rejected_qty = 0.0;
|
item.qty = item.rejected_qty = 0.0;
|
||||||
} else {
|
} else {
|
||||||
item.qty = flt(item.received_qty - item.rejected_qty, precision("qty", item));
|
item.qty = flt(item.received_qty - item.rejected_qty, precision("qty", item));
|
||||||
@@ -170,4 +169,4 @@ cur_frm.fields_dict.purchase_receipt_details.grid.get_field("qa_no").get_query =
|
|||||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||||
if(cint(frappe.boot.notification_settings.purchase_receipt))
|
if(cint(frappe.boot.notification_settings.purchase_receipt))
|
||||||
cur_frm.email_doc(frappe.boot.notification_settings.purchase_receipt_message);
|
cur_frm.email_doc(frappe.boot.notification_settings.purchase_receipt_message);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user