added format_currency and added options to all currency fields

This commit is contained in:
Rushabh Mehta
2013-01-23 19:39:51 +05:30
parent 6382a42dbe
commit 597d470e63
96 changed files with 804 additions and 604 deletions

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-19 10:23:33",
"docstatus": 0,
"modified": "2013-01-22 15:05:18",
"modified": "2013-01-23 17:11:26",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -169,7 +169,7 @@
"description": "Rate at which this tax is applied",
"doctype": "DocField",
"fieldname": "tax_rate",
"fieldtype": "Currency",
"fieldtype": "Float",
"hidden": 0,
"label": "Rate",
"oldfieldname": "tax_rate",
@@ -207,6 +207,7 @@
"label": "Credit Limit",
"oldfieldname": "credit_limit",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"permlevel": 0,
"print_hide": 1
},

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
cur_frm.add_fetch("bank_account", "company", "company");
cur_frm.cscript.onload = function(doc, cdt, cdn){
// add page head
var ph = new PageHeader(cur_frm.fields_dict['head_html'].wrapper, 'Bank Reconciliation', '');
}

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:05",
"docstatus": 0,
"modified": "2013-01-22 14:55:57",
"modified": "2013-01-23 17:11:16",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -37,7 +37,7 @@
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 1,
"report": 0,
"role": "Accounts User",
"submit": 0,
"write": 1
@@ -55,6 +55,16 @@
"options": "Account",
"reqd": 1
},
{
"doctype": "DocField",
"fieldname": "company",
"fieldtype": "Link",
"hidden": 1,
"label": "Company",
"options": "Company",
"print_hide": 1,
"reqd": 0
},
{
"doctype": "DocField",
"fieldname": "from_date",
@@ -95,6 +105,7 @@
"fieldname": "total_amount",
"fieldtype": "Currency",
"label": "Total Amount",
"options": "eval:erpnext.get_currency()",
"read_only": 1
},
{

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:05",
"docstatus": 0,
"modified": "2013-01-22 14:16:42",
"modified": "2013-01-23 17:11:16",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -79,6 +79,7 @@
"label": "Debit",
"oldfieldname": "debit",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"read_only": 1
},
{
@@ -88,6 +89,7 @@
"label": "Credit",
"oldfieldname": "credit",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"read_only": 1
},
{

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:05",
"docstatus": 0,
"modified": "2013-01-22 14:18:30",
"modified": "2013-01-23 17:02:32",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -44,6 +44,7 @@
"label": "Budget Allocated",
"oldfieldname": "budget_allocated",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency(cur_frm.doc.company_name)",
"reqd": 1
},
{
@@ -53,6 +54,7 @@
"label": "Actual",
"oldfieldname": "actual",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency(cur_frm.doc.company_name)",
"read_only": 1
},
{

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-19 10:23:34",
"docstatus": 0,
"modified": "2013-01-22 14:55:58",
"modified": "2013-01-23 17:11:26",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -120,6 +120,7 @@
"fieldname": "total_amount",
"fieldtype": "Currency",
"label": "Total Amount",
"options": "eval:erpnext.get_currency()",
"read_only": 0,
"reqd": 1
},
@@ -151,6 +152,7 @@
"fieldname": "total_invoiced_amount",
"fieldtype": "Currency",
"label": "Total Invoiced Amount",
"options": "eval:erpnext.get_currency()",
"print_hide": 0,
"read_only": 1
},

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:06",
"docstatus": 0,
"modified": "2013-01-22 14:18:52",
"modified": "2013-01-23 17:11:16",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -54,6 +54,7 @@
"fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total",
"options": "eval:erpnext.get_currency()",
"read_only": 1,
"width": "120px"
},
@@ -62,6 +63,7 @@
"fieldname": "grand_total",
"fieldtype": "Currency",
"label": "Grand Total",
"options": "eval:erpnext.get_currency()",
"read_only": 1,
"width": "120px"
}

View File

