From 48545bb3e3a7d3ba19991e860fc6a47ab0362b17 Mon Sep 17 00:00:00 2001 From: Jan Kissig Date: Thu, 7 Nov 2024 13:32:05 +0000 Subject: [PATCH] Bug 23426: (follow-up) Enhance sip_cli_emulator.pl for test plan This follow up enhances the sip_cli_emulator.pl to use start-item and/or end-item as params. With these new params the original test plan can be extended: Test plan: a) create several manual invoices for patron 23529000035676 : http://localhost:8081/cgi-bin/koha/members/maninvoice.pl?borrowernumber=19 b) run perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 23529000035676 -m patron_information -s " Y " --start-item=1 --end-item=2 to get fine 1 and 2 or perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 23529000035676 -m patron_information -s " Y " --start-item=3 --end-item=3 to retrieve fine 3 --- misc/sip_cli_emulator.pl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/misc/sip_cli_emulator.pl b/misc/sip_cli_emulator.pl index dbb56537fe..95ee8f5f56 100755 --- a/misc/sip_cli_emulator.pl +++ b/misc/sip_cli_emulator.pl @@ -55,6 +55,8 @@ my $transaction_id; my $pickup_location; my $hold_mode; my $no_block = 'N'; +my $start_item; +my $end_item; my $terminator = q{}; @@ -85,6 +87,8 @@ GetOptions( "pickup-location=s" => \$pickup_location, "hold-mode=s" => \$hold_mode, "n|no-block=s" => \$no_block, + "start-item=s" => \$start_item, + "end-item=s" => \$end_item, "t|terminator=s" => \$terminator, @@ -158,8 +162,10 @@ my $handlers = { terminal_password => $terminal_password, patron_password => $patron_password, summary => $summary, + start_item => $start_item, + end_item => $end_item, }, - optional => [ 'patron_password', 'summary' ], + optional => [ 'patron_password', 'summary', 'start_item', 'end_item' ], }, item_information => { name => 'Item Information', @@ -404,9 +410,13 @@ sub build_patron_information_command_message { my $patron_identifier = $params->{patron_identifier}; my $terminal_password = $params->{terminal_password}; my $patron_password = $params->{patron_password}; + my $start_item = $params->{start_item}; + my $end_item = $params->{end_item}; my $summary = $params->{summary}; $summary //= " "; + $start_item //= ""; + $end_item //= ""; return PATRON_INFO @@ -416,7 +426,9 @@ sub build_patron_information_command_message { . build_field( FID_INST_ID, $institution_id ) . build_field( FID_PATRON_ID, $patron_identifier ) . build_field( FID_TERMINAL_PWD, $terminal_password ) - . build_field( FID_PATRON_PWD, $patron_password, { optional => 1 } ); + . build_field( FID_PATRON_PWD, $patron_password, { optional => 1 } ) + . build_field( FID_START_ITEM, $start_item, { optional => 1 } ) + . build_field( FID_END_ITEM, $end_item, { optional => 1 } ); } sub build_item_information_command_message { -- 2.39.5