mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
added format_currency and added options to all currency fields
This commit is contained in:
@@ -242,8 +242,7 @@ erpnext.buying.BuyingController = erpnext.utils.Controller.extend({
|
||||
},
|
||||
|
||||
get_company_currency: function() {
|
||||
return (wn.boot.company[this.frm.doc.company].default_currency ||
|
||||
sys_defaults['currency']);
|
||||
return erpnext.get_currency(this.frm.doc.company);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -648,9 +647,9 @@ cur_frm.cscript.calc_other_charges = function(doc , tname , fname , other_fname)
|
||||
//prev_total += flt(tax[t].total_amount); // for previous row total
|
||||
|
||||
if(tax[t].charge_type == 'Actual')
|
||||
$td(otc,i+1,t+1).innerHTML = fmt_money(tax[t].total_amount);
|
||||
$td(otc,i+1,t+1).innerHTML = format_currency(tax[t].total_amount, erpnext.get_currency(doc.company));
|
||||
else
|
||||
$td(otc,i+1,t+1).innerHTML = '('+fmt_money(rate) + '%) ' +fmt_money(tax[t].total_amount);
|
||||
$td(otc,i+1,t+1).innerHTML = '('+fmt_money(rate) + '%) ' +format_currency(tax[t].total_amount, erpnext.get_currency(doc.company));
|
||||
|
||||
if (tax[t].category != "Total"){
|
||||
item_tax += tax[t].total_amount;
|
||||
@@ -676,9 +675,9 @@ cur_frm.cscript.calc_other_charges = function(doc , tname , fname , other_fname)
|
||||
//prev_total += flt(tax[t].total_amount); // for previous row total
|
||||
|
||||
if(tax[t].charge_type == 'Actual')
|
||||
$td(otc,i+1,t+1).innerHTML = fmt_money(tax[t].total_amount);
|
||||
$td(otc,i+1,t+1).innerHTML = format_currency(tax[t].total_amount, erpnext.get_currency(doc.company));
|
||||
else
|
||||
$td(otc,i+1,t+1).innerHTML = '('+fmt_money(rate) + '%) ' +fmt_money(tax[t].total_amount);
|
||||
$td(otc,i+1,t+1).innerHTML = '('+fmt_money(rate) + '%) ' +format_currency(tax[t].total_amount, erpnext.get_currency(doc.company));
|
||||
|
||||
if (tax[t].category != "Total"){
|
||||
item_tax -= tax[t].total_amount;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-01-22 15:11:37",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-01-22 16:55:21",
|
||||
"modified": "2013-01-23 17:11:28",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -367,6 +367,7 @@
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "net_total_import",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "currency",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
@@ -378,6 +379,7 @@
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "other_charges_added_import",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "currency",
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"report_hide": 0
|
||||
@@ -390,6 +392,7 @@
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "other_charges_deducted_import",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "currency",
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"report_hide": 0
|
||||
@@ -402,6 +405,7 @@
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "grand_total_import",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "currency",
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"report_hide": 0
|
||||
@@ -431,6 +435,7 @@
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "net_total",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"reqd": 0
|
||||
@@ -443,6 +448,7 @@
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "other_charges_added",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
@@ -454,6 +460,7 @@
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "other_charges_deducted",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
@@ -465,6 +472,7 @@
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "total_tax",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
@@ -476,6 +484,7 @@
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "grand_total",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
@@ -486,6 +495,7 @@
|
||||
"label": "Rounded Total",
|
||||
"oldfieldname": "rounded_total",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@ wn.doclistviews['Purchase Order'] = wn.views.ListView.extend({
|
||||
{
|
||||
width: '18%',
|
||||
content: function(parent, data) {
|
||||
$(parent).html(data.currency + ' ' + fmt_money(data.grand_total_import))
|
||||
$(parent).html(format_currency(data.grand_total_import, data.currency))
|
||||
},
|
||||
css: {'text-align':'right'}
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-01-10 16:34:10",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-01-22 15:02:01",
|
||||
"modified": "2013-01-23 17:11:19",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -116,6 +116,7 @@
|
||||
"fieldname": "import_ref_rate",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Ref Rate ",
|
||||
"options": "currency",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
@@ -133,6 +134,7 @@
|
||||
"label": "Rate ",
|
||||
"oldfieldname": "import_rate",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "currency",
|
||||
"print_hide": 0
|
||||
},
|
||||
{
|
||||
@@ -142,6 +144,7 @@
|
||||
"label": "Amount",
|
||||
"oldfieldname": "import_amount",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
@@ -149,6 +152,7 @@
|
||||
"fieldname": "purchase_ref_rate",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Ref Rate *",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
@@ -159,6 +163,7 @@
|
||||
"label": "Rate (Default Curr.) *",
|
||||
"oldfieldname": "purchase_rate",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"print_width": "100px",
|
||||
"reqd": 1,
|
||||
@@ -172,6 +177,7 @@
|
||||
"label": "Amount (Default Curr.)",
|
||||
"oldfieldname": "amount",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"reqd": 1
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-01-10 16:34:10",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-01-22 14:47:54",
|
||||
"modified": "2013-01-23 17:11:19",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "dhanalekshmi@webnotestech.com"
|
||||
},
|
||||
@@ -79,7 +79,8 @@
|
||||
"fieldtype": "Currency",
|
||||
"label": "Rate",
|
||||
"oldfieldname": "rate",
|
||||
"oldfieldtype": "Currency"
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
@@ -88,6 +89,7 @@
|
||||
"label": "Amount",
|
||||
"oldfieldname": "amount",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-01-10 16:34:10",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-01-22 14:47:55",
|
||||
"modified": "2013-01-23 17:11:19",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "wasim@webnotestech.com"
|
||||
},
|
||||
@@ -97,7 +97,8 @@
|
||||
"fieldtype": "Currency",
|
||||
"label": "Rate",
|
||||
"oldfieldname": "rate",
|
||||
"oldfieldtype": "Currency"
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
@@ -116,6 +117,7 @@
|
||||
"label": "Amount",
|
||||
"oldfieldname": "amount",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
@@ -130,7 +132,7 @@
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "current_stock",
|
||||
"fieldtype": "Currency",
|
||||
"fieldtype": "Float",
|
||||
"label": "Current Stock",
|
||||
"oldfieldname": "current_stock",
|
||||
"oldfieldtype": "Currency",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-01-21 18:19:20",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-01-22 14:56:44",
|
||||
"modified": "2013-01-23 16:59:33",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -242,7 +242,7 @@
|
||||
"description": "% of materials ordered against this Purchase Requisition",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "per_ordered",
|
||||
"fieldtype": "Currency",
|
||||
"fieldtype": "Float",
|
||||
"label": "% Ordered",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "per_ordered",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-01-21 18:19:20",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-01-22 16:55:26",
|
||||
"modified": "2013-01-23 17:11:28",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -322,6 +322,7 @@
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "net_total_import",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "currency",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
@@ -333,6 +334,7 @@
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "other_charges_added_import",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "currency",
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"report_hide": 0
|
||||
@@ -345,6 +347,7 @@
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "other_charges_deducted_import",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "currency",
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"report_hide": 0
|
||||
@@ -357,6 +360,7 @@
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "grand_total_import",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "currency",
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"report_hide": 0
|
||||
@@ -386,6 +390,7 @@
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "net_total",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"reqd": 0
|
||||
@@ -398,6 +403,7 @@
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "other_charges_added",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
@@ -409,6 +415,7 @@
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "other_charges_deducted",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
@@ -420,6 +427,7 @@
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "total_tax",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
@@ -431,6 +439,7 @@
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "grand_total",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
@@ -441,6 +450,7 @@
|
||||
"label": "Rounded Total",
|
||||
"oldfieldname": "rounded_total",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
|
||||
@@ -20,7 +20,7 @@ wn.doclistviews['Supplier Quotation'] = wn.views.ListView.extend({
|
||||
{
|
||||
width: '18%',
|
||||
content: function(parent, data) {
|
||||
$(parent).html(data.currency + ' ' + fmt_money(data.grand_total_import))
|
||||
$(parent).html(format_currency(data.grand_total_import, data.currency))
|
||||
},
|
||||
css: {'text-align':'right'}
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-01-10 16:34:12",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-01-22 14:50:08",
|
||||
"modified": "2013-01-23 17:11:19",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -102,6 +102,7 @@
|
||||
"fieldname": "import_ref_rate",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Ref Rate ",
|
||||
"options": "currency",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
@@ -119,6 +120,7 @@
|
||||
"label": "Rate ",
|
||||
"oldfieldname": "import_rate",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "currency",
|
||||
"print_hide": 0
|
||||
},
|
||||
{
|
||||
@@ -128,6 +130,7 @@
|
||||
"label": "Amount",
|
||||
"oldfieldname": "import_amount",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
@@ -135,6 +138,7 @@
|
||||
"fieldname": "purchase_ref_rate",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Ref Rate *",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
@@ -145,6 +149,7 @@
|
||||
"label": "Rate (Default Curr.) *",
|
||||
"oldfieldname": "purchase_rate",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"print_width": "100px",
|
||||
"reqd": 1,
|
||||
@@ -158,6 +163,7 @@
|
||||
"label": "Amount (Default Curr.)",
|
||||
"oldfieldname": "amount",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "eval:erpnext.get_currency()",
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"reqd": 1
|
||||
|
||||
Reference in New Issue
Block a user