@@ -1,250 +1,244 @@
[
{
"owner": "Administrator",
"creation": "2013-01-10 16:34:06",
"docstatus": 0,
"creation": "2012-03-27 14:35:42",
"modified": "2013-01-23 17:11:17",
"modified_by": "Administrator",
"modified": "2012-03-27 14:35:42"
"owner": "Administrator"
},
{
"section_style": "Simple",
"in_create": 1,
"search_fields": "voucher_no,account,posting_date,against_voucher",
"module": "Accounts",
"server_code_error": " ",
"autoname": "GL.#######",
"_last_update": "1319016431",
"name": "__common__",
"colour": "White:FFF",
"doctype": "DocType",
"show_in_menu": 0,
"version": 103
"in_create": 1,
"module": "Accounts",
"name": "__common__",
"search_fields": "voucher_no,account,posting_date,against_voucher"
},
{
"name": "__common__",
"parent": "GL Entry",
"doctype": "DocField",
"parenttype": "DocType",
"permlevel": 0,
"parentfield": "fields"
},
{
"name": "__common__",
"parent": "GL Entry",
"read": 1,
"create": 0,
"doctype": "DocPerm",
"write": 0,
"report": 1,
"parentfield": "fields",
"parenttype": "DocType",
"parentfield": "permissions"
},
{
"name": "GL Entry",
"doctype": "DocType"
},
{
"amend": 0,
"cancel": 0,
"role": "Accounts User",
"doctype": "DocPerm",
"submit": 0
},
{
"amend": 0,
"doctype": "DocPerm",
"submit": 0,
"role": "Accounts Manager",
"cancel": 0,
"permlevel": 0
},
{
"role": "System Manager",
"create": 0,
"doctype": "DocPerm",
"name": "__common__",
"parent": "GL Entry",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"doctype": "DocPerm"
"read": 1,
"report": 1,
"submit": 0,
"write": 0
},
{
"doctype": "DocType",
"name": "GL Entry"
},
{
"description": "The date at which current entry will get or has actually executed.",
"search_index": 1,
"doctype": "DocField",
"label": "Posting Date",
"oldfieldname": "posting_date",
"fieldname": "posting_date",
"fieldtype": "Date",
"in_filter": 1,
"label": "Posting Date",
"oldfieldname": "posting_date",
"oldfieldtype": "Date",
"in_filter": 1
"search_index": 1
},
{
"description": "The date at which current entry is made in system.",
"oldfieldtype": "Date",
"doctype": "DocField",
"fieldname": "transaction_date",
"fieldtype": "Date",
"label": "Transaction Date",
"oldfieldname": "transaction_date",
"fieldname": "transaction_date",
"fieldtype": "Date"
"oldfieldtype": "Date"
},
{
"search_index": 0,
"doctype": "DocField",
"label": "Aging Date",
"oldfieldname": "aging_date",
"fieldname": "aging_date",
"fieldtype": "Date",
"in_filter": 1,
"label": "Aging Date",
"oldfieldname": "aging_date",
"oldfieldtype": "Date",
"in_filter": 1
"search_index": 0
},
{
"search_index": 1,
"doctype": "DocField",
"label": "Account",
"oldfieldname": "account",
"fieldname": "account",
"fieldtype": "Link",
"in_filter": 1,
"label": "Account",
"oldfieldname": "account",
"oldfieldtype": "Link",
"options": "Account",
"in_filter": 1
"search_index": 1
},
{
"search_index": 0,
"doctype": "DocField",
"label": "Cost Center",
"oldfieldname": "cost_center",
"fieldname": "cost_center",
"fieldtype": "Link",
"in_filter": 1,
"label": "Cost Center",
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
"options": "Cost Center",
"in_filter": 1
"search_index": 0
},
{
"oldfieldtype": "Currency",
"doctype": "DocField",
"fieldname": "debit",
"fieldtype": "Currency",
"label": "Debit Amt",
"oldfieldname": "debit",
"fieldname": "debit",
"fieldtype": "Currency"
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()"
},
{
"oldfieldtype": "Currency",
"doctype": "DocField",
"fieldname": "credit",
"fieldtype": "Currency",
"label": "Credit Amt",
"oldfieldname": "credit",
"fieldname": "credit",
"fieldtype": "Currency"
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()"
},
{
"oldfieldtype": "Text",
"doctype": "DocField",
"label": "Against",
"oldfieldname": "against",
"fieldname": "against",
"fieldtype": "Text",
"in_filter": 1
"in_filter": 1,
"label": "Against",
"oldfieldname": "against",
"oldfieldtype": "Text"
},
{
"search_index": 0,
"doctype": "DocField",
"label": "Against Voucher",
"oldfieldname": "against_voucher",
"fieldname": "against_voucher",
"fieldtype": "Data",
"in_filter": 1,
"label": "Against Voucher",
"oldfieldname": "against_voucher",
"oldfieldtype": "Data",
"in_filter": 1
"search_index": 0
},
{
"search_index": 0,
"doctype": "DocField",
"label": "Against Voucher Type",
"oldfieldname": "against_voucher_type",
"fieldname": "against_voucher_type",
"fieldtype": "Data",
"in_filter": 0,
"label": "Against Voucher Type",
"oldfieldname": "against_voucher_type",
"oldfieldtype": "Data",
"in_filter": 0
"search_index": 0
},
{
"search_index": 0,
"doctype": "DocField",
"label": "Voucher Type",
"oldfieldname": "voucher_type",
"fieldname": "voucher_type",
"fieldtype": "Select",
"in_filter": 1,
"label": "Voucher Type",
"oldfieldname": "voucher_type",
"oldfieldtype": "Select",
"options": "Journal Voucher\nSales Invoice\nPurchase Invoice",
"in_filter": 1
"search_index": 0
},
{
"search_index": 1,
"doctype": "DocField",
"label": "Voucher No",
"oldfieldname": "voucher_no",
"fieldname": "voucher_no",
"fieldtype": "Data",
"in_filter": 1,
"label": "Voucher No",
"oldfieldname": "voucher_no",
"oldfieldtype": "Data",
"in_filter": 1
"search_index": 1
},
{
"no_copy": 1,
"search_index": 0,
"doctype": "DocField",
"label": "Remarks",
"oldfieldname": "remarks",
"fieldname": "remarks",
"fieldtype": "Text",
"in_filter": 1,
"label": "Remarks",
"no_copy": 1,
"oldfieldname": "remarks",
"oldfieldtype": "Text",
"in_filter": 1
"search_index": 0
},
{
"search_index": 0,
"doctype": "DocField",
"label": "Is Cancelled",
"oldfieldname": "is_cancelled",
"fieldname": "is_cancelled",
"fieldtype": "Select",
"in_filter": 1,
"label": "Is Cancelled",
"oldfieldname": "is_cancelled",
"oldfieldtype": "Select",
"options": "No\nYes",
"in_filter": 1
"search_index": 0
},
{
"search_index": 0,
"doctype": "DocField",
"label": "Is Opening",
"oldfieldname": "is_opening",
"fieldname": "is_opening",
"fieldtype": "Select",
"in_filter": 1,
"label": "Is Opening",
"oldfieldname": "is_opening",
"oldfieldtype": "Select",
"options": "No\nYes",
"in_filter": 1
"search_index": 0
},
{
"search_index": 0,
"doctype": "DocField",
"label": "Is Advance",
"oldfieldname": "is_advance",
"fieldname": "is_advance",
"fieldtype": "Select",
"in_filter": 0,
"label": "Is Advance",
"oldfieldname": "is_advance",
"oldfieldtype": "Select",
"options": "No\nYes",
"in_filter": 0
"search_index": 0
},
{
"search_index": 0,
"doctype": "DocField",
"label": "Fiscal Year",
"oldfieldname": "fiscal_year",
"fieldname": "fiscal_year",
"fieldtype": "Select",
"in_filter": 1,
"label": "Fiscal Year",
"oldfieldname": "fiscal_year",
"oldfieldtype": "Select",
"options": "link:Fiscal Year",
"in_filter": 1
"search_index": 0
},
{
"search_index": 0,
"doctype": "DocField",
"label": "Company",
"oldfieldname": "company",
"fieldname": "company",
"fieldtype": "Link",
"in_filter": 1,
"label": "Company",
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"in_filter": 1
"search_index": 0
},
{
"amend": 0,
"cancel": 0,
"doctype": "DocPerm",
"role": "Accounts User"
},
{
"amend": 0,
"cancel": 0,
"doctype": "DocPerm",
"role": "Accounts Manager"
},
{
"doctype": "DocPerm",
"role": "System Manager"
}
]

