Bug 41369 - SIP payments have no branchcode
Summary: SIP payments have no branchcode
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: 25.05
Hardware: All All
: P5 - low normal
Assignee: Kyle M Hall (khall)
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-03 18:13 UTC by Kyle M Hall (khall)
Modified: 2025-12-22 04:44 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes SIP2 based payments, so that a branchcode (institution id) is now recorded for the payment.
Version(s) released in:
26.05.00
Circulation function:


Attachments
Bug 41369 - SIP payments have no branchcode (4.04 KB, patch)
2025-12-03 18:15 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 41369 - SIP payments have no branchcode (4.34 KB, patch)
2025-12-03 18:53 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 41369: SIP payments have no branchcode (4.36 KB, patch)
2025-12-03 21:34 UTC, David Nind
Details | Diff | Splinter Review
Bug 41369: SIP payments have no branchcode (4.46 KB, patch)
2025-12-08 10:44 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall (khall) 2025-12-03 18:13:29 UTC
For SIP based payments, no branchcode is recorded for the corresponding credit. Koha should be recording the institution id ( i.e. branchcode ) for SIP payments.
Comment 1 Kyle M Hall (khall) 2025-12-03 18:15:19 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall (khall) 2025-12-03 18:53:43 UTC Comment hidden (obsolete)
Comment 3 David Nind 2025-12-03 21:34:06 UTC
Created attachment 190133 [details] [review]
Bug 41369: SIP payments have no branchcode

For SIP based payments, no branchcode is recorded for the corresponding
credit. Koha should be recording the institution id (i.e. branchcode)
for SIP payments.

Test plan:
1) Apply this patch
2) prove t/db_dependent/SIP/Transaction.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Marcel de Rooy 2025-12-05 10:17:03 UTC
        * Proving /usr/share/koha/t/db_dependent/SIP/Transaction.t FAIL
    # Looks like you planned 14 tests but ran 9.

#   Failed test 'do_checkin'
#   at /usr/share/koha/t/db_dependent/SIP/Transaction.t line 714.
 Can't call method "branchtransfer_id" on an undefined value at /usr/share/koha/t/db_dependent/SIP/Transaction.t line 501.

Do we need to mock some circ preferences to get this always working ?
Comment 5 Kyle M Hall (khall) 2025-12-05 12:04:21 UTC
(In reply to Marcel de Rooy from comment #4)
>         * Proving /usr/share/koha/t/db_dependent/SIP/Transaction.t FAIL
>     # Looks like you planned 14 tests but ran 9.
> 
> #   Failed test 'do_checkin'
> #   at /usr/share/koha/t/db_dependent/SIP/Transaction.t line 714.
>  Can't call method "branchtransfer_id" on an undefined value at
> /usr/share/koha/t/db_dependent/SIP/Transaction.t line 501.
> 
> Do we need to mock some circ preferences to get this always working ?

Possibly, but this would be unrelated to this patch. The failed unit test is not even in the subtest I modified!
Comment 6 Marcel de Rooy 2025-12-08 10:27:13 UTC
(In reply to Kyle M Hall (khall) from comment #5)
> (In reply to Marcel de Rooy from comment #4)
> >         * Proving /usr/share/koha/t/db_dependent/SIP/Transaction.t FAIL
> >     # Looks like you planned 14 tests but ran 9.
> > 
> > #   Failed test 'do_checkin'
> > #   at /usr/share/koha/t/db_dependent/SIP/Transaction.t line 714.
> >  Can't call method "branchtransfer_id" on an undefined value at
> > /usr/share/koha/t/db_dependent/SIP/Transaction.t line 501.
> > 
> > Do we need to mock some circ preferences to get this always working ?
> 
> Possibly, but this would be unrelated to this patch. The failed unit test is
> not even in the subtest I modified!

Ah. Thats true.
Comment 7 Marcel de Rooy 2025-12-08 10:43:59 UTC
Seems that AutomaticItemReturn was the cause; enabling it makes the test pass. Seems logical given the error message..
Comment 8 Marcel de Rooy 2025-12-08 10:44:47 UTC
Created attachment 190280 [details] [review]
Bug 41369: SIP payments have no branchcode

For SIP based payments, no branchcode is recorded for the corresponding
credit. Koha should be recording the institution id (i.e. branchcode)
for SIP payments.

Test plan:
1) Apply this patch
2) prove t/db_dependent/SIP/Transaction.t

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Lucas Gass (lukeg) 2025-12-17 20:27:16 UTC
Nice work everyone!

Pushed to main for 26.05