my $fee_amount;
my $fee_identifier;
my $transaction_id;
+my $pickup_location;
+my $hold_mode;
+my $no_block = 'N';
my $terminator = q{};
"s|summary=s" => \$summary,
- "fee-type=s" => \$fee_type,
- "payment-type=s" => \$payment_type,
- "currency-type=s" => \$currency_type,
- "fee-amount=s" => \$fee_amount,
- "fee-identifier=s" => \$fee_identifier,
- "transaction-id=s" => \$transaction_id,
+ "fee-type=s" => \$fee_type,
+ "payment-type=s" => \$payment_type,
+ "currency-type=s" => \$currency_type,
+ "fee-amount=s" => \$fee_amount,
+ "fee-identifier=s" => \$fee_identifier,
+ "transaction-id=s" => \$transaction_id,
+ "pickup-location=s" => \$pickup_location,
+ "hold-mode=s" => \$hold_mode,
+ "n|no-block=s" => \$no_block,
"t|terminator=s" => \$terminator,
exit();
}
-$terminator = ( $terminator eq 'CR' ) ? $CR : $CRLF;
+$no_block = $no_block eq 'Y' ? 'Y' : 'N';
+$terminator = $terminator eq 'CR' ? $CR : $CRLF;
# Set perl to expect the same record terminator it is sending
$/ = $terminator;
location_code => $location_code,
},
},
+ sc_status_request => {
+ name => 'SC Status',
+ subroutine => \&build_sc_status_command_message,
+ parameters => {
+ },
+ },
patron_status_request => {
name => 'Patron Status Request',
subroutine => \&build_patron_status_request_command_message,
subroutine => \&build_checkout_command_message,
parameters => {
SC_renewal_policy => 'Y',
- no_block => 'N',
+ no_block => $no_block,
transaction_date => $transaction_date,
nb_due_date => undef,
institution_id => $location_code,
name => 'Checkin',
subroutine => \&build_checkin_command_message,
parameters => {
- no_block => 'N',
+ no_block => $no_block,
transaction_date => $transaction_date,
return_date => $transaction_date,
current_location => $location_code,
subroutine => \&build_renew_command_message,
parameters => {
third_party_allowed => 'N',
- no_block => 'N',
+ no_block => $no_block,
transaction_date => $transaction_date,
nb_due_date => undef,
institution_id => $location_code,
'transaction_id',
],
},
+ hold => {
+ name => 'Hold',
+ subroutine => \&build_hold_command_message,
+ parameters => {
+ hold_mode => $hold_mode eq '-' ? '-' : '+',
+ transaction_date => $transaction_date,
+ expiration_date => undef,
+ pickup_location => $pickup_location,
+ hold_type => undef,
+ institution_id => $location_code,
+ patron_identifier => $patron_identifier,
+ patron_password => $patron_password,
+ item_identifier => $item_identifier,
+ title_identifier => undef,
+ terminal_password => $terminal_password,
+ fee_acknowledged => $fee_acknowledged,
+ },
+ optional => [
+ 'expiration_date',
+ 'pickup_location',
+ 'hold_type',
+ 'patron_password',
+ 'item_identifier',
+ 'title_identifier',
+ 'terminal_password',
+ 'fee_acknowledged',
+ ],
+ },
};
my $data = run_command_message('login');
. build_field( FID_LOCATION_CODE, $location_code );
}
+sub build_sc_status_command_message {
+ my ($params) = @_;
+
+ return SC_STATUS . "0" . "030" . "2.00";
+}
+
sub build_patron_status_request_command_message {
my ($params) = @_;
. build_field( FID_CANCEL, $cancel, { optional => 1 } );
}
+sub build_hold_command_message {
+ my ($params) = @_;
+
+ my $hold_mode = $params->{hold_mode};
+ my $transaction_date = $params->{transaction_date};
+ my $expiration_date = $params->{expiration_date};
+ my $pickup_location = $params->{pickup_location};
+ my $hold_type = $params->{hold_type};
+ my $institution_id = $params->{institution_id};
+ my $patron_identifier = $params->{patron_identifier};
+ my $patron_password = $params->{patron_password};
+ my $item_identifier = $params->{item_identifier};
+ my $title_identifier = $params->{title_identifier};
+ my $terminal_password = $params->{terminal_password};
+ my $fee_acknowledged = $params->{fee_acknowledged} || 'N';
+
+ return
+ HOLD
+ . $hold_mode
+ . $transaction_date
+ . build_field( FID_EXPIRATION, $expiration_date, { optional => 1 } )
+ . build_field( FID_PICKUP_LOCN, $pickup_location, { optional => 1 } )
+ . build_field( FID_HOLD_TYPE, $hold_type, { optional => 1 } )
+ . build_field( FID_INST_ID, $institution_id )
+ . build_field( FID_PATRON_ID, $patron_identifier )
+ . build_field( FID_PATRON_PWD, $patron_password, { optional => 1 } )
+ . build_field( FID_ITEM_ID, $item_identifier, { optional => 1 } )
+ . build_field( FID_TITLE_ID, $title_identifier, { optional => 1 } )
+ . build_field( FID_TERMINAL_PWD, $terminal_password, { optional => 1 } )
+ . build_field( FID_FEE_ACK, $fee_acknowledged, { optional => 1 } );
+}
+
sub build_renew_command_message {
my ($params) = @_;
--fee-amount Fee amount for Fee Paid message, required
--fee-identifier Fee identifier for Fee Paid message, optional
--transaction-id Transaction id for Fee Paid message, optional
+ --pickup-location Pickup location (branchcode) for Hold message, optional
+ --hold-mode Accepts "+" to add hold or "-" to cancel hold, defaults to +
+ -n --no-block Accepts "N" for standard operatoin, "Y" for no-block, defaults to "N"
-m --message SIP2 message to execute
Implemented Messages:
- patron_status_request
- patron_information
- item_information
- checkout
checkin
- renew
+ checkout
fee_paid
+ hold
+ item_information
+ patron_information
+ patron_status_request
+ sc_status_request
+ renew
/
}