https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42504 --- Comment #4 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 198411 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198411&action=edit Bug 42504: Move UpdateTotalIssues to Koha::Biblio Adds two methods to Koha::Biblio: - increment_total_issues: no params, increments by 1, triggers reindex. For real-time use on checkout. - calculate_total_issues({ use_items => 1 | use_stats => 1 }): recalculates from source data, updates DB, returns value. Testable encapsulation of the calculation logic. C4::Biblio::UpdateTotalIssues is kept as a thin wrapper for backward compatibility. C4::Circulation now calls $item_object->biblio->increment_total_issues directly. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Biblio.t => SUCCESS: Tests pass! 3. Tests cover: - increment_total_issues: 0->1, 1->2, undef->1, returns $self - calculate_total_issues: use_items sum, use_stats count, DB updated, no-op when unchanged 4. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.