Skip to content

Commit

Permalink
fix: test case for rounded total with cash disc
Browse files Browse the repository at this point in the history
(cherry picked from commit cc60c32)
  • Loading branch information
rtdany10 authored and mergify[bot] committed Nov 19, 2023
1 parent 70eccf7 commit eab18e6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,28 @@ def test_outstanding(self):
w = self.make()
self.assertEqual(w.outstanding_amount, w.base_rounded_total)

def test_rounded_total_with_cash_discount(self):
si = frappe.copy_doc(test_records[2])

item = copy.deepcopy(si.get("items")[0])
item.update(
{
"qty": 1,
"rate": 14960.66,
}
)

si.set("items", [item])
si.set("taxes", [])
si.apply_discount_on = "Grand Total"
si.is_cash_or_non_trade_discount = 1
si.discount_amount = 1
si.insert()

self.assertEqual(si.grand_total, 14959.66)
self.assertEqual(si.rounded_total, 14960)
self.assertEqual(si.rounding_adjustment, 0.34)

def test_payment(self):
w = self.make()

Expand Down

0 comments on commit eab18e6

Please sign in to comment.