View File

@@ -151,7 +151,7 @@ cur_frm.cscript.account = function(doc,dt,dn) {
method: "accounts.utils.get_balance_on",
args: {account: d.account, date: doc.posting_date},
callback: function(r) {
d.balance = fmt_money(r.message);
d.balance = format_currency(r.message, erpnext.get_currency(doc.company));
refresh_field('balance', d.name, 'entries');
}
});
@@ -161,7 +161,6 @@ cur_frm.cscript.validate = function(doc,cdt,cdn) {
cur_frm.cscript.update_totals(doc);
}
// ***************** Get Print Heading based on Sales Invoice *****************
cur_frm.fields_dict['select_print_heading'].get_query = function(doc, cdt, cdn) {
return 'SELECT `tabPrint Heading`.name FROM `tabPrint Heading` WHERE `tabPrint Heading`.docstatus !=2 AND `tabPrint Heading`.name LIKE "%s" ORDER BY `tabPrint Heading`.name ASC LIMIT 50';
}

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-19 10:23:34",
"docstatus": 0,
"modified": "2013-01-22 14:56:03",
"modified": "2013-01-23 17:11:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -123,6 +123,7 @@
"no_copy": 1,
"oldfieldname": "total_debit",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"read_only": 1
},
{
@@ -134,6 +135,7 @@
"no_copy": 1,
"oldfieldname": "total_credit",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"read_only": 1
},
{
@@ -149,6 +151,7 @@
"no_copy": 1,
"oldfieldname": "difference",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1
},
@@ -308,6 +311,7 @@
"fieldname": "write_off_amount",
"fieldtype": "Currency",
"label": "Write Off Amount <=",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"report_hide": 1
},

