[fix] [minor] Cost center is mandatory if tax is include din valuation and perpetual inventory enabled

This commit is contained in:
Nabin Hait 2013-10-28 15:33:36 +05:30
parent 1fbc03bcfb
commit 9304396e17

View File

@ -350,11 +350,14 @@ class DocType(BuyingController):
) )
# accumulate valuation tax # accumulate valuation tax
if tax.category in ("Valuation", "Valuation and Total") and flt(tax.tax_amount) \ if tax.category in ("Valuation", "Valuation and Total") and flt(tax.tax_amount):
and tax.cost_center: if auto_accounting_for_stock and not tax.cost_center:
valuation_tax.setdefault(tax.cost_center, 0) webnotes.throw(_("Row %(row)s: Cost Center is mandatory \
valuation_tax[tax.cost_center] += \ if tax/charges category is Valuation or Valuation and Total" %
(tax.add_deduct_tax == "Add" and 1 or -1) * flt(tax.tax_amount) {"row": tax.idx}))
valuation_tax.setdefault(tax.cost_center, 0)
valuation_tax[tax.cost_center] += \
(tax.add_deduct_tax == "Add" and 1 or -1) * flt(tax.tax_amount)
# item gl entries # item gl entries
stock_item_and_auto_accounting_for_stock = False stock_item_and_auto_accounting_for_stock = False