[accounts] [feature] added default_cash_account in company and gets set in Journal Voucher

This commit is contained in:
Rushabh Mehta
2013-03-25 15:44:36 +05:30
parent c5570c6341
commit df8b652402
5 changed files with 52 additions and 59 deletions

View File

@@ -49,6 +49,10 @@ cur_frm.fields_dict.default_bank_account.get_query = function(doc) {
return 'SELECT `tabAccount`.name, `tabAccount`.debit_or_credit, `tabAccount`.group_or_ledger FROM `tabAccount` WHERE `tabAccount`.company = "'+doc.name+'" AND `tabAccount`.group_or_ledger = "Ledger" AND `tabAccount`.docstatus != 2 AND `tabAccount`.account_type = "Bank or Cash" AND `tabAccount`.%(key)s LIKE "%s" ORDER BY `tabAccount`.name LIMIT 50';
}
cur_frm.fields_dict.default_cash_account.get_query = function(doc) {
return 'SELECT `tabAccount`.name, `tabAccount`.debit_or_credit, `tabAccount`.group_or_ledger FROM `tabAccount` WHERE `tabAccount`.company = "'+doc.name+'" AND `tabAccount`.group_or_ledger = "Ledger" AND `tabAccount`.docstatus != 2 AND `tabAccount`.account_type = "Bank or Cash" AND `tabAccount`.%(key)s LIKE "%s" ORDER BY `tabAccount`.name LIMIT 50';
}
cur_frm.fields_dict.receivables_group.get_query = function(doc) {
return 'SELECT `tabAccount`.name FROM `tabAccount` WHERE `tabAccount`.company = "'+doc.name+'" AND `tabAccount`.group_or_ledger = "Group" AND `tabAccount`.docstatus != 2 AND `tabAccount`.%(key)s LIKE "%s" ORDER BY `tabAccount`.name LIMIT 50';

View File

@@ -1,8 +1,8 @@
[
{
"creation": "2013-02-27 09:38:05",
"creation": "2013-03-21 17:41:00",
"docstatus": 0,
"modified": "2013-03-19 12:52:00",
"modified": "2013-03-25 15:35:34",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -25,19 +25,14 @@
},
{
"amend": 0,
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
"name": "__common__",
"parent": "Company",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 1,
"role": "System Manager",
"submit": 0,
"write": 1
"submit": 0
},
{
"doctype": "DocType",
@@ -102,6 +97,13 @@
"oldfieldtype": "Link",
"options": "Account"
},
{
"doctype": "DocField",
"fieldname": "default_cash_account",
"fieldtype": "Link",
"label": "Default Cash Account",
"options": "Account"
},
{
"depends_on": "eval:!doc.__islocal",
"doctype": "DocField",
@@ -307,6 +309,19 @@
"read_only": 1
},
{
"doctype": "DocPerm"
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
"permlevel": 0,
"role": "System Manager",
"write": 1
},
{
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"permlevel": 1,
"role": "All",
"write": 0
}
]