View File

@@ -28,7 +28,7 @@ wn.doclistviews['Journal Voucher'] = wn.views.ListView.extend({
{
width: '18%',
content: function(parent, data) {
$(parent).html(wn.boot.company[data.company].default_currency + ' ' + fmt_money(data.total_debit))
$(parent).html(format_currency(data.total_debit, erpnext.get_currency(data.company)));
},
css: {'text-align':'right'}
},

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:06",
"docstatus": 0,
"modified": "2013-01-22 14:47:01",
"modified": "2013-01-23 17:11:17",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -44,7 +44,8 @@
"fieldtype": "Currency",
"label": "Debit",
"oldfieldname": "debit",
"oldfieldtype": "Currency"
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()"
},
{
"doctype": "DocField",
@@ -52,7 +53,8 @@
"fieldtype": "Currency",
"label": "Credit",
"oldfieldname": "credit",
"oldfieldtype": "Currency"
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()"
},
{
"doctype": "DocField",

View File

@@ -17,6 +17,8 @@
// Booking Entry Id
// --------------------
cur_frm.add_fetch("account", "company", "company")
cur_frm.cscript.onload_post_render = function(doc) {
$(cur_frm.get_field("reconcile").input).addClass("btn-info");
}

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-21 18:19:17",
"docstatus": 0,
"modified": "2013-01-22 14:56:41",
"modified": "2013-01-23 17:11:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -31,7 +31,8 @@
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 1,
"report": 0,
"role": "Accounts User",
"submit": 0,
"write": 1
},
@@ -47,6 +48,15 @@
"options": "Account",
"reqd": 1
},
{
"doctype": "DocField",
"fieldname": "company",
"fieldtype": "Link",
"hidden": 1,
"label": "Company",
"options": "Company",
"print_hide": 1
},
{
"doctype": "DocField",
"fieldname": "voucher_type",
@@ -82,6 +92,7 @@
"fieldname": "total_amount",
"fieldtype": "Currency",
"label": "Total Amount",
"options": "eval:erpnext.get_currency()",
"read_only": 1
},
{
@@ -89,6 +100,7 @@
"fieldname": "pending_amt_to_reconcile",
"fieldtype": "Currency",
"label": "Outstanding Amount",
"options": "eval:erpnext.get_currency()",
"read_only": 1
},
{
@@ -166,15 +178,6 @@
"label": "Amount <="
},
{
"doctype": "DocPerm",
"role": "System Manager"
},
{
"doctype": "DocPerm",
"role": "Accounts Manager"
},
{
"doctype": "DocPerm",
"role": "Accounts User"
"doctype": "DocPerm"
}
]

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:07",
"docstatus": 0,
"modified": "2013-01-22 14:47:04",
"modified": "2013-01-23 17:11:17",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -40,6 +40,7 @@
"fieldname": "amt_due",
"fieldtype": "Currency",
"label": "Unmatched Amount",
"options": "eval:erpnext.get_currency()",
"read_only": 1
},
{
@@ -47,6 +48,7 @@
"fieldname": "amt_to_be_reconciled",
"fieldtype": "Currency",
"label": "Allocated Amount",
"options": "eval:erpnext.get_currency()",
"reqd": 1
},
{
@@ -61,6 +63,7 @@
"fieldname": "total_amt",
"fieldtype": "Currency",
"label": "Total Amount",
"options": "eval:erpnext.get_currency()",
"read_only": 1
},
{

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-21 18:19:17",
"docstatus": 0,
"modified": "2013-01-22 16:55:20",
"modified": "2013-01-23 17:25:09",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -73,6 +73,17 @@
"reqd": 1,
"search_index": 1
},
{
"doctype": "DocField",
"fieldname": "supplier",
"fieldtype": "Link",
"hidden": 0,
"label": "Supplier",
"oldfieldname": "supplier",
"oldfieldtype": "Link",
"options": "Supplier",
"print_hide": 1
},
{
"doctype": "DocField",
"fieldname": "supplier_name",
@@ -346,6 +357,7 @@
"label": "Total Tax",
"oldfieldname": "total_tax",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1
},
@@ -355,17 +367,6 @@
"fieldtype": "Section Break",
"label": "Contact Info"
},
{
"doctype": "DocField",
"fieldname": "supplier",
"fieldtype": "Link",
"hidden": 0,
"label": "Supplier",
"oldfieldname": "supplier",
"oldfieldtype": "Link",
"options": "Supplier",
"print_hide": 1
},
{
"depends_on": "eval:doc.supplier",
"doctype": "DocField",
@@ -403,6 +404,7 @@
"label": "Net Total (Import)",
"oldfieldname": "net_total_import",
"oldfieldtype": "Currency",
"options": "currency",
"print_hide": 1,
"read_only": 1
},
@@ -413,6 +415,7 @@
"label": "Taxes and Charges Added (Import)",
"oldfieldname": "other_charges_added_import",
"oldfieldtype": "Currency",
"options": "currency",
"print_hide": 1,
"read_only": 1
},
@@ -423,6 +426,7 @@
"label": "Taxes and Charges Deducted (Import)",
"oldfieldname": "other_charges_deducted_import",
"oldfieldtype": "Currency",
"options": "currency",
"print_hide": 1,
"read_only": 1
},
@@ -433,6 +437,7 @@
"label": "Grand Total (Import)",
"oldfieldname": "grand_total_import",
"oldfieldtype": "Currency",
"options": "currency",
"print_hide": 1,
"read_only": 1
},
@@ -455,6 +460,7 @@
"no_copy": 1,
"oldfieldname": "total_amount_to_pay",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1
},
@@ -466,6 +472,7 @@
"no_copy": 1,
"oldfieldname": "total_advance",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1
},
@@ -478,6 +485,7 @@
"no_copy": 1,
"oldfieldname": "outstanding_amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1,
"search_index": 1
@@ -498,6 +506,7 @@
"label": "Net Total",
"oldfieldname": "net_total",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1
},
@@ -508,6 +517,7 @@
"label": "Taxes and Charges Added",
"oldfieldname": "other_charges_added",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1
},
@@ -518,6 +528,7 @@
"label": "Taxes and Charges Deducted",
"oldfieldname": "other_charges_deducted",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1
},
@@ -528,6 +539,7 @@
"label": "Grand Total",
"oldfieldname": "grand_total",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1
},
@@ -548,6 +560,7 @@
"fieldtype": "Currency",
"label": "Write Off Amount",
"no_copy": 1,
"options": "eval:erpnext.get_currency()",
"print_hide": 1
},
{

View File

@@ -35,7 +35,7 @@ wn.doclistviews['Purchase Invoice'] = 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'}
},

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:08",
"docstatus": 0,
"modified": "2013-01-22 14:47:52",
"modified": "2013-01-23 17:11:17",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -55,6 +55,7 @@
"label": "Advance Amount",
"oldfieldname": "advance_amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"read_only": 1,
"width": "100px"
},
@@ -65,6 +66,7 @@
"label": "Allocated Amount",
"oldfieldname": "allocated_amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"width": "100px"
},
{

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:08",
"docstatus": 0,
"modified": "2013-01-22 14:47:52",
"modified": "2013-01-23 17:11:17",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -82,6 +82,7 @@
"fieldname": "import_ref_rate",
"fieldtype": "Currency",
"label": "Ref Rate ",
"options": "currency",
"print_hide": 1
},
{
@@ -98,6 +99,7 @@
"label": "Rate ",
"oldfieldname": "import_rate",
"oldfieldtype": "Currency",
"options": "currency",
"print_hide": 0,
"reqd": 1
},
@@ -108,6 +110,7 @@
"label": "Amount",
"oldfieldname": "import_amount",
"oldfieldtype": "Currency",
"options": "currency",
"read_only": 1,
"reqd": 1
},
@@ -116,6 +119,7 @@
"fieldname": "purchase_ref_rate",
"fieldtype": "Currency",
"label": "Ref Rate *",
"options": "eval:erpnext.get_currency()",
"print_hide": 1
},
{
@@ -125,6 +129,7 @@
"label": "Rate *(Default Curr.)",
"oldfieldname": "rate",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"reqd": 1
},
@@ -135,6 +140,7 @@
"label": "Amount (Default Curr.)",
"oldfieldname": "amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1,
"reqd": 1

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:08",
"docstatus": 0,
"modified": "2013-01-22 14:47:56",
"modified": "2013-01-23 17:11:17",
"modified_by": "Administrator",
"owner": "wasim@webnotestech.com"
},
@@ -72,6 +72,7 @@
"label": "Rate",
"oldfieldname": "rate",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"reqd": 0
},
{
@@ -81,6 +82,7 @@
"label": "Amount",
"oldfieldname": "tax_amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"reqd": 0
},
{
@@ -90,6 +92,7 @@
"label": "Total",
"oldfieldname": "total",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"read_only": 1
},
{
@@ -156,6 +159,7 @@
"no_copy": 1,
"oldfieldname": "total_tax_amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"report_hide": 1
},
@@ -169,6 +173,7 @@
"no_copy": 1,
"oldfieldname": "total_amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"report_hide": 1
}

