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
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) {
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";
}
@@ -38,7 +38,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
// read-only for root accounts
if(!doc.parent_account) {
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 {
// credit days and type if customer or supplier
cur_frm.set_intro(null);
@@ -81,17 +81,17 @@ cur_frm.cscript.account_type = function(doc, cdt, cdn) {
// Hide/unhide group or ledger
// -----------------------------------------
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')
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')
} 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')
cur_frm.add_custom_button('View Ledger', function() {
cur_frm.add_custom_button(wn._('View Ledger'), function() {
wn.route_options = {
"account": doc.name,
"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);
if(!doc.__islocal && doc.group_or_ledger=='Group') {
intro_txt += '<p><b>Note:</b> This Cost Center is a <i>Group</i>, \
Accounting Entries are not allowed against groups.</p>';
intro_txt += '<p><b>'+wn._('Note:')+'</b>'+ wn._('This Cost Center is a')+ '<i>'+wn._('Group')+'</i>, '+
wn._('Accounting Entries are not allowed against groups.')+'</p>';
}
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.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')
}
cur_frm.cscript.parent_cost_center = function(doc,cdt,cdn){
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) {
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')
} 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')
}
}

View File

@@ -5,8 +5,8 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
cur_frm.toggle_enable('year_start_date', doc.__islocal)
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.set_intro("To set this Fiscal Year as Deafult, click on 'Set as Default'");
cur_frm.add_custom_button(wn._("Set as Default"), cur_frm.cscript.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("");
}

View File

@@ -115,7 +115,7 @@ cur_frm.cscript.refresh = function(doc) {
erpnext.hide_naming_series();
cur_frm.cscript.voucher_type(doc);
if(doc.docstatus==1) {
cur_frm.add_custom_button('View Ledger', function() {
cur_frm.add_custom_button(wn._('View Ledger'), function() {
wn.route_options = {
"voucher_no": doc.name,
"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;
}
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) {

View File

@@ -13,15 +13,15 @@ cur_frm.cscript.onload_post_render = function(doc) {
cur_frm.cscript.refresh = function(doc) {
cur_frm.set_intro("");
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 {
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) {
// 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 {
return {
doctype: doc.voucher_type,

View File

@@ -27,10 +27,10 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
// Show / Hide button
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) {
cur_frm.add_custom_button('View Ledger', function() {
cur_frm.add_custom_button(wn._('View Ledger'), function() {
wn.route_options = {
"voucher_no": doc.name,
"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;
}
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) {
var d = locals[cdt][cdn];
if(!d.category && d.add_deduct_tax){
alert("Please select Category first");
alert(wn._("Please select Category first"));
d.add_deduct_tax = '';
}
else if(d.category != 'Total' && d.add_deduct_tax == 'Deduct') {
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 = '';
}
@@ -76,15 +76,15 @@ cur_frm.cscript.add_deduct_tax = function(doc, cdt, cdn) {
cur_frm.cscript.charge_type = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.category && d.charge_type){
alert("Please select Category first");
alert(wn._("Please select Category first"));
d.charge_type = '';
}
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 = '';
}
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 = '';
}
validated = false;
@@ -99,16 +99,16 @@ cur_frm.cscript.charge_type = function(doc, cdt, cdn) {
cur_frm.cscript.row_id = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.charge_type && d.row_id){
alert("Please select Charge Type first");
alert(wn._("Please select Charge Type first"));
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 = '';
}
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){
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 = '';
}
}
@@ -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) {
var d = locals[cdt][cdn];
if(!d.charge_type && d.rate) {
alert("Please select Charge Type first");
alert(wn._("Please select Charge Type first"));
d.rate = '';
}
validated = false;
@@ -149,11 +166,11 @@ cur_frm.cscript.rate = function(doc, cdt, cdn) {
cur_frm.cscript.tax_amount = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.charge_type && d.tax_amount){
alert("Please select Charge Type first");
alert(wn._("Please select Charge Type first"));
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 = '';
}
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);
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) {
// 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)
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)
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

View File

@@ -95,7 +95,7 @@ cur_frm.pformat.other_charges= function(doc){
cur_frm.cscript.charge_type = function(doc, 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')){
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 = '';
}
validated = false;
@@ -108,16 +108,16 @@ cur_frm.cscript.charge_type = function(doc, cdt, cdn) {
cur_frm.cscript.row_id = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.charge_type && d.row_id){
alert("Please select Charge Type first");
alert(wn._("Please select Charge Type first"));
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 = '';
}
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){
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 = '';
}
}
@@ -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) {
var d = locals[cdt][cdn];
if(!d.charge_type && d.rate) {
alert("Please select Charge Type first");
alert(wn._("Please select Charge Type first"));
d.rate = '';
}
validated = false;
@@ -158,11 +176,11 @@ cur_frm.cscript.rate = function(doc, cdt, cdn) {
cur_frm.cscript.tax_amount = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.charge_type && d.tax_amount){
alert("Please select Charge Type first");
alert(wn._("Please select Charge Type first"));
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 = '';
}
validated = false;