Merge branch 'master' of github.com:webnotes/erpnext

Conflicts:
	accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt
	accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.txt
	accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt
This commit is contained in:
Brahma K
2011-07-28 12:41:42 +05:30
12 changed files with 630 additions and 117 deletions

View File

@@ -94,8 +94,8 @@ class DocType:
def convert_group_to_ledger(self):
if self.check_if_child_exists():
msgprint("Account: %s has existing child. You can not convert this account to ledger" % (self.doc.name), raise_exception=1)
elif self.check_prev_bal_exists():
msgprint("Account with balance can not be converted to ledger.", raise_exception=1)
elif self.check_gle_exists():
msgprint("Account with existing transaction can not be converted to ledger.", raise_exception=1)
else:
self.doc.group_or_ledger = 'Ledger'
self.doc.save()
@@ -104,8 +104,8 @@ class DocType:
# Convert ledger to group
# ==================================================================
def convert_ledger_to_group(self):
if self.check_prev_bal_exists():
msgprint("Account with balance can not be converted to group.", raise_exception=1)
if self.check_gle_exists():
msgprint("Account with existing transaction can not be converted to group.", raise_exception=1)
else:
self.doc.group_or_ledger = 'Group'
self.doc.save()
@@ -113,9 +113,9 @@ class DocType:
# Check if any previous balance exists
# ==================================================================
def check_prev_bal_exists(self):
bal = sql("select balance from `tabAccount Balance` where parent = '%s' and ifnull(balance, 0) > 0" % (self.doc.name))
return bal and flt(bal[0][0]) or 0
def check_gle_exists(self):
exists = sql("select name from `tabGL Entry` where account = '%s' and ifnull(is_cancelled, 'No') = 'No'" % (self.doc.name))
return exists and exists[0][0] or ''
# check if child exists
# ==================================================================
@@ -231,8 +231,8 @@ class DocType:
# Account with balance cannot be inactive
# ==================================================================
def check_balance_before_trash(self):
if flt(self.get_curr_bal()) != 0:
msgprint("Account with existing balance can not be trashed", raise_exception=1)
if self.check_gle_exists():
msgprint("Account with existing transaction can not be trashed", raise_exception=1)
if self.check_if_child_exists():
msgprint("Child account exists for this account. You can not trash this account.", raise_exception=1)

View File

@@ -1,30 +0,0 @@
# Search Criteria, lease_agreement_list
[
# These values are common in all dictionaries
{
'creation': '2011-07-26 17:01:34',
'docstatus': 0,
'modified': '2011-07-28 11:18:26',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all Search Criteria
{
'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company',
'criteria_name': 'Lease Agreement List',
'doc_type': 'GL Entry',
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
'module': 'Accounts',
'name': '__common__',
'standard': 'Yes'
},
# Search Criteria, lease_agreement_list
{
'doctype': 'Search Criteria',
'name': 'lease_agreement_list'
}
]

View File

@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2011-07-26 16:45:07',
'creation': '2011-07-27 13:14:29',
'docstatus': 0,
'modified': '2011-07-26 18:26:16',
'modified': '2011-07-27 13:14:29',
'modified_by': 'Administrator',
'owner': 'Administrator'
},

View File

@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2011-07-26 18:11:10',
'creation': '2011-07-27 13:14:29',
'docstatus': 0,
'modified': '2011-07-26 18:26:40',
'modified': '2011-07-27 13:14:29',
'modified_by': 'Administrator',
'owner': 'Administrator'
},

View File

@@ -1,30 +0,0 @@
# Search Criteria, lease_receipt_summary_month_wise
[
# These values are common in all dictionaries
{
'creation': '2011-07-27 18:48:29',
'docstatus': 0,
'modified': '2011-07-28 09:59:51',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all Search Criteria
{
'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company',
'criteria_name': 'Lease Receipt Summary Month Wise',
'doc_type': 'GL Entry',
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
'module': 'Accounts',
'name': '__common__',
'standard': 'Yes'
},
# Search Criteria, lease_receipt_summary_month_wise
{
'doctype': 'Search Criteria',
'name': 'lease_receipt_summary_month_wise'
}
]

View File

@@ -1,31 +0,0 @@
# Search Criteria, lease_receipts_client_wise
[
# These values are common in all dictionaries
{
'creation': '2011-07-28 12:13:41',
'docstatus': 0,
'modified': '2011-07-28 12:16:13',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all Search Criteria
{
'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company',
'criteria_name': 'Lease Receipts Client Wise',
'doc_type': 'GL Entry',
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
'module': 'Accounts',
'name': '__common__',
'page_len': 50,
'standard': 'Yes'
},
# Search Criteria, lease_receipts_client_wise
{
'doctype': 'Search Criteria',
'name': 'lease_receipts_client_wise'
}
]

View File

@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2011-07-26 16:24:45',
'creation': '2011-07-27 13:14:29',
'docstatus': 0,
'modified': '2011-07-26 18:28:03',
'modified': '2011-07-27 13:14:29',
'modified_by': 'Administrator',
'owner': 'Administrator'
},