fix: split expected jv entries for scrap asset
diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py
index 2f721c8..70a8470 100644
--- a/erpnext/accounts/general_ledger.py
+++ b/erpnext/accounts/general_ledger.py
@@ -356,7 +356,7 @@
process_debit_credit_difference(gl_map)
if gl_map:
- # check_freezing_date(gl_map[0]["posting_date"], adv_adj)
+ check_freezing_date(gl_map[0]["posting_date"], adv_adj)
is_opening = any(d.get("is_opening") == "Yes" for d in gl_map)
if gl_map[0]["voucher_type"] != "Period Closing Voucher":
validate_against_pcv(is_opening, gl_map[0]["posting_date"], gl_map[0]["company"])
@@ -593,7 +593,7 @@
partial_cancel=partial_cancel,
)
validate_accounting_period(gl_entries)
- # check_freezing_date(gl_entries[0]["posting_date"], adv_adj)
+ check_freezing_date(gl_entries[0]["posting_date"], adv_adj)
is_opening = any(d.get("is_opening") == "Yes" for d in gl_entries)
validate_against_pcv(is_opening, gl_entries[0]["posting_date"], gl_entries[0]["company"])
diff --git a/erpnext/assets/doctype/asset/test_asset.py b/erpnext/assets/doctype/asset/test_asset.py
index 9e3ec6f..536845e 100644
--- a/erpnext/assets/doctype/asset/test_asset.py
+++ b/erpnext/assets/doctype/asset/test_asset.py
@@ -256,7 +256,16 @@
flt(18000.0 + pro_rata_amount, asset.precision("gross_purchase_amount")),
0.0,
),
- ("_Test Fixed Asset - _TC", 0.0, 100000.0),
+ (
+ "_Test Fixed Asset - _TC",
+ 0.0,
+ flt(18000.0 + pro_rata_amount, asset.precision("gross_purchase_amount")),
+ ),
+ (
+ "_Test Fixed Asset - _TC",
+ 0.0,
+ flt(82000.0 - pro_rata_amount, asset.precision("gross_purchase_amount")),
+ ),
(
"_Test Gain/Loss on Asset Disposal - _TC",
flt(82000.0 - pro_rata_amount, asset.precision("gross_purchase_amount")),
@@ -267,7 +276,7 @@
gle = frappe.db.sql(
"""select account, debit, credit from `tabGL Entry`
where voucher_type='Journal Entry' and voucher_no = %s
- order by account""",
+ order by account, credit""",
asset.journal_entry_for_scrap,
)
self.assertSequenceEqual(gle, expected_gle)