fix: Alert message and make sure invoice due dates are different for effective test
- Make invoice due dates are different so that the invoice with the earliest due date is allocated first in the test
- Translate voucher type, simplify alert message. The invoice could be "split" into 1 row, no. of rows in the message seems unnecessary.
(cherry picked from commit 56ac3424d2)
This commit is contained in:
@@ -1564,8 +1564,8 @@ def split_invoices_based_on_payment_terms(outstanding_invoices, company) -> list
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
frappe.msgprint(
|
frappe.msgprint(
|
||||||
_("Spliting {} {} into {} row(s) as per Payment Terms").format(
|
_("Splitting {0} {1} as per Payment Terms").format(
|
||||||
split_rows[0]["voucher_type"], split_rows[0]["voucher_no"], len(split_rows)
|
_(entry.voucher_type), frappe.bold(entry.voucher_no)
|
||||||
),
|
),
|
||||||
alert=True,
|
alert=True,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1227,7 +1227,10 @@ class TestPaymentEntry(FrappeTestCase):
|
|||||||
customer = create_customer("Max Mustermann", "INR")
|
customer = create_customer("Max Mustermann", "INR")
|
||||||
create_payment_terms_template()
|
create_payment_terms_template()
|
||||||
|
|
||||||
si = create_sales_invoice(qty=1, rate=100, customer=customer)
|
# SI has an earlier due date and SI2 has a later due date
|
||||||
|
si = create_sales_invoice(
|
||||||
|
qty=1, rate=100, customer=customer, posting_date=add_days(nowdate(), -4)
|
||||||
|
)
|
||||||
si2 = create_sales_invoice(do_not_save=1, qty=1, rate=100, customer=customer)
|
si2 = create_sales_invoice(do_not_save=1, qty=1, rate=100, customer=customer)
|
||||||
si2.payment_terms_template = "Test Receivable Template"
|
si2.payment_terms_template = "Test Receivable Template"
|
||||||
si2.submit()
|
si2.submit()
|
||||||
@@ -1243,8 +1246,8 @@ class TestPaymentEntry(FrappeTestCase):
|
|||||||
args.update(
|
args.update(
|
||||||
{
|
{
|
||||||
"get_outstanding_invoices": True,
|
"get_outstanding_invoices": True,
|
||||||
"from_posting_date": nowdate(),
|
"from_posting_date": add_days(nowdate(), -4),
|
||||||
"to_posting_date": add_days(nowdate(), 7),
|
"to_posting_date": add_days(nowdate(), 2),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
references = get_outstanding_reference_documents(args)
|
references = get_outstanding_reference_documents(args)
|
||||||
|
|||||||
Reference in New Issue
Block a user