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

Martin Renvoize (ashimema) <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #172566|0                           |1
        is obsolete|                            |

--- Comment #19 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 183858
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183858&action=edit
Bug 32934: Correctly honor the no block due date for SIP checkout messages

**Problem:**
When using SIP checkout messages with the "no block" flag, the specified due
date
was being ignored. Instead of honoring the provided due date, the system would:
1. Use the due date as the transaction timestamp (incorrect behavior)
2. Calculate a new due date based on circulation rules
3. Return an empty due date field (AH) in the SIP response

This affected SIP2 integrations where external systems needed to specify exact
due dates for checkouts, particularly for offline circulation scenarios.

**Root Cause:**
The `ProcessOfflineIssue` function in C4::Circulation was only returning a
success/failure message, but the SIP checkout transaction needed access to the
resulting checkout object to properly set the due date. The SIP
Transaction::Checkout
module was calling `ProcessOfflineIssue` but couldn't retrieve the checkout
details
to populate the transaction's due date field.

**Solution:**
1. Modified `ProcessOfflineIssue` to return both the status message AND the
checkout
   object: `return ( "Success.", $checkout );`
2. Updated `ProcessOfflineOperation` to handle the new return format by
capturing
   only the message: `( $report ) = ProcessOfflineIssue( $operation );`
3. Modified SIP Transaction::Checkout to capture both return values and use the
   checkout object to set the proper due date via `duedatefromissue`
4. Fixed the timestamp parameter to use `dt_from_string` instead of the due
date

**Test Plan:**
1. **Unit Tests:**
   - Run `prove t/db_dependent/Circulation/OfflineCirculation.t` to verify
     ProcessOfflineIssue returns checkout object and respects due_date
parameter
   - Run `prove t/db_dependent/SIP/Transaction.t` to verify SIP checkout honors
     no_block_due_date parameter

2. **Manual SIP Testing:**
   - Connect to SIP server via telnet on port 6001
   - Send checkout message with no block flag and specific due date:
     `111YN20250115    18000120241201   
180001AP|AO|AC|AD|AB<barcode>|AA<cardnumber>|`
   - Verify response contains correct due date in AH field
   - Verify checkout record in database has the specified due date

3. **Regression Testing:**
   - Verify normal SIP checkouts (without no block) still work correctly
   - Verify offline circulation operations continue to function
   - Verify ProcessOfflineOperation still processes queued operations correctly

Signed-off-by: Brendan Lawlor <[email protected]>
Signed-off-by: Kyle M Hall <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>

-- 
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