Merge pull request #25226 from deepeshgarg007/rcm_total_calculation_fix_v12

fix: RCM tax calculation
This commit is contained in:
Deepesh Garg
2021-04-13 20:07:35 +05:30
committed by GitHub

View File

@@ -748,16 +748,18 @@ def update_grand_total_for_rcm(doc, method):
update_totals(gst_tax, base_gst_tax, doc)
def update_totals(gst_tax, base_gst_tax, doc):
doc.base_grand_total -= base_gst_tax
doc.grand_total -= gst_tax
doc.base_grand_total = (doc.grand_total * doc.conversion_rate)
if doc.meta.get_field("rounded_total"):
if not doc.is_rounded_total_disabled():
doc.rounded_total = round_based_on_smallest_currency_fraction(doc.grand_total,
doc.currency, doc.precision("rounded_total"))
doc.base_rounded_total += doc.rounded_total * doc.conversion_rate
doc.rounding_adjustment += flt(doc.rounded_total - doc.grand_total,
doc.precision("rounding_adjustment"))
doc.base_rounding_adjustment = doc.rounding_adjustment * doc.conversion_rate
calculate_outstanding_amount(doc)
@@ -817,7 +819,11 @@ def get_gst_tax_amount(doc):
continue
if flt(tax.base_tax_amount_after_discount_amount) and tax.account_head in gst_account_list:
base_gst_tax += tax.base_tax_amount_after_discount_amount
gst_tax += tax.tax_amount_after_discount_amount
if tax.add_deduct_tax == "Add":
base_gst_tax += tax.base_tax_amount_after_discount_amount
gst_tax += tax.tax_amount_after_discount_amount
else:
base_gst_tax -= tax.base_tax_amount_after_discount_amount
gst_tax -= tax.tax_amount_after_discount_amount
return gst_tax, base_gst_tax