mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-09 08:02:51 +00:00
invoice account head fix
This commit is contained in:
@@ -35,7 +35,7 @@ class DocType(TransactionBase):
|
|||||||
# Credit To
|
# Credit To
|
||||||
# ----------
|
# ----------
|
||||||
def get_credit_to(self):
|
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)
|
#supp_detail = sql("select supplier_name,address from `tabSupplier` where name = %s", self.doc.supplier, as_dict =1)
|
||||||
#ret = {
|
#ret = {
|
||||||
# 'supplier_name' : supp_detail and supp_detail[0]['supplier_name'] or '',
|
# 'supplier_name' : supp_detail and supp_detail[0]['supplier_name'] or '',
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class DocType(TransactionBase):
|
|||||||
# Get Account Head to which amount needs to be Debited based on Customer
|
# Get Account Head to which amount needs to be Debited based on Customer
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
def get_customer_account(self):
|
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]:
|
if acc_head and acc_head[0][0]:
|
||||||
return acc_head[0][0]
|
return acc_head[0][0]
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user