https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42425 --- Comment #13 from David Nind <david@davidnind.com> --- Created attachment 198723 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198723&action=edit Bug 42425: Populate checkin_id on accountlines Replaces the fragile timestamp-based matching approach with explicit checkin_id threading through the call chain. Each accountline receives its checkin_id at creation time. The Koha::Item->store() chokepoint for lost-item accounting is preserved: store() still detects itemlost transitions and calls _set_found_trigger. It now passes checkin_id context through so the resulting accountlines are linked deterministically. Changes: - Koha::Account->add_credit/add_debit: accept and store checkin_id - Koha::Item->store/_set_found_trigger: thread checkin_id to LOST_FOUND and PROCESSING_FOUND credits - C4::Items::ModDateLastSeen: pass checkin_id to store() - C4::Circulation::_FixOverduesOnReturn: accept checkin_id, pass to FORGIVEN credit - C4::Circulation::_CalculateAndUpdateFine: pass checkin_id to UpdateFine - C4::Overdues::UpdateFine: pass checkin_id to add_debit - C4::Circulation::AddReturn: pass checkin_record->id to all callers; remove timestamp-based matching block Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Circulation.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.