account cleanup started
This commit is contained in:
parent
5281e350fb
commit
d6814dde29
@ -14,17 +14,6 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Fetch parent details
|
|
||||||
// -----------------------------------------
|
|
||||||
cur_frm.add_fetch('parent_account', 'debit_or_credit', 'debit_or_credit');
|
|
||||||
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
|
// Onload
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
@ -47,22 +36,36 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
|||||||
cur_frm.cscript.hide_unhide_group_ledger(doc);
|
cur_frm.cscript.hide_unhide_group_ledger(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fetch parent details
|
||||||
|
// -----------------------------------------
|
||||||
|
cur_frm.add_fetch('parent_account', 'debit_or_credit', 'debit_or_credit');
|
||||||
|
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']);
|
||||||
|
}
|
||||||
|
|
||||||
// Hide/unhide group or ledger
|
// Hide/unhide group or ledger
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
cur_frm.cscript.hide_unhide_group_ledger = function(doc) {
|
cur_frm.cscript.hide_unhide_group_ledger = function(doc) {
|
||||||
hide_field(['convert_to_group', 'convert_to_ledger']);
|
if (cstr(doc.group_or_ledger) == 'Group') {
|
||||||
if (cstr(doc.group_or_ledger) == 'Group') unhide_field('convert_to_ledger');
|
cur_frm.add_custom_button('Convert to Ledger',
|
||||||
else if (cstr(doc.group_or_ledger) == 'Ledger') unhide_field('convert_to_group');
|
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
|
// Convert group to ledger
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) {
|
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) {
|
if(r.message == 1) {
|
||||||
doc.group_or_ledger = 'Ledger';
|
|
||||||
refresh_field('group_or_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 +73,11 @@ cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) {
|
|||||||
// Convert ledger to group
|
// Convert ledger to group
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
cur_frm.cscript.convert_to_group = function(doc, cdt, cdn) {
|
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) {
|
if(r.message == 1) {
|
||||||
doc.group_or_ledger = 'Group';
|
doc.group_or_ledger = 'Group';
|
||||||
refresh_field('group_or_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());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
# These values are common in all dictionaries
|
# These values are common in all dictionaries
|
||||||
{
|
{
|
||||||
'creation': '2012-03-27 14:35:39',
|
'creation': '2012-07-03 13:30:50',
|
||||||
'docstatus': 0,
|
'docstatus': 0,
|
||||||
'modified': '2012-03-27 14:35:39',
|
'modified': '2012-07-10 18:34:16',
|
||||||
'modified_by': u'Administrator',
|
'modified_by': u'Administrator',
|
||||||
'owner': u'Administrator'
|
'owner': u'Administrator'
|
||||||
},
|
},
|
||||||
@ -26,7 +26,7 @@
|
|||||||
'section_style': u'Tray',
|
'section_style': u'Tray',
|
||||||
'server_code_error': u' ',
|
'server_code_error': u' ',
|
||||||
'show_in_menu': 0,
|
'show_in_menu': 0,
|
||||||
'version': 138
|
'version': 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocField
|
# These values are common for all DocField
|
||||||
@ -58,14 +58,34 @@
|
|||||||
|
|
||||||
# DocPerm
|
# DocPerm
|
||||||
{
|
{
|
||||||
'cancel': 1,
|
'cancel': 0,
|
||||||
'create': 1,
|
'create': 0,
|
||||||
'doctype': u'DocPerm',
|
'doctype': u'DocPerm',
|
||||||
'permlevel': 0,
|
'permlevel': 0,
|
||||||
'role': u'Accounts User',
|
'role': u'Auditor',
|
||||||
'write': 1
|
'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
|
# DocPerm
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
'cancel': 0,
|
||||||
@ -86,6 +106,26 @@
|
|||||||
'write': 0
|
'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
|
# DocPerm
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
'cancel': 0,
|
||||||
@ -106,16 +146,6 @@
|
|||||||
'write': 0
|
'write': 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
|
||||||
'cancel': 1,
|
|
||||||
'create': 1,
|
|
||||||
'doctype': u'DocPerm',
|
|
||||||
'permlevel': 0,
|
|
||||||
'role': u'Accounts Manager',
|
|
||||||
'write': 1
|
|
||||||
},
|
|
||||||
|
|
||||||
# DocPerm
|
# DocPerm
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
'cancel': 0,
|
||||||
@ -141,7 +171,7 @@
|
|||||||
'doctype': u'DocField',
|
'doctype': u'DocField',
|
||||||
'fieldname': u'properties',
|
'fieldname': u'properties',
|
||||||
'fieldtype': u'Section Break',
|
'fieldtype': u'Section Break',
|
||||||
'label': u'Properties',
|
'label': u'Account Details',
|
||||||
'oldfieldtype': u'Section Break',
|
'oldfieldtype': u'Section Break',
|
||||||
'permlevel': 0
|
'permlevel': 0
|
||||||
},
|
},
|
||||||
@ -170,20 +200,6 @@
|
|||||||
'search_index': 1
|
'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
|
# DocField
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
'doctype': u'DocField',
|
||||||
@ -213,26 +229,6 @@
|
|||||||
'search_index': 1
|
'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
|
# DocField
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
'doctype': u'DocField',
|
||||||
@ -260,6 +256,44 @@
|
|||||||
'search_index': 1
|
'search_index': 1
|
||||||
},
|
},
|
||||||
|
|
||||||
|
# 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
|
# DocField
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
'doctype': u'DocField',
|
||||||
@ -292,40 +326,18 @@
|
|||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
'colour': u'White:FFF',
|
||||||
'fieldname': u'column_break1',
|
'description': u'If the account is frozen, entries are allowed for the "Account Manager" only.',
|
||||||
'fieldtype': u'Column Break',
|
|
||||||
'permlevel': 0,
|
|
||||||
'width': u'50%'
|
|
||||||
},
|
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
|
||||||
'doctype': u'DocField',
|
'doctype': u'DocField',
|
||||||
'fieldname': u'freeze_account',
|
'fieldname': u'freeze_account',
|
||||||
'fieldtype': u'Select',
|
'fieldtype': u'Select',
|
||||||
'label': u'Freeze Account',
|
'label': u'Frozen',
|
||||||
'oldfieldname': u'freeze_account',
|
'oldfieldname': u'freeze_account',
|
||||||
'oldfieldtype': u'Select',
|
'oldfieldtype': u'Select',
|
||||||
'options': u'No\nYes',
|
'options': u'No\nYes',
|
||||||
'permlevel': 2
|
'permlevel': 2
|
||||||
},
|
},
|
||||||
|
|
||||||
# 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
|
# DocField
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
'doctype': u'DocField',
|
||||||
|
@ -2492,6 +2492,10 @@ div.sidebar-comment-info {
|
|||||||
.input_area input, select, textarea {
|
.input_area input, select, textarea {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
|
|
||||||
|
-webkit-border-radius: 3px;
|
||||||
|
-moz-border-radius: 3px;
|
||||||
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input_area input {
|
.input_area input {
|
||||||
@ -2509,9 +2513,16 @@ div.sidebar-comment-info {
|
|||||||
width: 80%;
|
width: 80%;
|
||||||
padding: 2px 0px;
|
padding: 2px 0px;
|
||||||
font-size: 12px;
|
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 {
|
.disp_area_no_val {
|
||||||
height: 14px;
|
min-height: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.no_img {
|
.no_img {
|
||||||
|
@ -28,6 +28,10 @@
|
|||||||
.input_area input, select, textarea {
|
.input_area input, select, textarea {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
|
|
||||||
|
-webkit-border-radius: 3px;
|
||||||
|
-moz-border-radius: 3px;
|
||||||
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input_area input {
|
.input_area input {
|
||||||
@ -45,9 +49,16 @@
|
|||||||
width: 80%;
|
width: 80%;
|
||||||
padding: 2px 0px;
|
padding: 2px 0px;
|
||||||
font-size: 12px;
|
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 {
|
.disp_area_no_val {
|
||||||
height: 14px;
|
min-height: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.no_img {
|
.no_img {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user