This commit is contained in:
Anand Doshi
2014-04-02 15:03:35 +05:30
parent dd32d6eb1f
commit 5b552b51f1
15 changed files with 53 additions and 73 deletions

View File

@@ -342,20 +342,14 @@ class AccountsController(TransactionBase):
def _cleanup(self):
for tax in self.tax_doclist:
for fieldname in ("grand_total_for_current_item",
"tax_amount_for_current_item",
"tax_fraction_for_current_item",
"grand_total_fraction_for_current_item"):
if fieldname in tax.fields:
del tax.get(fieldname)
tax.item_wise_tax_detail = json.dumps(tax.item_wise_tax_detail)
def _set_in_company_currency(self, item, print_field, base_field):
"""set values in base currency"""
item.set(base_field, flt((flt(item.get(print_field),)
self.precision(print_field, item)) * self.conversion_rate),
value_in_company_currency = flt(self.conversion_rate *
flt(item.get(print_field), self.precision(print_field, item)),
self.precision(base_field, item))
item.set(base_field, value_in_company_currency)
def calculate_total_advance(self, parenttype, advance_parentfield):
if self.doctype == parenttype and self.docstatus < 2:

View File

@@ -147,18 +147,6 @@ class BuyingController(StockController):
self.outstanding_amount = flt(self.total_amount_to_pay - self.total_advance,
self.precision("outstanding_amount"))
def _cleanup(self):
super(BuyingController, self)._cleanup()
if not self.meta.get_field("item_tax_amount", parentfield=self.fname):
for item in self.item_doclist:
del item.get("item_tax_amount")
if not self.meta.get_field("tax_amount_after_discount_amount",
parentfield=self.other_fname):
for tax in self.tax_doclist:
del tax.get("tax_amount_after_discount_amount")
# update valuation rate
def update_valuation_rate(self, parentfield):
"""