https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42418

--- Comment #48 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 201487
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201487&action=edit
Bug 42418: (follow-up) Always create Koha::Checkin and attach messages

This patch ensures every barcode scan at the checkin desk creates a
Koha::Checkin record, even when the return is blocked. Previously, the
BlockedWithdrawn and Wrongbranch early-return paths skipped creating
the record, losing the audit trail.

Changes:
- Create Koha::Checkin record once, before blocker checks
- BlockedWithdrawn and Wrongbranch early returns now include the record
- Add _attach_messages_to_checkin() to translate AddReturn's legacy
  $messages hashref into Koha::Object::Message instances on the
  checkin object, using lower_snake_case coded values
- Call _attach_messages_to_checkin at all return points

This is backwards compatible - existing callers still receive the
$messages hashref. The object_messages are additive and ignored by
callers that don't read them.

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
   k$ prove t/db_dependent/api/v1/checkins.t
=> SUCCESS: Tests pass
3. Sign off :-D

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to