[feature] [refactor] Shipping Rule for Buying + Refactor (#11628)

* Shipping rule for Buying

* [refactor] shipping rule
This commit is contained in:
Rushabh Mehta
2017-11-17 14:31:09 +05:30
committed by GitHub
parent 66e65dc104
commit 30dc9a14c6
26 changed files with 13041 additions and 12246 deletions

View File

@@ -233,7 +233,8 @@ class calculate_taxes_and_totals(object):
# if tax/charges is for deduction, multiply by -1
if getattr(tax, "category", None):
tax_amount = 0.0 if (tax.category == "Valuation") else tax_amount
tax_amount *= -1.0 if (tax.add_deduct_tax == "Deduct") else 1.0
if self.doc.doctype in ["Purchase Order", "Purchase Invoice", "Purchase Receipt", "Supplier Quotation"]:
tax_amount *= -1.0 if (tax.add_deduct_tax == "Deduct") else 1.0
return tax_amount
def set_cumulative_total(self, row_idx, tax):