Lines 53-61
sub do_checkout {
Link Here
|
53 |
my $patron = Koha::Patrons->find($self->{patron}->{borrowernumber}); |
53 |
my $patron = Koha::Patrons->find($self->{patron}->{borrowernumber}); |
54 |
my $overridden_duedate; # usually passed as undef to AddIssue |
54 |
my $overridden_duedate; # usually passed as undef to AddIssue |
55 |
$debug and warn "do_checkout borrower: . " . $patron->borrowernumber; |
55 |
$debug and warn "do_checkout borrower: . " . $patron->borrowernumber; |
56 |
my ($issuingimpossible, $needsconfirmation) = _can_we_issue($patron, $barcode, |
56 |
my ($issuingimpossible, $needsconfirmation) = _can_we_issue($patron, $barcode, 0); |
57 |
C4::Context->preference("AllowItemsOnHoldCheckoutSIP") |
|
|
58 |
); |
59 |
|
57 |
|
60 |
my $noerror=1; # If set to zero we block the issue |
58 |
my $noerror=1; # If set to zero we block the issue |
61 |
if (keys %{$issuingimpossible}) { |
59 |
if (keys %{$issuingimpossible}) { |
Lines 69-82
sub do_checkout {
Link Here
|
69 |
foreach my $confirmation (keys %{$needsconfirmation}) { |
67 |
foreach my $confirmation (keys %{$needsconfirmation}) { |
70 |
if ($confirmation eq 'RENEW_ISSUE'){ |
68 |
if ($confirmation eq 'RENEW_ISSUE'){ |
71 |
$self->screen_msg("Item already checked out to you: renewing item."); |
69 |
$self->screen_msg("Item already checked out to you: renewing item."); |
72 |
} elsif ($confirmation eq 'RESERVED' or $confirmation eq 'RESERVE_WAITING' or $confirmation eq 'TRANSFERRED') { |
70 |
} elsif ($confirmation eq 'RESERVED' and !C4::Context->preference("AllowItemsOnHoldCheckoutSIP")) { |
73 |
my $x = $self->{item}->available($patron->borrowernumber); |
71 |
$self->screen_msg("Item is reserved for another patron upon return."); |
74 |
if ($x) { |
72 |
$noerror = 0; |
75 |
$self->screen_msg("Item was reserved for you."); |
73 |
} elsif ($confirmation eq 'RESERVE_WAITING' or $confirmation eq 'TRANSFERRED') { |
76 |
} else { |
74 |
$debug and warn "Item is on hold for another patron."; |
77 |
$self->screen_msg("Item is reserved for another patron upon return."); |
75 |
$self->screen_msg("Item is on hold for another patron."); |
78 |
$noerror = 0; |
76 |
$noerror = 0; |
79 |
} |
|
|
80 |
} elsif ($confirmation eq 'ISSUED_TO_ANOTHER') { |
77 |
} elsif ($confirmation eq 'ISSUED_TO_ANOTHER') { |
81 |
$self->screen_msg("Item already checked out to another patron. Please return item for check-in."); |
78 |
$self->screen_msg("Item already checked out to another patron. Please return item for check-in."); |
82 |
$noerror = 0; |
79 |
$noerror = 0; |
Lines 110-124
sub do_checkout {
Link Here
|
110 |
} |
107 |
} |
111 |
} |
108 |
} |
112 |
my $itemnumber = $self->{item}->{itemnumber}; |
109 |
my $itemnumber = $self->{item}->{itemnumber}; |
113 |
foreach (@$shelf) { |
|
|
114 |
$debug and warn sprintf( "shelf has (%s for %s). this is (%is, %s)", $_->{itemnumber}, $_->{borrowernumber}, $itemnumber, $patron->borrowernumber ); |
115 |
($_->{itemnumber} eq $itemnumber) or next; # skip it if not this item |
116 |
($_->{borrowernumber} == $patron->borrowernumber) and last; |
117 |
# if item was waiting for this patron, we're done. AddIssue takes care of the "W" hold. |
118 |
$debug and warn "Item is on hold for another patron."; |
119 |
$self->screen_msg("Item is on hold for another patron."); |
120 |
$noerror = 0; |
121 |
} |
122 |
my ($fee, undef) = GetIssuingCharges($itemnumber, $patron->borrowernumber); |
110 |
my ($fee, undef) = GetIssuingCharges($itemnumber, $patron->borrowernumber); |
123 |
if ( $fee > 0 ) { |
111 |
if ( $fee > 0 ) { |
124 |
$self->{sip_fee_type} = '06'; |
112 |
$self->{sip_fee_type} = '06'; |
125 |
- |
|
|