https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42425 --- Comment #38 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- QA review as part of the Bug 42383 dependency chain, applied on current main. Review was done with Claude assistance; items I reproduced are marked, the rest are from reading the code and tests. Applying the series on current main shows the last functional patch needs a rebase, and that its intent is broken on the forgive path. 1. (reproduced) "Populate checkin_id on accountlines" no longer applies: Bug 43504 (pushed 2026-11-06) moved the forgive logic out of C4::Circulation::_FixOverduesOnReturn into Koha::Account::forgive_debit. A mechanical resolution keeps the checkin_id argument at the call site, but forgive_debit builds its own credit via add_credit and never passes checkin_id on, so the FORGIVEN credit is created with checkin_id NULL. t/db_dependent/Circulation.t then fails: subtest "AddReturn populates checkin_id on accountlines", "Scenario 2: FORGIVEN credit has checkin_id" (got undef, expected the checkin id). Fix: pass checkin_id through forgive_debit (and document it in its POD), and add a direct test of forgive_debit in t/db_dependent/Koha/Account.t. On the author's earlier base this worked because add_credit was called inline there, so this is rebase fallout rather than a defect in the original patch. 2. The backfill problem Pedro reported in comment 37 stands. In addition, from reading the atomicupdate, it links every accountline that carries an old_issue_id, including payments and write-offs made long after the return, and it assumes one checkin per checkout although checkins.checkout_id is not unique. Please restrict it to the debit and credit types a checkin creates, and consider the duration of the single UPDATE (and the ALTER TABLE) on a large accountlines table. 3. Minor: the "( $x ? ( checkin_id => $x ) : () )" idiom is repeated and redundant, since add_credit and add_debit accept undef. The POD for add_credit and add_debit does not mention the new parameter. 4. Test gaps: PROCESSING_FOUND, direct add_credit/add_debit use of checkin_id, the atomicupdate backfill and its idempotency, and the FK ON DELETE SET NULL behaviour. The Koha/Checkin.t debits subtest sets checkin_id by hand, so it does not show that production code populates the column. Status stays Failed QA. -- You are receiving this mail because: You are watching all bug changes.