diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js index d5300c75b5..79c15bf1ae 100644 --- a/erpnext/accounts/doctype/account/account.js +++ b/erpnext/accounts/doctype/account/account.js @@ -14,6 +14,41 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + +// Onload +// ----------------------------------------- +cur_frm.cscript.onload = function(doc, cdt, cdn) { +} + +// Refresh +// ----------------------------------------- +cur_frm.cscript.refresh = function(doc, cdt, cdn) { + // read-only for root accounts + root_acc = ['Application of Funds (Assets)','Expenses','Income','Source of Funds (Liabilities)']; + if(inList(root_acc, doc.account_name)) + cur_frm.perm = [[1,0,0], [1,0,0]]; + + // hide fields if group + cur_frm.toggle_fields(['account_type', 'master_type', 'master_name', 'freeze_account', + 'credit_days', 'credit_limit'], doc.group_or_ledger=='Ledger') + + // credit days and type if customer or supplier + cur_frm.toggle_fields(['credit_days', 'credit_limit'], + in_list(['Customer', 'Supplier'], doc.master_type)) + + // hide tax_rate + cur_frm.cscript.account_type(doc, cdt, cdn); + + // show / hide convert buttons + cur_frm.cscript.hide_unhide_group_ledger(doc); + + // back to chart of accounts + cur_frm.add_custom_button('Back To Chart of Accounts', function() { + wn.set_route('Accounts Browser', 'Account'); + }, 'icon-arrow-left') + +} + // Fetch parent details // ----------------------------------------- cur_frm.add_fetch('parent_account', 'debit_or_credit', 'debit_or_credit'); @@ -22,47 +57,28 @@ cur_frm.add_fetch('parent_account', 'is_pl_account', 'is_pl_account'); // Hide tax rate based on account type // ----------------------------------------- cur_frm.cscript.account_type = function(doc, cdt, cdn) { - if(doc.account_type == 'Tax') unhide_field(['tax_rate']); - else hide_field(['tax_rate']); -} - -// Onload -// ----------------------------------------- -cur_frm.cscript.onload = function(doc, cdt, cdn) { - cur_frm.cscript.account_type(doc, cdt, cdn); - // hide India specific fields - var cp = wn.control_panel; - if(cp.country == 'India') - unhide_field(['pan_number', 'tds_applicable', 'tds_details', 'tds']); - else - hide_field(['pan_number', 'tds_applicable', 'tds_details', 'tds']); -} - -// Refresh -// ----------------------------------------- -cur_frm.cscript.refresh = function(doc, cdt, cdn) { - root_acc = [' Application of Funds (Assets)','Expenses','Income','Source of Funds (Liabilities)']; - if(inList(root_acc, doc.account_name)) - cur_frm.perm = [[1,0,0], [1,0,0]]; - cur_frm.cscript.hide_unhide_group_ledger(doc); + cur_frm.toggle_fields(['tax_rate'], doc.account_type == 'Tax') + cur_frm.toggle_fields(['master_type', 'master_name'], cstr(doc.account_type)=='') } // Hide/unhide group or ledger // ----------------------------------------- cur_frm.cscript.hide_unhide_group_ledger = function(doc) { - hide_field(['convert_to_group', 'convert_to_ledger']); - if (cstr(doc.group_or_ledger) == 'Group') unhide_field('convert_to_ledger'); - else if (cstr(doc.group_or_ledger) == 'Ledger') unhide_field('convert_to_group'); + if (cstr(doc.group_or_ledger) == 'Group') { + cur_frm.add_custom_button('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', + function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet') + } } - // Convert group to ledger // ----------------------------------------- cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) { - $c_obj(make_doclist(cdt,cdn),'convert_group_to_ledger','',function(r,rt) { + $c_obj(cur_frm.get_doclist(),'convert_group_to_ledger','',function(r,rt) { if(r.message == 1) { - doc.group_or_ledger = 'Ledger'; refresh_field('group_or_ledger'); - cur_frm.cscript.hide_unhide_group_ledger(doc); + cur_frm.cscript.hide_unhide_group_ledger(cur_frm.get_doc()); } }); } @@ -70,11 +86,11 @@ cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) { // Convert ledger to group // ----------------------------------------- cur_frm.cscript.convert_to_group = function(doc, cdt, cdn) { - $c_obj(make_doclist(cdt,cdn),'convert_ledger_to_group','',function(r,rt) { + $c_obj(cur_frm.get_doclist(),'convert_ledger_to_group','',function(r,rt) { if(r.message == 1) { doc.group_or_ledger = 'Group'; refresh_field('group_or_ledger'); - cur_frm.cscript.hide_unhide_group_ledger(doc); + cur_frm.cscript.hide_unhide_group_ledger(cur_frm.get_doc()); } }); } @@ -85,11 +101,13 @@ cur_frm.fields_dict['master_name'].get_query=function(doc){ if (doc.master_type){ return 'SELECT `tab'+doc.master_type+'`.name FROM `tab'+doc.master_type+'` WHERE `tab'+doc.master_type+'`.name LIKE "%s" and `tab'+doc.master_type+'`.docstatus != 2 ORDER BY `tab'+doc.master_type+'`.name LIMIT 50'; } - else alert("Please select master type"); } // parent account get query // ----------------------------------------- cur_frm.fields_dict['parent_account'].get_query = function(doc){ - return 'SELECT DISTINCT `tabAccount`.name FROM `tabAccount` WHERE `tabAccount`.group_or_ledger="Group" AND `tabAccount`.docstatus != 2 AND `tabAccount`.company="'+ doc.company+'" AND `tabAccount`.company is not NULL AND `tabAccount`.name LIKE "%s" ORDER BY `tabAccount`.name LIMIT 50'; + return 'SELECT DISTINCT `tabAccount`.name FROM `tabAccount` WHERE \ + `tabAccount`.group_or_ledger="Group" AND `tabAccount`.docstatus != 2 AND \ + `tabAccount`.company="'+ doc.company+'" AND `tabAccount`.company is not NULL AND \ + `tabAccount`.name LIKE "%s" ORDER BY `tabAccount`.name LIMIT 50'; } diff --git a/erpnext/accounts/doctype/account/account.txt b/erpnext/accounts/doctype/account/account.txt index ec0ade9db2..e3ec85a7b2 100644 --- a/erpnext/accounts/doctype/account/account.txt +++ b/erpnext/accounts/doctype/account/account.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:35:39', + 'creation': '2012-07-03 13:30:50', 'docstatus': 0, - 'modified': '2012-03-27 14:35:39', + 'modified': '2012-07-11 09:21:01', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -26,7 +26,7 @@ 'section_style': u'Tray', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 138 + 'version': 1 }, # These values are common for all DocField @@ -58,14 +58,34 @@ # DocPerm { - 'cancel': 1, - 'create': 1, + 'cancel': 0, + 'create': 0, 'doctype': u'DocPerm', 'permlevel': 0, - 'role': u'Accounts User', + 'role': u'Auditor', 'write': 1 }, + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Auditor', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 2, + 'role': u'Auditor', + 'write': 0 + }, + # DocPerm { 'cancel': 0, @@ -86,6 +106,26 @@ 'write': 0 }, + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Accounts User', + 'write': 1 + }, + + # DocPerm + { + 'cancel': 1, + 'create': 1, + 'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Accounts Manager', + 'write': 1 + }, + # DocPerm { 'cancel': 0, @@ -106,16 +146,6 @@ 'write': 0 }, - # DocPerm - { - 'cancel': 1, - 'create': 1, - 'doctype': u'DocPerm', - 'permlevel': 0, - 'role': u'Accounts Manager', - 'write': 1 - }, - # DocPerm { 'cancel': 0, @@ -141,7 +171,7 @@ 'doctype': u'DocField', 'fieldname': u'properties', 'fieldtype': u'Section Break', - 'label': u'Properties', + 'label': u'Account Details', 'oldfieldtype': u'Section Break', 'permlevel': 0 }, @@ -170,20 +200,6 @@ 'search_index': 1 }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'parent_account', - 'fieldtype': u'Link', - 'label': u'Parent Account', - 'oldfieldname': u'parent_account', - 'oldfieldtype': u'Link', - 'options': u'Account', - 'permlevel': 0, - 'search_index': 1, - 'trigger': u'Client' - }, - # DocField { 'doctype': u'DocField', @@ -213,26 +229,6 @@ 'search_index': 1 }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'convert_to_group', - 'fieldtype': u'Button', - 'label': u'Convert to Group', - 'permlevel': 0, - 'trigger': u'Client' - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'convert_to_ledger', - 'fieldtype': u'Button', - 'label': u'Convert to Ledger', - 'permlevel': 0, - 'trigger': u'Client' - }, - # DocField { 'doctype': u'DocField', @@ -262,6 +258,46 @@ # DocField { + 'doctype': u'DocField', + 'fieldname': u'company', + 'fieldtype': u'Link', + 'in_filter': 1, + 'label': u'Company', + 'oldfieldname': u'company', + 'oldfieldtype': u'Link', + 'options': u'Company', + 'permlevel': 1, + 'reqd': 1, + 'search_index': 1 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'column_break1', + 'fieldtype': u'Column Break', + 'permlevel': 0, + 'width': u'50%' + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'parent_account', + 'fieldtype': u'Link', + 'label': u'Parent Account', + 'oldfieldname': u'parent_account', + 'oldfieldtype': u'Link', + 'options': u'Account', + 'permlevel': 0, + 'search_index': 1, + 'trigger': u'Client' + }, + + # DocField + { + 'colour': u'White:FFF', + 'description': u'Setting Account Type helps in selecting this Account in transactions.', 'doctype': u'DocField', 'fieldname': u'account_type', 'fieldtype': u'Select', @@ -278,7 +314,7 @@ # DocField { 'colour': u'White:FFF', - 'description': u'If Account Type is "Tax" then the default rate is required.', + 'description': u'Rate at which this tax is applied', 'doctype': u'DocField', 'fieldname': u'tax_rate', 'fieldtype': u'Currency', @@ -292,19 +328,12 @@ # DocField { - 'doctype': u'DocField', - 'fieldname': u'column_break1', - 'fieldtype': u'Column Break', - 'permlevel': 0, - 'width': u'50%' - }, - - # DocField - { + 'colour': u'White:FFF', + 'description': u'If the account is frozen, entries are allowed for the "Account Manager" only.', 'doctype': u'DocField', 'fieldname': u'freeze_account', 'fieldtype': u'Select', - 'label': u'Freeze Account', + 'label': u'Frozen', 'oldfieldname': u'freeze_account', 'oldfieldtype': u'Select', 'options': u'No\nYes', @@ -313,21 +342,7 @@ # DocField { - 'doctype': u'DocField', - 'fieldname': u'company', - 'fieldtype': u'Link', - 'in_filter': 1, - 'label': u'Company', - 'oldfieldname': u'company', - 'oldfieldtype': u'Link', - 'options': u'Company', - 'permlevel': 1, - 'reqd': 1, - 'search_index': 1 - }, - - # DocField - { + 'colour': u'White:FFF', 'doctype': u'DocField', 'fieldname': u'credit_days', 'fieldtype': u'Int', @@ -354,13 +369,15 @@ # DocField { + 'colour': u'White:FFF', + 'description': u'If this Account represents a Customer, Supplier or Employee, set it here.', 'doctype': u'DocField', 'fieldname': u'master_type', 'fieldtype': u'Select', 'label': u'Master Type', 'oldfieldname': u'master_type', 'oldfieldtype': u'Select', - 'options': u'\nNA\nSupplier\nCustomer\nEmployee', + 'options': u'\nSupplier\nCustomer\nEmployee', 'permlevel': 0 }, @@ -374,116 +391,5 @@ 'oldfieldtype': u'Link', 'permlevel': 0, 'trigger': u'Client' - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'tds', - 'fieldtype': u'Section Break', - 'label': u'TDS', - 'oldfieldtype': u'Section Break', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'pan_number', - 'fieldtype': u'Data', - 'label': u'PAN Number', - 'oldfieldname': u'pan_number', - 'oldfieldtype': u'Data', - 'permlevel': 0 - }, - - # DocField - { - 'default': u'No', - 'doctype': u'DocField', - 'fieldname': u'tds_applicable', - 'fieldtype': u'Select', - 'label': u'TDS Applicable', - 'oldfieldname': u'tds_applicable', - 'oldfieldtype': u'Select', - 'options': u'\nYes\nNo', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'tds_details', - 'fieldtype': u'Table', - 'label': u'TDS Details', - 'oldfieldname': u'tds_details', - 'oldfieldtype': u'Table', - 'options': u'TDS Detail', - 'permlevel': 0 - }, - - # DocField - { - 'description': u"Don't delete this field at any cost", - 'doctype': u'DocField', - 'fieldname': u'old_parent', - 'fieldtype': u'Link', - 'hidden': 1, - 'label': u'Old Parent', - 'no_copy': 1, - 'oldfieldname': u'old_parent', - 'oldfieldtype': u'Data', - 'options': u'Account', - 'permlevel': 0, - 'report_hide': 1 - }, - - # DocField - { - 'colour': u'White:FFF', - 'description': u"Don't delete this field at any cost", - 'doctype': u'DocField', - 'fieldname': u'lft', - 'fieldtype': u'Int', - 'hidden': 1, - 'in_filter': 1, - 'label': u'Lft', - 'no_copy': 1, - 'oldfieldname': u'lft', - 'oldfieldtype': u'Int', - 'permlevel': 3, - 'print_hide': 1, - 'report_hide': 1, - 'search_index': 1 - }, - - # DocField - { - 'colour': u'White:FFF', - 'description': u"Don't delete this field at any cost", - 'doctype': u'DocField', - 'fieldname': u'rgt', - 'fieldtype': u'Int', - 'hidden': 1, - 'in_filter': 1, - 'label': u'Rgt', - 'no_copy': 1, - 'oldfieldname': u'rgt', - 'oldfieldtype': u'Int', - 'permlevel': 3, - 'print_hide': 1, - 'report_hide': 1, - 'search_index': 1 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'trash_reason', - 'fieldtype': u'Small Text', - 'label': u'Trash Reason', - 'oldfieldname': u'trash_reason', - 'oldfieldtype': u'Small Text', - 'permlevel': 1 } ] \ No newline at end of file diff --git a/erpnext/accounts/doctype/cost_center/cost_center.js b/erpnext/accounts/doctype/cost_center/cost_center.js index ade4ee882b..f721e42f2d 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.js +++ b/erpnext/accounts/doctype/cost_center/cost_center.js @@ -15,6 +15,30 @@ // along with this program. If not, see . +//onload if cost center is group +cur_frm.cscript.onload = function(doc, cdt, cdn) { + if(!doc.__islocal && doc.docstatus == 0){ + get_field(doc.doctype,'group_or_ledger',doc.name).permlevel = 1; + refresh_field('group_or_ledger'); + get_field(doc.doctype,'company_name',doc.name).permlevel = 1; + refresh_field('company_name'); + } + +} + +cur_frm.cscript.refresh = function(doc, cdt, cdn) { + cur_frm.cscript.hide_unhide_group_ledger(doc); + cur_frm.add_custom_button('Back To Chart of Cost Centers', function() { + wn.set_route('Accounts Browser', 'Cost Center'); + }, 'icon-arrow-left') + + var intro_txt = ''; + if(!doc.__islocal && doc.group_or_ledger=='Group') { + intro_txt += '

