https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42425 Bug ID: 42425 Summary: Add checkin_id FK to accountlines to link fee adjustments to checkin events Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Depends on: 42418 Blocks: 24401 When AddReturn processes a checkin, it may create or modify several accountlines (lost item fee refunds/charges, processing fee refunds, etc.). Currently these fee adjustments have no persistent link back to the checkin event that triggered them. Bug 42418 introduced the checkins table as a first-class resource. Adding a checkin_id FK to accountlines would: - Allow Koha::Checkin->account_lines as a proper relationship - Enable embedding account_lines in the checkin REST API response (bug 24401) - Provide an audit trail linking financial transactions to the specific checkin that caused them - Eliminate the need to infer fee changes from timestamps or $messages parsing Implementation notes: - Add checkin_id INT(11) DEFAULT NULL to accountlines with FK to checkins.checkin_id ON DELETE SET NULL - Update AddReturn to pass the checkin_id when creating/modifying accountlines during return processing - The relevant C4::Circulation code paths are: _FixAccountForLostAndFound, _FixOverduesOnReturn, and the lost item fee charge logic Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24401 [Bug 24401] REST API: Check-in https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42418 [Bug 42418] Add Koha::Checkin(s) - checkin as a first-class resource -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.