fix: (india)(einvoice) discount for CN DN
This commit is contained in:
@@ -273,16 +273,16 @@ def get_item_list(invoice):
|
|||||||
|
|
||||||
item.qty = abs(item.qty)
|
item.qty = abs(item.qty)
|
||||||
|
|
||||||
if invoice.get("apply_discount_on") and (invoice.get("base_discount_amount") > 0.00):
|
if invoice.get("apply_discount_on") and (abs(invoice.get("base_discount_amount")) > 0.00):
|
||||||
# TODO: need to handle case when tax included in basic rate is checked.
|
# TODO: need to handle case when tax included in basic rate is checked.
|
||||||
item.discount_amount = (item.discount_amount * item.qty) + (
|
item.discount_amount = (item.discount_amount * item.qty) + (
|
||||||
item.base_amount - item.base_net_amount
|
abs(item.base_amount) - abs(item.base_net_amount)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
item.discount_amount = item.discount_amount * item.qty
|
item.discount_amount = item.discount_amount * item.qty
|
||||||
|
|
||||||
if invoice.get("is_return") or invoice.get("is_debit_note"):
|
if invoice.get("is_return") or invoice.get("is_debit_note"):
|
||||||
item.unit_rate = abs(item.taxable_value + item.discount_amount) / (
|
item.unit_rate = (abs(item.taxable_value) + item.discount_amount) / (
|
||||||
1 if (item.qty == 0) else item.qty
|
1 if (item.qty == 0) else item.qty
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user