test: extend test to cancellation
(cherry picked from commit 79fa562004)
This commit is contained in:
@@ -977,7 +977,7 @@ class TestAccountsController(FrappeTestCase):
|
|||||||
self.assert_ledger_outstanding(si1.doctype, si1.name, 0.0, 0.0)
|
self.assert_ledger_outstanding(si1.doctype, si1.name, 0.0, 0.0)
|
||||||
self.assert_ledger_outstanding(si2.doctype, si2.name, 0.0, 0.0)
|
self.assert_ledger_outstanding(si2.doctype, si2.name, 0.0, 0.0)
|
||||||
|
|
||||||
# Exchange Gain/Loss Journal should've been cancelled
|
# Exchange Gain/Loss Journal should've been created
|
||||||
# remove payment JE from list
|
# remove payment JE from list
|
||||||
exc_je_for_si1 = [x for x in self.get_journals_for(si1.doctype, si1.name) if x.parent != je.name]
|
exc_je_for_si1 = [x for x in self.get_journals_for(si1.doctype, si1.name) if x.parent != je.name]
|
||||||
exc_je_for_si2 = [x for x in self.get_journals_for(si2.doctype, si2.name) if x.parent != je.name]
|
exc_je_for_si2 = [x for x in self.get_journals_for(si2.doctype, si2.name) if x.parent != je.name]
|
||||||
@@ -986,6 +986,15 @@ class TestAccountsController(FrappeTestCase):
|
|||||||
self.assertEqual(len(exc_je_for_si2), 1)
|
self.assertEqual(len(exc_je_for_si2), 1)
|
||||||
self.assertEqual(len(exc_je_for_je), 2)
|
self.assertEqual(len(exc_je_for_je), 2)
|
||||||
|
|
||||||
|
si1.cancel()
|
||||||
|
# Gain/Loss JE of si1 should've been cancelled
|
||||||
|
exc_je_for_si1 = [x for x in self.get_journals_for(si1.doctype, si1.name) if x.parent != je.name]
|
||||||
|
exc_je_for_si2 = [x for x in self.get_journals_for(si2.doctype, si2.name) if x.parent != je.name]
|
||||||
|
exc_je_for_je = [x for x in self.get_journals_for(je.doctype, je.name) if x.parent != je.name]
|
||||||
|
self.assertEqual(len(exc_je_for_si1), 0)
|
||||||
|
self.assertEqual(len(exc_je_for_si2), 1)
|
||||||
|
self.assertEqual(len(exc_je_for_je), 1)
|
||||||
|
|
||||||
def test_30_cr_note_against_sales_invoice(self):
|
def test_30_cr_note_against_sales_invoice(self):
|
||||||
"""
|
"""
|
||||||
Reconciling Cr Note against Sales Invoice, both having different exchange rates
|
Reconciling Cr Note against Sales Invoice, both having different exchange rates
|
||||||
|
|||||||
Reference in New Issue
Block a user