Merge pull request #40790 from frappe/pot_develop_2024-03-31
chore: update POT file
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index c7862c1..0af00c4 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -665,7 +665,7 @@
else:
future_amount_field = "future_amount_in_base_currency"
- if row.remaining_balance > 0 and future.get(future_amount_field):
+ if row.remaining_balance != 0 and future.get(future_amount_field):
if future.get(future_amount_field) > row.outstanding:
row.future_amount = row.outstanding
future[future_amount_field] = future.get(future_amount_field) - row.outstanding
diff --git a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py
index 83d95de..a65e424 100644
--- a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py
@@ -463,11 +463,30 @@
)
def test_future_payments(self):
+ sr = self.create_sales_invoice(do_not_submit=True)
+ sr.is_return = 1
+ sr.items[0].qty = -1
+ sr.items[0].rate = 10
+ sr.calculate_taxes_and_totals()
+ sr.submit()
+
si = self.create_sales_invoice()
pe = get_payment_entry(si.doctype, si.name)
+ pe.append(
+ "references",
+ {
+ "reference_doctype": sr.doctype,
+ "reference_name": sr.name,
+ "due_date": sr.due_date,
+ "total_amount": sr.grand_total,
+ "outstanding_amount": sr.outstanding_amount,
+ "allocated_amount": sr.outstanding_amount,
+ },
+ )
+
pe.posting_date = add_days(today(), 1)
- pe.paid_amount = 90.0
- pe.references[0].allocated_amount = 90.0
+ pe.paid_amount = 80
+ pe.references[0].allocated_amount = 90.0 # pe.paid_amount + sr.grand_total
pe.save().submit()
filters = {
"company": self.company,
@@ -479,16 +498,21 @@
"show_future_payments": True,
}
report = execute(filters)[1]
- self.assertEqual(len(report), 1)
+ self.assertEqual(len(report), 2)
- expected_data = [100.0, 100.0, 10.0, 90.0]
+ expected_data = {sr.name: [10.0, -10.0, 0.0, -10], si.name: [100.0, 100.0, 10.0, 90.0]}
- row = report[0]
- self.assertEqual(
- expected_data, [row.invoiced, row.outstanding, row.remaining_balance, row.future_amount]
- )
+ rows = report[:2]
+ for row in rows:
+ self.assertEqual(
+ expected_data[row.voucher_no],
+ [row.invoiced or row.paid, row.outstanding, row.remaining_balance, row.future_amount],
+ )
pe.cancel()
+ sr.load_from_db() # Outstanding amount is updated so a updated timestamp is needed.
+ sr.cancel()
+
# full payment in future date
pe = get_payment_entry(si.doctype, si.name)
pe.posting_date = add_days(today(), 1)
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py
index bee46c1..888e040 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -453,7 +453,7 @@
for gle in gl_entries:
group_by_value = gle.get(group_by)
- gle.voucher_type = _(gle.voucher_type)
+ gle.voucher_type = gle.voucher_type
gle.voucher_subtype = _(gle.voucher_subtype)
gle.against_voucher_type = _(gle.against_voucher_type)
gle.remarks = _(gle.remarks)