Lines 17-23
use C4::SIP::ILS::Transaction;
Link Here
|
17 |
use C4::Context; |
17 |
use C4::Context; |
18 |
use C4::Circulation qw( AddIssue GetIssuingCharges CanBookBeIssued ); |
18 |
use C4::Circulation qw( AddIssue GetIssuingCharges CanBookBeIssued ); |
19 |
use C4::Members; |
19 |
use C4::Members; |
20 |
use Koha::DateUtils; |
20 |
use Koha::DateUtils qw( dt_from_string ); |
21 |
|
21 |
|
22 |
use parent qw(C4::SIP::ILS::Transaction); |
22 |
use parent qw(C4::SIP::ILS::Transaction); |
23 |
|
23 |
|
Lines 41-46
sub new {
Link Here
|
41 |
sub do_checkout { |
41 |
sub do_checkout { |
42 |
my $self = shift; |
42 |
my $self = shift; |
43 |
my $account = shift; |
43 |
my $account = shift; |
|
|
44 |
my $no_block_due_date = shift; |
44 |
siplog('LOG_DEBUG', "ILS::Transaction::Checkout performing checkout..."); |
45 |
siplog('LOG_DEBUG', "ILS::Transaction::Checkout performing checkout..."); |
45 |
my $shelf = $self->{item}->hold_attached; |
46 |
my $shelf = $self->{item}->hold_attached; |
46 |
my $barcode = $self->{item}->id; |
47 |
my $barcode = $self->{item}->id; |
Lines 49-54
sub do_checkout {
Link Here
|
49 |
my $prevcheckout_block_checkout = $account->{prevcheckout_block_checkout}; |
50 |
my $prevcheckout_block_checkout = $account->{prevcheckout_block_checkout}; |
50 |
my ($issuingimpossible, $needsconfirmation) = _can_we_issue($patron, $barcode, 0); |
51 |
my ($issuingimpossible, $needsconfirmation) = _can_we_issue($patron, $barcode, 0); |
51 |
|
52 |
|
|
|
53 |
if ( $no_block_due_date ) { |
54 |
my $year = substr($no_block_due_date,0,4); |
55 |
my $month = substr($no_block_due_date,4,2); |
56 |
my $day = substr($no_block_due_date,6,2); |
57 |
my $hour = substr($no_block_due_date,12,2); |
58 |
my $minute = substr($no_block_due_date,14,2); |
59 |
my $second = substr($no_block_due_date,16,2); |
60 |
|
61 |
my $iso = "$year-$month-$day $hour:$minute:$second"; |
62 |
$no_block_due_date = dt_from_string( $iso, "iso" ); |
63 |
} |
64 |
|
52 |
my $noerror=1; # If set to zero we block the issue |
65 |
my $noerror=1; # If set to zero we block the issue |
53 |
if (keys %{$issuingimpossible}) { |
66 |
if (keys %{$issuingimpossible}) { |
54 |
foreach (keys %{$issuingimpossible}) { |
67 |
foreach (keys %{$issuingimpossible}) { |
Lines 113-122
sub do_checkout {
Link Here
|
113 |
$noerror = 0; |
126 |
$noerror = 0; |
114 |
} |
127 |
} |
115 |
} |
128 |
} |
|
|
129 |
|
130 |
if ( $no_block_due_date ) { |
131 |
$overridden_duedate = $no_block_due_date; |
132 |
$noerror = 1; |
133 |
} |
134 |
|
116 |
unless ($noerror) { |
135 |
unless ($noerror) { |
117 |
$self->ok(0); |
136 |
$self->ok(0); |
118 |
return $self; |
137 |
return $self; |
119 |
} |
138 |
} |
|
|
139 |
|
120 |
# can issue |
140 |
# can issue |
121 |
my $issue = AddIssue( $patron->unblessed, $barcode, $overridden_duedate, 0 ); |
141 |
my $issue = AddIssue( $patron->unblessed, $barcode, $overridden_duedate, 0 ); |
122 |
$self->{due} = $self->duedatefromissue($issue, $itemnumber); |
142 |
$self->{due} = $self->duedatefromissue($issue, $itemnumber); |