mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-09 15:29:30 +00:00
fix: show cost center for unmatched payments in receivables (#58453)
(cherry picked from commit cee9f4949a)
Co-authored-by: Krishna Pramod Shirsath <91021227+krishna-254@users.noreply.github.com>
This commit is contained in:
@@ -172,6 +172,7 @@ class ReceivablePayableReport:
|
|||||||
party_account=ple.account,
|
party_account=ple.account,
|
||||||
posting_date=ple.posting_date,
|
posting_date=ple.posting_date,
|
||||||
account_currency=ple.account_currency,
|
account_currency=ple.account_currency,
|
||||||
|
cost_center=ple.cost_center,
|
||||||
remarks=ple.remarks,
|
remarks=ple.remarks,
|
||||||
invoiced=0.0,
|
invoiced=0.0,
|
||||||
paid=0.0,
|
paid=0.0,
|
||||||
|
|||||||
@@ -1173,6 +1173,28 @@ class TestAccountsReceivable(ERPNextTestSuite, AccountsTestMixin):
|
|||||||
row = report[1][0]
|
row = report[1][0]
|
||||||
self.assertEqual(expected_data_after_payment, [row.voucher_no, row.cost_center, row.outstanding])
|
self.assertEqual(expected_data_after_payment, [row.voucher_no, row.cost_center, row.outstanding])
|
||||||
|
|
||||||
|
def test_cost_center_on_payment_before_invoice(self):
|
||||||
|
filters = {
|
||||||
|
"company": self.company,
|
||||||
|
"party_type": "Customer",
|
||||||
|
"party": [self.customer],
|
||||||
|
"report_date": today(),
|
||||||
|
"range": "30, 60, 90, 120",
|
||||||
|
}
|
||||||
|
|
||||||
|
si = self.create_sales_invoice(no_payment_schedule=True, do_not_submit=True)
|
||||||
|
si.posting_date = add_days(today(), 1)
|
||||||
|
si.due_date = si.posting_date
|
||||||
|
si.payment_schedule[0].due_date = si.posting_date
|
||||||
|
si.save().submit()
|
||||||
|
|
||||||
|
pe = self.create_payment_entry(si.name, do_not_submit=True)
|
||||||
|
pe.cost_center = self.cost_center
|
||||||
|
pe.save().submit()
|
||||||
|
|
||||||
|
row = next(row for row in execute(filters)[1] if row.voucher_no == pe.name)
|
||||||
|
self.assertEqual(row.cost_center, pe.cost_center)
|
||||||
|
|
||||||
def test_payment_terms_template_filters(self):
|
def test_payment_terms_template_filters(self):
|
||||||
from erpnext.controllers.accounts_controller import get_payment_terms
|
from erpnext.controllers.accounts_controller import get_payment_terms
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user