fixes in dynamic label setting and column hiding based on currency

This commit is contained in:
Nabin Hait 2013-01-25 18:31:06 +05:30
parent 163bebb670
commit d4c7159f60
5 changed files with 22 additions and 22 deletions

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-01-10 16:34:08", "creation": "2013-01-24 11:03:29",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-23 17:11:17", "modified": "2013-01-25 18:28:20",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -118,7 +118,7 @@
"doctype": "DocField", "doctype": "DocField",
"fieldname": "purchase_ref_rate", "fieldname": "purchase_ref_rate",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Ref Rate *", "label": "Ref Rate*",
"options": "eval:erpnext.get_currency()", "options": "eval:erpnext.get_currency()",
"print_hide": 1 "print_hide": 1
}, },
@ -126,7 +126,7 @@
"doctype": "DocField", "doctype": "DocField",
"fieldname": "rate", "fieldname": "rate",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Rate *(Default Curr.)", "label": "Rate*",
"oldfieldname": "rate", "oldfieldname": "rate",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()", "options": "eval:erpnext.get_currency()",
@ -137,7 +137,7 @@
"doctype": "DocField", "doctype": "DocField",
"fieldname": "amount", "fieldname": "amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Amount (Default Curr.)", "label": "Amount*",
"oldfieldname": "amount", "oldfieldname": "amount",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()", "options": "eval:erpnext.get_currency()",

View File

@ -228,10 +228,10 @@ erpnext.buying.BuyingController = erpnext.utils.Controller.extend({
// toggle columns // toggle columns
var item_grid = this.frm.fields_dict[this.fname].grid; var item_grid = this.frm.fields_dict[this.fname].grid;
var hide = this.frm.doc.currency == company_currency; var show = this.frm.doc.currency != company_currency;
$.each(["purchase_rate", "purchase_ref_rate", "amount", "rate"], function(i, fname) { $.each(["purchase_rate", "purchase_ref_rate", "amount", "rate"], function(i, fname) {
if(wn.meta.get_docfield(item_grid.doctype, fname)) if(wn.meta.get_docfield(item_grid.doctype, fname))
item_grid.set_column_disp(fname, hide); item_grid.set_column_disp(fname, show);
}); });
// set labels // set labels

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-01-10 16:34:10", "creation": "2013-01-24 11:03:31",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-23 17:11:19", "modified": "2013-01-25 18:26:49",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -151,7 +151,7 @@
"doctype": "DocField", "doctype": "DocField",
"fieldname": "purchase_ref_rate", "fieldname": "purchase_ref_rate",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Ref Rate *", "label": "Ref Rate*",
"options": "eval:erpnext.get_currency()", "options": "eval:erpnext.get_currency()",
"print_hide": 1 "print_hide": 1
}, },
@ -160,7 +160,7 @@
"doctype": "DocField", "doctype": "DocField",
"fieldname": "purchase_rate", "fieldname": "purchase_rate",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Rate (Default Curr.) *", "label": "Rate*",
"oldfieldname": "purchase_rate", "oldfieldname": "purchase_rate",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()", "options": "eval:erpnext.get_currency()",
@ -174,7 +174,7 @@
"doctype": "DocField", "doctype": "DocField",
"fieldname": "amount", "fieldname": "amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Amount (Default Curr.)", "label": "Amount*",
"oldfieldname": "amount", "oldfieldname": "amount",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()", "options": "eval:erpnext.get_currency()",

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-01-10 16:34:12", "creation": "2013-01-24 11:03:32",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-23 17:11:19", "modified": "2013-01-25 18:28:54",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -137,7 +137,7 @@
"doctype": "DocField", "doctype": "DocField",
"fieldname": "purchase_ref_rate", "fieldname": "purchase_ref_rate",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Ref Rate *", "label": "Ref Rate*",
"options": "eval:erpnext.get_currency()", "options": "eval:erpnext.get_currency()",
"print_hide": 1 "print_hide": 1
}, },
@ -146,7 +146,7 @@
"doctype": "DocField", "doctype": "DocField",
"fieldname": "purchase_rate", "fieldname": "purchase_rate",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Rate (Default Curr.) *", "label": "Rate*",
"oldfieldname": "purchase_rate", "oldfieldname": "purchase_rate",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()", "options": "eval:erpnext.get_currency()",
@ -160,7 +160,7 @@
"doctype": "DocField", "doctype": "DocField",
"fieldname": "amount", "fieldname": "amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Amount (Default Curr.)", "label": "Amount*",
"oldfieldname": "amount", "oldfieldname": "amount",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()", "options": "eval:erpnext.get_currency()",

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-01-10 16:34:28", "creation": "2013-01-24 11:03:43",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-23 17:11:25", "modified": "2013-01-25 18:27:53",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -155,7 +155,7 @@
"doctype": "DocField", "doctype": "DocField",
"fieldname": "purchase_ref_rate", "fieldname": "purchase_ref_rate",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Ref Rate *", "label": "Ref Rate*",
"options": "eval:erpnext.get_currency()", "options": "eval:erpnext.get_currency()",
"print_hide": 1 "print_hide": 1
}, },
@ -164,7 +164,7 @@
"doctype": "DocField", "doctype": "DocField",
"fieldname": "purchase_rate", "fieldname": "purchase_rate",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Rate *(Default Curr.)", "label": "Rate*",
"oldfieldname": "purchase_rate", "oldfieldname": "purchase_rate",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()", "options": "eval:erpnext.get_currency()",
@ -178,7 +178,7 @@
"doctype": "DocField", "doctype": "DocField",
"fieldname": "amount", "fieldname": "amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Amount (Default Curr.)", "label": "Amount*",
"oldfieldname": "amount", "oldfieldname": "amount",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()", "options": "eval:erpnext.get_currency()",