View File

@@ -31,8 +31,8 @@ cur_frm.pformat.purchase_tax_details= function(doc){
var make_row = function(title,val,bold){
var bstart = '<b>'; var bend = '</b>';
return '<tr><td style="width:50%;">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'
+'<td style="width:25%;text-align:right;">'+doc.currency+'</td>'
+'<td style="width:25%;text-align:right;">'+val+'</td>'
+'<td style="width:25%;text-align:right;"></td>'
+'<td style="width:25%;text-align:right;">'+format_currency(val, doc.currency)+'</td>'
+'</tr>'
}
@@ -44,20 +44,22 @@ cur_frm.pformat.purchase_tax_details= function(doc){
var cl = getchildren('Purchase Taxes and Charges',doc.name,'purchase_tax_details');
// outer table
var out='<div><table class="noborder" style="width:100%"><tr><td style="width: 60%"></td><td>';
var out='<div><table class="noborder" style="width:100%">\
<tr><td style="width: 60%"></td><td>';
// main table
out +='<table class="noborder" style="width:100%">'+make_row('Net Total',fmt_money(convert_rate(doc.net_total)),1);
out +='<table class="noborder" style="width:100%">'
+make_row('Net Total',convert_rate(doc.net_total),1);
// add rows
if(cl.length){
for(var i=0;i<cl.length;i++){
out += make_row(cl[i].description,fmt_money(convert_rate(cl[i].tax_amount)),0);
out += make_row(cl[i].description,convert_rate(cl[i].tax_amount),0);
}
}
// grand total
out +=make_row('Grand Total',fmt_money(doc.grand_total_import),1)
out +=make_row('Grand Total',doc.grand_total_import,1)
if(doc.in_words_import){
out +='</table></td></tr>';
out += '<tr><td colspan = "2">';

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:08",
"docstatus": 0,
"modified": "2013-01-22 16:55:23",
"modified": "2013-01-23 17:11:17",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -244,6 +244,7 @@
"label": "Net Total*",
"oldfieldname": "net_total",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 0,
"read_only": 1,
"reqd": 1
@@ -413,6 +414,7 @@
"label": "Total Taxes and Charges",
"oldfieldname": "other_charges_total",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1
},
@@ -448,6 +450,7 @@
"label": "Grand Total",
"oldfieldname": "grand_total",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1,
"reqd": 1,
@@ -460,6 +463,7 @@
"label": "Rounded Total",
"oldfieldname": "rounded_total",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1
},
@@ -481,6 +485,7 @@
"label": "Total Advance",
"oldfieldname": "total_advance",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1
},
@@ -492,6 +497,7 @@
"no_copy": 1,
"oldfieldname": "outstanding_amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1
},
@@ -510,6 +516,7 @@
"label": "Grand Total (Export)",
"oldfieldname": "grand_total_export",
"oldfieldtype": "Currency",
"options": "currency",
"print_hide": 0,
"read_only": 1,
"reqd": 1
@@ -521,6 +528,7 @@
"label": "Rounded Total (Export)",
"oldfieldname": "rounded_total_export",
"oldfieldtype": "Currency",
"options": "currency",
"print_hide": 0,
"read_only": 1
},
@@ -541,13 +549,14 @@
"label": "Gross Profit",
"oldfieldname": "gross_profit",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "gross_profit_percent",
"fieldtype": "Currency",
"fieldtype": "Float",
"label": "Gross Profit (%)",
"oldfieldname": "gross_profit_percent",
"oldfieldtype": "Currency",
@@ -573,6 +582,7 @@
"label": "Paid Amount",
"oldfieldname": "paid_amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1
},
{
@@ -603,6 +613,7 @@
"fieldname": "write_off_amount",
"fieldtype": "Currency",
"label": "Write Off Amount",
"options": "eval:erpnext.get_currency()",
"print_hide": 1
},
{
@@ -1016,6 +1027,7 @@
"label": "Total Commission",
"oldfieldname": "total_commission",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1
},
{

View File

@@ -32,7 +32,7 @@ wn.doclistviews['Sales Invoice'] = wn.views.ListView.extend({
{
width: '18%',
content: function(parent, data) {
$(parent).html(data.currency + ' ' + fmt_money(data.grand_total_export))
$(parent).html(format_currency(data.grand_total_export, data.currency))
},
css: {'text-align':'right'}
},

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:09",
"docstatus": 0,
"modified": "2013-01-22 14:48:41",
"modified": "2013-01-23 17:11:18",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -55,6 +55,7 @@
"label": "Advance amount",
"oldfieldname": "advance_amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"read_only": 1,
"width": "120px"
},
@@ -65,6 +66,7 @@
"label": "Allocated amount",
"oldfieldname": "allocated_amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"width": "120px"
},
{

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:09",
"docstatus": 0,
"modified": "2013-01-22 15:01:34",
"modified": "2013-01-23 17:11:18",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -99,6 +99,7 @@
"label": "Price List Rate",
"oldfieldname": "ref_rate",
"oldfieldtype": "Currency",
"options": "currency",
"print_hide": 1,
"reqd": 0
},
@@ -118,6 +119,7 @@
"label": "Basic Rate",
"oldfieldname": "export_rate",
"oldfieldtype": "Currency",
"options": "currency",
"reqd": 1
},
{
@@ -127,6 +129,7 @@
"label": "Amount",
"oldfieldname": "export_amount",
"oldfieldtype": "Currency",
"options": "currency",
"read_only": 1,
"reqd": 1
},
@@ -137,6 +140,7 @@
"label": "Price List Rate*",
"oldfieldname": "base_ref_rate",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1
},
@@ -148,6 +152,7 @@
"label": "Basic Rate*",
"oldfieldname": "basic_rate",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"reqd": 1,
"search_index": 0
@@ -159,6 +164,7 @@
"label": "Amount*",
"oldfieldname": "amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"read_only": 1,
"reqd": 1

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:09",
"docstatus": 0,
"modified": "2013-01-22 14:48:42",
"modified": "2013-01-23 17:11:18",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -69,7 +69,7 @@
{
"doctype": "DocField",
"fieldname": "rate",
"fieldtype": "Currency",
"fieldtype": "Float",
"label": "Rate",
"oldfieldname": "rate",
"oldfieldtype": "Currency",
@@ -82,6 +82,7 @@
"label": "Amount",
"oldfieldname": "tax_amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"reqd": 0
},
{
@@ -91,6 +92,7 @@
"label": "Total",
"oldfieldname": "total",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"read_only": 1
},
{
@@ -134,6 +136,7 @@
"no_copy": 1,
"oldfieldname": "total_tax_amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"report_hide": 1
},
@@ -147,6 +150,7 @@
"no_copy": 1,
"oldfieldname": "total_amount",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"print_hide": 1,
"report_hide": 1
},

