@@ -, +, @@ "CPL" instead of "kohalibrary" ) Henry Acevedo (23529000035676) checked out Philippics. by Cicero, Marcus Tullius. 39999000001396 --- C4/SIP/ILS.pm | 4 ++-- C4/SIP/ILS/Transaction/Checkout.pm | 22 +++++++++++++++++++++- C4/SIP/Sip/MsgType.pm | 2 +- 3 files changed, 24 insertions(+), 4 deletions(-) --- a/C4/SIP/ILS.pm +++ a/C4/SIP/ILS.pm @@ -121,7 +121,7 @@ sub offline_ok { # the response. # sub checkout { - my ( $self, $patron_id, $item_id, $sc_renew, $fee_ack, $account ) = @_; + my ( $self, $patron_id, $item_id, $sc_renew, $fee_ack, $account, $no_block_due_date ) = @_; my ( $patron, $item, $circ ); $circ = C4::SIP::ILS::Transaction::Checkout->new(); # BEGIN TRANSACTION @@ -153,7 +153,7 @@ sub checkout { $circ->screen_msg("Item checked out to another patron"); } else { - $circ->do_checkout($account); + $circ->do_checkout($account, $no_block_due_date); if ( $circ->ok ) { # If the item is already associated with this patron, then --- a/C4/SIP/ILS/Transaction/Checkout.pm +++ a/C4/SIP/ILS/Transaction/Checkout.pm @@ -17,7 +17,7 @@ use C4::SIP::ILS::Transaction; use C4::Context; use C4::Circulation qw( AddIssue GetIssuingCharges CanBookBeIssued ); use C4::Members; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use parent qw(C4::SIP::ILS::Transaction); @@ -41,6 +41,7 @@ sub new { sub do_checkout { my $self = shift; my $account = shift; + my $no_block_due_date = shift; siplog('LOG_DEBUG', "ILS::Transaction::Checkout performing checkout..."); my $shelf = $self->{item}->hold_attached; my $barcode = $self->{item}->id; @@ -49,6 +50,18 @@ sub do_checkout { my $prevcheckout_block_checkout = $account->{prevcheckout_block_checkout}; my ($issuingimpossible, $needsconfirmation) = _can_we_issue($patron, $barcode, 0); + if ( $no_block_due_date ) { + my $year = substr($no_block_due_date,0,4); + my $month = substr($no_block_due_date,4,2); + my $day = substr($no_block_due_date,6,2); + my $hour = substr($no_block_due_date,12,2); + my $minute = substr($no_block_due_date,14,2); + my $second = substr($no_block_due_date,16,2); + + my $iso = "$year-$month-$day $hour:$minute:$second"; + $no_block_due_date = dt_from_string( $iso, "iso" ); + } + my $noerror=1; # If set to zero we block the issue if (keys %{$issuingimpossible}) { foreach (keys %{$issuingimpossible}) { @@ -113,10 +126,17 @@ sub do_checkout { $noerror = 0; } } + + if ( $no_block_due_date ) { + $overridden_duedate = $no_block_due_date; + $noerror = 1; + } + unless ($noerror) { $self->ok(0); return $self; } + # can issue my $issue = AddIssue( $patron->unblessed, $barcode, $overridden_duedate, 0 ); $self->{due} = $self->duedatefromissue($issue, $itemnumber); --- a/C4/SIP/Sip/MsgType.pm +++ a/C4/SIP/Sip/MsgType.pm @@ -532,7 +532,7 @@ sub handle_checkout { # not a lot we can do about it siplog( "LOG_WARNING", "received no-block checkout from terminal '%s'", $account->{id} ); - $status = $ils->checkout_no_block( $patron_id, $item_id, $sc_renewal_policy, $trans_date, $nb_due_date ); + $status = $ils->checkout( $patron_id, $item_id, $sc_renewal_policy, $fee_ack, $account, $nb_due_date ); } else { # Does the transaction date really matter for items that are --