Skip to content

Commit

Permalink
test: partial payment for pos invoice
Browse files Browse the repository at this point in the history
(cherry picked from commit 8772628)
  • Loading branch information
rtdany10 authored and mergify[bot] committed Dec 19, 2023
1 parent cff9e47 commit ffb6d65
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,41 @@ def create_credit_note(self, docname):

return credit_note

def test_pos_receivable(self):
filters = {
"company": self.company,
"party_type": "Customer",
"party": [self.customer],
"report_date": add_days(today(), 2),
"based_on_payment_terms": 0,
"range1": 30,
"range2": 60,
"range3": 90,
"range4": 120,
"show_remarks": False,
}

pos_inv = self.create_sales_invoice(no_payment_schedule=True, do_not_submit=True)
pos_inv.posting_date = add_days(today(), 2)
pos_inv.is_pos = 1
pos_inv.append(
"payments",
frappe._dict(
mode_of_payment="Cash",
amount=flt(pos_inv.grand_total / 2),
),
)
pos_inv.disable_rounded_total = 1
pos_inv.save()
pos_inv.submit()

report = execute(filters)
expected_data = [[pos_inv.grand_total, pos_inv.paid_amount, 0]]

row = report[1][-1]
self.assertEqual(expected_data[0], [row.invoiced, row.paid, row.credit_note])
pos_inv.cancel()

def test_accounts_receivable(self):
filters = {
"company": self.company,
Expand Down

0 comments on commit ffb6d65

Please sign in to comment.