View File

@@ -45,8 +45,8 @@ cur_frm.pformat.other_charges= function(doc){
var make_row = function(title,val,bold){
var bstart = '<b>'; var bend = '</b>';
return '<tr><td style="width:50%;">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'
+'<td style="width:25%;text-align:right;">'+doc.currency+'</td>'
+'<td style="width:25%;text-align:right;">'+val+'</td>'
+'<td style="width:25%;text-align:right;"></td>'
+'<td style="width:25%;text-align:right;">'+format_currency(val, doc.currency)+'</td>'
+'</tr>'
}
@@ -73,24 +73,24 @@ cur_frm.pformat.other_charges= function(doc){
out +='<table class="noborder" style="width:100%">';
if(!print_hide_dict['net_total']) {
out +=make_row('Net Total',fmt_money(convert_rate(doc.net_total)),1);
out +=make_row('Net Total',convert_rate(doc.net_total),1);
}
// add rows
if(cl.length){
for(var i=0;i<cl.length;i++){
if(fmt_money(convert_rate(cl[i].tax_amount))!=0 && !cl[i].included_in_print_rate)
out += make_row(cl[i].description,fmt_money(convert_rate(cl[i].tax_amount)),0);
if(convert_rate(cl[i].tax_amount)!=0 && !cl[i].included_in_print_rate)
out += make_row(cl[i].description,convert_rate(cl[i].tax_amount),0);
}
}
// grand total
if(!print_hide_dict['grand_total_export']) {
out += make_row('Grand Total',fmt_money(doc.grand_total_export),1);
out += make_row('Grand Total',doc.grand_total_export,1);
}
if(!print_hide_dict['rounded_total_export']) {
out += make_row('Rounded Total',fmt_money(doc.rounded_total_export),1);
out += make_row('Rounded Total',doc.rounded_total_export,1);
}
if(doc.in_words_export && !print_hide_dict['in_words_export']){
@@ -184,4 +184,4 @@ cur_frm.cscript.tax_amount = function(doc, cdt, cdn) {
}
validated = false;
refresh_field('tax_amount',d.name,'other_charges');
}
};

View File

@@ -112,9 +112,8 @@ erpnext.AccountsChart = Class.extend({
if (ctype == 'Account') {
var bal = treenode.data && treenode.data.balance.split(' ') || ['',''];
if (bal && flt(bal[1])) {
treenode.parent.append('<span class="balance-area">\
<span style="color: #aaa">'+ bal[0] + '</span> '
+ fmt_money(bal[1]) + '</span>');
treenode.parent.append('<span class="balance-area">'
+ format_currency(bal[1], bal[0]) + '</span>');
}
}
}

View File

@@ -1,6 +1,6 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import get_defaults, fmt_money
from webnotes.utils import get_defaults
from accounts.utils import get_balance_on
@webnotes.whitelist()

View File

@@ -83,9 +83,11 @@ pscript.stmt_new = function(stmt,company_name,level,period,year) {
$i('stmt_tree').innerHTML = 'Refreshing....';
$i('stmt_tree').style.display = 'block';
var company = sel_val($i('stmt_company'))
var arg = {
statement:sel_val($i('stmt_type'))
,company:sel_val($i('stmt_company'))
,company:company,
,period:sel_val($i('stmt_period'))
,year:sel_val($i('stmt_fiscal_year'))
}
@@ -136,9 +138,12 @@ pscript.stmt_new = function(stmt,company_name,level,period,year) {
}
if(nl[i][0] != 0){
if(nl[i][j]) {
if (i==0) per.innerHTML = (nl[i][j]+'').bold();
else if(nl[i][0] == 1 || nl[i][0] == 4) per.innerHTML = (cstr(fmt_money(nl[i][j]))+'').bold();
else per.innerHTML = fmt_money(nl[i][j])
if (i==0)
per.innerHTML = (nl[i][j]+'').bold();
else if(nl[i][0] == 1 || nl[i][0] == 4)
per.innerHTML = format_currency(nl[i][j], erpnext.get_currency(company)).bold();
else
per.innerHTML = format_currency(nl[i][j], erpnext.get_currency(company))
} else
per.innerHTML = '-';
}