invoice account head fix

This commit is contained in:
Ravi Dey 2011-06-30 18:10:20 +05:30
parent 38e623ce8b
commit c1c54c9400
2 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ class DocType(TransactionBase):
# Credit To
# ----------
def get_credit_to(self):
acc_head = sql("select name, credit_days from `tabAccount` where name = %s", (cstr(self.doc.supplier) + " - " + self.get_company_abbr()))
acc_head = sql("select name, credit_days from `tabAccount` where (name = %s or (master_name = %s and master_type = 'supplier')) and docstatus != 2", (cstr(self.doc.supplier) + " - " + self.get_company_abbr(),self.doc.supplier))
#supp_detail = sql("select supplier_name,address from `tabSupplier` where name = %s", self.doc.supplier, as_dict =1)
#ret = {
# 'supplier_name' : supp_detail and supp_detail[0]['supplier_name'] or '',

View File

@ -81,7 +81,7 @@ class DocType(TransactionBase):
# Get Account Head to which amount needs to be Debited based on Customer
# ----------------------------------------------------------------------
def get_customer_account(self):
acc_head = sql("select name from `tabAccount` where name = %s and docstatus != 2", (cstr(self.doc.customer) + " - " + self.get_company_abbr()))
acc_head = sql("select name from `tabAccount` where (name = %s or (master_name = %s and master_type = 'customer')) and docstatus != 2", (cstr(self.doc.customer) + " - " + self.get_company_abbr(),self.doc.customer))
if acc_head and acc_head[0][0]:
return acc_head[0][0]
else: