Merge branch 'master' into staging-fixes

This commit is contained in:
Frappe Bot
2018-12-06 09:26:42 +00:00
10 changed files with 27 additions and 19 deletions

View File

@@ -65,6 +65,7 @@ class calculate_taxes_and_totals(object):
if item.doctype in ['Quotation Item', 'Sales Order Item', 'Delivery Note Item', 'Sales Invoice Item']:
item.rate_with_margin, item.base_rate_with_margin = self.calculate_margin(item)
if flt(item.rate_with_margin) > 0:
item.rate = flt(item.rate_with_margin * (1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))
item.discount_amount = item.rate_with_margin - item.rate
@@ -647,4 +648,4 @@ def get_rounded_tax_amount(itemised_tax, precision):
# Rounding based on tax_amount precision
for taxes in itemised_tax.values():
for tax_account in taxes:
taxes[tax_account]["tax_amount"] = flt(taxes[tax_account]["tax_amount"], precision)
taxes[tax_account]["tax_amount"] = flt(taxes[tax_account]["tax_amount"], precision)