[buying] [cleanup] deprecated load_default_taxes and get_purchase_tax_details

This commit is contained in:
Anand Doshi 2013-06-10 16:32:55 +05:30
parent ed5f876349
commit 27a981677e
6 changed files with 2 additions and 61 deletions

View File

@ -154,14 +154,6 @@ class DocType(BuyingController):
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 }

View File

@ -387,39 +387,6 @@ class DocType(BuyingController):
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)

View File

@ -224,10 +224,4 @@ class DocType(BuyingController):
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)

View File

@ -63,12 +63,6 @@ class DocType(BuyingController):
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')

View File

@ -54,7 +54,7 @@ class BuyingController(StockController):
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",

View File

@ -313,12 +313,6 @@ class DocType(BuyingController):
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