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