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

Conflicts:
	accounts/doctype/account/account.py
	controllers/accounts_controller.py
	patches/patch_list.py
	selling/doctype/sales_common/sales_common.py
	stock/doctype/purchase_receipt/purchase_receipt.py
This commit is contained in:
Anand Doshi
2013-11-15 19:12:09 +05:30
26 changed files with 590 additions and 143 deletions

View File

@@ -247,14 +247,14 @@ class SellingController(StockController):
customer_account = webnotes.conn.get_value("Account", {"company": self.doc.company,
"master_name": self.doc.customer}, "name")
if customer_account:
total_outstanding = 0
total_outstanding = webnotes.conn.sql("""select
sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
from `tabGL Entry` where account = %s""", customer_account)[0][0]
from `tabGL Entry` where account = %s""", customer_account)
total_outstanding = total_outstanding[0][0] if total_outstanding else 0
outstanding_including_current = flt(total_outstanding) + flt(grand_total)
webnotes.bean('Account', customer_account).run_method("check_credit_limit",
customer_account, self.doc.company, outstanding_including_current)
outstanding_including_current)
def validate_max_discount(self):
for d in self.doclist.get({"parentfield": self.fname}):