[buying] [cleanup] deprecated load_default_taxes and get_purchase_tax_details
diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.py b/accounts/doctype/purchase_invoice/purchase_invoice.py
index 56940fc..56d6075 100644
--- a/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -154,14 +154,6 @@
def get_rate(self,arg):
return get_obj('Purchase Common').get_rate(arg,self)
- def load_default_taxes(self):
- self.doclist = get_obj('Purchase Common').load_default_taxes(self)
-
-
- def get_purchase_tax_details(self):
- self.doclist = get_obj('Purchase Common').get_purchase_tax_details(self)
-
-
def get_rate1(self,acc):
rate = sql("select tax_rate from `tabAccount` where name='%s'"%(acc))
ret={'add_tax_rate' :rate and flt(rate[0][0]) or 0 }
diff --git a/buying/doctype/purchase_common/purchase_common.py b/buying/doctype/purchase_common/purchase_common.py
index 0ceac1d..6d2baf6 100644
--- a/buying/doctype/purchase_common/purchase_common.py
+++ b/buying/doctype/purchase_common/purchase_common.py
@@ -387,39 +387,6 @@
msgprint("'%s' Not Within The Fiscal Year"%(dn))
raise Exception
- def load_default_taxes(self, obj):
- return self.get_purchase_tax_details(obj, 1)
-
- def get_purchase_tax_details(self,obj, default = 0):
- obj.doclist = self.doc.clear_table(obj.doclist,'purchase_tax_details')
-
- if default: add_cond = " and ifnull(t2.is_default,0) = 1"
- else: add_cond = " and t1.parent = '"+cstr(obj.doc.purchase_other_charges)+"'"
-
- other_charge = sql("""
- select t1.*
- from `tabPurchase Taxes and Charges` t1, `tabPurchase Taxes and Charges Master` t2
- where t1.parent = t2.name %s
- order by t1.idx
- """% add_cond, as_dict = 1)
-
- idx = 0
- for other in other_charge:
- d = addchild(obj.doc, 'purchase_tax_details', 'Purchase Taxes and Charges',
- obj.doclist)
- d.category = other['category']
- d.add_deduct_tax = other['add_deduct_tax']
- d.charge_type = other['charge_type']
- d.row_id = other['row_id']
- d.description = other['description']
- d.account_head = other['account_head']
- d.rate = flt(other['rate'])
- d.tax_amount = flt(other['tax_amount'])
- d.cost_center = other["cost_center"]
- d.idx = idx
- idx += 1
- return obj.doclist
-
def get_rate(self, arg, obj):
arg = eval(arg)
rate = sql("select account_type, tax_rate from `tabAccount` where name = '%s'" %(arg['account_head']), as_dict=1)
diff --git a/buying/doctype/purchase_order/purchase_order.py b/buying/doctype/purchase_order/purchase_order.py
index d956971..908df67 100644
--- a/buying/doctype/purchase_order/purchase_order.py
+++ b/buying/doctype/purchase_order/purchase_order.py
@@ -224,10 +224,4 @@
pass
def get_rate(self,arg):
- return get_obj('Purchase Common').get_rate(arg,self)
-
- def load_default_taxes(self):
- self.doclist = get_obj('Purchase Common').load_default_taxes(self)
-
- def get_purchase_tax_details(self):
- self.doclist = get_obj('Purchase Common').get_purchase_tax_details(self)
+ return get_obj('Purchase Common').get_rate(arg,self)
\ No newline at end of file
diff --git a/buying/doctype/supplier_quotation/supplier_quotation.py b/buying/doctype/supplier_quotation/supplier_quotation.py
index 0982fd6..421ecd0 100644
--- a/buying/doctype/supplier_quotation/supplier_quotation.py
+++ b/buying/doctype/supplier_quotation/supplier_quotation.py
@@ -63,12 +63,6 @@
d.purchase_ref_rate = d.discount_rate = d.purchase_rate = 0.0
d.import_ref_rate = d.import_rate = 0.0
- def load_default_taxes(self):
- self.doclist = get_obj('Purchase Common').load_default_taxes(self)
-
- def get_purchase_tax_details(self):
- self.doclist = get_obj('Purchase Common').get_purchase_tax_details(self)
-
def validate_fiscal_year(self):
get_obj(dt = 'Purchase Common').validate_fiscal_year( \
self.doc.fiscal_year, self.doc.transaction_date, 'Quotation Date')
diff --git a/controllers/buying_controller.py b/controllers/buying_controller.py
index f1cfc10..36ce285 100644
--- a/controllers/buying_controller.py
+++ b/controllers/buying_controller.py
@@ -54,7 +54,7 @@
def get_purchase_tax_details(self):
self.doclist = self.doc.clear_table(self.doclist, "purchase_tax_details")
- self.set_taxes()
+ self.set_taxes("Purchase Taxes and Charges", "purchase_tax_details", "purchase_other_charges")
def validate_warehouse_belongs_to_company(self):
for warehouse, company in webnotes.conn.get_values("Warehouse",
diff --git a/stock/doctype/purchase_receipt/purchase_receipt.py b/stock/doctype/purchase_receipt/purchase_receipt.py
index f47bdee..83322c1 100644
--- a/stock/doctype/purchase_receipt/purchase_receipt.py
+++ b/stock/doctype/purchase_receipt/purchase_receipt.py
@@ -313,12 +313,6 @@
def get_rate(self,arg):
return get_obj('Purchase Common').get_rate(arg,self)
- def load_default_taxes(self):
- self.doclist = get_obj('Purchase Common').load_default_taxes(self)
-
- def get_purchase_tax_details(self):
- self.doclist = get_obj('Purchase Common').get_purchase_tax_details(self)
-
def make_gl_entries(self):
if not cint(webnotes.defaults.get_global_default("auto_inventory_accounting")):
return