mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 10:36:31 +00:00
test: reload invoice for outstanding and cover equal-time boundary
This commit is contained in:
@@ -20,6 +20,7 @@ class TestCashierClosing(ERPNextTestSuite):
|
|||||||
si = create_sales_invoice(rate=rate, qty=1, posting_date=DATE, do_not_submit=True)
|
si = create_sales_invoice(rate=rate, qty=1, posting_date=DATE, do_not_submit=True)
|
||||||
si.posting_time = "10:30:00"
|
si.posting_time = "10:30:00"
|
||||||
si.submit()
|
si.submit()
|
||||||
|
si.reload() # read outstanding_amount as persisted after submit
|
||||||
return si
|
return si
|
||||||
|
|
||||||
def make_closing(self, user="Administrator", payments=None, **args):
|
def make_closing(self, user="Administrator", payments=None, **args):
|
||||||
@@ -39,6 +40,11 @@ class TestCashierClosing(ERPNextTestSuite):
|
|||||||
doc = self.make_closing(from_time="18:00:00", time="09:00:00")
|
doc = self.make_closing(from_time="18:00:00", time="09:00:00")
|
||||||
self.assertRaises(frappe.ValidationError, doc.save)
|
self.assertRaises(frappe.ValidationError, doc.save)
|
||||||
|
|
||||||
|
def test_equal_from_and_to_time_is_rejected(self):
|
||||||
|
# validate_time uses >=, so a zero-length window is also blocked
|
||||||
|
doc = self.make_closing(from_time="09:00:00", time="09:00:00")
|
||||||
|
self.assertRaises(frappe.ValidationError, doc.save)
|
||||||
|
|
||||||
def test_net_amount_rolls_up_outstanding_and_adjustments(self):
|
def test_net_amount_rolls_up_outstanding_and_adjustments(self):
|
||||||
si = self.make_invoice_in_window(rate=100)
|
si = self.make_invoice_in_window(rate=100)
|
||||||
doc = self.make_closing(payments=[500], expense=50, custody=30, returns=20)
|
doc = self.make_closing(payments=[500], expense=50, custody=30, returns=20)
|
||||||
|
|||||||
Reference in New Issue
Block a user