Bug 34737: Add ability to match on combinations of item fields
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 7 Sep 2023 15:53:00 +0000 (16:53 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 4 Oct 2023 15:07:51 +0000 (11:07 -0400)
commit1a633d68da8d2d8a1576d3d9c50ef13ec37fca81
treec3831ebb13197a508281cde0f69d1855eb788ca0
parent6296658e862b7d0cd267f580b3ae4169dd6e80b4
Bug 34737: Add ability to match on combinations of item fields

This patch updates the sort bin selection logic to allow for multiple
item field comparisons in a single config rule line.

Test plan
1) Run the unit tests before and after applying this patch and confirm
   they pass in both cases (prove -v t/db_debendant/SIP/Transaction.t
2) Check out an item and return it via SIP2:
     $ telnet localhost 8023
     9300CNterm1|COterm1|CPCPL|
     09N20200422    12430020200422    124300APCPL|AOCPL|AB001|AC|
   (Where 001 in |AB001| is the barcode of the item in question)
4) Check there is no CL field in the last response
5) Apply the patch, fill in SIP2SortBinMapping with e.g.:
       CPL:itype:eq:BK:ccode:eq:TEEN:3
6) Repeat the first step
7) Check the response contains a CL field with a value of 3 (or what
   you put in the config). The field should look like |CL3|

Signed-off-by: Toni Ford <Toni.Ford@newcastle.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/SIP/ILS/Transaction/Checkin.pm
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref