fix: test case for rounded total with cash disc
(cherry picked from commit cc60c328fe349f7d53c77799e8e91973c2790746)
This commit is contained in:
parent
70eccf7da0
commit
eab18e6f71
@ -789,6 +789,28 @@ class TestSalesInvoice(FrappeTestCase):
|
|||||||
w = self.make()
|
w = self.make()
|
||||||
self.assertEqual(w.outstanding_amount, w.base_rounded_total)
|
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):
|
def test_payment(self):
|
||||||
w = self.make()
|
w = self.make()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user