Merge branch 'i18n' of git://github.com/bperretti/erpnext into bperretti-i18n

This commit is contained in:
Nabin Hait 2013-10-24 11:40:32 +05:30
commit ca8ad210d2
112 changed files with 677 additions and 617 deletions

View File

@ -11,7 +11,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
// ----------------------------------------- // -----------------------------------------
cur_frm.cscript.refresh = function(doc, cdt, cdn) { cur_frm.cscript.refresh = function(doc, cdt, cdn) {
if(doc.__islocal) { if(doc.__islocal) {
msgprint("Please create new account from Chart of Accounts."); msgprint(wn._("Please create new account from Chart of Accounts."));
throw "cannot create"; throw "cannot create";
} }
@ -38,7 +38,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
// read-only for root accounts // read-only for root accounts
if(!doc.parent_account) { if(!doc.parent_account) {
cur_frm.perm = [[1,0,0], [1,0,0]]; cur_frm.perm = [[1,0,0], [1,0,0]];
cur_frm.set_intro("This is a root account and cannot be edited."); cur_frm.set_intro(wn._("This is a root account and cannot be edited."));
} else { } else {
// credit days and type if customer or supplier // credit days and type if customer or supplier
cur_frm.set_intro(null); cur_frm.set_intro(null);
@ -81,17 +81,17 @@ cur_frm.cscript.account_type = function(doc, cdt, cdn) {
// Hide/unhide group or ledger // Hide/unhide group or ledger
// ----------------------------------------- // -----------------------------------------
cur_frm.cscript.add_toolbar_buttons = function(doc) { cur_frm.cscript.add_toolbar_buttons = function(doc) {
cur_frm.add_custom_button('Chart of Accounts', cur_frm.add_custom_button(wn._('Chart of Accounts'),
function() { wn.set_route("Accounts Browser", "Account"); }, 'icon-sitemap') function() { wn.set_route("Accounts Browser", "Account"); }, 'icon-sitemap')
if (cstr(doc.group_or_ledger) == 'Group') { if (cstr(doc.group_or_ledger) == 'Group') {
cur_frm.add_custom_button('Convert to Ledger', cur_frm.add_custom_button(wn._('Convert to Ledger'),
function() { cur_frm.cscript.convert_to_ledger(); }, 'icon-retweet') function() { cur_frm.cscript.convert_to_ledger(); }, 'icon-retweet')
} else if (cstr(doc.group_or_ledger) == 'Ledger') { } else if (cstr(doc.group_or_ledger) == 'Ledger') {
cur_frm.add_custom_button('Convert to Group', cur_frm.add_custom_button(wn._('Convert to Group'),
function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet') function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet')
cur_frm.add_custom_button('View Ledger', function() { cur_frm.add_custom_button(wn._('View Ledger'), function() {
wn.route_options = { wn.route_options = {
"account": doc.name, "account": doc.name,
"from_date": sys_defaults.year_start_date, "from_date": sys_defaults.year_start_date,

View File

@ -41,8 +41,8 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.toggle_enable(['group_or_ledger', 'company'], doc.__islocal); cur_frm.toggle_enable(['group_or_ledger', 'company'], doc.__islocal);
if(!doc.__islocal && doc.group_or_ledger=='Group') { if(!doc.__islocal && doc.group_or_ledger=='Group') {
intro_txt += '<p><b>Note:</b> This Cost Center is a <i>Group</i>, \ intro_txt += '<p><b>'+wn._('Note:')+'</b>'+ wn._('This Cost Center is a')+ '<i>'+wn._('Group')+'</i>, '+
Accounting Entries are not allowed against groups.</p>'; wn._('Accounting Entries are not allowed against groups.')+'</p>';
} }
cur_frm.cscript.hide_unhide_group_ledger(doc); cur_frm.cscript.hide_unhide_group_ledger(doc);
@ -50,22 +50,22 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.toggle_display('sb1', doc.group_or_ledger=='Ledger') cur_frm.toggle_display('sb1', doc.group_or_ledger=='Ledger')
cur_frm.set_intro(intro_txt); cur_frm.set_intro(intro_txt);
cur_frm.add_custom_button('Chart of Cost Centers', cur_frm.add_custom_button(wn._('Chart of Cost Centers'),
function() { wn.set_route("Accounts Browser", "Cost Center"); }, 'icon-sitemap') function() { wn.set_route("Accounts Browser", "Cost Center"); }, 'icon-sitemap')
} }
cur_frm.cscript.parent_cost_center = function(doc,cdt,cdn){ cur_frm.cscript.parent_cost_center = function(doc,cdt,cdn){
if(!doc.company){ if(!doc.company){
alert('Please enter company name first'); alert(wn._('Please enter company name first'));
} }
} }
cur_frm.cscript.hide_unhide_group_ledger = function(doc) { cur_frm.cscript.hide_unhide_group_ledger = function(doc) {
if (cstr(doc.group_or_ledger) == 'Group') { if (cstr(doc.group_or_ledger) == 'Group') {
cur_frm.add_custom_button('Convert to Ledger', cur_frm.add_custom_button(wn._('Convert to Ledger'),
function() { cur_frm.cscript.convert_to_ledger(); }, 'icon-retweet') function() { cur_frm.cscript.convert_to_ledger(); }, 'icon-retweet')
} else if (cstr(doc.group_or_ledger) == 'Ledger') { } else if (cstr(doc.group_or_ledger) == 'Ledger') {
cur_frm.add_custom_button('Convert to Group', cur_frm.add_custom_button(wn._('Convert to Group'),
function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet') function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet')
} }
} }

View File

@ -5,8 +5,8 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
cur_frm.toggle_enable('year_start_date', doc.__islocal) cur_frm.toggle_enable('year_start_date', doc.__islocal)
if (!doc.__islocal && (doc.name != sys_defaults.fiscal_year)) { if (!doc.__islocal && (doc.name != sys_defaults.fiscal_year)) {
cur_frm.add_custom_button("Set as Default", cur_frm.cscript.set_as_default); cur_frm.add_custom_button(wn._("Set as Default"), cur_frm.cscript.set_as_default);
cur_frm.set_intro("To set this Fiscal Year as Deafult, click on 'Set as Default'"); cur_frm.set_intro(wn._("To set this Fiscal Year as Deafult, click on 'Set as Default'"));
} else cur_frm.set_intro(""); } else cur_frm.set_intro("");
} }

View File

@ -115,7 +115,7 @@ cur_frm.cscript.refresh = function(doc) {
erpnext.hide_naming_series(); erpnext.hide_naming_series();
cur_frm.cscript.voucher_type(doc); cur_frm.cscript.voucher_type(doc);
if(doc.docstatus==1) { if(doc.docstatus==1) {
cur_frm.add_custom_button('View Ledger', function() { cur_frm.add_custom_button(wn._('View Ledger'), function() {
wn.route_options = { wn.route_options = {
"voucher_no": doc.name, "voucher_no": doc.name,
"from_date": doc.posting_date, "from_date": doc.posting_date,
@ -185,7 +185,7 @@ cur_frm.cscript.select_print_heading = function(doc,cdt,cdn){
cur_frm.pformat.print_heading = doc.select_print_heading; cur_frm.pformat.print_heading = doc.select_print_heading;
} }
else else
cur_frm.pformat.print_heading = "Journal Voucher"; cur_frm.pformat.print_heading = wn._("Journal Voucher");
} }
cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {

View File

@ -13,15 +13,15 @@ cur_frm.cscript.onload_post_render = function(doc) {
cur_frm.cscript.refresh = function(doc) { cur_frm.cscript.refresh = function(doc) {
cur_frm.set_intro(""); cur_frm.set_intro("");
if(!doc.voucher_no) { if(!doc.voucher_no) {
cur_frm.set_intro("Select the Invoice against which you want to allocate payments."); cur_frm.set_intro(wn._("Select the Invoice against which you want to allocate payments."));
} else { } else {
cur_frm.set_intro("Set allocated amount against each Payment Entry and click 'Allocate'."); cur_frm.set_intro(wn._("Set allocated amount against each Payment Entry and click 'Allocate'."));
} }
} }
cur_frm.fields_dict.voucher_no.get_query = function(doc) { cur_frm.fields_dict.voucher_no.get_query = function(doc) {
// TO-do: check for pos, it should not come // TO-do: check for pos, it should not come
if (!doc.account) msgprint("Please select Account first"); if (!doc.account) msgprint(wn._("Please select Account first"));
else { else {
return { return {
doctype: doc.voucher_type, doctype: doc.voucher_type,

View File

@ -27,10 +27,10 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
// Show / Hide button // Show / Hide button
if(doc.docstatus==1 && doc.outstanding_amount > 0) if(doc.docstatus==1 && doc.outstanding_amount > 0)
this.frm.add_custom_button('Make Payment Entry', this.make_bank_voucher); this.frm.add_custom_button(wn._('Make Payment Entry'), this.make_bank_voucher);
if(doc.docstatus==1) { if(doc.docstatus==1) {
cur_frm.add_custom_button('View Ledger', function() { cur_frm.add_custom_button(wn._('View Ledger'), function() {
wn.route_options = { wn.route_options = {
"voucher_no": doc.name, "voucher_no": doc.name,
"from_date": doc.posting_date, "from_date": doc.posting_date,
@ -214,5 +214,5 @@ cur_frm.cscript.select_print_heading = function(doc,cdt,cdn){
cur_frm.pformat.print_heading = doc.select_print_heading; cur_frm.pformat.print_heading = doc.select_print_heading;
} }
else else
cur_frm.pformat.print_heading = "Purchase Invoice"; cur_frm.pformat.print_heading = wn._("Purchase Invoice");
} }

View File

@ -62,12 +62,12 @@ cur_frm.pformat.purchase_tax_details= function(doc){
cur_frm.cscript.add_deduct_tax = function(doc, cdt, cdn) { cur_frm.cscript.add_deduct_tax = function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if(!d.category && d.add_deduct_tax){ if(!d.category && d.add_deduct_tax){
alert("Please select Category first"); alert(wn._("Please select Category first"));
d.add_deduct_tax = ''; d.add_deduct_tax = '';
} }
else if(d.category != 'Total' && d.add_deduct_tax == 'Deduct') { else if(d.category != 'Total' && d.add_deduct_tax == 'Deduct') {
console.log([d.category, d.add_deduct_tax]); console.log([d.category, d.add_deduct_tax]);
msgprint("You cannot deduct when category is for 'Valuation' or 'Valuation and Total'"); msgprint(wn._("You cannot deduct when category is for 'Valuation' or 'Valuation and Total'"));
d.add_deduct_tax = ''; d.add_deduct_tax = '';
} }
@ -76,15 +76,15 @@ cur_frm.cscript.add_deduct_tax = function(doc, cdt, cdn) {
cur_frm.cscript.charge_type = function(doc, cdt, cdn) { cur_frm.cscript.charge_type = function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if(!d.category && d.charge_type){ if(!d.category && d.charge_type){
alert("Please select Category first"); alert(wn._("Please select Category first"));
d.charge_type = ''; d.charge_type = '';
} }
else if(d.idx == 1 && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')){ else if(d.idx == 1 && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')){
alert("You cannot select Charge Type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"); alert(wn._("You cannot select Charge Type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"));
d.charge_type = ''; d.charge_type = '';
} }
else if((d.category == 'Valuation' || d.category == 'Valuation and Total') && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')){ else if((d.category == 'Valuation' || d.category == 'Valuation and Total') && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')){
alert("You cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for valuation. You can select only 'Total' option for previous row amount or previous row total") alert(wn._("You cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for valuation. You can select only 'Total' option for previous row amount or previous row total"))
d.charge_type = ''; d.charge_type = '';
} }
validated = false; validated = false;
@ -99,16 +99,16 @@ cur_frm.cscript.charge_type = function(doc, cdt, cdn) {
cur_frm.cscript.row_id = function(doc, cdt, cdn) { cur_frm.cscript.row_id = function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if(!d.charge_type && d.row_id){ if(!d.charge_type && d.row_id){
alert("Please select Charge Type first"); alert(wn._("Please select Charge Type first"));
d.row_id = ''; d.row_id = '';
} }
else if((d.charge_type == 'Actual' || d.charge_type == 'On Net Total') && d.row_id) { else if((d.charge_type == 'Actual' || d.charge_type == 'On Net Total') && d.row_id) {
alert("You can Enter Row only if your Charge Type is 'On Previous Row Amount' or ' Previous Row Total'"); alert(wn._("You can Enter Row only if your Charge Type is 'On Previous Row Amount' or ' Previous Row Total'"));
d.row_id = ''; d.row_id = '';
} }
else if((d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total') && d.row_id){ else if((d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total') && d.row_id){
if(d.row_id >= d.idx){ if(d.row_id >= d.idx){
alert("You cannot Enter Row no. greater than or equal to current row no. for this Charge type"); alert(wn._("You cannot Enter Row no. greater than or equal to current row no. for this Charge type"));
d.row_id = ''; d.row_id = '';
} }
} }
@ -136,10 +136,27 @@ cur_frm.fields_dict['purchase_tax_details'].grid.get_field("cost_center").get_qu
} }
} }
<<<<<<< HEAD
cur_frm.cscript.account_head = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.charge_type && d.account_head){
alert(wn._("Please select Charge Type first"));
validated = false;
d.account_head = '';
}
else if(d.account_head && d.charge_type) {
arg = "{'charge_type' : '" + d.charge_type + "', 'account_head' : '" + d.account_head + "'}";
return get_server_fields('get_rate', arg, 'purchase_tax_details', doc, cdt, cdn, 1);
}
refresh_field('account_head',d.name,'purchase_tax_details');
}
=======
>>>>>>> f146e8b7f52a3e46e335c0fefd92c347717b370b
cur_frm.cscript.rate = function(doc, cdt, cdn) { cur_frm.cscript.rate = function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if(!d.charge_type && d.rate) { if(!d.charge_type && d.rate) {
alert("Please select Charge Type first"); alert(wn._("Please select Charge Type first"));
d.rate = ''; d.rate = '';
} }
validated = false; validated = false;
@ -149,11 +166,11 @@ cur_frm.cscript.rate = function(doc, cdt, cdn) {
cur_frm.cscript.tax_amount = function(doc, cdt, cdn) { cur_frm.cscript.tax_amount = function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if(!d.charge_type && d.tax_amount){ if(!d.charge_type && d.tax_amount){
alert("Please select Charge Type first"); alert(wn._("Please select Charge Type first"));
d.tax_amount = ''; d.tax_amount = '';
} }
else if(d.charge_type && d.tax_amount) { else if(d.charge_type && d.tax_amount) {
alert("You cannot directly enter Amount and if your Charge Type is Actual enter your amount in Rate"); alert(wn._("You cannot directly enter Amount and if your Charge Type is Actual enter your amount in Rate"));
d.tax_amount = ''; d.tax_amount = '';
} }
validated = false; validated = false;

View File

@ -61,7 +61,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
var percent_paid = cint(flt(doc.grand_total - doc.outstanding_amount) / flt(doc.grand_total) * 100); var percent_paid = cint(flt(doc.grand_total - doc.outstanding_amount) / flt(doc.grand_total) * 100);
cur_frm.dashboard.add_progress(percent_paid + "% Paid", percent_paid); cur_frm.dashboard.add_progress(percent_paid + "% Paid", percent_paid);
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms); cur_frm.add_custom_button(wn._('Send SMS'), cur_frm.cscript.send_sms);
if(cint(doc.update_stock)!=1) { if(cint(doc.update_stock)!=1) {
// show Make Delivery Note button only if Sales Invoice is not created from Delivery Note // show Make Delivery Note button only if Sales Invoice is not created from Delivery Note
@ -72,11 +72,11 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
}); });
if(!from_delivery_note) if(!from_delivery_note)
cur_frm.add_custom_button('Make Delivery', cur_frm.cscript['Make Delivery Note']); cur_frm.add_custom_button(wn._('Make Delivery'), cur_frm.cscript['Make Delivery Note']);
} }
if(doc.outstanding_amount!=0) if(doc.outstanding_amount!=0)
cur_frm.add_custom_button('Make Payment Entry', cur_frm.cscript.make_bank_voucher); cur_frm.add_custom_button(wn._('Make Payment Entry'), cur_frm.cscript.make_bank_voucher);
} }
// Show buttons only when pos view is active // Show buttons only when pos view is active

View File

@ -95,7 +95,7 @@ cur_frm.pformat.other_charges= function(doc){
cur_frm.cscript.charge_type = function(doc, cdt, cdn) { cur_frm.cscript.charge_type = function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if(d.idx == 1 && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')){ if(d.idx == 1 && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')){
alert("You cannot select Charge Type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"); alert(wn._("You cannot select Charge Type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"));
d.charge_type = ''; d.charge_type = '';
} }
validated = false; validated = false;
@ -108,16 +108,16 @@ cur_frm.cscript.charge_type = function(doc, cdt, cdn) {
cur_frm.cscript.row_id = function(doc, cdt, cdn) { cur_frm.cscript.row_id = function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if(!d.charge_type && d.row_id){ if(!d.charge_type && d.row_id){
alert("Please select Charge Type first"); alert(wn._("Please select Charge Type first"));
d.row_id = ''; d.row_id = '';
} }
else if((d.charge_type == 'Actual' || d.charge_type == 'On Net Total') && d.row_id) { else if((d.charge_type == 'Actual' || d.charge_type == 'On Net Total') && d.row_id) {
alert("You can Enter Row only if your Charge Type is 'On Previous Row Amount' or ' Previous Row Total'"); alert(wn._("You can Enter Row only if your Charge Type is 'On Previous Row Amount' or ' Previous Row Total'"));
d.row_id = ''; d.row_id = '';
} }
else if((d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total') && d.row_id){ else if((d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total') && d.row_id){
if(d.row_id >= d.idx){ if(d.row_id >= d.idx){
alert("You cannot Enter Row no. greater than or equal to current row no. for this Charge type"); alert(wn._("You cannot Enter Row no. greater than or equal to current row no. for this Charge type"));
d.row_id = ''; d.row_id = '';
} }
} }
@ -145,10 +145,28 @@ cur_frm.fields_dict['other_charges'].grid.get_field("cost_center").get_query = f
} }
} }
<<<<<<< HEAD
cur_frm.cscript.account_head = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.charge_type && d.account_head){
alert(wn._("Please select Charge Type first"));
validated = false;
d.account_head = '';
}
else if(d.account_head && d.charge_type) {
arg = "{'charge_type' : '" + d.charge_type +"', 'account_head' : '" + d.account_head + "'}";
return get_server_fields('get_rate', arg, 'other_charges', doc, cdt, cdn, 1);
}
refresh_field('account_head',d.name,'other_charges');
}
=======
>>>>>>> f146e8b7f52a3e46e335c0fefd92c347717b370b
cur_frm.cscript.rate = function(doc, cdt, cdn) { cur_frm.cscript.rate = function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if(!d.charge_type && d.rate) { if(!d.charge_type && d.rate) {
alert("Please select Charge Type first"); alert(wn._("Please select Charge Type first"));
d.rate = ''; d.rate = '';
} }
validated = false; validated = false;
@ -158,11 +176,11 @@ cur_frm.cscript.rate = function(doc, cdt, cdn) {
cur_frm.cscript.tax_amount = function(doc, cdt, cdn) { cur_frm.cscript.tax_amount = function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if(!d.charge_type && d.tax_amount){ if(!d.charge_type && d.tax_amount){
alert("Please select Charge Type first"); alert(wn._("Please select Charge Type first"));
d.tax_amount = ''; d.tax_amount = '';
} }
else if(d.charge_type && d.tax_amount) { else if(d.charge_type && d.tax_amount) {
alert("You cannot directly enter Amount and if your Charge Type is Actual enter your amount in Rate"); alert(wn._("You cannot directly enter Amount and if your Charge Type is Actual enter your amount in Rate"));
d.tax_amount = ''; d.tax_amount = '';
} }
validated = false; validated = false;

View File

@ -20,29 +20,31 @@ pscript['onload_Accounts Browser'] = function(wrapper){
chart_area = $("<div>") chart_area = $("<div>")
.css({"margin-bottom": "15px"}) .css({"margin-bottom": "15px"})
.appendTo(main), .appendTo(main),
help_area = $('<div class="well">\ help_area = $('<div class="well">'+
<h4>Quick Help</h4>\ '<h4>'+wn._('Quick Help')+'</h4>'+
<ol>\ '<ol>'+
<li>To add child nodes, explore tree and click on the node under which you \ '<li>'+wn._('To add child nodes, explore tree and click on the node under which you want to add more nodes.')+'</li>'+
want to add more nodes.\ '<li>'+
<li>Accounting Entries can be made against leaf nodes, called <b>Ledgers</b>.\ wn._('Accounting Entries can be made against leaf nodes, called')+
Entries against <b>Groups</b> are not allowed.\ '<b>' +wn._('Ledgers')+'</b>.'+ wn._('Entries against') +
<li>Please do NOT create Account (Ledgers) for Customers and Suppliers. \ '<b>' +wn._('Groups') + '</b>'+ wn._('are not allowed.')+
They are created directly from the Customer / Supplier masters.\ '</li>'+
<li><b>To create a Bank Account:</b> Go to the appropriate group \ '<li>'+wn._('Please do NOT create Account (Ledgers) for Customers and Suppliers. They are created directly from the Customer / Supplier masters.')+'</li>'+
(usually Application of Funds > Current Assets > Bank Accounts)\ '<li>'+
and create a new Account Ledger (by clicking on Add Child) of \ '<b>'+wn._('To create a Bank Account:')+'</b>'+
type "Bank or Cash"\ wn._('Go to the appropriate group (usually Application of Funds > Current Assets > Bank Accounts)')+
<li><b>To create a Tax Account:</b> Go to the appropriate group \ wn._('and create a new Account Ledger (by clicking on Add Child) of type "Bank or Cash"')+
(usually Source of Funds > Current Liabilities > Taxes and Duties) \ '</li>'+
and create a new Account Ledger (by clicking on Add Child) of type\ '<li>'+
"Tax" and do mention the Tax rate.\ '<b>'+wn._('To create a Tax Account:')+'</b>'+
</ol>\ wn._('Go to the appropriate group (usually Source of Funds > Current Liabilities > Taxes and Duties)')+
<p>Please setup your chart of accounts before you start Accounting Entries</p>\ wn._('and create a new Account Ledger (by clicking on Add Child) of type "Tax" and do mention the Tax rate.')+
</div>').appendTo(main); '</li>'+
'</ol>'+
'<p>'+wn._('Please setup your chart of accounts before you start Accounting Entries')+'</p></div>').appendTo(main);
if (wn.boot.profile.can_create.indexOf("Company") !== -1) { if (wn.boot.profile.can_create.indexOf("Company") !== -1) {
wrapper.appframe.add_button('New Company', function() { newdoc('Company'); }, wrapper.appframe.add_button(wn._('New Company'), function() { newdoc('Company'); },
'icon-plus'); 'icon-plus');
} }
@ -145,20 +147,20 @@ erpnext.AccountsChart = Class.extend({
var node_links = []; var node_links = [];
// edit // edit
if (wn.model.can_read(this.ctype) !== -1) { if (wn.model.can_read(this.ctype) !== -1) {
node_links.push('<a onclick="erpnext.account_chart.open();">Edit</a>'); node_links.push('<a onclick="erpnext.account_chart.open();">'+wn._('Edit')+'</a>');
} }
if (data.expandable && wn.boot.profile.in_create.indexOf(this.ctype) !== -1) { if (data.expandable && wn.boot.profile.in_create.indexOf(this.ctype) !== -1) {
node_links.push('<a onclick="erpnext.account_chart.new_node();">Add Child</a>'); node_links.push('<a onclick="erpnext.account_chart.new_node();">'+wn._('Add Child')+'</a>');
} else if (this.ctype === 'Account' && wn.boot.profile.can_read.indexOf("GL Entry") !== -1) { } else if (this.ctype === 'Account' && wn.boot.profile.can_read.indexOf("GL Entry") !== -1) {
node_links.push('<a onclick="erpnext.account_chart.show_ledger();">View Ledger</a>'); node_links.push('<a onclick="erpnext.account_chart.show_ledger();">'+wn._('View Ledger')+'</a>');
} }
if (this.can_write) { if (this.can_write) {
node_links.push('<a onclick="erpnext.account_chart.rename()">Rename</a>'); node_links.push('<a onclick="erpnext.account_chart.rename()">'+wn._('Rename')+'</a>');
}; };
if (this.can_delete) { if (this.can_delete) {
node_links.push('<a onclick="erpnext.account_chart.delete()">Delete</a>'); node_links.push('<a onclick="erpnext.account_chart.delete()">'+wn._('Delete')+'</a>');
}; };
link.toolbar.append(node_links.join(" | ")); link.toolbar.append(node_links.join(" | "));
@ -204,20 +206,20 @@ erpnext.AccountsChart = Class.extend({
// the dialog // the dialog
var d = new wn.ui.Dialog({ var d = new wn.ui.Dialog({
title:'New Account', title:wn._('New Account'),
fields: [ fields: [
{fieldtype:'Data', fieldname:'account_name', label:'New Account Name', reqd:true, {fieldtype:'Data', fieldname:'account_name', label:wn._('New Account Name'), reqd:true,
description: "Name of new Account. Note: Please don't create accounts for Customers and Suppliers, \ description: wn._("Name of new Account. Note: Please don't create accounts for Customers and Suppliers,")+
they are created automatically from the Customer and Supplier master"}, wn._("they are created automatically from the Customer and Supplier master")},
{fieldtype:'Select', fieldname:'group_or_ledger', label:'Group or Ledger', {fieldtype:'Select', fieldname:'group_or_ledger', label:wn._('Group or Ledger'),
options:'Group\nLedger', description:'Further accounts can be made under Groups,\ options:'Group\nLedger', description: wn._('Further accounts can be made under Groups,')+
but entries can be made against Ledger'}, wn._('but entries can be made against Ledger')},
{fieldtype:'Select', fieldname:'account_type', label:'Account Type', {fieldtype:'Select', fieldname:'account_type', label:wn._('Account Type'),
options: ['', 'Fixed Asset Account', 'Bank or Cash', 'Expense Account', 'Tax', options: ['', 'Fixed Asset Account', 'Bank or Cash', 'Expense Account', 'Tax',
'Income Account', 'Chargeable'].join('\n'), 'Income Account', 'Chargeable'].join('\n'),
description: "Optional. This setting will be used to filter in various transactions." }, description: wn._("Optional. This setting will be used to filter in various transactions.") },
{fieldtype:'Float', fieldname:'tax_rate', label:'Tax Rate'}, {fieldtype:'Float', fieldname:'tax_rate', label:wn._('Tax Rate')},
{fieldtype:'Button', fieldname:'create_new', label:'Create New' } {fieldtype:'Button', fieldname:'create_new', label:wn._('Create New') }
] ]
}) })
@ -282,13 +284,13 @@ erpnext.AccountsChart = Class.extend({
var me = this; var me = this;
// the dialog // the dialog
var d = new wn.ui.Dialog({ var d = new wn.ui.Dialog({
title:'New Cost Center', title:wn._('New Cost Center'),
fields: [ fields: [
{fieldtype:'Data', fieldname:'cost_center_name', label:'New Cost Center Name', reqd:true}, {fieldtype:'Data', fieldname:'cost_center_name', label:wn._('New Cost Center Name'), reqd:true},
{fieldtype:'Select', fieldname:'group_or_ledger', label:'Group or Ledger', {fieldtype:'Select', fieldname:'group_or_ledger', label:wn._('Group or Ledger'),
options:'Group\nLedger', description:'Further accounts can be made under Groups,\ options:'Group\nLedger', description:wn._('Further accounts can be made under Groups,')+
but entries can be made against Ledger'}, wn._('but entries can be made against Ledger')},
{fieldtype:'Button', fieldname:'create_new', label:'Create New' } {fieldtype:'Button', fieldname:'create_new', label:wn._('Create New') }
] ]
}); });

View File

@ -88,12 +88,12 @@ wn.module_page["Accounts"] = [
{ {
"label": wn._("Period Closing Voucher"), "label": wn._("Period Closing Voucher"),
"doctype": "Period Closing Voucher", "doctype": "Period Closing Voucher",
description: "Close Balance Sheet and book Profit or Loss." description: wn._("Close Balance Sheet and book Profit or Loss.")
}, },
{ {
"page":"voucher-import-tool", "page":"voucher-import-tool",
"label": wn._("Voucher Import Tool"), "label": wn._("Voucher Import Tool"),
"description": "Import accounting entries from CSV." "description": wn._("Import accounting entries from CSV.")
}, },
] ]
}, },
@ -105,7 +105,7 @@ wn.module_page["Accounts"] = [
"label": wn._("Accounts Settings"), "label": wn._("Accounts Settings"),
"route": "Form/Accounts Settings", "route": "Form/Accounts Settings",
"doctype":"Accounts Settings", "doctype":"Accounts Settings",
"description": "Settings for Accounts" "description": wn._("Settings for Accounts")
}, },
{ {
"label": wn._("Sales Taxes and Charges Master"), "label": wn._("Sales Taxes and Charges Master"),
@ -130,7 +130,7 @@ wn.module_page["Accounts"] = [
{ {
"label": wn._("Point-of-Sale Setting"), "label": wn._("Point-of-Sale Setting"),
"doctype":"POS Setting", "doctype":"POS Setting",
"description": "User settings for Point-of-sale (POS)" "description": wn._("User settings for Point-of-sale (POS)")
}, },
{ {
"doctype":"Budget Distribution", "doctype":"Budget Distribution",
@ -150,7 +150,7 @@ wn.module_page["Accounts"] = [
{ {
"doctype":"C-Form", "doctype":"C-Form",
"label": wn._("C-Form"), "label": wn._("C-Form"),
description: "C-Form records", description: wn._("C-Form records"),
country: "India" country: "India"
} }
] ]

View File

@ -6,7 +6,7 @@ wn.require("app/js/account_tree_grid.js");
wn.pages['financial-analytics'].onload = function(wrapper) { wn.pages['financial-analytics'].onload = function(wrapper) {
wn.ui.make_app_page({ wn.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: 'Financial Analytics', title: wn._('Financial Analytics'),
single_column: true single_column: true
}); });
erpnext.trial_balance = new erpnext.FinancialAnalytics(wrapper, 'Financial Analytics'); erpnext.trial_balance = new erpnext.FinancialAnalytics(wrapper, 'Financial Analytics');
@ -18,7 +18,7 @@ wn.pages['financial-analytics'].onload = function(wrapper) {
erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({
filters: [ filters: [
{fieldtype:"Select", label: "PL or BS", options:["Profit and Loss", "Balance Sheet"], {fieldtype:"Select", label: wn._("PL or BS"), options:["Profit and Loss", "Balance Sheet"],
filter: function(val, item, opts, me) { filter: function(val, item, opts, me) {
if(item._show) return true; if(item._show) return true;
@ -28,27 +28,27 @@ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({
return me.apply_zero_filter(val, item, opts, me); return me.apply_zero_filter(val, item, opts, me);
}}, }},
{fieldtype:"Select", label: "Company", link:"Company", default_value: "Select Company...", {fieldtype:"Select", label: wn._("Company"), link:"Company", default_value: "Select Company...",
filter: function(val, item, opts) { filter: function(val, item, opts) {
return item.company == val || val == opts.default_value || item._show; return item.company == val || val == opts.default_value || item._show;
}}, }},
{fieldtype:"Select", label: "Fiscal Year", link:"Fiscal Year", {fieldtype:"Select", label: wn._("Fiscal Year"), link:"Fiscal Year",
default_value: "Select Fiscal Year..."}, default_value: "Select Fiscal Year..."},
{fieldtype:"Date", label: "From Date"}, {fieldtype:"Date", label: wn._("From Date")},
{fieldtype:"Label", label: "To"}, {fieldtype:"Label", label: wn._("To")},
{fieldtype:"Date", label: "To Date"}, {fieldtype:"Date", label: wn._("To Date")},
{fieldtype:"Select", label: "Range", {fieldtype:"Select", label: wn._("Range"),
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
{fieldtype:"Button", label: "Refresh", icon:"icon-refresh icon-white", cssClass:"btn-info"}, {fieldtype:"Button", label: wn._("Refresh"), icon:"icon-refresh icon-white", cssClass:"btn-info"},
{fieldtype:"Button", label: "Reset Filters"} {fieldtype:"Button", label: wn._("Reset Filters")}
], ],
setup_columns: function() { setup_columns: function() {
var std_columns = [ var std_columns = [
{id: "check", name: "Plot", field: "check", width: 30, {id: "check", name: wn._("Plot"), field: "check", width: 30,
formatter: this.check_formatter}, formatter: this.check_formatter},
{id: "name", name: "Account", field: "name", width: 300, {id: "name", name: wn._("Account"), field: "name", width: 300,
formatter: this.tree_formatter}, formatter: this.tree_formatter},
{id: "opening", name: "Opening", field: "opening", hidden: true, {id: "opening", name: wn._("Opening"), field: "opening", hidden: true,
formatter: this.currency_formatter} formatter: this.currency_formatter}
]; ];

View File

@ -6,7 +6,7 @@ erpnext.fs = {}
pscript['onload_Financial Statements'] = function(wrapper) { pscript['onload_Financial Statements'] = function(wrapper) {
wn.ui.make_app_page({ wn.ui.make_app_page({
parent: wrapper, parent: wrapper,
"title": "Financial Statements", "title": wn._("Financial Statements"),
"single_column": true, "single_column": true,
}); });
@ -34,18 +34,18 @@ pscript['onload_Financial Statements'] = function(wrapper) {
options: ['Loading...'] options: ['Loading...']
}) })
wrapper.appframe.add_button("Create", function() { wrapper.appframe.add_button(wn._("Create"), function() {
pscript.stmt_new(); pscript.stmt_new();
}, "icon-refresh") }, "icon-refresh")
wrapper.appframe.add_button("Print", function() { wrapper.appframe.add_button(wn._("Print"), function() {
_p.go($i('print_html').innerHTML); _p.go($i('print_html').innerHTML);
}, "icon-print") }, "icon-print")
$(wrapper).find(".layout-main").html('<div id="print_html">\ $(wrapper).find(".layout-main").html('<div id="print_html">\
<div id="stmt_title1" style="margin:16px 0px 4px 0px; font-size: 16px; font-weight: bold; color: #888;"></div>\ <div id="stmt_title1" style="margin:16px 0px 4px 0px; font-size: 16px; font-weight: bold; color: #888;"></div>\
<div id="stmt_title2" style="margin:0px 0px 8px 0px; font-size: 16px; font-weight: bold;"></div>\ <div id="stmt_title2" style="margin:0px 0px 8px 0px; font-size: 16px; font-weight: bold;"></div>\
<div id="stmt_tree" style="margin: 0px 0px 16px; overflow: auto;">Please select options and click on Create</div>\ <div id="stmt_tree" style="margin: 0px 0px 16px; overflow: auto;">'+wn._('Please select options and click on Create')+'</div>\
</div>').css({"min-height": "400px"}); </div>').css({"min-height": "400px"});
// load companies // load companies
@ -61,7 +61,7 @@ pscript['onload_Financial Statements'] = function(wrapper) {
pscript.stmt_new = function(stmt,company_name,level,period,year) { pscript.stmt_new = function(stmt,company_name,level,period,year) {
$i('stmt_tree').innerHTML = 'Refreshing....'; $i('stmt_tree').innerHTML = wn._('Refreshing....');
$i('stmt_tree').style.display = 'block'; $i('stmt_tree').style.display = 'block';
var company =erpnext.fs.stmt_company.get_value(); var company =erpnext.fs.stmt_company.get_value();

View File

@ -4,7 +4,7 @@
wn.pages['general-ledger'].onload = function(wrapper) { wn.pages['general-ledger'].onload = function(wrapper) {
wn.ui.make_app_page({ wn.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: 'General Ledger', title: wn._('General Ledger'),
single_column: true single_column: true
}); });
@ -16,7 +16,7 @@ wn.pages['general-ledger'].onload = function(wrapper) {
erpnext.GeneralLedger = wn.views.GridReport.extend({ erpnext.GeneralLedger = wn.views.GridReport.extend({
init: function(wrapper) { init: function(wrapper) {
this._super({ this._super({
title: "General Ledger", title: wn._("General Ledger"),
page: wrapper, page: wrapper,
parent: $(wrapper).find('.layout-main'), parent: $(wrapper).find('.layout-main'),
appframe: wrapper.appframe, appframe: wrapper.appframe,
@ -24,41 +24,42 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({
}); });
}, },
setup_columns: function() { setup_columns: function() {
var DEFAULT_COMPANY_VALUE = wn._("Select Company...");
this.columns = [ this.columns = [
{id: "posting_date", name: "Posting Date", field: "posting_date", width: 100, {id: "posting_date", name: wn._("Posting Date"), field: "posting_date", width: 100,
formatter: this.date_formatter}, formatter: this.date_formatter},
{id: "account", name: "Account", field: "account", width: 240, {id: "account", name: wn._("Account"), field: "account", width: 240,
link_formatter: { link_formatter: {
filter_input: "account", filter_input: "account",
open_btn: true, open_btn: true,
doctype: "'Account'" doctype: "'Account'"
}}, }},
{id: "against_account", name: "Against Account", field: "against_account", {id: "against_account", name: wn._("Against Account"), field: "against_account",
width: 240, hidden: !this.account}, width: 240, hidden: !this.account},
{id: "debit", name: "Debit", field: "debit", width: 100, {id: "debit", name: wn._("Debit"), field: "debit", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "credit", name: "Credit", field: "credit", width: 100, {id: "credit", name: wn._("Credit"), field: "credit", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "voucher_type", name: "Voucher Type", field: "voucher_type", width: 120}, {id: "voucher_type", name: wn._("Voucher Type"), field: "voucher_type", width: 120},
{id: "voucher_no", name: "Voucher No", field: "voucher_no", width: 160, {id: "voucher_no", name: wn._("Voucher No"), field: "voucher_no", width: 160,
link_formatter: { link_formatter: {
filter_input: "voucher_no", filter_input: "voucher_no",
open_btn: true, open_btn: true,
doctype: "dataContext.voucher_type" doctype: "dataContext.voucher_type"
}}, }},
{id: "remarks", name: "Remarks", field: "remarks", width: 200, {id: "remarks", name: wn._("Remarks"), field: "remarks", width: 200,
formatter: this.text_formatter}, formatter: this.text_formatter},
]; ];
}, },
filters: [ filters: [
{fieldtype:"Select", label: "Company", link:"Company", default_value: "Select Company...", {fieldtype:"Select", label: wn._("Company"), link:"Company", default_value: DEFAULT_COMPANY_VALUE,
filter: function(val, item, opts) { filter: function(val, item, opts) {
return item.company == val || val == opts.default_value; return item.company == val || val == DEFAULT_COMPANY_VALUE;
}}, }},
{fieldtype:"Link", label: "Account", link:"Account", {fieldtype:"Link", label: wn._("Account"), link:"Account",
filter: function(val, item, opts, me) { filter: function(val, item, opts, me) {
if(!val) { if(!val) {
return true; return true;
@ -68,22 +69,22 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({
return me.is_child_account(val, item.account); return me.is_child_account(val, item.account);
} }
}}, }},
{fieldtype:"Data", label: "Voucher No", {fieldtype:"Data", label: wn._("Voucher No"),
filter: function(val, item, opts) { filter: function(val, item, opts) {
if(!val) return true; if(!val) return true;
return (item.voucher_no && item.voucher_no.indexOf(val)!=-1); return (item.voucher_no && item.voucher_no.indexOf(val)!=-1);
}}, }},
{fieldtype:"Date", label: "From Date", filter: function(val, item) { {fieldtype:"Date", label: wn._("From Date"), filter: function(val, item) {
return dateutil.str_to_obj(val) <= dateutil.str_to_obj(item.posting_date); return dateutil.str_to_obj(val) <= dateutil.str_to_obj(item.posting_date);
}}, }},
{fieldtype:"Label", label: "To"}, {fieldtype:"Label", label: wn._("To")},
{fieldtype:"Date", label: "To Date", filter: function(val, item) { {fieldtype:"Date", label: wn._("To Date"), filter: function(val, item) {
return dateutil.str_to_obj(val) >= dateutil.str_to_obj(item.posting_date); return dateutil.str_to_obj(val) >= dateutil.str_to_obj(item.posting_date);
}}, }},
{fieldtype: "Check", label: "Group by Ledger"}, {fieldtype: "Check", label: wn._("Group by Ledger")},
{fieldtype: "Check", label: "Group by Voucher"}, {fieldtype: "Check", label: wn._("Group by Voucher")},
{fieldtype:"Button", label: "Refresh", icon:"icon-refresh icon-white", cssClass:"btn-info"}, {fieldtype:"Button", label: wn._("Refresh"), icon:"icon-refresh icon-white", cssClass:"btn-info"},
{fieldtype:"Button", label: "Reset Filters"} {fieldtype:"Button", label: wn._("Reset Filters")}
], ],
setup_filters: function() { setup_filters: function() {
this._super(); this._super();
@ -160,7 +161,7 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({
var to_date = dateutil.str_to_obj(this.to_date); var to_date = dateutil.str_to_obj(this.to_date);
if(to_date < from_date) { if(to_date < from_date) {
msgprint("From Date must be before To Date"); msgprint(wn._("From Date must be before To Date"));
return; return;
} }
@ -236,7 +237,7 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({
closing.credit = opening.credit + totals.credit; closing.credit = opening.credit + totals.credit;
if(me.account) { if(me.account) {
me.appframe.set_title("General Ledger: " + me.account); me.appframe.set_title(wn._("General Ledger: ") + me.account);
// group by ledgers // group by ledgers
if(this.account_by_name[this.account].group_or_ledger==="Group" if(this.account_by_name[this.account].group_or_ledger==="Group"
@ -254,7 +255,7 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({
out = [opening].concat(out).concat([totals, closing]); out = [opening].concat(out).concat([totals, closing]);
} else { } else {
me.appframe.set_title("General Ledger"); me.appframe.set_title(wn._("General Ledger"));
out = out.concat([totals]); out = out.concat([totals]);
} }

View File

@ -6,7 +6,7 @@ wn.require("app/js/account_tree_grid.js");
wn.pages['trial-balance'].onload = function(wrapper) { wn.pages['trial-balance'].onload = function(wrapper) {
wn.ui.make_app_page({ wn.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: 'Trial Balance', title: wn._('Trial Balance'),
single_column: true single_column: true
}); });
var TrialBalance = erpnext.AccountTreeGrid.extend({ var TrialBalance = erpnext.AccountTreeGrid.extend({
@ -17,8 +17,8 @@ wn.pages['trial-balance'].onload = function(wrapper) {
// period closing entry checkbox // period closing entry checkbox
this.wrapper.bind("make", function() { this.wrapper.bind("make", function() {
$('<div style="margin: 10px 0px; "\ $('<div style="margin: 10px 0px; "\
class="with_period_closing_entry"><input type="checkbox" checked="checked">\ class="with_period_closing_entry"><input type="checkbox" checked="checked">' +
With period closing entry</div>') wn._("With period closing entry") + '</div>')
.appendTo(me.wrapper) .appendTo(me.wrapper)
.find("input").click(function() { me.refresh(); }); .find("input").click(function() { me.refresh(); });
}); });

View File

@ -4,29 +4,34 @@
wn.pages['voucher-import-tool'].onload = function(wrapper) { wn.pages['voucher-import-tool'].onload = function(wrapper) {
wn.ui.make_app_page({ wn.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: 'Voucher Import Tool', title: wn._('Voucher Import Tool'),
single_column: true single_column: true
}); });
$(wrapper).find('.layout-main').html('\ $(wrapper).find('.layout-main').html('<p class="help">' +
<p class="help">Import multiple accounting entries via CSV (spreadsheet) file:</p>\ wn._('Import multiple accounting entries via CSV (spreadsheet) file:') +
<h3>1. Download Template</h3><br>\ '</p><h3> 1. ' + wn._('Download Template') + '</h3><br>' +
<div style="padding-left: 30px;">\ '<div style="padding-left: 30px;">' +
<button class="btn btn-default btn-download-two-accounts">Download</button>\ '<button class="btn btn-default btn-download-two-accounts">' +
<p class="help">Import multiple vouchers with one debit and one credit entry</p>\ wn._('Download') + '</button>' +
</div>\ '<p class="help">' +
<div style="padding-left: 30px;">\ wn._('Import multiple vouchers with one debit and one credit entry') +
<button class="btn btn-default btn-download-multiple-accounts">Download</button>\ '</p></div>'+
<p class="help">Import multiple vouchers with multiple accounts</p>\ '<div style="padding-left: 30px;">'+
</div>\ '<button class="btn btn-default btn-download-multiple-accounts">' +
<hr>\ wn._('Download') +
<h3>2. Upload</h3><br>\ '</button><p class="help">' +
<div style="padding-left: 30px;">\ wn._('Import multiple vouchers with multiple accounts')+
<p class="help">Upload file in CSV format with UTF-8 encoding</p>\ '</p>'+
<div id="voucher-upload"></div>\ '</div>'+
</div><br>\ '<hr>'+
<div class="working"></div>\ '<h3> 2. ' + wn._('Upload') + '</h3><br>'+
<div class="well messages" style="display: none;"></div>'); '<div style="padding-left: 30px;">'+
'<p class="help">' + wn._('Upload file in CSV format with UTF-8 encoding') +
'</p><div id="voucher-upload"></div>'+
'</div><br>'+
'<div class="working"></div>'+
'<div class="well messages" style="display: none;"></div>');
wn.upload.make({ wn.upload.make({
parent: $(wrapper).find("#voucher-upload"), parent: $(wrapper).find("#voucher-upload"),

View File

@ -5,14 +5,14 @@ wn.query_reports["Accounts Payable"] = {
"filters": [ "filters": [
{ {
"fieldname":"company", "fieldname":"company",
"label": "Company", "label": wn._("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company", "options": "Company",
"default": wn.defaults.get_default("company") "default": wn.defaults.get_default("company")
}, },
{ {
"fieldname":"account", "fieldname":"account",
"label": "Account", "label": wn._("Account"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Account", "options": "Account",
"get_query": function() { "get_query": function() {
@ -30,13 +30,13 @@ wn.query_reports["Accounts Payable"] = {
}, },
{ {
"fieldname":"report_date", "fieldname":"report_date",
"label": "Date", "label": wn._("Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": get_today() "default": get_today()
}, },
{ {
"fieldname":"ageing_based_on", "fieldname":"ageing_based_on",
"label": "Ageing Based On", "label": wn._("Ageing Based On"),
"fieldtype": "Select", "fieldtype": "Select",
"options": 'Posting Date' + NEWLINE + 'Due Date', "options": 'Posting Date' + NEWLINE + 'Due Date',
"default": "Posting Date" "default": "Posting Date"

View File

@ -5,14 +5,14 @@ wn.query_reports["Accounts Receivable"] = {
"filters": [ "filters": [
{ {
"fieldname":"company", "fieldname":"company",
"label": "Company", "label": wn._("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company", "options": "Company",
"default": wn.defaults.get_default("company") "default": wn.defaults.get_default("company")
}, },
{ {
"fieldname":"account", "fieldname":"account",
"label": "Account", "label": wn._("Account"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Account", "options": "Account",
"get_query": function() { "get_query": function() {
@ -30,13 +30,13 @@ wn.query_reports["Accounts Receivable"] = {
}, },
{ {
"fieldname":"report_date", "fieldname":"report_date",
"label": "Date", "label": wn._("Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": get_today() "default": get_today()
}, },
{ {
"fieldname":"ageing_based_on", "fieldname":"ageing_based_on",
"label": "Ageing Based On", "label": wn._("Ageing Based On"),
"fieldtype": "Select", "fieldtype": "Select",
"options": 'Posting Date' + NEWLINE + 'Due Date', "options": 'Posting Date' + NEWLINE + 'Due Date',
"default": "Posting Date" "default": "Posting Date"

View File

@ -5,20 +5,20 @@ wn.query_reports["Bank Clearance Summary"] = {
"filters": [ "filters": [
{ {
"fieldname":"from_date", "fieldname":"from_date",
"label": "From Date", "label": wn._("From Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": wn.defaults.get_user_default("year_start_date"), "default": wn.defaults.get_user_default("year_start_date"),
"width": "80" "width": "80"
}, },
{ {
"fieldname":"to_date", "fieldname":"to_date",
"label": "To Date", "label": wn._("To Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": get_today() "default": get_today()
}, },
{ {
"fieldname":"account", "fieldname":"account",
"label": "Bank Account", "label": wn._("Bank Account"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Account", "options": "Account",
"get_query": function() { "get_query": function() {

View File

@ -5,7 +5,7 @@ wn.query_reports["Bank Reconciliation Statement"] = {
"filters": [ "filters": [
{ {
"fieldname":"account", "fieldname":"account",
"label": "Bank Account", "label": wn._("Bank Account"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Account", "options": "Account",
"get_query": function() { "get_query": function() {
@ -20,7 +20,7 @@ wn.query_reports["Bank Reconciliation Statement"] = {
}, },
{ {
"fieldname":"report_date", "fieldname":"report_date",
"label": "Date", "label": wn._("Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": get_today() "default": get_today()
}, },

View File

@ -5,21 +5,21 @@ wn.query_reports["Budget Variance Report"] = {
"filters": [ "filters": [
{ {
fieldname: "fiscal_year", fieldname: "fiscal_year",
label: "Fiscal Year", label: wn._("Fiscal Year"),
fieldtype: "Link", fieldtype: "Link",
options: "Fiscal Year", options: "Fiscal Year",
default: sys_defaults.fiscal_year default: sys_defaults.fiscal_year
}, },
{ {
fieldname: "period", fieldname: "period",
label: "Period", label: wn._("Period"),
fieldtype: "Select", fieldtype: "Select",
options: "Monthly\nQuarterly\nHalf-Yearly\nYearly", options: "Monthly\nQuarterly\nHalf-Yearly\nYearly",
default: "Monthly" default: "Monthly"
}, },
{ {
fieldname: "company", fieldname: "company",
label: "Company", label: wn._("Company"),
fieldtype: "Link", fieldtype: "Link",
options: "Company", options: "Company",
default: wn.defaults.get_default("company") default: wn.defaults.get_default("company")

View File

@ -5,20 +5,20 @@ wn.query_reports["Gross Profit"] = {
"filters": [ "filters": [
{ {
"fieldname":"company", "fieldname":"company",
"label": "Company", "label": wn._("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company", "options": "Company",
"default": wn.defaults.get_user_default("company") "default": wn.defaults.get_user_default("company")
}, },
{ {
"fieldname":"from_date", "fieldname":"from_date",
"label": "From Date", "label": wn._("From Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": wn.defaults.get_user_default("year_start_date") "default": wn.defaults.get_user_default("year_start_date")
}, },
{ {
"fieldname":"to_date", "fieldname":"to_date",
"label": "To Date", "label": wn._("To Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": wn.defaults.get_user_default("year_end_date") "default": wn.defaults.get_user_default("year_end_date")
}, },

View File

@ -5,26 +5,26 @@ wn.query_reports["Item-wise Purchase Register"] = {
"filters": [ "filters": [
{ {
"fieldname":"from_date", "fieldname":"from_date",
"label": "From Date", "label": wn._("From Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": wn.defaults.get_user_default("year_start_date"), "default": wn.defaults.get_user_default("year_start_date"),
"width": "80" "width": "80"
}, },
{ {
"fieldname":"to_date", "fieldname":"to_date",
"label": "To Date", "label": wn._("To Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": get_today() "default": get_today()
}, },
{ {
"fieldname": "item_code", "fieldname": "item_code",
"label": "Item", "label": wn._("Item"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Item", "options": "Item",
}, },
{ {
"fieldname":"account", "fieldname":"account",
"label": "Account", "label": wn._("Account"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Account", "options": "Account",
"get_query": function() { "get_query": function() {
@ -42,7 +42,7 @@ wn.query_reports["Item-wise Purchase Register"] = {
}, },
{ {
"fieldname":"company", "fieldname":"company",
"label": "Company", "label": wn._("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company", "options": "Company",
"default": wn.defaults.get_default("company") "default": wn.defaults.get_default("company")

View File

@ -5,20 +5,20 @@ wn.query_reports["Item-wise Sales Register"] = wn.query_reports["Sales Register"
"filters": [ "filters": [
{ {
"fieldname":"from_date", "fieldname":"from_date",
"label": "From Date", "label": wn._("From Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": wn.defaults.get_default("year_start_date"), "default": wn.defaults.get_default("year_start_date"),
"width": "80" "width": "80"
}, },
{ {
"fieldname":"to_date", "fieldname":"to_date",
"label": "To Date", "label": wn._("To Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": get_today() "default": get_today()
}, },
{ {
"fieldname":"account", "fieldname":"account",
"label": "Account", "label": wn._("Account"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Account", "options": "Account",
"get_query": function() { "get_query": function() {
@ -36,7 +36,7 @@ wn.query_reports["Item-wise Sales Register"] = wn.query_reports["Sales Register"
}, },
{ {
"fieldname":"company", "fieldname":"company",
"label": "Company", "label": wn._("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company", "options": "Company",
"default": wn.defaults.get_default("company") "default": wn.defaults.get_default("company")

View File

@ -5,20 +5,20 @@ wn.query_reports["Payment Collection With Ageing"] = {
"filters": [ "filters": [
{ {
"fieldname": "from_date", "fieldname": "from_date",
"label": "From Date", "label": wn._("From Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": wn.defaults.get_user_default("year_start_date"), "default": wn.defaults.get_user_default("year_start_date"),
"width": "80" "width": "80"
}, },
{ {
"fieldname":"to_date", "fieldname":"to_date",
"label": "To Date", "label": wn._("To Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": get_today() "default": get_today()
}, },
{ {
"fieldname":"account", "fieldname":"account",
"label": "Customer Account", "label": wn._("Customer Account"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Account", "options": "Account",
"get_query": function() { "get_query": function() {
@ -36,7 +36,7 @@ wn.query_reports["Payment Collection With Ageing"] = {
}, },
{ {
"fieldname":"company", "fieldname":"company",
"label": "Company", "label": wn._("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company", "options": "Company",
"default": wn.defaults.get_default("company") "default": wn.defaults.get_default("company")

View File

@ -5,19 +5,19 @@ wn.query_reports["Payment Made With Ageing"] = {
"filters": [ "filters": [
{ {
fieldname: "from_date", fieldname: "from_date",
label: "From Date", label: wn._("From Date"),
fieldtype: "Date", fieldtype: "Date",
default: wn.defaults.get_user_default("year_start_date"), default: wn.defaults.get_user_default("year_start_date"),
}, },
{ {
fieldname:"to_date", fieldname:"to_date",
label: "To Date", label: wn._("To Date"),
fieldtype: "Date", fieldtype: "Date",
default: get_today() default: get_today()
}, },
{ {
fieldname:"account", fieldname:"account",
label: "Supplier Account", label: wn._("Supplier Account"),
fieldtype: "Link", fieldtype: "Link",
options: "Account", options: "Account",
get_query: function() { get_query: function() {
@ -34,7 +34,7 @@ wn.query_reports["Payment Made With Ageing"] = {
}, },
{ {
fieldname:"company", fieldname:"company",
label: "Company", label: wn._("Company"),
fieldtype: "Link", fieldtype: "Link",
options: "Company", options: "Company",
default: wn.defaults.get_default("company") default: wn.defaults.get_default("company")

View File

@ -5,20 +5,20 @@ wn.query_reports["Purchase Register"] = {
"filters": [ "filters": [
{ {
"fieldname":"from_date", "fieldname":"from_date",
"label": "From Date", "label": wn._("From Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": wn.defaults.get_user_default("year_start_date"), "default": wn.defaults.get_user_default("year_start_date"),
"width": "80" "width": "80"
}, },
{ {
"fieldname":"to_date", "fieldname":"to_date",
"label": "To Date", "label": wn._("To Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": get_today() "default": get_today()
}, },
{ {
"fieldname":"account", "fieldname":"account",
"label": "Account", "label": wn._("Account"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Account", "options": "Account",
"get_query": function() { "get_query": function() {
@ -36,7 +36,7 @@ wn.query_reports["Purchase Register"] = {
}, },
{ {
"fieldname":"company", "fieldname":"company",
"label": "Company", "label": wn._("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company", "options": "Company",
"default": wn.defaults.get_default("company") "default": wn.defaults.get_default("company")

View File

@ -5,20 +5,20 @@ wn.query_reports["Sales Register"] = {
"filters": [ "filters": [
{ {
"fieldname":"from_date", "fieldname":"from_date",
"label": "From Date", "label": wn._("From Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": wn.defaults.get_default("year_start_date"), "default": wn.defaults.get_default("year_start_date"),
"width": "80" "width": "80"
}, },
{ {
"fieldname":"to_date", "fieldname":"to_date",
"label": "To Date", "label": wn._("To Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": get_today() "default": get_today()
}, },
{ {
"fieldname":"account", "fieldname":"account",
"label": "Account", "label": wn._("Account"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Account", "options": "Account",
"get_query": function() { "get_query": function() {
@ -36,7 +36,7 @@ wn.query_reports["Sales Register"] = {
}, },
{ {
"fieldname":"company", "fieldname":"company",
"label": "Company", "label": wn._("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company", "options": "Company",
"default": wn.defaults.get_default("company") "default": wn.defaults.get_default("company")

View File

@ -24,19 +24,19 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
doc.per_billed); doc.per_billed);
cur_frm.add_custom_button('Send SMS', cur_frm.cscript['Send SMS']); cur_frm.add_custom_button(wn._('Send SMS'), cur_frm.cscript['Send SMS']);
if(flt(doc.per_received, 2) < 100) if(flt(doc.per_received, 2) < 100)
cur_frm.add_custom_button('Make Purchase Receipt', this.make_purchase_receipt); cur_frm.add_custom_button(wn._('Make Purchase Receipt'), this.make_purchase_receipt);
if(flt(doc.per_billed, 2) < 100) if(flt(doc.per_billed, 2) < 100)
cur_frm.add_custom_button('Make Invoice', this.make_purchase_invoice); cur_frm.add_custom_button(wn._('Make Invoice'), this.make_purchase_invoice);
if(flt(doc.per_billed, 2) < 100 || doc.per_received < 100) if(flt(doc.per_billed, 2) < 100 || doc.per_received < 100)
cur_frm.add_custom_button('Stop', cur_frm.cscript['Stop Purchase Order']); cur_frm.add_custom_button(wn._('Stop'), cur_frm.cscript['Stop Purchase Order']);
} else if(doc.docstatus===0) { } else if(doc.docstatus===0) {
cur_frm.cscript.add_from_mappers(); cur_frm.cscript.add_from_mappers();
} }
if(doc.docstatus == 1 && doc.status == 'Stopped') if(doc.docstatus == 1 && doc.status == 'Stopped')
cur_frm.add_custom_button('Unstop Purchase Order', cur_frm.add_custom_button(wn._('Unstop Purchase Order'),
cur_frm.cscript['Unstop Purchase Order']); cur_frm.cscript['Unstop Purchase Order']);
}, },
@ -137,7 +137,7 @@ cur_frm.cscript.get_last_purchase_rate = function(doc, cdt, cdn){
cur_frm.cscript['Stop Purchase Order'] = function() { cur_frm.cscript['Stop Purchase Order'] = function() {
var doc = cur_frm.doc; var doc = cur_frm.doc;
var check = confirm("Do you really want to STOP " + doc.name); var check = confirm(wn._("Do you really want to STOP ") + doc.name);
if (check) { if (check) {
return $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) { return $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
@ -148,7 +148,7 @@ cur_frm.cscript['Stop Purchase Order'] = function() {
cur_frm.cscript['Unstop Purchase Order'] = function() { cur_frm.cscript['Unstop Purchase Order'] = function() {
var doc = cur_frm.doc; var doc = cur_frm.doc;
var check = confirm("Do you really want to UNSTOP " + doc.name); var check = confirm(wn._("Do you really want to UNSTOP ") + doc.name);
if (check) { if (check) {
return $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted', 'docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) { return $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted', 'docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {

View File

@ -68,7 +68,7 @@ cur_frm.cscript.make_address = function() {
return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where supplier='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc" return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where supplier='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc"
}, },
as_dict: 1, as_dict: 1,
no_results_message: 'No addresses created', no_results_message: wn._('No addresses created'),
render_row: cur_frm.cscript.render_address_row, render_row: cur_frm.cscript.render_address_row,
}); });
// note: render_address_row is defined in contact_control.js // note: render_address_row is defined in contact_control.js
@ -86,7 +86,7 @@ cur_frm.cscript.make_contact = function() {
return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where supplier='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_contact desc" return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where supplier='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_contact desc"
}, },
as_dict: 1, as_dict: 1,
no_results_message: 'No contacts created', no_results_message: wn._('No contacts created'),
render_row: cur_frm.cscript.render_contact_row, render_row: cur_frm.cscript.render_contact_row,
}); });
// note: render_contact_row is defined in contact_control.js // note: render_contact_row is defined in contact_control.js

View File

@ -16,7 +16,7 @@ erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.ext
this._super(); this._super();
if (this.frm.doc.docstatus === 1) { if (this.frm.doc.docstatus === 1) {
cur_frm.add_custom_button("Make Purchase Order", this.make_purchase_order); cur_frm.add_custom_button(wn._("Make Purchase Order"), this.make_purchase_order);
} }
else if (this.frm.doc.docstatus===0) { else if (this.frm.doc.docstatus===0) {
cur_frm.add_custom_button(wn._('From Material Request'), cur_frm.add_custom_button(wn._('From Material Request'),

View File

@ -58,7 +58,7 @@ wn.module_page["Buying"] = [
"label": wn._("Buying Settings"), "label": wn._("Buying Settings"),
"route": "Form/Buying Settings", "route": "Form/Buying Settings",
"doctype":"Buying Settings", "doctype":"Buying Settings",
"description": "Settings for Buying Module" "description": wn._("Settings for Buying Module")
}, },
{ {
"label": wn._("Purchase Taxes and Charges Master"), "label": wn._("Purchase Taxes and Charges Master"),

View File

@ -4,7 +4,7 @@
wn.pages['purchase-analytics'].onload = function(wrapper) { wn.pages['purchase-analytics'].onload = function(wrapper) {
wn.ui.make_app_page({ wn.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: 'Purchase Analytics', title: wn._('Purchase Analytics'),
single_column: true single_column: true
}); });
@ -18,7 +18,7 @@ wn.pages['purchase-analytics'].onload = function(wrapper) {
erpnext.PurchaseAnalytics = wn.views.TreeGridReport.extend({ erpnext.PurchaseAnalytics = wn.views.TreeGridReport.extend({
init: function(wrapper) { init: function(wrapper) {
this._super({ this._super({
title: "Purchase Analytics", title: wn._("Purchase Analytics"),
page: wrapper, page: wrapper,
parent: $(wrapper).find('.layout-main'), parent: $(wrapper).find('.layout-main'),
appframe: wrapper.appframe, appframe: wrapper.appframe,
@ -31,7 +31,7 @@ erpnext.PurchaseAnalytics = wn.views.TreeGridReport.extend({
this.tree_grids = { this.tree_grids = {
"Supplier Type": { "Supplier Type": {
label: "Supplier Type / Supplier", label: wn._("Supplier Type / Supplier"),
show: true, show: true,
item_key: "supplier", item_key: "supplier",
parent_field: "parent_supplier_type", parent_field: "parent_supplier_type",
@ -44,7 +44,7 @@ erpnext.PurchaseAnalytics = wn.views.TreeGridReport.extend({
} }
}, },
"Supplier": { "Supplier": {
label: "Supplier", label: wn._("Supplier"),
show: false, show: false,
item_key: "supplier", item_key: "supplier",
formatter: function(item) { formatter: function(item) {
@ -74,7 +74,7 @@ erpnext.PurchaseAnalytics = wn.views.TreeGridReport.extend({
this.tree_grid = this.tree_grids[this.tree_type]; this.tree_grid = this.tree_grids[this.tree_type];
var std_columns = [ var std_columns = [
{id: "check", name: "Plot", field: "check", width: 30, {id: "check", name: wn._("Plot"), field: "check", width: 30,
formatter: this.check_formatter}, formatter: this.check_formatter},
{id: "name", name: this.tree_grid.label, field: "name", width: 300, {id: "name", name: this.tree_grid.label, field: "name", width: 300,
formatter: this.tree_formatter}, formatter: this.tree_formatter},
@ -86,23 +86,23 @@ erpnext.PurchaseAnalytics = wn.views.TreeGridReport.extend({
this.columns = std_columns.concat(this.columns); this.columns = std_columns.concat(this.columns);
}, },
filters: [ filters: [
{fieldtype:"Select", label: "Tree Type", options:["Supplier Type", "Supplier", {fieldtype:"Select", label: wn._("Tree Type"), options:["Supplier Type", "Supplier",
"Item Group", "Item"], "Item Group", "Item"],
filter: function(val, item, opts, me) { filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me); return me.apply_zero_filter(val, item, opts, me);
}}, }},
{fieldtype:"Select", label: "Based On", options:["Purchase Invoice", {fieldtype:"Select", label: wn._("Based On"), options:["Purchase Invoice",
"Purchase Order", "Purchase Receipt"]}, "Purchase Order", "Purchase Receipt"]},
{fieldtype:"Select", label: "Value or Qty", options:["Value", "Quantity"]}, {fieldtype:"Select", label: wn._("Value or Qty"), options:["Value", "Quantity"]},
{fieldtype:"Select", label: "Company", link:"Company", {fieldtype:"Select", label: wn._("Company"), link:"Company",
default_value: "Select Company..."}, default_value: "Select Company..."},
{fieldtype:"Date", label: "From Date"}, {fieldtype:"Date", label: wn._("From Date")},
{fieldtype:"Label", label: "To"}, {fieldtype:"Label", label: wn._("To")},
{fieldtype:"Date", label: "To Date"}, {fieldtype:"Date", label: wn._("To Date")},
{fieldtype:"Select", label: "Range", {fieldtype:"Select", label: wn._("Range"),
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
{fieldtype:"Button", label: "Refresh", icon:"icon-refresh icon-white", cssClass:"btn-info"}, {fieldtype:"Button", label: wn._("Refresh"), icon:"icon-refresh icon-white", cssClass:"btn-info"},
{fieldtype:"Button", label: "Reset Filters"} {fieldtype:"Button", label: wn._("Reset Filters")}
], ],
setup_filters: function() { setup_filters: function() {
var me = this; var me = this;
@ -130,18 +130,18 @@ erpnext.PurchaseAnalytics = wn.views.TreeGridReport.extend({
}) })
wn.report_dump.data["Supplier Type"] = [{ wn.report_dump.data["Supplier Type"] = [{
name: "All Supplier Types", name: wn._("All Supplier Types"),
id: "All Supplier Types", id: "All Supplier Types",
}].concat(wn.report_dump.data["Supplier Type"]); }].concat(wn.report_dump.data["Supplier Type"]);
wn.report_dump.data["Supplier"].push({ wn.report_dump.data["Supplier"].push({
name: "Not Set", name: wn._("Not Set"),
parent_supplier_type: "All Supplier Types", parent_supplier_type: "All Supplier Types",
id: "Not Set", id: "Not Set",
}); });
wn.report_dump.data["Item"].push({ wn.report_dump.data["Item"].push({
name: "Not Set", name: wn._("Not Set"),
parent_item_group: "All Item Groups", parent_item_group: "All Item Groups",
id: "Not Set", id: "Not Set",
}); });

View File

@ -4,7 +4,7 @@
wn.pages['activity'].onload = function(wrapper) { wn.pages['activity'].onload = function(wrapper) {
wn.ui.make_app_page({ wn.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: "Activity", title: wn._("Activity"),
single_column: true single_column: true
}) })
wrapper.appframe.add_module_icon("Activity"); wrapper.appframe.add_module_icon("Activity");
@ -21,7 +21,7 @@ wn.pages['activity'].onload = function(wrapper) {
// Build Report Button // Build Report Button
if(wn.boot.profile.can_get_report.indexOf("Feed")!=-1) { if(wn.boot.profile.can_get_report.indexOf("Feed")!=-1) {
wrapper.appframe.add_button('Build Report', function() { wrapper.appframe.add_button(wn._('Build Report'), function() {
wn.set_route('Report', "Feed"); wn.set_route('Report', "Feed");
}, 'icon-th') }, 'icon-th')
} }

View File

@ -4,7 +4,7 @@
wn.pages['latest-updates'].onload = function(wrapper) { wn.pages['latest-updates'].onload = function(wrapper) {
wn.ui.make_app_page({ wn.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: 'Latest Updates', title: wn._('Latest Updates'),
single_column: true single_column: true
}); });
@ -16,9 +16,9 @@ wn.pages['latest-updates'].onload = function(wrapper) {
method:"home.page.latest_updates.latest_updates.get", method:"home.page.latest_updates.latest_updates.get",
callback: function(r) { callback: function(r) {
parent.empty(); parent.empty();
$("<p class='help'>Report issues at\ $("<p class='help'>"+wn._("Report issues at")+
<a href='https://github.com/webnotes/erpnext/issues'>GitHub Issues</a></p>\ "<a href='https://github.com/webnotes/erpnext/issues'>"+wn._("GitHub Issues")+"</a></p>\
<hr><h3>Commit Log</h3>") <hr><h3>"+wn._("Commit Log")+"</h3>")
.appendTo(parent); .appendTo(parent);
var $tbody = $('<table class="table table-bordered"><tbody></tbody></table>') var $tbody = $('<table class="table table-bordered"><tbody></tbody></table>')

View File

@ -45,7 +45,7 @@ cur_frm.cscript.score = function(doc,cdt,cdn){
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if (d.score){ if (d.score){
if (flt(d.score) > 5) { if (flt(d.score) > 5) {
msgprint("Score must be less than or equal to 5"); msgprint(wn._("Score must be less than or equal to 5"));
d.score = 0; d.score = 0;
refresh_field('score', d.name, 'appraisal_details'); refresh_field('score', d.name, 'appraisal_details');
} }

View File

@ -21,7 +21,7 @@ erpnext.hr.EmployeeController = wn.ui.form.Controller.extend({
var me = this; var me = this;
erpnext.hide_naming_series(); erpnext.hide_naming_series();
if(!this.frm.doc.__islocal) { if(!this.frm.doc.__islocal) {
cur_frm.add_custom_button('Make Salary Structure', function() { cur_frm.add_custom_button(wn._('Make Salary Structure'), function() {
me.make_salary_structure(this); }); me.make_salary_structure(this); });
} }
}, },

View File

@ -93,28 +93,28 @@ cur_frm.cscript.refresh = function(doc,cdt,cdn){
cur_frm.savesubmit(); cur_frm.savesubmit();
if(doc.docstatus==1 && wn.model.can_create("Journal Voucher")) if(doc.docstatus==1 && wn.model.can_create("Journal Voucher"))
cur_frm.add_custom_button("Make Bank Voucher", cur_frm.cscript.make_bank_voucher); cur_frm.add_custom_button(wn._("Make Bank Voucher"), cur_frm.cscript.make_bank_voucher);
} }
} }
cur_frm.cscript.set_help = function(doc) { cur_frm.cscript.set_help = function(doc) {
cur_frm.set_intro(""); cur_frm.set_intro("");
if(doc.__islocal && !in_list(user_roles, "HR User")) { if(doc.__islocal && !in_list(user_roles, "HR User")) {
cur_frm.set_intro("Fill the form and save it") cur_frm.set_intro(wn._("Fill the form and save it"))
} else { } else {
if(doc.docstatus==0 && doc.approval_status=="Draft") { if(doc.docstatus==0 && doc.approval_status=="Draft") {
if(user==doc.exp_approver) { if(user==doc.exp_approver) {
cur_frm.set_intro("You are the Expense Approver for this record. \ cur_frm.set_intro(wn._("You are the Expense Approver for this record. \
Please Update the 'Status' and Save"); Please Update the 'Status' and Save"));
} else { } else {
cur_frm.set_intro("Expense Claim is pending approval. \ cur_frm.set_intro(wn._("Expense Claim is pending approval. \
Only the Expense Approver can update status."); Only the Expense Approver can update status."));
} }
} else { } else {
if(doc.approval_status=="Approved") { if(doc.approval_status=="Approved") {
cur_frm.set_intro("Expense Claim has been approved."); cur_frm.set_intro(wn._("Expense Claim has been approved."));
} else if(doc.approval_status=="Rejected") { } else if(doc.approval_status=="Rejected") {
cur_frm.set_intro("Expense Claim has been rejected."); cur_frm.set_intro(wn._("Expense Claim has been rejected."));
} }
} }
} }

View File

@ -7,8 +7,8 @@ cur_frm.cscript = {
onload: function(doc, dt, dn) { onload: function(doc, dt, dn) {
if(in_list(user_roles,'System Manager')) { if(in_list(user_roles,'System Manager')) {
cur_frm.footer.help_area.innerHTML = '<hr>\ cur_frm.footer.help_area.innerHTML = '<hr>\
<p><a href="#Form/Jobs Email Settings">Jobs Email Settings</a><br>\ <p><a href="#Form/Jobs Email Settings">'+wn._("Jobs Email Settings")+'</a><br>\
<span class="help">Automatically extract Job Applicants from a mail box e.g. "jobs@example.com"</span></p>'; <span class="help">'+wn._('Automatically extract Job Applicants from a mail box ')+'e.g. "jobs@example.com"</span></p>';
} }
}, },
refresh: function(doc) { refresh: function(doc) {

View File

@ -31,14 +31,14 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
} }
cur_frm.set_intro(""); cur_frm.set_intro("");
if(doc.__islocal && !in_list(user_roles, "HR User")) { if(doc.__islocal && !in_list(user_roles, "HR User")) {
cur_frm.set_intro("Fill the form and save it") cur_frm.set_intro(wn._("Fill the form and save it"))
} else { } else {
if(doc.docstatus==0 && doc.status=="Open") { if(doc.docstatus==0 && doc.status=="Open") {
if(user==doc.leave_approver) { if(user==doc.leave_approver) {
cur_frm.set_intro("You are the Leave Approver for this record. Please Update the 'Status' and Save"); cur_frm.set_intro(wn._("You are the Leave Approver for this record. Please Update the 'Status' and Save"));
cur_frm.toggle_enable("status", true); cur_frm.toggle_enable("status", true);
} else { } else {
cur_frm.set_intro("This Leave Application is pending approval. Only the Leave Apporver can update status.") cur_frm.set_intro(wn._("This Leave Application is pending approval. Only the Leave Apporver can update status."))
cur_frm.toggle_enable("status", false); cur_frm.toggle_enable("status", false);
if(!doc.__islocal) { if(!doc.__islocal) {
if(cur_frm.frm_head.appframe.buttons.Submit) if(cur_frm.frm_head.appframe.buttons.Submit)
@ -47,12 +47,12 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
} }
} else { } else {
if(doc.status=="Approved") { if(doc.status=="Approved") {
cur_frm.set_intro("Leave application has been approved."); cur_frm.set_intro(wn._("Leave application has been approved."));
if(cur_frm.doc.docstatus==0) { if(cur_frm.doc.docstatus==0) {
cur_frm.set_intro("Please submit to update Leave Balance."); cur_frm.set_intro(wn._("Please submit to update Leave Balance."));
} }
} else if(doc.status=="Rejected") { } else if(doc.status=="Rejected") {
cur_frm.set_intro("Leave application has been rejected."); cur_frm.set_intro(wn._("Leave application has been rejected."));
} }
} }
} }
@ -86,7 +86,7 @@ cur_frm.cscript.from_date = function(doc, dt, dn) {
cur_frm.cscript.to_date = function(doc, dt, dn) { cur_frm.cscript.to_date = function(doc, dt, dn) {
if(cint(doc.half_day) == 1 && cstr(doc.from_date) && doc.from_date != doc.to_date){ if(cint(doc.half_day) == 1 && cstr(doc.from_date) && doc.from_date != doc.to_date){
msgprint("To Date should be same as From Date for Half Day leave"); msgprint(wn._("To Date should be same as From Date for Half Day leave"));
set_multiple(dt,dn,{to_date:doc.from_date}); set_multiple(dt,dn,{to_date:doc.from_date});
} }
cur_frm.cscript.calculate_total_days(doc, dt, dn); cur_frm.cscript.calculate_total_days(doc, dt, dn);

View File

@ -15,7 +15,7 @@ cur_frm.cscript.to_date = function(doc, cdt, cdn) {
function(r, rt) { function(r, rt) {
var doc = locals[cdt][cdn]; var doc = locals[cdt][cdn];
if (r.message) { if (r.message) {
alert("To date cannot be before from date"); alert(wn._("To date cannot be before from date"));
doc.to_date = ''; doc.to_date = '';
refresh_field('to_date'); refresh_field('to_date');
} }

View File

@ -5,7 +5,7 @@ var display_activity_log = function(msg) {
if(!pscript.ss_html) if(!pscript.ss_html)
pscript.ss_html = $a(cur_frm.fields_dict['activity_log'].wrapper,'div'); pscript.ss_html = $a(cur_frm.fields_dict['activity_log'].wrapper,'div');
pscript.ss_html.innerHTML = pscript.ss_html.innerHTML =
'<div class="panel"><div class="panel-heading">Activity Log:</div>'+msg+'</div>'; '<div class="panel"><div class="panel-heading">'+wn._("Activity Log:")+'</div>'+msg+'</div>';
} }
//Create salary slip //Create salary slip
@ -23,7 +23,7 @@ cur_frm.cscript.create_salary_slip = function(doc, cdt, cdn) {
//Submit salary slip //Submit salary slip
//----------------------- //-----------------------
cur_frm.cscript.submit_salary_slip = function(doc, cdt, cdn) { cur_frm.cscript.submit_salary_slip = function(doc, cdt, cdn) {
var check = confirm("Do you really want to Submit all Salary Slip for month : " + doc.month+" and fiscal year : "+doc.fiscal_year); var check = confirm(wn._("Do you really want to Submit all Salary Slip for month : ") + doc.month+ wn._(" and fiscal year : ")+doc.fiscal_year);
if(check){ if(check){
var callback = function(r, rt){ var callback = function(r, rt){
if (r.message) if (r.message)
@ -49,7 +49,7 @@ cur_frm.cscript.make_jv = function(doc, dt, dn) {
var jv = wn.model.make_new_doc_and_get_name('Journal Voucher'); var jv = wn.model.make_new_doc_and_get_name('Journal Voucher');
jv = locals['Journal Voucher'][jv]; jv = locals['Journal Voucher'][jv];
jv.voucher_type = 'Bank Voucher'; jv.voucher_type = 'Bank Voucher';
jv.user_remark = 'Payment of salary for the month: ' + doc.month + 'and fiscal year: ' + doc.fiscal_year; jv.user_remark = wn._('Payment of salary for the month: ') + doc.month + wn._('and fiscal year: ') + doc.fiscal_year;
jv.fiscal_year = doc.fiscal_year; jv.fiscal_year = doc.fiscal_year;
jv.company = doc.company; jv.company = doc.company;
jv.posting_date = dateutil.obj_to_str(new Date()); jv.posting_date = dateutil.obj_to_str(new Date());

View File

@ -12,7 +12,7 @@ cur_frm.cscript.onload = function(doc, dt, dn){
cur_frm.cscript.refresh = function(doc, dt, dn){ cur_frm.cscript.refresh = function(doc, dt, dn){
if((!doc.__islocal) && (doc.is_active == 'Yes')){ if((!doc.__islocal) && (doc.is_active == 'Yes')){
cur_frm.add_custom_button('Make Salary Slip', cur_frm.cscript['Make Salary Slip']); cur_frm.add_custom_button(wn._('Make Salary Slip'), cur_frm.cscript['Make Salary Slip']);
} }
cur_frm.toggle_enable('employee', doc.__islocal); cur_frm.toggle_enable('employee', doc.__islocal);

View File

@ -17,7 +17,7 @@ erpnext.hr.AttendanceControlPanel = wn.ui.form.Controller.extend({
get_template:function() { get_template:function() {
if(!this.frm.doc.att_fr_date || !this.frm.doc.att_to_date) { if(!this.frm.doc.att_fr_date || !this.frm.doc.att_to_date) {
msgprint("Attendance From Date and Attendance To Date is mandatory"); msgprint(wn._("Attendance From Date and Attendance To Date is mandatory"));
return; return;
} }
window.location.href = repl(wn.request.url + window.location.href = repl(wn.request.url +
@ -56,10 +56,10 @@ erpnext.hr.AttendanceControlPanel = wn.ui.form.Controller.extend({
return v; return v;
}); });
r.messages = ["<h4 style='color:red'>Import Failed!</h4>"] r.messages = ["<h4 style='color:red'>"+wn._("Import Failed!")+"</h4>"]
.concat(r.messages) .concat(r.messages)
} else { } else {
r.messages = ["<h4 style='color:green'>Import Successful!</h4>"]. r.messages = ["<h4 style='color:green'>"+wn._("Import Successful!")+"</h4>"].
concat(r.message.messages) concat(r.message.messages)
} }

View File

@ -5,7 +5,7 @@ wn.query_reports["Employee Birthday"] = {
"filters": [ "filters": [
{ {
"fieldname":"month", "fieldname":"month",
"label": "Month", "label": wn._("Month"),
"fieldtype": "Select", "fieldtype": "Select",
"options": "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\nOct\nNov\nDec", "options": "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\nOct\nNov\nDec",
"default": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "default": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
@ -13,7 +13,7 @@ wn.query_reports["Employee Birthday"] = {
}, },
{ {
"fieldname":"company", "fieldname":"company",
"label": "Company", "label": wn._("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company", "options": "Company",
"default": wn.defaults.get_user_default("company") "default": wn.defaults.get_user_default("company")

View File

@ -5,14 +5,14 @@ wn.query_reports["Employee Leave Balance"] = {
"filters": [ "filters": [
{ {
"fieldname":"fiscal_year", "fieldname":"fiscal_year",
"label": "Fiscal Year", "label": wn._("Fiscal Year"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Fiscal Year", "options": "Fiscal Year",
"default": wn.defaults.get_user_default("fiscal_year") "default": wn.defaults.get_user_default("fiscal_year")
}, },
{ {
"fieldname":"company", "fieldname":"company",
"label": "Company", "label": wn._("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company", "options": "Company",
"default": wn.defaults.get_user_default("company") "default": wn.defaults.get_user_default("company")

View File

@ -5,7 +5,7 @@ wn.query_reports["Monthly Attendance Sheet"] = {
"filters": [ "filters": [
{ {
"fieldname":"month", "fieldname":"month",
"label": "Month", "label": wn._("Month"),
"fieldtype": "Select", "fieldtype": "Select",
"options": "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\nOct\nNov\nDec", "options": "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\nOct\nNov\nDec",
"default": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "default": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
@ -13,20 +13,20 @@ wn.query_reports["Monthly Attendance Sheet"] = {
}, },
{ {
"fieldname":"fiscal_year", "fieldname":"fiscal_year",
"label": "Fiscal Year", "label": wn._("Fiscal Year"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Fiscal Year", "options": "Fiscal Year",
"default": sys_defaults.fiscal_year, "default": sys_defaults.fiscal_year,
}, },
{ {
"fieldname":"employee", "fieldname":"employee",
"label": "Employee", "label": wn._("Employee"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Employee" "options": "Employee"
}, },
{ {
"fieldname":"company", "fieldname":"company",
"label": "Company", "label": wn._("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company", "options": "Company",
"default": wn.defaults.get_default("company") "default": wn.defaults.get_default("company")

View File

@ -5,7 +5,7 @@ wn.query_reports["Monthly Salary Register"] = {
"filters": [ "filters": [
{ {
"fieldname":"month", "fieldname":"month",
"label": "Month", "label": wn._("Month"),
"fieldtype": "Select", "fieldtype": "Select",
"options": "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\nOct\nNov\nDec", "options": "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\nOct\nNov\nDec",
"default": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "default": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
@ -13,20 +13,20 @@ wn.query_reports["Monthly Salary Register"] = {
}, },
{ {
"fieldname":"fiscal_year", "fieldname":"fiscal_year",
"label": "Fiscal Year", "label": wn._("Fiscal Year"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Fiscal Year", "options": "Fiscal Year",
"default": sys_defaults.fiscal_year, "default": sys_defaults.fiscal_year,
}, },
{ {
"fieldname":"employee", "fieldname":"employee",
"label": "Employee", "label": wn._("Employee"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Employee" "options": "Employee"
}, },
{ {
"fieldname":"company", "fieldname":"company",
"label": "Company", "label": wn._("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company", "options": "Company",
"default": wn.defaults.get_default("company") "default": wn.defaults.get_default("company")

View File

@ -6,7 +6,7 @@ cur_frm.cscript.refresh = function(doc,dt,dn){
cur_frm.toggle_enable("item", doc.__islocal); cur_frm.toggle_enable("item", doc.__islocal);
if (!doc.__islocal && doc.docstatus<2) { if (!doc.__islocal && doc.docstatus<2) {
cur_frm.add_custom_button("Update Cost", cur_frm.cscript.update_cost); cur_frm.add_custom_button(wn._("Update Cost"), cur_frm.cscript.update_cost);
} }
cur_frm.cscript.with_operations(doc); cur_frm.cscript.with_operations(doc);
@ -123,7 +123,7 @@ cur_frm.cscript.qty = function(doc, cdt, cdn) {
cur_frm.cscript.rate = function(doc, cdt, cdn) { cur_frm.cscript.rate = function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if (d.bom_no) { if (d.bom_no) {
msgprint("You can not change rate if BOM mentioned agianst any item"); msgprint(wn._("You can not change rate if BOM mentioned agianst any item"));
get_bom_material_detail(doc, cdt, cdn); get_bom_material_detail(doc, cdt, cdn);
} else { } else {
calculate_rm_cost(doc); calculate_rm_cost(doc);

View File

@ -13,7 +13,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
cfn_set_fields(doc, dt, dn); cfn_set_fields(doc, dt, dn);
if(doc.docstatus===0 && !doc.__islocal) { if(doc.docstatus===0 && !doc.__islocal) {
cur_frm.set_intro("Submit this Production Order for further processing."); cur_frm.set_intro(wn._("Submit this Production Order for further processing."));
} else if(doc.docstatus===1) { } else if(doc.docstatus===1) {
var percent = flt(doc.produced_qty) / flt(doc.qty) * 100; var percent = flt(doc.produced_qty) / flt(doc.qty) * 100;
cur_frm.dashboard.add_progress(cint(percent) + "% " + wn._("Complete"), percent); cur_frm.dashboard.add_progress(cint(percent) + "% " + wn._("Complete"), percent);
@ -27,13 +27,13 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
var cfn_set_fields = function(doc, dt, dn) { var cfn_set_fields = function(doc, dt, dn) {
if (doc.docstatus == 1) { if (doc.docstatus == 1) {
if (doc.status != 'Stopped' && doc.status != 'Completed') if (doc.status != 'Stopped' && doc.status != 'Completed')
cur_frm.add_custom_button('Stop!', cur_frm.cscript['Stop Production Order']); cur_frm.add_custom_button(wn._('Stop!'), cur_frm.cscript['Stop Production Order']);
else if (doc.status == 'Stopped') else if (doc.status == 'Stopped')
cur_frm.add_custom_button('Unstop', cur_frm.cscript['Unstop Production Order']); cur_frm.add_custom_button(wn._('Unstop'), cur_frm.cscript['Unstop Production Order']);
if (doc.status == 'Submitted' || doc.status == 'Material Transferred' || doc.status == 'In Process'){ if (doc.status == 'Submitted' || doc.status == 'Material Transferred' || doc.status == 'In Process'){
cur_frm.add_custom_button('Transfer Raw Materials', cur_frm.cscript['Transfer Raw Materials']); cur_frm.add_custom_button(wn._('Transfer Raw Materials'), cur_frm.cscript['Transfer Raw Materials']);
cur_frm.add_custom_button('Update Finished Goods', cur_frm.cscript['Update Finished Goods']); cur_frm.add_custom_button(wn._('Update Finished Goods'), cur_frm.cscript['Update Finished Goods']);
} }
} }
} }
@ -47,7 +47,7 @@ cur_frm.cscript.production_item = function(doc) {
cur_frm.cscript['Stop Production Order'] = function() { cur_frm.cscript['Stop Production Order'] = function() {
var doc = cur_frm.doc; var doc = cur_frm.doc;
var check = confirm("Do you really want to stop production order: " + doc.name); var check = confirm(wn._("Do you really want to stop production order: " + doc.name));
if (check) { if (check) {
return $c_obj(make_doclist(doc.doctype, doc.name), 'stop_unstop', 'Stopped', function(r, rt) {cur_frm.refresh();}); return $c_obj(make_doclist(doc.doctype, doc.name), 'stop_unstop', 'Stopped', function(r, rt) {cur_frm.refresh();});
} }
@ -55,7 +55,7 @@ cur_frm.cscript['Stop Production Order'] = function() {
cur_frm.cscript['Unstop Production Order'] = function() { cur_frm.cscript['Unstop Production Order'] = function() {
var doc = cur_frm.doc; var doc = cur_frm.doc;
var check = confirm("Do really want to unstop production order: " + doc.name); var check = confirm(wn._("Do really want to unstop production order: " + doc.name));
if (check) if (check)
return $c_obj(make_doclist(doc.doctype, doc.name), 'stop_unstop', 'Unstopped', function(r, rt) {cur_frm.refresh();}); return $c_obj(make_doclist(doc.doctype, doc.name), 'stop_unstop', 'Unstopped', function(r, rt) {cur_frm.refresh();});
} }
@ -105,5 +105,5 @@ cur_frm.set_query("bom_no", function(doc) {
query:"controllers.queries.bom", query:"controllers.queries.bom",
filters: {item: cstr(doc.production_item)} filters: {item: cstr(doc.production_item)}
} }
} else msgprint(" Please enter Production Item first"); } else msgprint(wn._("Please enter Production Item first"));
}); });

View File

@ -44,7 +44,7 @@ cur_frm.fields_dict['pp_details'].grid.get_field('bom_no').get_query = function(
query:"controllers.queries.bom", query:"controllers.queries.bom",
filters:{'item': cstr(d.item_code)} filters:{'item': cstr(d.item_code)}
} }
} else msgprint(" Please enter Item first"); } else msgprint(wn._("Please enter Item first"));
} }
cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {

View File

@ -13,11 +13,11 @@ $(document).ready(function() {
$(".progress").remove(); $(".progress").remove();
if(r.exc) { if(r.exc) {
if(r.exc.indexOf("WebsitePriceListMissingError")!==-1) { if(r.exc.indexOf("WebsitePriceListMissingError")!==-1) {
erpnext.cart.show_error("Oops!", "Price List not configured."); erpnext.cart.show_error("Oops!", wn._("Price List not configured."));
} else if(r["403"]) { } else if(r["403"]) {
erpnext.cart.show_error("Hey!", "You need to be logged in to view your cart."); erpnext.cart.show_error("Hey!", wn._("You need to be logged in to view your cart."));
} else { } else {
erpnext.cart.show_error("Oops!", "Something went wrong."); erpnext.cart.show_error("Oops!", wn._("Something went wrong."));
} }
} else { } else {
erpnext.cart.set_cart_count(); erpnext.cart.set_cart_count();
@ -78,7 +78,7 @@ $.extend(erpnext.cart, {
var no_items = $.map(doclist, function(d) { return d.item_code || null;}).length===0; var no_items = $.map(doclist, function(d) { return d.item_code || null;}).length===0;
if(no_items) { if(no_items) {
erpnext.cart.show_error("Empty :-(", "Go ahead and add something to your cart."); erpnext.cart.show_error("Empty :-(", wn._("Go ahead and add something to your cart."));
$("#cart-addresses").toggle(false); $("#cart-addresses").toggle(false);
return; return;
} }
@ -117,7 +117,7 @@ $.extend(erpnext.cart, {
}); });
if(!(addresses && addresses.length)) { if(!(addresses && addresses.length)) {
$cart_shipping_address.html('<div class="well">Hey! Go ahead and add an address</div>'); $cart_shipping_address.html('<div class="well">'+wn._("Hey! Go ahead and add an address")+'</div>');
} else { } else {
erpnext.cart.render_address($cart_shipping_address, addresses, doclist[0].shipping_address_name); erpnext.cart.render_address($cart_shipping_address, addresses, doclist[0].shipping_address_name);
erpnext.cart.render_address($cart_billing_address, addresses, doclist[0].customer_address); erpnext.cart.render_address($cart_billing_address, addresses, doclist[0].customer_address);
@ -283,7 +283,7 @@ $.extend(erpnext.cart, {
$("#cart-error") $("#cart-error")
.empty() .empty()
.html(msg || "Something went wrong!") .html(msg || wn._("Something went wrong!"))
.toggle(true); .toggle(true);
} else { } else {
window.location.href = "order?name=" + encodeURIComponent(r.message); window.location.href = "order?name=" + encodeURIComponent(r.message);

View File

@ -4,11 +4,11 @@
// show tasks // show tasks
cur_frm.cscript.refresh = function(doc) { cur_frm.cscript.refresh = function(doc) {
if(!doc.__islocal) { if(!doc.__islocal) {
cur_frm.add_custom_button("Gantt Chart", function() { cur_frm.add_custom_button(wn._("Gantt Chart"), function() {
wn.route_options = {"project": doc.name} wn.route_options = {"project": doc.name}
wn.set_route("Gantt", "Task"); wn.set_route("Gantt", "Task");
}, "icon-tasks"); }, "icon-tasks");
cur_frm.add_custom_button("Tasks", function() { cur_frm.add_custom_button(wn._("Tasks"), function() {
wn.route_options = {"project": doc.name} wn.route_options = {"project": doc.name}
wn.set_route("List", "Task"); wn.set_route("List", "Task");
}, "icon-list"); }, "icon-list");

View File

@ -6,7 +6,7 @@ wn.views.calendar["Task"] = {
"start": "exp_start_date", "start": "exp_start_date",
"end": "exp_end_date", "end": "exp_end_date",
"id": "name", "id": "name",
"title": "subject", "title": wn._("subject"),
"allDay": "allDay" "allDay": "allDay"
}, },
gantt: true, gantt: true,
@ -15,7 +15,7 @@ wn.views.calendar["Task"] = {
"fieldtype": "Link", "fieldtype": "Link",
"fieldname": "project", "fieldname": "project",
"options": "Project", "options": "Project",
"label": "Project" "label": wn._("Project")
} }
], ],
get_events_method: "projects.doctype.task.task.get_events" get_events_method: "projects.doctype.task.task.get_events"

View File

@ -6,7 +6,7 @@ wn.views.calendar["Time Log"] = {
"start": "from_time", "start": "from_time",
"end": "to_time", "end": "to_time",
"id": "name", "id": "name",
"title": "title", "title": w._("title"),
"allDay": "allDay" "allDay": "allDay"
}, },
get_events_method: "projects.doctype.time_log.time_log.get_events" get_events_method: "projects.doctype.time_log.time_log.get_events"

View File

@ -25,7 +25,7 @@ $.extend(cur_frm.cscript, {
}[doc.status]); }[doc.status]);
if(doc.status=="Submitted") { if(doc.status=="Submitted") {
cur_frm.add_custom_button("Make Sales Invoice", function() { cur_frm.cscript.make_invoice() }, cur_frm.add_custom_button(wn._("Make Sales Invoice"), function() { cur_frm.cscript.make_invoice() },
"icon-file-alt"); "icon-file-alt");
} }
}, },

View File

@ -5,13 +5,13 @@ wn.query_reports["Daily Time Log Summary"] = {
"filters": [ "filters": [
{ {
"fieldname":"from_date", "fieldname":"from_date",
"label": "From Date", "label": wn._("From Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": wn.datetime.get_today() "default": wn.datetime.get_today()
}, },
{ {
"fieldname":"to_date", "fieldname":"to_date",
"label": "To Date", "label": wn._("To Date"),
"fieldtype": "Date", "fieldtype": "Date",
"default": wn.datetime.get_today() "default": wn.datetime.get_today()
}, },

View File

@ -36,39 +36,39 @@ erpnext.AccountTreeGrid = wn.views.TreeGridReport.extend({
}, },
setup_columns: function() { setup_columns: function() {
this.columns = [ this.columns = [
{id: "name", name: "Account", field: "name", width: 300, cssClass: "cell-title", {id: "name", name: wn._("Account"), field: "name", width: 300, cssClass: "cell-title",
formatter: this.tree_formatter}, formatter: this.tree_formatter},
{id: "opening_debit", name: "Opening (Dr)", field: "opening_debit", width: 100, {id: "opening_debit", name: wn._("Opening (Dr)"), field: "opening_debit", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "opening_credit", name: "Opening (Cr)", field: "opening_credit", width: 100, {id: "opening_credit", name: wn._("Opening (Cr)"), field: "opening_credit", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "debit", name: "Debit", field: "debit", width: 100, {id: "debit", name: wn._("Debit"), field: "debit", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "credit", name: "Credit", field: "credit", width: 100, {id: "credit", name: wn._("Credit"), field: "credit", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "closing_debit", name: "Closing (Dr)", field: "closing_debit", width: 100, {id: "closing_debit", name: wn._("Closing (Dr)"), field: "closing_debit", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "closing_credit", name: "Closing (Cr)", field: "closing_credit", width: 100, {id: "closing_credit", name: wn._("Closing (Cr)"), field: "closing_credit", width: 100,
formatter: this.currency_formatter} formatter: this.currency_formatter}
]; ];
}, },
filters: [ filters: [
{fieldtype: "Select", label: "Company", link:"Company", default_value: "Select Company...", {fieldtype: "Select", label: wn._("Company"), link:"Company", default_value: "Select Company...",
filter: function(val, item, opts, me) { filter: function(val, item, opts, me) {
if (item.company == val || val == opts.default_value) { if (item.company == val || val == opts.default_value) {
return me.apply_zero_filter(val, item, opts, me); return me.apply_zero_filter(val, item, opts, me);
} }
return false; return false;
}}, }},
{fieldtype: "Select", label: "Fiscal Year", link:"Fiscal Year", {fieldtype: "Select", label: wn._("Fiscal Year"), link:"Fiscal Year",
default_value: "Select Fiscal Year..."}, default_value: "Select Fiscal Year..."},
{fieldtype: "Date", label: "From Date"}, {fieldtype: "Date", label: wn._("From Date")},
{fieldtype: "Label", label: "To"}, {fieldtype: "Label", label: wn._("To")},
{fieldtype: "Date", label: "To Date"}, {fieldtype: "Date", label: wn._("To Date")},
{fieldtype: "Button", label: "Refresh", icon:"icon-refresh icon-white", {fieldtype: "Button", label: wn._("Refresh"), icon:"icon-refresh icon-white",
cssClass:"btn-info"}, cssClass:"btn-info"},
{fieldtype: "Button", label: "Reset Filters"}, {fieldtype: "Button", label: wn._("Reset Filters")},
], ],
setup_filters: function() { setup_filters: function() {
this._super(); this._super();
@ -193,7 +193,7 @@ erpnext.AccountTreeGrid = wn.views.TreeGridReport.extend({
set_fiscal_year: function() { set_fiscal_year: function() {
if (this.opening_date > this.closing_date) { if (this.opening_date > this.closing_date) {
msgprint("Opening Date should be before Closing Date"); msgprint(wn._("Opening Date should be before Closing Date"));
return; return;
} }
@ -207,7 +207,7 @@ erpnext.AccountTreeGrid = wn.views.TreeGridReport.extend({
}); });
if (!this.fiscal_year) { if (!this.fiscal_year) {
msgprint("Opening Date and Closing Date should be within same Fiscal Year"); msgprint(wn._("Opening Date and Closing Date should be within same Fiscal Year"));
return; return;
} }
}, },

View File

@ -24,14 +24,14 @@ $(document).bind('toolbar_setup', function() {
wn.provide('wn.ui.misc'); wn.provide('wn.ui.misc');
wn.ui.misc.about = function() { wn.ui.misc.about = function() {
if(!wn.ui.misc.about_dialog) { if(!wn.ui.misc.about_dialog) {
var d = new wn.ui.Dialog({title:'About ERPNext'}) var d = new wn.ui.Dialog({title: wn._('About ERPNext')})
$(d.body).html(repl("<div>\ $(d.body).html(repl("<div>\
<p>ERPNext is an open-source web based ERP made by Web Notes Technologies Pvt Ltd.\ <p>"+wn._("ERPNext is an open-source web based ERP made by Web Notes Technologies Pvt Ltd.\
to provide an integrated tool to manage most processes in a small organization.\ to provide an integrated tool to manage most processes in a small organization.\
For more information about Web Notes, or to buy hosting servies, go to \ For more information about Web Notes, or to buy hosting servies, go to ")+
<a href='https://erpnext.com'>https://erpnext.com</a>.</p>\ "<a href='https://erpnext.com'>https://erpnext.com</a>.</p>\
<p>To report an issue, go to <a href='https://github.com/webnotes/erpnext/issues'>GitHub Issues</a></p>\ <p>"+wn._("To report an issue, go to ")+"<a href='https://github.com/webnotes/erpnext/issues'>GitHub Issues</a></p>\
<hr>\ <hr>\
<p><a href='http://www.gnu.org/copyleft/gpl.html'>License: GNU General Public License Version 3</a></p>\ <p><a href='http://www.gnu.org/copyleft/gpl.html'>License: GNU General Public License Version 3</a></p>\
</div>", wn.app)); </div>", wn.app));

View File

@ -7,7 +7,7 @@ erpnext.stock.StockController = wn.ui.form.Controller.extend({
show_stock_ledger: function() { show_stock_ledger: function() {
var me = this; var me = this;
if(this.frm.doc.docstatus===1) { if(this.frm.doc.docstatus===1) {
this.frm.add_custom_button("Stock Ledger", function() { this.frm.add_custom_button(wn._("Stock Ledger"), function() {
wn.route_options = { wn.route_options = {
voucher_no: me.frm.doc.name, voucher_no: me.frm.doc.name,
from_date: me.frm.doc.posting_date, from_date: me.frm.doc.posting_date,
@ -22,7 +22,7 @@ erpnext.stock.StockController = wn.ui.form.Controller.extend({
show_general_ledger: function() { show_general_ledger: function() {
var me = this; var me = this;
if(this.frm.doc.docstatus===1 && cint(wn.defaults.get_default("auto_accounting_for_stock"))) { if(this.frm.doc.docstatus===1 && cint(wn.defaults.get_default("auto_accounting_for_stock"))) {
cur_frm.add_custom_button('Accounting Ledger', function() { cur_frm.add_custom_button(wn._('Accounting Ledger'), function() {
wn.route_options = { wn.route_options = {
"voucher_no": me.frm.doc.name, "voucher_no": me.frm.doc.name,
"from_date": me.frm.doc.posting_date, "from_date": me.frm.doc.posting_date,

View File

@ -198,7 +198,7 @@ $(document).bind('form_refresh', function() {
} else if(cur_frm.fields_dict[fort]) { } else if(cur_frm.fields_dict[fort]) {
cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort], false); cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort], false);
} else { } else {
msgprint('Grid "'+fort+'" does not exists'); msgprint(wn._('Grid "')+fort+wn._('" does not exists'));
} }
} }
} }

View File

@ -5,35 +5,35 @@ var get_filters = function(){
return [ return [
{ {
"fieldname":"period", "fieldname":"period",
"label": "Period", "label": wn._("Period"),
"fieldtype": "Select", "fieldtype": "Select",
"options": ["Monthly", "Quarterly", "Half-Yearly", "Yearly"].join("\n"), "options": ["Monthly", "Quarterly", "Half-Yearly", "Yearly"].join("\n"),
"default": "Monthly" "default": "Monthly"
}, },
{ {
"fieldname":"based_on", "fieldname":"based_on",
"label": "Based On", "label": wn._("Based On"),
"fieldtype": "Select", "fieldtype": "Select",
"options": ["Item", "Item Group", "Supplier", "Supplier Type", "Project"].join("\n"), "options": ["Item", "Item Group", "Supplier", "Supplier Type", "Project"].join("\n"),
"default": "Item" "default": "Item"
}, },
{ {
"fieldname":"group_by", "fieldname":"group_by",
"label": "Group By", "label": wn._("Group By"),
"fieldtype": "Select", "fieldtype": "Select",
"options": ["Item", "Supplier"].join("\n"), "options": ["Item", "Supplier"].join("\n"),
"default": "" "default": ""
}, },
{ {
"fieldname":"fiscal_year", "fieldname":"fiscal_year",
"label": "Fiscal Year", "label": wn._("Fiscal Year"),
"fieldtype": "Link", "fieldtype": "Link",
"options":'Fiscal Year', "options":'Fiscal Year',
"default": sys_defaults.fiscal_year "default": sys_defaults.fiscal_year
}, },
{ {
"fieldname":"company", "fieldname":"company",
"label": "Company", "label": wn._("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company", "options": "Company",
"default": wn.defaults.get_default("company") "default": wn.defaults.get_default("company")

View File

@ -5,35 +5,35 @@ var get_filters = function(){
return[ return[
{ {
"fieldname":"period", "fieldname":"period",
"label": "Period", "label": wn._("Period"),
"fieldtype": "Select", "fieldtype": "Select",
"options": ["Monthly", "Quarterly", "Half-Yearly", "Yearly"].join("\n"), "options": ["Monthly", "Quarterly", "Half-Yearly", "Yearly"].join("\n"),
"default": "Monthly" "default": "Monthly"
}, },
{ {
"fieldname":"based_on", "fieldname":"based_on",
"label": "Based On", "label": wn._("Based On"),
"fieldtype": "Select", "fieldtype": "Select",
"options": ["Item", "Item Group", "Customer", "Customer Group", "Territory", "Project"].join("\n"), "options": ["Item", "Item Group", "Customer", "Customer Group", "Territory", "Project"].join("\n"),
"default": "Item" "default": "Item"
}, },
{ {
"fieldname":"group_by", "fieldname":"group_by",
"label": "Group By", "label": wn._("Group By"),
"fieldtype": "Select", "fieldtype": "Select",
"options": ["Item", "Customer"].join("\n"), "options": ["Item", "Customer"].join("\n"),
"default": "" "default": ""
}, },
{ {
"fieldname":"fiscal_year", "fieldname":"fiscal_year",
"label": "Fiscal Year", "label": wn._("Fiscal Year"),
"fieldtype": "Link", "fieldtype": "Link",
"options":'Fiscal Year', "options":'Fiscal Year',
"default": sys_defaults.fiscal_year "default": sys_defaults.fiscal_year
}, },
{ {
"fieldname":"company", "fieldname":"company",
"label": "Company", "label": wn._("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company", "options": "Company",
"default": wn.defaults.get_default("company") "default": wn.defaults.get_default("company")

View File

@ -6,7 +6,7 @@ var current_module;
wn.provide('erpnext.startup'); wn.provide('erpnext.startup');
erpnext.startup.start = function() { erpnext.startup.start = function() {
console.log('Starting up...'); console.log(wn._('Starting up...'));
$('#startup_div').html('Starting up...').toggle(true); $('#startup_div').html('Starting up...').toggle(true);
erpnext.toolbar.setup(); erpnext.toolbar.setup();
@ -20,16 +20,16 @@ erpnext.startup.show_expiry_banner = function() {
var today = dateutil.str_to_obj(wn.boot.server_date); var today = dateutil.str_to_obj(wn.boot.server_date);
var expires_on = dateutil.str_to_obj(wn.boot.expires_on); var expires_on = dateutil.str_to_obj(wn.boot.expires_on);
var diff = dateutil.get_diff(expires_on, today); var diff = dateutil.get_diff(expires_on, today);
var payment_link = "<a href=\"https://erpnext.com/modes-of-payment.html\" target=\"_blank\">\ var payment_link = "<a href=\"https://erpnext.com/modes-of-payment.html\" target=\"_blank\">"+
Click here to buy subscription.</a>"; wn._("Click here to buy subscription.")+"</a>";
var msg = ""; var msg = "";
if (0 <= diff && diff <= 10) { if (0 <= diff && diff <= 10) {
var expiry_string = diff==0 ? "today" : repl("in %(diff)s day(s)", { diff: diff }); var expiry_string = diff==0 ? "today" : repl("in %(diff)s day(s)", { diff: diff });
msg = repl('Your ERPNext subscription will <b>expire %(expiry_string)s</b>. %(payment_link)s', msg = repl(wn._('Your ERPNext subscription will')+'<b>expire %(expiry_string)s</b>. %(payment_link)s',
{ expiry_string: expiry_string, payment_link: payment_link }); { expiry_string: expiry_string, payment_link: payment_link });
} else if (diff < 0) { } else if (diff < 0) {
msg = repl('This ERPNext subscription <b>has expired</b>. %(payment_link)s', {payment_link: payment_link}); msg = repl(wn._('This ERPNext subscription')+'<b>'+wn._('has expired')+'</b>. %(payment_link)s'), {payment_link: payment_link});
} }
if(msg) wn.ui.toolbar.show_banner(msg); if(msg) wn.ui.toolbar.show_banner(msg);

View File

@ -6,7 +6,7 @@ wn.require("app/js/stock_grid_report.js");
erpnext.StockAnalytics = erpnext.StockGridReport.extend({ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
init: function(wrapper, opts) { init: function(wrapper, opts) {
var args = { var args = {
title: "Stock Analytics", title: wn._("Stock Analytics"),
page: wrapper, page: wrapper,
parent: $(wrapper).find('.layout-main'), parent: $(wrapper).find('.layout-main'),
appframe: wrapper.appframe, appframe: wrapper.appframe,
@ -36,13 +36,13 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
}, },
setup_columns: function() { setup_columns: function() {
var std_columns = [ var std_columns = [
{id: "check", name: "Plot", field: "check", width: 30, {id: "check", name: wn._("Plot"), field: "check", width: 30,
formatter: this.check_formatter}, formatter: this.check_formatter},
{id: "name", name: "Item", field: "name", width: 300, {id: "name", name: wn._("Item"), field: "name", width: 300,
formatter: this.tree_formatter}, formatter: this.tree_formatter},
{id: "brand", name: "Brand", field: "brand", width: 100}, {id: "brand", name: wn._("Brand"), field: "brand", width: 100},
{id: "stock_uom", name: "UOM", field: "stock_uom", width: 100}, {id: "stock_uom", name: wn._("UOM"), field: "stock_uom", width: 100},
{id: "opening", name: "Opening", field: "opening", hidden: true, {id: "opening", name: wn._("Opening"), field: "opening", hidden: true,
formatter: this.currency_formatter} formatter: this.currency_formatter}
]; ];
@ -50,23 +50,23 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
this.columns = std_columns.concat(this.columns); this.columns = std_columns.concat(this.columns);
}, },
filters: [ filters: [
{fieldtype:"Select", label: "Value or Qty", options:["Value", "Quantity"], {fieldtype:"Select", label: wn._("Value or Qty"), options:["Value", "Quantity"],
filter: function(val, item, opts, me) { filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me); return me.apply_zero_filter(val, item, opts, me);
}}, }},
{fieldtype:"Select", label: "Brand", link:"Brand", {fieldtype:"Select", label: wn._("Brand"), link:"Brand",
default_value: "Select Brand...", filter: function(val, item, opts) { default_value: "Select Brand...", filter: function(val, item, opts) {
return val == opts.default_value || item.brand == val || item._show; return val == opts.default_value || item.brand == val || item._show;
}, link_formatter: {filter_input: "brand"}}, }, link_formatter: {filter_input: "brand"}},
{fieldtype:"Select", label: "Warehouse", link:"Warehouse", {fieldtype:"Select", label: wn._("Warehouse"), link:"Warehouse",
default_value: "Select Warehouse..."}, default_value: "Select Warehouse..."},
{fieldtype:"Date", label: "From Date"}, {fieldtype:"Date", label: wn._("From Date")},
{fieldtype:"Label", label: "To"}, {fieldtype:"Label", label: wn._("To")},
{fieldtype:"Date", label: "To Date"}, {fieldtype:"Date", label: wn._("To Date")},
{fieldtype:"Select", label: "Range", {fieldtype:"Select", label: wn._("Range"),
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
{fieldtype:"Button", label: "Refresh", icon:"icon-refresh icon-white", cssClass:"btn-info"}, {fieldtype:"Button", label: wn._("Refresh"), icon:"icon-refresh icon-white", cssClass:"btn-info"},
{fieldtype:"Button", label: "Reset Filters"} {fieldtype:"Button", label: wn._("Reset Filters")}
], ],
setup_filters: function() { setup_filters: function() {
var me = this; var me = this;

View File

@ -326,7 +326,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
validate_on_previous_row: function(tax) { validate_on_previous_row: function(tax) {
// validate if a valid row id is mentioned in case of // validate if a valid row id is mentioned in case of
// On Previous Row Amount and On Previous Row Total // On Previous Row Amount and On Previous Row Total
if((["On Previous Row Amount", "On Previous Row Total"].indexOf(tax.charge_type) != -1) && if(([wn._("On Previous Row Amount"), wn._("On Previous Row Total")].indexOf(tax.charge_type) != -1) &&
(!tax.row_id || cint(tax.row_id) >= tax.idx)) { (!tax.row_id || cint(tax.row_id) >= tax.idx)) {
var msg = repl(wn._("Row") + " # %(idx)s [%(doctype)s]: " + var msg = repl(wn._("Row") + " # %(idx)s [%(doctype)s]: " +
wn._("Please specify a valid") + " %(row_id_label)s", { wn._("Please specify a valid") + " %(row_id_label)s", {

View File

@ -41,19 +41,19 @@ $.extend(erpnext, {
if(!grid_row.fields_dict.serial_no || if(!grid_row.fields_dict.serial_no ||
grid_row.fields_dict.serial_no.get_status()!=="Write") return; grid_row.fields_dict.serial_no.get_status()!=="Write") return;
var $btn = $('<button class="btn btn-sm btn-default">Add Serial No</button>') var $btn = $('<button class="btn btn-sm btn-default">'+wn._("Add Serial No")+'</button>')
.appendTo($("<div>") .appendTo($("<div>")
.css({"margin-bottom": "10px", "margin-top": "-10px"}) .css({"margin-bottom": "10px", "margin-top": "-10px"})
.appendTo(grid_row.fields_dict.serial_no.$wrapper)); .appendTo(grid_row.fields_dict.serial_no.$wrapper));
$btn.on("click", function() { $btn.on("click", function() {
var d = new wn.ui.Dialog({ var d = new wn.ui.Dialog({
title: "Add Serial No", title: wn._("Add Serial No"),
fields: [ fields: [
{ {
"fieldtype": "Link", "fieldtype": "Link",
"options": "Serial No", "options": "Serial No",
"label": "Serial No", "label": wn._("Serial No"),
"get_query": { "get_query": {
item_code: grid_row.doc.item_code, item_code: grid_row.doc.item_code,
warehouse: grid_row.doc.warehouse warehouse: grid_row.doc.warehouse
@ -61,7 +61,7 @@ $.extend(erpnext, {
}, },
{ {
"fieldtype": "Button", "fieldtype": "Button",
"label": "Add" "label": wn._("Add")
} }
] ]
}); });

View File

@ -77,7 +77,7 @@ cur_frm.cscript.make_address = function() {
return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where customer='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc" return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where customer='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc"
}, },
as_dict: 1, as_dict: 1,
no_results_message: 'No addresses created', no_results_message: wn._('No addresses created'),
render_row: cur_frm.cscript.render_address_row, render_row: cur_frm.cscript.render_address_row,
}); });
// note: render_address_row is defined in contact_control.js // note: render_address_row is defined in contact_control.js

View File

@ -24,8 +24,8 @@ erpnext.LeadController = wn.ui.form.Controller.extend({
if(in_list(user_roles,'System Manager')) { if(in_list(user_roles,'System Manager')) {
cur_frm.footer.help_area.innerHTML = '<hr>\ cur_frm.footer.help_area.innerHTML = '<hr>\
<p><a href="#Form/Sales Email Settings">Sales Email Settings</a><br>\ <p><a href="#Form/Sales Email Settings">'+wn._('Sales Email Settings')+'</a><br>\
<span class="help">Automatically extract Leads from a mail box e.g. "sales@example.com"</span></p>'; <span class="help">'+wn._('Automatically extract Leads from a mail box e.g.')+' "sales@example.com"</span></p>';
} }
}, },
@ -36,9 +36,9 @@ erpnext.LeadController = wn.ui.form.Controller.extend({
this.frm.__is_customer = this.frm.__is_customer || this.frm.doc.__is_customer; this.frm.__is_customer = this.frm.__is_customer || this.frm.doc.__is_customer;
if(!this.frm.doc.__islocal && !this.frm.__is_customer) { if(!this.frm.doc.__islocal && !this.frm.__is_customer) {
this.frm.add_custom_button("Create Customer", this.create_customer); this.frm.add_custom_button(wn._("Create Customer"), this.create_customer);
this.frm.add_custom_button("Create Opportunity", this.create_opportunity); this.frm.add_custom_button(wn._("Create Opportunity"), this.create_opportunity);
this.frm.add_custom_button("Send SMS", this.frm.cscript.send_sms); this.frm.add_custom_button(wn._("Send SMS"), this.frm.cscript.send_sms);
} }
cur_frm.communication_view = new wn.views.CommunicationList({ cur_frm.communication_view = new wn.views.CommunicationList({
@ -68,7 +68,7 @@ erpnext.LeadController = wn.ui.form.Controller.extend({
order by is_primary_address, is_shipping_address desc' order by is_primary_address, is_shipping_address desc'
}, },
as_dict: 1, as_dict: 1,
no_results_message: 'No addresses created', no_results_message: wn._('No addresses created'),
render_row: this.render_address_row, render_row: this.render_address_row,
}); });
// note: render_address_row is defined in contact_control.js // note: render_address_row is defined in contact_control.js

View File

@ -103,12 +103,19 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn){
erpnext.hide_naming_series(); erpnext.hide_naming_series();
cur_frm.clear_custom_buttons(); cur_frm.clear_custom_buttons();
<<<<<<< HEAD
if(doc.docstatus === 1 && doc.status!=="Opportunity Lost") {
cur_frm.add_custom_button( wn._('Create Quotation'), cur_frm.cscript.create_quotation);
cur_frm.add_custom_button(wn._('Opportunity Lost'), cur_frm.cscript['Declare Opportunity Lost']);
cur_frm.add_custom_button(wn._('Send SMS'), cur_frm.cscript.send_sms);
=======
if(doc.docstatus === 1 && doc.status!=="Lost") { if(doc.docstatus === 1 && doc.status!=="Lost") {
cur_frm.add_custom_button('Create Quotation', cur_frm.cscript.create_quotation); cur_frm.add_custom_button('Create Quotation', cur_frm.cscript.create_quotation);
if(doc.status!=="Quotation") { if(doc.status!=="Quotation") {
cur_frm.add_custom_button('Opportunity Lost', cur_frm.cscript['Declare Opportunity Lost']); cur_frm.add_custom_button('Opportunity Lost', cur_frm.cscript['Declare Opportunity Lost']);
} }
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms); cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
>>>>>>> f146e8b7f52a3e46e335c0fefd92c347717b370b
} }
cur_frm.toggle_display("contact_info", doc.customer || doc.lead); cur_frm.toggle_display("contact_info", doc.customer || doc.lead);
@ -174,11 +181,11 @@ cur_frm.cscript.lead = function(doc, cdt, cdn) {
cur_frm.cscript['Declare Opportunity Lost'] = function(){ cur_frm.cscript['Declare Opportunity Lost'] = function(){
var dialog = new wn.ui.Dialog({ var dialog = new wn.ui.Dialog({
title: "Set as Lost", title: wn._("Set as Lost"),
fields: [ fields: [
{"fieldtype": "Text", "label": "Reason for losing", "fieldname": "reason", {"fieldtype": "Text", "label": wn._("Reason for losing"), "fieldname": "reason",
"reqd": 1 }, "reqd": 1 },
{"fieldtype": "Button", "label": "Update", "fieldname": "update"}, {"fieldtype": "Button", "label": wn._("Update"), "fieldname": "update"},
] ]
}); });
@ -191,7 +198,7 @@ cur_frm.cscript['Declare Opportunity Lost'] = function(){
args: args.reason, args: args.reason,
callback: function(r) { callback: function(r) {
if(r.exc) { if(r.exc) {
msgprint("There were errors."); msgprint(wn._("There were errors."));
return; return;
} }
dialog.hide(); dialog.hide();

View File

@ -25,12 +25,19 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
refresh: function(doc, dt, dn) { refresh: function(doc, dt, dn) {
this._super(doc, dt, dn); this._super(doc, dt, dn);
<<<<<<< HEAD
if(doc.docstatus == 1 && doc.status!=='Order Lost') {
cur_frm.add_custom_button(wn._('Make Sales Order'), cur_frm.cscript['Make Sales Order']);
if(doc.status!=="Order Confirmed") {
cur_frm.add_custom_button(wn._('Set as Lost'), cur_frm.cscript['Declare Order Lost']);
=======
if(doc.docstatus == 1 && doc.status!=='Lost') { if(doc.docstatus == 1 && doc.status!=='Lost') {
cur_frm.add_custom_button('Make Sales Order', cur_frm.cscript['Make Sales Order']); cur_frm.add_custom_button('Make Sales Order', cur_frm.cscript['Make Sales Order']);
if(doc.status!=="Ordered") { if(doc.status!=="Ordered") {
cur_frm.add_custom_button('Set as Lost', cur_frm.cscript['Declare Order Lost']); cur_frm.add_custom_button('Set as Lost', cur_frm.cscript['Declare Order Lost']);
>>>>>>> f146e8b7f52a3e46e335c0fefd92c347717b370b
} }
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms); cur_frm.add_custom_button(wn._('Send SMS'), cur_frm.cscript.send_sms);
} }
if (this.frm.doc.docstatus===0) { if (this.frm.doc.docstatus===0) {
@ -122,9 +129,9 @@ cur_frm.cscript['Declare Order Lost'] = function(){
var dialog = new wn.ui.Dialog({ var dialog = new wn.ui.Dialog({
title: "Set as Lost", title: "Set as Lost",
fields: [ fields: [
{"fieldtype": "Text", "label": "Reason for losing", "fieldname": "reason", {"fieldtype": "Text", "label": wn._("Reason for losing"), "fieldname": "reason",
"reqd": 1 }, "reqd": 1 },
{"fieldtype": "Button", "label": "Update", "fieldname": "update"}, {"fieldtype": "Button", "label": wn._("Update"), "fieldname": "update"},
] ]
}); });
@ -137,7 +144,7 @@ cur_frm.cscript['Declare Order Lost'] = function(){
args: args.reason, args: args.reason,
callback: function(r) { callback: function(r) {
if(r.exc) { if(r.exc) {
msgprint("There were errors."); msgprint(wn._("There were errors."));
return; return;
} }
dialog.hide(); dialog.hide();

View File

@ -4,7 +4,7 @@
cur_frm.cscript.refresh = function(doc, cdt, cdn) { cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.toggle_enable('new_item_code', doc.__islocal); cur_frm.toggle_enable('new_item_code', doc.__islocal);
if(!doc.__islocal) { if(!doc.__islocal) {
cur_frm.add_custom_button("Check for Duplicates", function() { cur_frm.add_custom_button(wn._("Check for Duplicates"), function() {
return cur_frm.call_server('check_duplicate', 1) return cur_frm.call_server('check_duplicate', 1)
}, 'icon-search') }, 'icon-search')
} }
@ -15,8 +15,8 @@ cur_frm.fields_dict.new_item_code.get_query = function() {
query: "selling.doctype.sales_bom.sales_bom.get_new_item_code" query: "selling.doctype.sales_bom.sales_bom.get_new_item_code"
} }
} }
cur_frm.fields_dict.new_item_code.query_description = 'Select Item where "Is Stock Item" is "No" \ cur_frm.fields_dict.new_item_code.query_description = wn._('Select Item where "Is Stock Item" is "No"')+
and "Is Sales Item" is "Yes" and there is no other Sales BOM'; wn._('and "Is Sales Item" is "Yes" and there is no other Sales BOM');
cur_frm.cscript.item_code = function(doc, dt, dn) { cur_frm.cscript.item_code = function(doc, dt, dn) {
var d = locals[dt][dn]; var d = locals[dt][dn];

View File

@ -4,7 +4,7 @@
wn.pages['sales-analytics'].onload = function(wrapper) { wn.pages['sales-analytics'].onload = function(wrapper) {
wn.ui.make_app_page({ wn.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: 'Sales Analytics', title: wn._('Sales Analytics'),
single_column: true single_column: true
}); });
new erpnext.SalesAnalytics(wrapper); new erpnext.SalesAnalytics(wrapper);
@ -17,7 +17,7 @@ wn.pages['sales-analytics'].onload = function(wrapper) {
erpnext.SalesAnalytics = wn.views.TreeGridReport.extend({ erpnext.SalesAnalytics = wn.views.TreeGridReport.extend({
init: function(wrapper) { init: function(wrapper) {
this._super({ this._super({
title: "Sales Analytics", title: wn._("Sales Analytics"),
page: wrapper, page: wrapper,
parent: $(wrapper).find('.layout-main'), parent: $(wrapper).find('.layout-main'),
appframe: wrapper.appframe, appframe: wrapper.appframe,
@ -30,14 +30,14 @@ erpnext.SalesAnalytics = wn.views.TreeGridReport.extend({
this.tree_grids = { this.tree_grids = {
"Customer Group": { "Customer Group": {
label: "Customer Group / Customer", label: wn._("Customer Group / Customer"),
show: true, show: true,
item_key: "customer", item_key: "customer",
parent_field: "parent_customer_group", parent_field: "parent_customer_group",
formatter: function(item) { return item.name; } formatter: function(item) { return item.name; }
}, },
"Customer": { "Customer": {
label: "Customer", label: wn._("Customer"),
show: false, show: false,
item_key: "customer", item_key: "customer",
formatter: function(item) { formatter: function(item) {
@ -45,7 +45,7 @@ erpnext.SalesAnalytics = wn.views.TreeGridReport.extend({
} }
}, },
"Item Group": { "Item Group": {
label: "Item", label: wn._("Item"),
show: true, show: true,
parent_field: "parent_item_group", parent_field: "parent_item_group",
item_key: "item_code", item_key: "item_code",
@ -54,7 +54,7 @@ erpnext.SalesAnalytics = wn.views.TreeGridReport.extend({
} }
}, },
"Item": { "Item": {
label: "Item", label: wn._("Item"),
show: false, show: false,
item_key: "item_code", item_key: "item_code",
formatter: function(item) { formatter: function(item) {
@ -62,7 +62,7 @@ erpnext.SalesAnalytics = wn.views.TreeGridReport.extend({
} }
}, },
"Territory": { "Territory": {
label: "Territory / Customer", label: wn._("Territory / Customer"),
show: true, show: true,
item_key: "customer", item_key: "customer",
parent_field: "parent_territory", parent_field: "parent_territory",
@ -88,23 +88,23 @@ erpnext.SalesAnalytics = wn.views.TreeGridReport.extend({
this.columns = std_columns.concat(this.columns); this.columns = std_columns.concat(this.columns);
}, },
filters: [ filters: [
{fieldtype:"Select", label: "Tree Type", options:["Customer Group", "Customer", {fieldtype:"Select", label: wn._("Tree Type"), options:["Customer Group", "Customer",
"Item Group", "Item", "Territory"], "Item Group", "Item", "Territory"],
filter: function(val, item, opts, me) { filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me); return me.apply_zero_filter(val, item, opts, me);
}}, }},
{fieldtype:"Select", label: "Based On", options:["Sales Invoice", {fieldtype:"Select", label: wn._("Based On"), options:["Sales Invoice",
"Sales Order", "Delivery Note"]}, "Sales Order", "Delivery Note"]},
{fieldtype:"Select", label: "Value or Qty", options:["Value", "Quantity"]}, {fieldtype:"Select", label: wn._("Value or Qty"), options:["Value", "Quantity"]},
{fieldtype:"Select", label: "Company", link:"Company", {fieldtype:"Select", label: wn._("Company"), link:"Company",
default_value: "Select Company..."}, default_value: "Select Company..."},
{fieldtype:"Date", label: "From Date"}, {fieldtype:"Date", label: wn._("From Date")},
{fieldtype:"Label", label: "To"}, {fieldtype:"Label", label: wn._("To")},
{fieldtype:"Date", label: "To Date"}, {fieldtype:"Date", label: wn._("To Date")},
{fieldtype:"Select", label: "Range", {fieldtype:"Select", label: wn._("Range"),
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
{fieldtype:"Button", label: "Refresh", icon:"icon-refresh icon-white", cssClass:"btn-info"}, {fieldtype:"Button", label: wn._("Refresh"), icon:"icon-refresh icon-white", cssClass:"btn-info"},
{fieldtype:"Button", label: "Reset Filters"} {fieldtype:"Button", label: wn._("Reset Filters")}
], ],
setup_filters: function() { setup_filters: function() {
var me = this; var me = this;

View File

@ -15,8 +15,9 @@ pscript['onload_Sales Browser'] = function(wrapper){
$(wrapper) $(wrapper)
.find(".layout-side-section") .find(".layout-side-section")
.html('<div class="text-muted">Click on a link to get options to expand \ .html('<div class="text-muted">'+
get options Add / Edit / Delete.</div>') wn._('Click on a link to get options to expand get options ') +
wn._('Add') + ' / ' + wn._('Edit') + ' / '+ wn._('Delete') + '.</div>')
wrapper.make_tree = function() { wrapper.make_tree = function() {
var ctype = wn.get_route()[1] || 'Territory'; var ctype = wn.get_route()[1] || 'Territory';
@ -87,22 +88,22 @@ erpnext.SalesChart = Class.extend({
var node_links = []; var node_links = [];
if (wn.model.can_read(this.ctype)) { if (wn.model.can_read(this.ctype)) {
node_links.push('<a onclick="erpnext.sales_chart.open();">Edit</a>'); node_links.push('<a onclick="erpnext.sales_chart.open();">'+wn._('Edit')+'</a>');
} }
if(data.expandable) { if(data.expandable) {
if (wn.boot.profile.can_create.indexOf(this.ctype) !== -1 || if (wn.boot.profile.can_create.indexOf(this.ctype) !== -1 ||
wn.boot.profile.in_create.indexOf(this.ctype) !== -1) { wn.boot.profile.in_create.indexOf(this.ctype) !== -1) {
node_links.push('<a onclick="erpnext.sales_chart.new_node();">Add Child</a>'); node_links.push('<a onclick="erpnext.sales_chart.new_node();">' + wn._('Add Child') + '</a>');
} }
} }
if (wn.model.can_write(this.ctype)) { if (wn.model.can_write(this.ctype)) {
node_links.push('<a onclick="erpnext.sales_chart.rename()">Rename</a>'); node_links.push('<a onclick="erpnext.sales_chart.rename()">' + wn._('Rename') + '</a>');
}; };
if (wn.model.can_delete(this.ctype)) { if (wn.model.can_delete(this.ctype)) {
node_links.push('<a onclick="erpnext.sales_chart.delete()">Delete</a>'); node_links.push('<a onclick="erpnext.sales_chart.delete()">' + wn._('Delete') + '</a>');
}; };
link.toolbar.append(node_links.join(" | ")); link.toolbar.append(node_links.join(" | "));
@ -114,18 +115,18 @@ erpnext.SalesChart = Class.extend({
{fieldtype:'Data', fieldname: 'name_field', {fieldtype:'Data', fieldname: 'name_field',
label:'New ' + me.ctype + ' Name', reqd:true}, label:'New ' + me.ctype + ' Name', reqd:true},
{fieldtype:'Select', fieldname:'is_group', label:'Group Node', options:'No\nYes', {fieldtype:'Select', fieldname:'is_group', label:'Group Node', options:'No\nYes',
description: "Further nodes can be only created under 'Group' type nodes"}, description: wn._("Further nodes can be only created under 'Group' type nodes")},
{fieldtype:'Button', fieldname:'create_new', label:'Create New' } {fieldtype:'Button', fieldname:'create_new', label:'Create New' }
] ]
if(me.ctype == "Sales Person") { if(me.ctype == "Sales Person") {
fields.splice(-1, 0, {fieldtype:'Link', fieldname:'employee', label:'Employee', fields.splice(-1, 0, {fieldtype:'Link', fieldname:'employee', label:'Employee',
options:'Employee', description: "Please enter Employee Id of this sales parson"}); options:'Employee', description: wn._("Please enter Employee Id of this sales parson")});
} }
// the dialog // the dialog
var d = new wn.ui.Dialog({ var d = new wn.ui.Dialog({
title:'New ' + me.ctype, title: wn._('New ') + wn._(me.ctype),
fields: fields fields: fields
}) })

View File

@ -63,7 +63,7 @@ wn.module_page["Selling"] = [
"label": wn._("Selling Settings"), "label": wn._("Selling Settings"),
"route": "Form/Selling Settings", "route": "Form/Selling Settings",
"doctype":"Selling Settings", "doctype":"Selling Settings",
"description": "Settings for Selling Module" "description": wn._("Settings for Selling Module")
}, },
{ {
"route":"Form/Shopping Cart Settings", "route":"Form/Shopping Cart Settings",

View File

@ -5,7 +5,7 @@ wn.query_reports["Customers Not Buying Since Long Time"] = {
"filters": [ "filters": [
{ {
"fieldname":"days_since_last_order", "fieldname":"days_since_last_order",
"label": "Days Since Last Order", "label": wn._("Days Since Last Order"),
"fieldtype": "Int", "fieldtype": "Int",
"default": 60 "default": 60
} }

View File

@ -5,21 +5,21 @@ wn.query_reports["Sales Person Target Variance Item Group-Wise"] = {
"filters": [ "filters": [
{ {
fieldname: "fiscal_year", fieldname: "fiscal_year",
label: "Fiscal Year", label: wn._("Fiscal Year"),
fieldtype: "Link", fieldtype: "Link",
options: "Fiscal Year", options: "Fiscal Year",
default: sys_defaults.fiscal_year default: sys_defaults.fiscal_year
}, },
{ {
fieldname: "period", fieldname: "period",
label: "Period", label: wn._("Period"),
fieldtype: "Select", fieldtype: "Select",
options: "Monthly\nQuarterly\nHalf-Yearly\nYearly", options: "Monthly\nQuarterly\nHalf-Yearly\nYearly",
default: "Monthly" default: "Monthly"
}, },
{ {
fieldname: "target_on", fieldname: "target_on",
label: "Target On", label: wn._("Target On"),
fieldtype: "Select", fieldtype: "Select",
options: "Quantity\nAmount", options: "Quantity\nAmount",
default: "Quantity" default: "Quantity"

View File

@ -5,57 +5,57 @@ wn.query_reports["Sales Person-wise Transaction Summary"] = {
"filters": [ "filters": [
{ {
fieldname: "sales_person", fieldname: "sales_person",
label: "Sales Person", label: wn._("Sales Person"),
fieldtype: "Link", fieldtype: "Link",
options: "Sales Person" options: "Sales Person"
}, },
{ {
fieldname: "doc_type", fieldname: "doc_type",
label: "Document Type", label: wn._("Document Type"),
fieldtype: "Select", fieldtype: "Select",
options: "Sales Order\nDelivery Note\nSales Invoice", options: "Sales Order\nDelivery Note\nSales Invoice",
default: "Sales Order" default: "Sales Order"
}, },
{ {
fieldname: "from_date", fieldname: "from_date",
label: "From Date", label: wn._("From Date"),
fieldtype: "Date", fieldtype: "Date",
default: wn.defaults.get_user_default("year_start_date"), default: wn.defaults.get_user_default("year_start_date"),
}, },
{ {
fieldname:"to_date", fieldname:"to_date",
label: "To Date", label: wn._("To Date"),
fieldtype: "Date", fieldtype: "Date",
default: get_today() default: get_today()
}, },
{ {
fieldname:"company", fieldname:"company",
label: "Company", label: wn._("Company"),
fieldtype: "Link", fieldtype: "Link",
options: "Company", options: "Company",
default: wn.defaults.get_default("company") default: wn.defaults.get_default("company")
}, },
{ {
fieldname:"item_group", fieldname:"item_group",
label: "Item Group", label: wn._("Item Group"),
fieldtype: "Link", fieldtype: "Link",
options: "Item Group", options: "Item Group",
}, },
{ {
fieldname:"brand", fieldname:"brand",
label: "Brand", label: wn._("Brand"),
fieldtype: "Link", fieldtype: "Link",
options: "Brand", options: "Brand",
}, },
{ {
fieldname:"customer", fieldname:"customer",
label: "Customer", label: wn._("Customer"),
fieldtype: "Link", fieldtype: "Link",
options: "Customer", options: "Customer",
}, },
{ {
fieldname:"territory", fieldname:"territory",
label: "Territory", label: wn._("Territory"),
fieldtype: "Link", fieldtype: "Link",
options: "Territory", options: "Territory",
}, },

View File

@ -5,21 +5,21 @@ wn.query_reports["Territory Target Variance Item Group-Wise"] = {
"filters": [ "filters": [
{ {
fieldname: "fiscal_year", fieldname: "fiscal_year",
label: "Fiscal Year", label: wn._("Fiscal Year"),
fieldtype: "Link", fieldtype: "Link",
options: "Fiscal Year", options: "Fiscal Year",
default: sys_defaults.fiscal_year default: sys_defaults.fiscal_year
}, },
{ {
fieldname: "period", fieldname: "period",
label: "Period", label: wn._("Period"),
fieldtype: "Select", fieldtype: "Select",
options: "Monthly\nQuarterly\nHalf-Yearly\nYearly", options: "Monthly\nQuarterly\nHalf-Yearly\nYearly",
default: "Monthly" default: "Monthly"
}, },
{ {
fieldname: "target_on", fieldname: "target_on",
label: "Target On", label: wn._("Target On"),
fieldtype: "Select", fieldtype: "Select",
options: "Quantity\nAmount", options: "Quantity\nAmount",
default: "Quantity" default: "Quantity"

View File

@ -71,7 +71,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
this.frm.set_query("batch_no", this.fname, function(doc, cdt, cdn) { this.frm.set_query("batch_no", this.fname, function(doc, cdt, cdn) {
var item = wn.model.get_doc(cdt, cdn); var item = wn.model.get_doc(cdt, cdn);
if(!item.item_code) { if(!item.item_code) {
wn.throw("Please enter Item Code to get batch no"); wn.throw(wn._("Please enter Item Code to get batch no"));
} else { } else {
filters = { filters = {
'item_code': item.item_code, 'item_code': item.item_code,
@ -625,12 +625,12 @@ var set_sales_bom_help = function(doc) {
$(cur_frm.fields_dict.packing_list.row.wrapper).toggle(true); $(cur_frm.fields_dict.packing_list.row.wrapper).toggle(true);
if (inList(['Delivery Note', 'Sales Invoice'], doc.doctype)) { if (inList(['Delivery Note', 'Sales Invoice'], doc.doctype)) {
help_msg = "<div class='alert alert-warning'> \ help_msg = "<div class='alert alert-warning'>" +
For 'Sales BOM' items, warehouse, serial no and batch no \ wn._("For 'Sales BOM' items, warehouse, serial no and batch no \
will be considered from the 'Packing List' table. \ will be considered from the 'Packing List' table. \
If warehouse and batch no are same for all packing items for any 'Sales BOM' item, \ If warehouse and batch no are same for all packing items for any 'Sales BOM' item, \
those values can be entered in the main item table, values will be copied to 'Packing List' table. \ those values can be entered in the main item table, values will be copied to 'Packing List' table.")+
</div>"; "</div>";
wn.meta.get_docfield(doc.doctype, 'sales_bom_help', doc.name).options = help_msg; wn.meta.get_docfield(doc.doctype, 'sales_bom_help', doc.name).options = help_msg;
} }
} else { } else {

View File

@ -61,7 +61,8 @@ cur_frm.cscript.has_special_chars = function(t) {
cur_frm.cscript.company_name = function(doc){ cur_frm.cscript.company_name = function(doc){
if(doc.company_name && cur_frm.cscript.has_special_chars(doc.company_name)){ if(doc.company_name && cur_frm.cscript.has_special_chars(doc.company_name)){
msgprint("<font color=red>Special Characters <b>! @ # $ % ^ * + = - [ ] ' ; , / { } | : < > ?</b> are not allowed for</font>\nCompany Name <b>" + doc.company_name +"</b>") msgprint(("<font color=red>"+wn._("Special Characters")+" <b>! @ # $ % ^ * + = - [ ] ' ; , / { } | : < > ?</b> "+
wn._("are not allowed for ")+"</font>\n"+wn._("Company Name")+" <b> "+ doc.company_name +"</b>"))
doc.company_name = ''; doc.company_name = '';
refresh_field('company_name'); refresh_field('company_name');
} }
@ -69,7 +70,8 @@ cur_frm.cscript.company_name = function(doc){
cur_frm.cscript.abbr = function(doc){ cur_frm.cscript.abbr = function(doc){
if(doc.abbr && cur_frm.cscript.has_special_chars(doc.abbr)){ if(doc.abbr && cur_frm.cscript.has_special_chars(doc.abbr)){
msgprint("<font color=red>Special Characters <b>! @ # $ % ^ * + = - [ ] ' ; , / { } | : < > ?</b> are not allowed for</font>\nAbbr <b>" + doc.abbr +"</b>") msgprint("<font color=red>"+wn._("Special Characters ")+"<b>! @ # $ % ^ * + = - [ ] ' ; , / { } | : < > ?</b>" +
wn._("are not allowed for")+ "</font>\nAbbr <b>" + doc.abbr +"</b>")
doc.abbr = ''; doc.abbr = '';
refresh_field('abbr'); refresh_field('abbr');
} }

View File

@ -9,7 +9,7 @@ cur_frm.cscript.set_root_readonly = function(doc) {
// read-only for root customer group // read-only for root customer group
if(!doc.parent_customer_group) { if(!doc.parent_customer_group) {
cur_frm.perm = [[1,0,0], [1,0,0]]; cur_frm.perm = [[1,0,0], [1,0,0]];
cur_frm.set_intro("This is a root customer group and cannot be edited."); cur_frm.set_intro(wn._("This is a root customer group and cannot be edited."));
} else { } else {
cur_frm.set_intro(null); cur_frm.set_intro(null);
} }

View File

@ -3,10 +3,10 @@
cur_frm.cscript.refresh = function(doc, dt, dn) { cur_frm.cscript.refresh = function(doc, dt, dn) {
doc = locals[dt][dn]; doc = locals[dt][dn];
var save_msg = "You must <b>Save</b> the form before proceeding"; var save_msg = wn._("You must ")+ "<b>"+wn._("Save ")+"</b>"+wn._("the form before proceeding");
var err_msg = "There was an error. One probable reason could be that you haven't saved the form. Please contact support@erpnext.com if the problem persists." var err_msg = wn._("There was an error. One probable reason could be that you haven't saved the form. Please contact support@erpnext.com if the problem persists.")
cur_frm.add_custom_button('View Now', function() { cur_frm.add_custom_button(wn._('View Now'), function() {
doc = locals[dt][dn]; doc = locals[dt][dn];
if(doc.__unsaved != 1) { if(doc.__unsaved != 1) {
return $c_obj(make_doclist(dt, dn), 'get_digest_msg', '', function(r, rt) { return $c_obj(make_doclist(dt, dn), 'get_digest_msg', '', function(r, rt) {
@ -16,7 +16,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
} else { } else {
//console.log(arguments); //console.log(arguments);
var d = new wn.ui.Dialog({ var d = new wn.ui.Dialog({
title: 'Email Digest: ' + dn, title: wn._('Email Digest: ') + dn,
width: 800 width: 800
}); });
@ -29,7 +29,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
msgprint(save_msg); msgprint(save_msg);
} }
}, 1); }, 1);
cur_frm.add_custom_button('Send Now', function() { cur_frm.add_custom_button(wn._('Send Now'), function() {
doc = locals[dt][dn]; doc = locals[dt][dn];
if(doc.__unsaved != 1) { if(doc.__unsaved != 1) {
return $c_obj(make_doclist(dt, dn), 'send', '', function(r, rt) { return $c_obj(make_doclist(dt, dn), 'send', '', function(r, rt) {
@ -38,7 +38,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
console.log(r.exc); console.log(r.exc);
} else { } else {
//console.log(arguments); //console.log(arguments);
msgprint('Message Sent'); msgprint(wn._('Message Sent'));
} }
}); });
} else { } else {
@ -56,7 +56,7 @@ cur_frm.cscript.addremove_recipients = function(doc, dt, dn) {
// Open a dialog and display checkboxes against email addresses // Open a dialog and display checkboxes against email addresses
doc = locals[dt][dn]; doc = locals[dt][dn];
var d = new wn.ui.Dialog({ var d = new wn.ui.Dialog({
title: 'Add/Remove Recipients', title: wn._('Add/Remove Recipients'),
width: 400 width: 400
}); });
var dialog_div = $a(d.body, 'div', 'dialog-div', '', ''); var dialog_div = $a(d.body, 'div', 'dialog-div', '', '');

View File

@ -4,7 +4,7 @@
cur_frm.cscript.refresh = function(doc, cdt, cdn) { cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.cscript.set_root_readonly(doc); cur_frm.cscript.set_root_readonly(doc);
cur_frm.add_custom_button("Item Group Tree", function() { cur_frm.add_custom_button(wn._("Item Group Tree"), function() {
wn.set_route("Sales Browser", "Item Group"); wn.set_route("Sales Browser", "Item Group");
}) })
@ -19,7 +19,7 @@ cur_frm.cscript.set_root_readonly = function(doc) {
// read-only for root item group // read-only for root item group
if(!doc.parent_item_group) { if(!doc.parent_item_group) {
cur_frm.perm = [[1,0,0], [1,0,0]]; cur_frm.perm = [[1,0,0], [1,0,0]];
cur_frm.set_intro("This is a root item group and cannot be edited."); cur_frm.set_intro(wn._("This is a root item group and cannot be edited."));
} else { } else {
cur_frm.set_intro(null); cur_frm.set_intro(null);
} }

View File

@ -39,7 +39,7 @@ cur_frm.cscript.make_address = function() {
return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where sales_partner='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc" return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where sales_partner='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc"
}, },
as_dict: 1, as_dict: 1,
no_results_message: 'No addresses created', no_results_message: wn._('No addresses created'),
render_row: function(wrapper, data) { render_row: function(wrapper, data) {
$(wrapper).css('padding','5px 0px'); $(wrapper).css('padding','5px 0px');
var link = $ln(wrapper,cstr(data.name), function() { loaddoc("Address", this.dn); }, {fontWeight:'bold'}); var link = $ln(wrapper,cstr(data.name), function() { loaddoc("Address", this.dn); }, {fontWeight:'bold'});
@ -69,7 +69,7 @@ cur_frm.cscript.make_contact = function() {
return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where sales_partner='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_contact desc" return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where sales_partner='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_contact desc"
}, },
as_dict: 1, as_dict: 1,
no_results_message: 'No contacts created', no_results_message: wn._('No contacts created'),
render_row: function(wrapper, data) { render_row: function(wrapper, data) {
$(wrapper).css('padding', '5px 0px'); $(wrapper).css('padding', '5px 0px');
var link = $ln(wrapper, cstr(data.name), function() { loaddoc("Contact", this.dn); }, {fontWeight:'bold'}); var link = $ln(wrapper, cstr(data.name), function() { loaddoc("Contact", this.dn); }, {fontWeight:'bold'});

View File

@ -9,7 +9,7 @@ cur_frm.cscript.set_root_readonly = function(doc) {
// read-only for root // read-only for root
if(!doc.parent_sales_person) { if(!doc.parent_sales_person) {
cur_frm.perm = [[1,0,0], [1,0,0]]; cur_frm.perm = [[1,0,0], [1,0,0]];
cur_frm.set_intro("This is a root sales person and cannot be edited."); cur_frm.set_intro(wn._("This is a root sales person and cannot be edited."));
} else { } else {
cur_frm.set_intro(null); cur_frm.set_intro(null);
} }

View File

@ -2,5 +2,5 @@
// License: GNU General Public License v3. See license.txt // License: GNU General Public License v3. See license.txt
cur_frm.cscript.refresh = function(doc) { cur_frm.cscript.refresh = function(doc) {
cur_frm.set_intro(doc.__islocal ? "" : "There is nothing to edit.") cur_frm.set_intro(doc.__islocal ? "" : wn._("There is nothing to edit."))
} }

View File

@ -9,7 +9,7 @@ cur_frm.cscript.set_root_readonly = function(doc) {
// read-only for root territory // read-only for root territory
if(!doc.parent_territory) { if(!doc.parent_territory) {
cur_frm.perm = [[1,0,0], [1,0,0]]; cur_frm.perm = [[1,0,0], [1,0,0]];
cur_frm.set_intro("This is a root territory and cannot be edited."); cur_frm.set_intro(wn._("This is a root territory and cannot be edited."));
} else { } else {
cur_frm.set_intro(null); cur_frm.set_intro(null);
} }

View File

@ -5,12 +5,12 @@ wn.pages['Setup'].onload = function(wrapper) {
if(msg_dialog && msg_dialog.display) msg_dialog.hide(); if(msg_dialog && msg_dialog.display) msg_dialog.hide();
wn.ui.make_app_page({ wn.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: 'Setup', title: wn._('Setup'),
single_column: true single_column: true
}); });
wrapper.appframe.add_module_icon("Setup"); wrapper.appframe.add_module_icon("Setup");
wrapper.appframe.add_button("Refresh", function() { wrapper.appframe.add_button(wn._("Refresh"), function() {
wn.pages.Setup.make(wrapper); wn.pages.Setup.make(wrapper);
}, "icon-refresh"); }, "icon-refresh");
@ -110,7 +110,7 @@ wn.pages.Setup.make = function(wrapper) {
}) })
} else if(item.single) { } else if(item.single) {
$('<a class="view-link"><i class="icon-edit"></i> Edit</a>') $('<a class="view-link"><i class="icon-edit"></i>'+wn._('Edit')+'</a>')
.appendTo($links) .appendTo($links)
$links.find(".view-link") $links.find(".view-link")
@ -119,11 +119,11 @@ wn.pages.Setup.make = function(wrapper) {
wn.set_route("Form", $(this).attr("data-doctype")); wn.set_route("Form", $(this).attr("data-doctype"));
}) })
} else if(item.type !== "Link"){ } else if(item.type !== "Link"){
$('<a class="new-link"><i class="icon-plus"></i> New</a> \ $('<a class="new-link"><i class="icon-plus"></i>'+wn._('New')+'</a> \
<span class="text-muted">|</span> \ <span class="text-muted">|</span> \
<a class="view-link"><i class="icon-list"></i> View</a> \ <a class="view-link"><i class="icon-list"></i>'+wn._('View')+'</a> \
<span class="text-muted">|</span> \ <span class="text-muted">|</span> \
<a class="import-link"><i class="icon-upload"></i> Import</a>') <a class="import-link"><i class="icon-upload"></i>'+wn._('Import')+'</a>')
.appendTo($links) .appendTo($links)
$links.find(".view-link") $links.find(".view-link")
@ -180,11 +180,11 @@ wn.pages.Setup.make = function(wrapper) {
if(r.message) { if(r.message) {
body.empty(); body.empty();
if(wn.boot.expires_on) { if(wn.boot.expires_on) {
$(body).prepend("<div class='text-muted' style='text-align:right'>Account expires on " $(body).prepend("<div class='text-muted' style='text-align:right'>"+wn.("Account expires on")
+ wn.datetime.global_date_format(wn.boot.expires_on) + "</div>"); + wn.datetime.global_date_format(wn.boot.expires_on) + "</div>");
} }
$completed = $('<h4>Setup Completed <span class="completed-percent"></span><h4>\ $completed = $('<h4>'+wn._("Setup Completed")+'<span class="completed-percent"></span><h4>\
<div class="progress"><div class="progress-bar"></div></div>') <div class="progress"><div class="progress-bar"></div></div>')
.appendTo(body); .appendTo(body);

View File

@ -26,20 +26,20 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend(
}); });
if(!from_sales_invoice) if(!from_sales_invoice)
cur_frm.add_custom_button('Make Invoice', this.make_sales_invoice); cur_frm.add_custom_button(wn._('Make Invoice'), this.make_sales_invoice);
} }
if(flt(doc.per_installed, 2) < 100 && doc.docstatus==1) if(flt(doc.per_installed, 2) < 100 && doc.docstatus==1)
cur_frm.add_custom_button('Make Installation Note', this.make_installation_note); cur_frm.add_custom_button(wn._('Make Installation Note'), this.make_installation_note);
if (doc.docstatus==1) { if (doc.docstatus==1) {
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms); cur_frm.add_custom_button(wn._('Send SMS'), cur_frm.cscript.send_sms);
this.show_stock_ledger(); this.show_stock_ledger();
this.show_general_ledger(); this.show_general_ledger();
} }
if(doc.docstatus==0 && !doc.__islocal) { if(doc.docstatus==0 && !doc.__islocal) {
cur_frm.add_custom_button('Make Packing Slip', cur_frm.cscript['Make Packing Slip']); cur_frm.add_custom_button(wn._('Make Packing Slip'), cur_frm.cscript['Make Packing Slip']);
} }
set_print_hide(doc, dt, dn); set_print_hide(doc, dt, dn);

View File

@ -124,7 +124,7 @@ cur_frm.fields_dict['item_group'].get_query = function(doc,cdt,cdn) {
// in the "alternate_description" field // in the "alternate_description" field
cur_frm.cscript.add_image = function(doc, dt, dn) { cur_frm.cscript.add_image = function(doc, dt, dn) {
if(!doc.image) { if(!doc.image) {
msgprint('Please select an "Image" first'); msgprint(wn._('Please select an "Image" first'));
return; return;
} }
@ -140,7 +140,7 @@ cur_frm.cscript.weight_to_validate = function(doc,cdt,cdn){
if((doc.nett_weight || doc.gross_weight) && !doc.weight_uom) if((doc.nett_weight || doc.gross_weight) && !doc.weight_uom)
{ {
alert('Weight is mentioned,\nPlease mention "Weight UOM" too'); alert(wn._('Weight is mentioned,\nPlease mention "Weight UOM" too'));
validated=0; validated=0;
} }
} }

View File

@ -27,21 +27,21 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
if(doc.docstatus == 1 && doc.status != 'Stopped') { if(doc.docstatus == 1 && doc.status != 'Stopped') {
if(doc.material_request_type === "Purchase") if(doc.material_request_type === "Purchase")
cur_frm.add_custom_button("Make Supplier Quotation", cur_frm.add_custom_button(wn._("Make Supplier Quotation"),
this.make_supplier_quotation); this.make_supplier_quotation);
if(doc.material_request_type === "Transfer" && doc.status === "Submitted") if(doc.material_request_type === "Transfer" && doc.status === "Submitted")
cur_frm.add_custom_button("Transfer Material", this.make_stock_entry); cur_frm.add_custom_button(wn._("Transfer Material"), this.make_stock_entry);
if(flt(doc.per_ordered, 2) < 100) { if(flt(doc.per_ordered, 2) < 100) {
if(doc.material_request_type === "Purchase") if(doc.material_request_type === "Purchase")
cur_frm.add_custom_button('Make Purchase Order', cur_frm.add_custom_button(wn._('Make Purchase Order'),
this.make_purchase_order); this.make_purchase_order);
cur_frm.add_custom_button('Stop Material Request', cur_frm.add_custom_button(wn._('Stop Material Request'),
cur_frm.cscript['Stop Material Request']); cur_frm.cscript['Stop Material Request']);
} }
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms); cur_frm.add_custom_button(wn._('Send SMS'), cur_frm.cscript.send_sms);
} }
@ -62,7 +62,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
} }
if(doc.docstatus == 1 && doc.status == 'Stopped') if(doc.docstatus == 1 && doc.status == 'Stopped')
cur_frm.add_custom_button('Unstop Material Request', cur_frm.add_custom_button(wn._('Unstop Material Request'),
cur_frm.cscript['Unstop Material Request']); cur_frm.cscript['Unstop Material Request']);
}, },
@ -154,12 +154,12 @@ $.extend(cur_frm.cscript, new erpnext.buying.MaterialRequestController({frm: cur
cur_frm.cscript.qty = function(doc, cdt, cdn) { cur_frm.cscript.qty = function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if (flt(d.qty) < flt(d.min_order_qty)) if (flt(d.qty) < flt(d.min_order_qty))
alert("Warning: Material Requested Qty is less than Minimum Order Qty"); alert(wn._("Warning: Material Requested Qty is less than Minimum Order Qty"));
}; };
cur_frm.cscript['Stop Material Request'] = function() { cur_frm.cscript['Stop Material Request'] = function() {
var doc = cur_frm.doc; var doc = cur_frm.doc;
var check = confirm("Do you really want to STOP this Material Request?"); var check = confirm(wn._("Do you really want to STOP this Material Request?"));
if (check) { if (check) {
return $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) { return $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
@ -170,7 +170,7 @@ cur_frm.cscript['Stop Material Request'] = function() {
cur_frm.cscript['Unstop Material Request'] = function(){ cur_frm.cscript['Unstop Material Request'] = function(){
var doc = cur_frm.doc; var doc = cur_frm.doc;
var check = confirm("Do you really want to UNSTOP this Material Request?"); var check = confirm(wn._("Do you really want to UNSTOP this Material Request?"));
if (check) { if (check) {
return $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted','docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) { return $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted','docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {

View File

@ -45,13 +45,13 @@ cur_frm.cscript.validate = function(doc, cdt, cdn) {
cur_frm.cscript.validate_case_nos = function(doc) { cur_frm.cscript.validate_case_nos = function(doc) {
doc = locals[doc.doctype][doc.name]; doc = locals[doc.doctype][doc.name];
if(cint(doc.from_case_no)==0) { if(cint(doc.from_case_no)==0) {
msgprint("Case No. cannot be 0") msgprint(wn._("Case No. cannot be 0"))
validated = false; validated = false;
} else if(!cint(doc.to_case_no)) { } else if(!cint(doc.to_case_no)) {
doc.to_case_no = doc.from_case_no; doc.to_case_no = doc.from_case_no;
refresh_field('to_case_no'); refresh_field('to_case_no');
} else if(cint(doc.to_case_no) < cint(doc.from_case_no)) { } else if(cint(doc.to_case_no) < cint(doc.from_case_no)) {
msgprint("'To Case No.' cannot be less than 'From Case No.'"); msgprint(wn._("'To Case No.' cannot be less than 'From Case No.'"));
validated = false; validated = false;
} }
} }
@ -72,14 +72,14 @@ cur_frm.cscript.validate_duplicate_items = function(doc, ps_detail) {
for(var i=0; i<ps_detail.length; i++) { for(var i=0; i<ps_detail.length; i++) {
for(var j=0; j<ps_detail.length; j++) { for(var j=0; j<ps_detail.length; j++) {
if(i!=j && ps_detail[i].item_code && ps_detail[i].item_code==ps_detail[j].item_code) { if(i!=j && ps_detail[i].item_code && ps_detail[i].item_code==ps_detail[j].item_code) {
msgprint("You have entered duplicate items. Please rectify and try again."); msgprint(wn._("You have entered duplicate items. Please rectify and try again."));
validated = false; validated = false;
return; return;
} }
} }
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(wn._("Invalid quantity specified for item ") + ps_detail[i].item_code +
". Quantity should be greater than 0."); "."+wn._(" Quantity should be greater than 0."));
validated = false; validated = false;
} }
} }
@ -95,9 +95,9 @@ 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(wn._("Different UOM for items will lead to incorrect")+
(Total) Net Weight value. Make sure that Net Weight of each item is \ wn._("(Total) Net Weight value. Make sure that Net Weight of each item is")+
in the same UOM.") wn._("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);

View File

@ -17,15 +17,15 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
if(this.frm.doc.docstatus == 1) { if(this.frm.doc.docstatus == 1) {
if(!this.frm.doc.__billing_complete) { if(!this.frm.doc.__billing_complete) {
cur_frm.add_custom_button('Make Purchase Invoice', cur_frm.add_custom_button(wn._('Make Purchase Invoice'),
this.make_purchase_invoice); this.make_purchase_invoice);
} }
cur_frm.add_custom_button('Send SMS', cur_frm.cscript['Send SMS']); cur_frm.add_custom_button(wn._('Send SMS'), cur_frm.cscript['Send SMS']);
this.show_stock_ledger(); this.show_stock_ledger();
this.show_general_ledger(); this.show_general_ledger();
} else { } else {
cur_frm.add_custom_button(wn._('From Purchase Order'), cur_frm.add_custom_button(wn._(wn._('From Purchase Order')),
function() { function() {
wn.model.map_current_doc({ wn.model.map_current_doc({
method: "buying.doctype.purchase_order.purchase_order.make_purchase_receipt", method: "buying.doctype.purchase_order.purchase_order.make_purchase_receipt",
@ -140,7 +140,7 @@ cur_frm.fields_dict['purchase_receipt_details'].grid.get_field('batch_no').get_q
} }
} }
else{ else{
alert("Please enter Item Code."); alert(wn._("Please enter Item Code."));
} }
} }

View File

@ -70,10 +70,10 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
if(this.frm.doc.docstatus === 1 && if(this.frm.doc.docstatus === 1 &&
wn.boot.profile.can_create.indexOf("Journal Voucher")!==-1) { wn.boot.profile.can_create.indexOf("Journal Voucher")!==-1) {
if(this.frm.doc.purpose === "Sales Return") { if(this.frm.doc.purpose === "Sales Return") {
this.frm.add_custom_button("Make Credit Note", function() { me.make_return_jv(); }); this.frm.add_custom_button(wn._("Make Credit Note"), function() { me.make_return_jv(); });
this.add_excise_button(); this.add_excise_button();
} else if(this.frm.doc.purpose === "Purchase Return") { } else if(this.frm.doc.purpose === "Purchase Return") {
this.frm.add_custom_button("Make Debit Note", function() { me.make_return_jv(); }); this.frm.add_custom_button(wn._("Make Debit Note"), function() { me.make_return_jv(); });
this.add_excise_button(); this.add_excise_button();
} }
} }
@ -195,7 +195,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
add_excise_button: function() { add_excise_button: function() {
if(wn.boot.control_panel.country === "India") if(wn.boot.control_panel.country === "India")
this.frm.add_custom_button("Make Excise Invoice", function() { this.frm.add_custom_button(wn._("Make Excise Invoice"), function() {
var excise = wn.model.make_new_doc_and_get_name('Journal Voucher'); var excise = wn.model.make_new_doc_and_get_name('Journal Voucher');
excise = locals['Journal Voucher'][excise]; excise = locals['Journal Voucher'][excise];
excise.voucher_type = 'Excise Voucher'; excise.voucher_type = 'Excise Voucher';
@ -318,7 +318,7 @@ cur_frm.fields_dict['mtn_details'].grid.get_field('batch_no').get_query = functi
} }
} }
} else { } else {
msgprint("Please enter Item Code to get batch no"); msgprint(wn._("Please enter Item Code to get batch no"));
} }
} }
@ -372,7 +372,7 @@ cur_frm.cscript.validate = function(doc, cdt, cdn) {
cur_frm.cscript.validate_items = function(doc) { cur_frm.cscript.validate_items = function(doc) {
cl = getchildren('Stock Entry Detail', doc.name, 'mtn_details'); cl = getchildren('Stock Entry Detail', doc.name, 'mtn_details');
if (!cl.length) { if (!cl.length) {
alert("Item table can not be blank"); alert(wn._("Item table can not be blank"));
validated = false; validated = false;
} }
} }

View File

@ -48,13 +48,13 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
this.show_download_template(); this.show_download_template();
this.show_upload(); this.show_upload();
if(this.frm.doc.reconciliation_json) { if(this.frm.doc.reconciliation_json) {
this.frm.set_intro("You can submit this Stock Reconciliation."); this.frm.set_intro(wn._("You can submit this Stock Reconciliation."));
} else { } else {
this.frm.set_intro("Download the Template, fill appropriate data and \ this.frm.set_intro(wn._("Download the Template, fill appropriate data and \
attach the modified file."); attach the modified file."));
} }
} else if(this.frm.doc.docstatus == 1) { } else if(this.frm.doc.docstatus == 1) {
this.frm.set_intro("Cancelling this Stock Reconciliation will nullify its effect."); this.frm.set_intro(wn._("Cancelling this Stock Reconciliation will nullify its effect."));
this.show_stock_ledger(); this.show_stock_ledger();
this.show_general_ledger(); this.show_general_ledger();
} else { } else {
@ -66,20 +66,20 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
show_download_template: function() { show_download_template: function() {
var me = this; var me = this;
this.frm.add_custom_button("Download Template", function() { this.frm.add_custom_button(wn._("Download Template"), function() {
this.title = "Stock Reconcilation Template"; this.title = wn._("Stock Reconcilation Template");
wn.tools.downloadify([["Stock Reconciliation"], wn.tools.downloadify([[wn._("Stock Reconciliation")],
["----"], ["----"],
["Stock Reconciliation can be used to update the stock on a particular date," [wn._("Stock Reconciliation can be used to update the stock on a particular date, ")
+ " usually as per physical inventory."], + wn._("usually as per physical inventory.")],
["When submitted, the system creates difference entries" [wn._("When submitted, the system creates difference entries ")
+ " to set the given stock and valuation on this date."], + wn._("to set the given stock and valuation on this date.")],
["It can also be used to create opening stock entries and to fix stock value."], [wn._("It can also be used to create opening stock entries and to fix stock value.")],
["----"], ["----"],
["Notes:"], [wn._("Notes:")],
["Item Code and Warehouse should already exist."], [wn._("Item Code and Warehouse should already exist.")],
["You can update either Quantity or Valuation Rate or both."], [wn._("You can update either Quantity or Valuation Rate or both.")],
["If no change in either Quantity or Valuation Rate, leave the cell blank."], [wn._("If no change in either Quantity or Valuation Rate, leave the cell blank.")],
["----"], ["----"],
["Item Code", "Warehouse", "Quantity", "Valuation Rate"]], null, this); ["Item Code", "Warehouse", "Quantity", "Valuation Rate"]], null, this);
return false; return false;
@ -113,8 +113,8 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
show_download_reconciliation_data: function() { show_download_reconciliation_data: function() {
var me = this; var me = this;
if(this.frm.doc.reconciliation_json) { if(this.frm.doc.reconciliation_json) {
this.frm.add_custom_button("Download Reconcilation Data", function() { this.frm.add_custom_button(wn._("Download Reconcilation Data"), function() {
this.title = "Stock Reconcilation Data"; this.title = wn._("Stock Reconcilation Data");
wn.tools.downloadify(JSON.parse(me.frm.doc.reconciliation_json), null, this); wn.tools.downloadify(JSON.parse(me.frm.doc.reconciliation_json), null, this);
return false; return false;
}, "icon-download"); }, "icon-download");

View File

@ -7,11 +7,11 @@ cur_frm.cscript.refresh = function(doc) {
cur_frm.cscript.merge = function(doc, cdt, cdn) { cur_frm.cscript.merge = function(doc, cdt, cdn) {
if (!doc.merge_with) { if (!doc.merge_with) {
msgprint("Please enter the warehouse to which you want to merge?"); msgprint(wn._("Please enter the warehouse to which you want to merge?"));
return; return;
} }
var check = confirm("Are you sure you want to merge this warehouse into " var check = confirm(wn._("Are you sure you want to merge this warehouse into "
+ doc.merge_with + "?"); + doc.merge_with + "?"));
if (check) { if (check) {
return $c_obj(make_doclist(cdt, cdn), 'merge_warehouses', '', ''); return $c_obj(make_doclist(cdt, cdn), 'merge_warehouses', '', '');
} }

View File

@ -5,7 +5,7 @@
wn.pages['stock-ageing'].onload = function(wrapper) { wn.pages['stock-ageing'].onload = function(wrapper) {
wn.ui.make_app_page({ wn.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: 'Stock Ageing', title: wn._('Stock Ageing'),
single_column: true single_column: true
}); });
@ -21,7 +21,7 @@ wn.require("app/js/stock_grid_report.js");
erpnext.StockAgeing = erpnext.StockGridReport.extend({ erpnext.StockAgeing = erpnext.StockGridReport.extend({
init: function(wrapper) { init: function(wrapper) {
this._super({ this._super({
title: "Stock Ageing", title: wn._("Stock Ageing"),
page: wrapper, page: wrapper,
parent: $(wrapper).find('.layout-main'), parent: $(wrapper).find('.layout-main'),
appframe: wrapper.appframe, appframe: wrapper.appframe,
@ -30,37 +30,37 @@ erpnext.StockAgeing = erpnext.StockGridReport.extend({
}, },
setup_columns: function() { setup_columns: function() {
this.columns = [ this.columns = [
{id: "name", name: "Item", field: "name", width: 300, {id: "name", name: wn._("Item"), field: "name", width: 300,
link_formatter: { link_formatter: {
open_btn: true, open_btn: true,
doctype: '"Item"' doctype: '"Item"'
}}, }},
{id: "item_name", name: "Item Name", field: "item_name", {id: "item_name", name: wn._("Item Name"), field: "item_name",
width: 100, formatter: this.text_formatter}, width: 100, formatter: this.text_formatter},
{id: "description", name: "Description", field: "description", {id: "description", name: wn._("Description"), field: "description",
width: 200, formatter: this.text_formatter}, width: 200, formatter: this.text_formatter},
{id: "brand", name: "Brand", field: "brand", width: 100}, {id: "brand", name: wn._("Brand"), field: "brand", width: 100},
{id: "average_age", name: "Average Age", field: "average_age", {id: "average_age", name: wn._("Average Age"), field: "average_age",
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "earliest", name: "Earliest", field: "earliest", {id: "earliest", name: wn._("Earliest"), field: "earliest",
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "latest", name: "Latest", field: "latest", {id: "latest", name: wn._("Latest"), field: "latest",
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "stock_uom", name: "UOM", field: "stock_uom", width: 100}, {id: "stock_uom", name: "UOM", field: "stock_uom", width: 100},
]; ];
}, },
filters: [ filters: [
{fieldtype:"Select", label: "Warehouse", link:"Warehouse", {fieldtype:"Select", label: wn._("Warehouse"), link:"Warehouse",
default_value: "Select Warehouse..."}, default_value: "Select Warehouse..."},
{fieldtype:"Select", label: "Brand", link:"Brand", {fieldtype:"Select", label: wn._("Brand"), link:"Brand",
default_value: "Select Brand...", filter: function(val, item, opts) { default_value: "Select Brand...", filter: function(val, item, opts) {
return val == opts.default_value || item.brand == val; return val == opts.default_value || item.brand == val;
}, link_formatter: {filter_input: "brand"}}, }, link_formatter: {filter_input: "brand"}},
{fieldtype:"Select", label: "Plot By", {fieldtype:"Select", label: wn._("Plot By"),
options: ["Average Age", "Earliest", "Latest"]}, options: ["Average Age", "Earliest", "Latest"]},
{fieldtype:"Date", label: "To Date"}, {fieldtype:"Date", label: wn._("To Date")},
{fieldtype:"Button", label: "Refresh", icon:"icon-refresh icon-white", cssClass:"btn-info"}, {fieldtype:"Button", label: wn._("Refresh"), icon:"icon-refresh icon-white", cssClass:"btn-info"},
{fieldtype:"Button", label: "Reset Filters"} {fieldtype:"Button", label: wn._("Reset Filters")}
], ],
setup_filters: function() { setup_filters: function() {
var me = this; var me = this;

View File

@ -5,7 +5,7 @@
wn.pages['stock-analytics'].onload = function(wrapper) { wn.pages['stock-analytics'].onload = function(wrapper) {
wn.ui.make_app_page({ wn.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: 'Stock Analytics', title: wn._('Stock Analytics'),
single_column: true single_column: true
}); });

View File

@ -6,7 +6,7 @@ wn.require("app/js/stock_analytics.js");
wn.pages['stock-balance'].onload = function(wrapper) { wn.pages['stock-balance'].onload = function(wrapper) {
wn.ui.make_app_page({ wn.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: 'Stock Balance', title: wn._('Stock Balance'),
single_column: true single_column: true
}); });
@ -20,58 +20,58 @@ wn.pages['stock-balance'].onload = function(wrapper) {
erpnext.StockBalance = erpnext.StockAnalytics.extend({ erpnext.StockBalance = erpnext.StockAnalytics.extend({
init: function(wrapper) { init: function(wrapper) {
this._super(wrapper, { this._super(wrapper, {
title: "Stock Balance", title: wn._("Stock Balance"),
doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand", doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
"Stock Entry", "Project"], "Stock Entry", "Project"],
}); });
}, },
setup_columns: function() { setup_columns: function() {
this.columns = [ this.columns = [
{id: "name", name: "Item", field: "name", width: 300, {id: "name", name: wn._("Item"), field: "name", width: 300,
formatter: this.tree_formatter}, formatter: this.tree_formatter},
{id: "item_name", name: "Item Name", field: "item_name", width: 100}, {id: "item_name", name: wn._("Item Name"), field: "item_name", width: 100},
{id: "description", name: "Description", field: "description", width: 200, {id: "description", name: wn._("Description"), field: "description", width: 200,
formatter: this.text_formatter}, formatter: this.text_formatter},
{id: "brand", name: "Brand", field: "brand", width: 100}, {id: "brand", name: wn._("Brand"), field: "brand", width: 100},
{id: "stock_uom", name: "UOM", field: "stock_uom", width: 100}, {id: "stock_uom", name: wn._("UOM"), field: "stock_uom", width: 100},
{id: "opening_qty", name: "Opening Qty", field: "opening_qty", width: 100, {id: "opening_qty", name: wn._("Opening Qty"), field: "opening_qty", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "inflow_qty", name: "In Qty", field: "inflow_qty", width: 100, {id: "inflow_qty", name: wn._("In Qty"), field: "inflow_qty", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "outflow_qty", name: "Out Qty", field: "outflow_qty", width: 100, {id: "outflow_qty", name: wn._("Out Qty"), field: "outflow_qty", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "closing_qty", name: "Closing Qty", field: "closing_qty", width: 100, {id: "closing_qty", name: wn._("Closing Qty"), field: "closing_qty", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "opening_value", name: "Opening Value", field: "opening_value", width: 100, {id: "opening_value", name: wn._("Opening Value"), field: "opening_value", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "inflow_value", name: "In Value", field: "inflow_value", width: 100, {id: "inflow_value", name: wn._("In Value"), field: "inflow_value", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "outflow_value", name: "Out Value", field: "outflow_value", width: 100, {id: "outflow_value", name: wn._("Out Value"), field: "outflow_value", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "closing_value", name: "Closing Value", field: "closing_value", width: 100, {id: "closing_value", name: wn._("Closing Value"), field: "closing_value", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
]; ];
}, },
filters: [ filters: [
{fieldtype:"Select", label: "Brand", link:"Brand", {fieldtype:"Select", label: wn._("Brand"), link:"Brand",
default_value: "Select Brand...", filter: function(val, item, opts) { default_value: "Select Brand...", filter: function(val, item, opts) {
return val == opts.default_value || item.brand == val || item._show; return val == opts.default_value || item.brand == val || item._show;
}, link_formatter: {filter_input: "brand"}}, }, link_formatter: {filter_input: "brand"}},
{fieldtype:"Select", label: "Warehouse", link:"Warehouse", {fieldtype:"Select", label: wn._("Warehouse"), link:"Warehouse",
default_value: "Select Warehouse...", filter: function(val, item, opts, me) { default_value: "Select Warehouse...", filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me); return me.apply_zero_filter(val, item, opts, me);
}}, }},
{fieldtype:"Select", label: "Project", link:"Project", {fieldtype:"Select", label: wn._("Project"), link:"Project",
default_value: "Select Project...", filter: function(val, item, opts, me) { default_value: "Select Project...", filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me); return me.apply_zero_filter(val, item, opts, me);
}, link_formatter: {filter_input: "project"}}, }, link_formatter: {filter_input: "project"}},
{fieldtype:"Date", label: "From Date"}, {fieldtype:"Date", label: wn._("From Date")},
{fieldtype:"Label", label: "To"}, {fieldtype:"Label", label: wn._("To")},
{fieldtype:"Date", label: "To Date"}, {fieldtype:"Date", label: wn._("To Date")},
{fieldtype:"Button", label: "Refresh", icon:"icon-refresh icon-white", cssClass:"btn-info"}, {fieldtype:"Button", label: wn._("Refresh"), icon:"icon-refresh icon-white", cssClass:"btn-info"},
{fieldtype:"Button", label: "Reset Filters"} {fieldtype:"Button", label: wn._("Reset Filters")}
], ],
setup_plot_check: function() { setup_plot_check: function() {

Some files were not shown because too many files have changed in this diff Show More