Note: This is Cost Center is a Group, \ + Accounting Entries are not allowed against groups.

'; + } + cur_frm.set_intro(intro_txt); +} //Account filtering for cost center cur_frm.fields_dict['budget_details'].grid.get_field('account').get_query = function(doc) { @@ -38,39 +62,26 @@ cur_frm.cscript.company_name = function(doc,cdt,cdn){ get_server_fields('get_abbr','','',doc,cdt,cdn,1); } -//onload if cost center is group -cur_frm.cscript.onload = function(doc, cdt, cdn) { - - if(!doc.__islocal && doc.docstatus == 0){ - get_field(doc.doctype,'group_or_ledger',doc.name).permlevel = 1; - refresh_field('group_or_ledger'); - get_field(doc.doctype,'company_name',doc.name).permlevel = 1; - refresh_field('company_name'); - } - -} - -cur_frm.cscript.refresh = function(doc, cdt, cdn) { - cur_frm.cscript.hide_unhide_group_ledger(doc); -} - // Hide/unhide group or ledger // ----------------------------------------- cur_frm.cscript.hide_unhide_group_ledger = function(doc) { - hide_field(['convert_to_group', 'convert_to_ledger']); - if (cstr(doc.group_or_ledger) == 'Group') unhide_field('convert_to_ledger'); - else if (cstr(doc.group_or_ledger) == 'Ledger') unhide_field('convert_to_group'); + if (cstr(doc.group_or_ledger) == 'Group') { + cur_frm.add_custom_button('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', + function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet') + } } // Convert group to ledger // ----------------------------------------- cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) { - $c_obj(make_doclist(cdt,cdn),'convert_group_to_ledger','',function(r,rt) { + $c_obj(cur_frm.get_doclist(),'convert_group_to_ledger','',function(r,rt) { if(r.message == 1) { - doc.group_or_ledger = 'Ledger'; refresh_field('group_or_ledger'); - cur_frm.cscript.hide_unhide_group_ledger(doc); + cur_frm.cscript.hide_unhide_group_ledger(cur_frm.get_doc()); } }); } @@ -78,11 +89,10 @@ cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) { // Convert ledger to group // ----------------------------------------- cur_frm.cscript.convert_to_group = function(doc, cdt, cdn) { - $c_obj(make_doclist(cdt,cdn),'convert_ledger_to_group','',function(r,rt) { + $c_obj(cur_frm.get_doclist(),'convert_ledger_to_group','',function(r,rt) { if(r.message == 1) { - doc.group_or_ledger = 'Group'; refresh_field('group_or_ledger'); - cur_frm.cscript.hide_unhide_group_ledger(doc); + cur_frm.cscript.hide_unhide_group_ledger(cur_frm.get_doc()); } }); } diff --git a/erpnext/accounts/doctype/cost_center/cost_center.txt b/erpnext/accounts/doctype/cost_center/cost_center.txt index b02d909370..aea5fbb9d6 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.txt +++ b/erpnext/accounts/doctype/cost_center/cost_center.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:35:41', + 'creation': '2012-07-03 13:30:47', 'docstatus': 0, - 'modified': '2012-03-27 14:35:41', + 'modified': '2012-07-10 18:06:51', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -27,7 +27,7 @@ 'section_style': u'Simple', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 109 + 'version': 1 }, # These values are common for all DocField @@ -55,6 +55,42 @@ 'name': u'Cost Center' }, + # DocPerm + { + 'amend': 0, + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Accounts Manager', + 'submit': 0, + 'write': 0 + }, + + # DocPerm + { + 'amend': 0, + 'cancel': 1, + 'create': 1, + 'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Accounts Manager', + 'submit': 0, + 'write': 1 + }, + + # DocPerm + { + 'amend': 0, + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Accounts User', + 'submit': 0, + 'write': 0 + }, + # DocPerm { 'amend': 0, @@ -84,40 +120,13 @@ 'role': u'All' }, - # DocPerm + # DocField { - 'amend': 0, - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'Accounts Manager', - 'submit': 0, - 'write': 0 - }, - - # DocPerm - { - 'amend': 0, - 'cancel': 1, - 'create': 1, - 'doctype': u'DocPerm', - 'permlevel': 0, - 'role': u'Accounts Manager', - 'submit': 0, - 'write': 1 - }, - - # DocPerm - { - 'amend': 0, - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'Accounts User', - 'submit': 0, - 'write': 0 + 'doctype': u'DocField', + 'fieldname': u'sb0', + 'fieldtype': u'Section Break', + 'label': u'Cost Center Details', + 'permlevel': 0 }, # DocField @@ -148,7 +157,7 @@ # DocField { - 'description': u'Select company name first.', + 'colour': u'White:FFF', 'doctype': u'DocField', 'fieldname': u'parent_cost_center', 'fieldtype': u'Link', @@ -178,15 +187,26 @@ # DocField { + 'colour': u'White:FFF', 'doctype': u'DocField', 'fieldname': u'company_abbr', 'fieldtype': u'Data', + 'hidden': 1, 'label': u'Company Abbr', 'oldfieldname': u'company_abbr', 'oldfieldtype': u'Data', 'permlevel': 1 }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'cb0', + 'fieldtype': u'Column Break', + 'permlevel': 0, + 'width': u'50%' + }, + # DocField { 'colour': u'White:FFF', @@ -209,27 +229,18 @@ # DocField { 'colour': u'White:FFF', + 'description': u'Define Budget for this Cost Center', 'doctype': u'DocField', - 'fieldname': u'convert_to_group', - 'fieldtype': u'Button', - 'label': u'Convert to Group', - 'permlevel': 0, - 'trigger': u'Client' + 'fieldname': u'sb1', + 'fieldtype': u'Section Break', + 'label': u'Budget', + 'permlevel': 0 }, # DocField { 'colour': u'White:FFF', - 'doctype': u'DocField', - 'fieldname': u'convert_to_ledger', - 'fieldtype': u'Button', - 'label': u'Convert to Ledger', - 'permlevel': 0, - 'trigger': u'Client' - }, - - # DocField - { + 'description': u'Select Budget Distribution, if you want to track based on seasonality.', 'doctype': u'DocField', 'fieldname': u'distribution_id', 'fieldtype': u'Link', @@ -242,6 +253,8 @@ # DocField { + 'colour': u'White:FFF', + 'description': u'Add rows to set budgets on Accounts. To set budget actions, see the company master.', 'doctype': u'DocField', 'fieldname': u'budget_details', 'fieldtype': u'Table', diff --git a/public/css/all-app.css b/public/css/all-app.css index ecdbe652f9..6bd1d58037 100644 --- a/public/css/all-app.css +++ b/public/css/all-app.css @@ -2059,7 +2059,7 @@ div.fix_ff_cursor { overflow: auto; } div.comment { color: #444; } .small { - font-size: 11px; + font-size: 12px; } .help { @@ -2284,23 +2284,13 @@ div.notice { } .help_box, .help-box { - background-color:#FFC; - font-size: 13px; - color: #864; - padding: 7px; + background-color: #ffe; + color: #874; + padding: 9px 9px 9px 9px; + border: 1px dashed #fc7; margin: 11px 0px; - border: 1px solid #EEB; } -.help_box_big { - background-color:#FFC; - color: #864; - padding: 7px; - margin: 7px 0px; - border: 1px solid #EEB; - text-align: center; - font-size: 14px; -} /* * lib/css/legacy/forms.css @@ -2319,6 +2309,11 @@ div.form-title { margin-right: 7px; } +div.form-intro-area { + padding: 9px 9px 0px 9px; + margin: 0px 0px 15px 0px; +} + div.form-section-head { margin: 11px -15px 3px -15px; border-top: 1px solid #ccc; @@ -2328,7 +2323,7 @@ div.form-section-head { div.form-layout-row:first-child .form-section-head { border-top: 0px solid #ccc !important; margin-top: 0px; - padding-top: 15px; + padding-top: 0px; } div.form-section-head h3 { @@ -2355,18 +2350,6 @@ div.page_break { border-top: 1px dashed #888; } -div.grid_tbarlinks { - border-bottom: 0px; - background-color: #CCC; - padding: 4px 4px 2px 4px; - width: 190px; - float: right; - - -moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px; - -webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px; -} - - div.dialog_frm { position: relative; margin: 10px; @@ -2497,6 +2480,10 @@ div.sidebar-comment-info { .input_area input, select, textarea { font-size: 14px; padding: 2px; + + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } .input_area input { @@ -2514,9 +2501,16 @@ div.sidebar-comment-info { width: 80%; padding: 2px 0px; font-size: 12px; + background-color: #eee; + padding: 2px; + border: 1px solid #ddd; + + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } .disp_area_no_val { - height: 14px; + min-height: 14px; } .no_img { @@ -2541,48 +2535,38 @@ div.sidebar-comment-info { * lib/css/legacy/grid.css */ - -/* Grid */ - - -/* --- Simple --- */ -.grid_wrapper_simple { - width: 100%; - margin-bottom: 8px; - border: 1px solid #AA9; -} - -.grid_head_wrapper_simple { - padding: 0px; - border-bottom: 2px solid #AAA; -} - -.grid_head_wrapper_simple td { - border-right: 1px solid #AA9; -} - -.grid_head_wrapper_simple td div { - padding: 2px; -} - -.grid_tab_wrapper_simple { -} - -.grid_cell_simple { - padding: 2px; - background-color: #fff; - border-right: 1px solid #AA9; -} - - -/* --- Normal --- */ .grid_wrapper { position: relative; overflow: auto; border: 1px solid #AAA; width: 100%; margin-bottom: 8px; - background-color: #fff; + background-color: #f8f8f8; +} + +div.grid_tbarlinks { + border-bottom: 0px; + padding: 4px 4px 2px 4px; + width: 190px; + float: right; + margin-right: 12px; + + -webkit-border-top-left-radius: 5px; + -webkit-border-top-right-radius: 5px; + -moz-border-radius-topleft: 5px; + -moz-border-radius-topright: 5px; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + + background: #dddddd; /* Old browsers */ + background: -moz-linear-gradient(top, #dddddd 0%, #bbbbbb 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dddddd), color-stop(100%,#bbbbbb)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #dddddd 0%,#bbbbbb 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #dddddd 0%,#bbbbbb 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #dddddd 0%,#bbbbbb 100%); /* IE10+ */ + background: linear-gradient(to bottom, #dddddd 0%,#bbbbbb 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dddddd', endColorstr='#bbbbbb',GradientType=0 ); /* IE6-9 */ + } .grid_tab_wrapper { @@ -2613,11 +2597,19 @@ div.sidebar-comment-info { } .grid_head_table td { - background-color: #EEE; border-right: 1px solid #AAA; border-bottom: 1px solid #AAA; height: 40px; padding: 0px; + + background: #eeeeee; /* Old browsers */ + background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#cccccc)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* IE10+ */ + background: linear-gradient(to bottom, #eeeeee 0%,#cccccc 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0 ); /* IE6-9 */ } .grid_head_table td div { diff --git a/public/css/all-web.css b/public/css/all-web.css index 332471b01b..e1311c4baa 100644 --- a/public/css/all-web.css +++ b/public/css/all-web.css @@ -1920,7 +1920,7 @@ div.fix_ff_cursor { overflow: auto; } div.comment { color: #444; } .small { - font-size: 11px; + font-size: 12px; } .help { @@ -2145,23 +2145,13 @@ div.notice { } .help_box, .help-box { - background-color:#FFC; - font-size: 13px; - color: #864; - padding: 7px; + background-color: #ffe; + color: #874; + padding: 9px 9px 9px 9px; + border: 1px dashed #fc7; margin: 11px 0px; - border: 1px solid #EEB; } -.help_box_big { - background-color:#FFC; - color: #864; - padding: 7px; - margin: 7px 0px; - border: 1px solid #EEB; - text-align: center; - font-size: 14px; -} /* * lib/css/legacy/dialog.css diff --git a/public/css/fields.css b/public/css/fields.css index 3f8aaf3f63..61892eeb72 100644 --- a/public/css/fields.css +++ b/public/css/fields.css @@ -28,6 +28,10 @@ .input_area input, select, textarea { font-size: 14px; padding: 2px; + + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } .input_area input { @@ -45,9 +49,16 @@ width: 80%; padding: 2px 0px; font-size: 12px; + background-color: #eee; + padding: 2px; + border: 1px solid #ddd; + + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } .disp_area_no_val { - height: 14px; + min-height: 14px; } .no_img { diff --git a/public/js/all-app.js b/public/js/all-app.js index fd55b1684c..d0e4771658 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -855,7 +855,7 @@ wn.ui.AppFrame=Class.extend({init:function(parent,title){this.buttons={};this.$w ×\ ').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();}) if(title)this.title(title);},title:function(txt){this.$titlebar.find('.appframe-title').html(txt);},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length) -this.$w.append('
');args={label:label,icon:''};if(icon){args.icon='';} +this.$w.append('
');args={label:label,icon:''};if(icon){args.icon='';} this.buttons[label]=$(repl('',args)).click(click).appendTo(this.$w.find('.appframe-toolbar'));return this.buttons[label];},clear_buttons:function(){this.$w.find('.appframe-toolbar').empty();}});wn.ui.make_app_page=function(opts){if(opts.single_column){$(opts.parent).html('
\
\ @@ -1220,14 +1220,14 @@ args.colnames=colnames.join(',');args.report_name=report_name?report_name:'';ope * lib/js/legacy/webpage/search.js */ search_fields={};function setlinkvalue(name){selector.input.set_input_value(name);selector.hide();} -function makeselector(){var d=new Dialog(540,440,'Search');d.make_body([['Data','Beginning With','Tip: You can use wildcard "%"'],['Select','Search By'],['Button','Search'],['HTML','Help'],['HTML','Result']]);var inp=d.widgets['Beginning With'];var field_sel=d.widgets['Search By'];var btn=d.widgets['Search'];d.sel_type='';d.values_len=0;d.set=function(input,type,label){d.sel_type=type;d.input=input;if(d.style!='Link'){d.rows['Result'].innerHTML='';d.values_len=0;} +function makeselector(){var d=new Dialog(540,440,'Search');d.make_body([['HTML','Help'],['Data','Beginning With','Tip: You can use wildcard "%"'],['Select','Search By'],['Button','Search'],['HTML','Result']]);var inp=d.widgets['Beginning With'];var field_sel=d.widgets['Search By'];var btn=d.widgets['Search'];d.sel_type='';d.values_len=0;d.set=function(input,type,label){d.sel_type=type;d.input=input;if(d.style!='Link'){d.rows['Result'].innerHTML='';d.values_len=0;} d.style='Link';d.set_query_description() -if(!d.sel_type)d.sel_type='Value';d.set_title('Select a "'+d.sel_type+'" for field "'+label+'"');} +if(!d.sel_type)d.sel_type='Value';d.set_title("Select");d.set_query_description('Select a "'+d.sel_type+'" for field "'+label+'"');} d.set_search=function(dt){if(d.style!='Search'){d.rows['Result'].innerHTML='';d.values_len=0;} d.style='Search';if(d.input){d.input=null;sel_type=null;} d.sel_type=get_label_doctype(dt);d.set_title('Quick Search for '+dt);} $(inp).keydown(function(e){if(e.which==13){if(!btn.disabled)btn.onclick();}}) -d.set_query_description=function(){if(d.input&&d.input.query_description){d.rows['Help'].innerHTML='
'+d.input.query_description+'
';}else{d.rows['Help'].innerHTML=''}} +d.set_query_description=function(txt){if(!txt)txt=d.input&&d.input.query_description||null;if(txt){d.rows['Help'].innerHTML='
'+txt+'
';}else{d.rows['Help'].innerHTML=''}} d.onshow=function(){if(d.set_doctype!=d.sel_type){d.rows['Result'].innerHTML='';d.values_len=0;} inp.value='';if(d.input&&d.input.txt.value){inp.value=d.input.txt.value;} try{inp.focus();}catch(e){} @@ -1743,6 +1743,8 @@ this.setup_print();} _f.Frm.prototype.setup_sidebar=function(){this.sidebar=new wn.widgets.form.sidebar.Sidebar(this);} _f.Frm.prototype.setup_footer=function(){var me=this;var f=this.page_layout.footer;f.save_area=$a(this.page_layout.footer,'div','',{display:'none',marginTop:'11px'});f.help_area=$a(this.page_layout.footer,'div');var b=$btn(f.save_area,'Save',function(){cur_frm.save('Save');},{marginLeft:'0px'},'green');f.show_save=function(){$ds(me.page_layout.footer.save_area);} f.hide_save=function(){$dh(me.page_layout.footer.save_area);}} +_f.Frm.prototype.set_intro=function(txt){if(!this.intro_area){this.intro_area=$('
').insertBefore(this.page_layout.body.firstChild);} +if(txt){this.intro_area.html(txt);}else{this.intro_area.remove();this.intro_area=null;}} _f.Frm.prototype.setup_fields_std=function(){var fl=wn.meta.docfield_list[this.doctype];fl.sort(function(a,b){return a.idx-b.idx});if(fl[0]&&fl[0].fieldtype!="Section Break"||get_url_arg('embed')){this.layout.addrow();if(fl[0].fieldtype!="Column Break"){var c=this.layout.addcell();$y(c.wrapper,{padding:'8px'});}} var sec;for(var i=0;i'+label+'
';c.cur_label=label;break;}}} @@ -1992,7 +1997,7 @@ var r=this.append_row();r.cells[0].div.innerHTML='*< _f.FormGrid.prototype.check_selected=function(){if(!_f.cur_grid_cell){show_alert('Select a cell first');return false;} if(_f.cur_grid_cell.grid!=this){show_alert('Select a cell first');return false;} return true;} -_f.FormGrid.prototype.delete_row=function(dt,dn){if(dt&&dn){LocalDB.delete_record(dt,dn);this.refresh();}else{if(!this.check_selected())return;var r=_f.cur_grid_cell.row;if(r.is_newrow)return;var ci=_f.cur_grid_cell.cellIndex;var ri=_f.cur_grid_cell.row.rowIndex;LocalDB.delete_record(this.doctype,r.docname);this.refresh();if(ri<(this.tab.rows.length-2)) +_f.FormGrid.prototype.delete_row=function(dt,dn){if(dt&&dn){LocalDB.delete_record(dt,dn);this.refresh();}else{if(!this.check_selected())return;var r=_f.cur_grid_cell.row;if(r.is_newrow)return;var ci=_f.cur_grid_cell.cellIndex;var ri=_f.cur_grid_cell.row.rowIndex;LocalDB.delete_record(this.doctype,r.docname);this.refresh();if(ri<(this.tab.rows.length-1)) this.cell_select(null,ri,ci);else _f.cur_grid_cell=null;} this.set_unsaved();} _f.FormGrid.prototype.move_row=function(up){if(!this.check_selected())return;var r=_f.cur_grid_cell.row;if(r.is_newrow)return;if(up&&r.rowIndex>0){var swap_row=this.tab.rows[r.rowIndex-1];}else if(!up){var len=this.tab.rows.length;if(this.tab.rows[len-1].is_newrow) @@ -2131,10 +2136,10 @@ set_field_options=function(n,txt){var df=get_field(cur_frm.doctype,n,cur_frm.doc set_field_permlevel=function(n,level){var df=get_field(cur_frm.doctype,n,cur_frm.docname);if(df)df.permlevel=level;refresh_field(n);} hide_field=function(n){function _hide_field(n,hidden){var df=get_field(cur_frm.doctype,n,cur_frm.docname);if(df){df.hidden=hidden;refresh_field(n);} else{console.log("hide_field cannot find field "+n);}} -if(cur_frm){if(n.substr)_hide_field(n,1);else{for(var i in n)_hide_field(n[i],1)}}} +if(cur_frm){if(typeof n=='string')_hide_field(n,1);else{for(var i in n)_hide_field(n[i],1)}}} unhide_field=function(n){function _hide_field(n,hidden){var df=get_field(cur_frm.doctype,n,cur_frm.docname);if(df){df.hidden=hidden;refresh_field(n);} else{console.log("unhide_field cannot find field "+n);}} -if(cur_frm){if(n.substr)_hide_field(n,0);else{for(var i in n)_hide_field(n[i],0)}}} +if(cur_frm){if(typeof n=='string')_hide_field(n,0);else{for(var i in n)_hide_field(n[i],0)}}} get_field_obj=function(fn){return cur_frm.fields_dict[fn];} /* * lib/js/legacy/widgets/form/form_comments.js diff --git a/public/js/all-web.js b/public/js/all-web.js index 9673ffb726..76c41120fa 100644 --- a/public/js/all-web.js +++ b/public/js/all-web.js @@ -514,7 +514,7 @@ wn.ui.AppFrame=Class.extend({init:function(parent,title){this.buttons={};this.$w ×\
').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();}) if(title)this.title(title);},title:function(txt){this.$titlebar.find('.appframe-title').html(txt);},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length) -this.$w.append('
');args={label:label,icon:''};if(icon){args.icon='';} +this.$w.append('
');args={label:label,icon:''};if(icon){args.icon='';} this.buttons[label]=$(repl('',args)).click(click).appendTo(this.$w.find('.appframe-toolbar'));return this.buttons[label];},clear_buttons:function(){this.$w.find('.appframe-toolbar').empty();}});wn.ui.make_app_page=function(opts){if(opts.single_column){$(opts.parent).html('
\
\