Lines 146-153
sub checkout {
Link Here
|
146 |
# holds checked inside do_checkout |
146 |
# holds checked inside do_checkout |
147 |
# } elsif ($item->hold_queue && @{$item->hold_queue} && ! $item->barcode_is_borrowernumber($patron_id, $item->hold_queue->[0]->{borrowernumber})) { |
147 |
# } elsif ($item->hold_queue && @{$item->hold_queue} && ! $item->barcode_is_borrowernumber($patron_id, $item->hold_queue->[0]->{borrowernumber})) { |
148 |
# $circ->screen_msg("Item on Hold for Another User"); |
148 |
# $circ->screen_msg("Item on Hold for Another User"); |
149 |
} elsif ($item->{patron} && ($item->{patron} ne $patron_id)) { |
149 |
} elsif ($item->{patron} && !_ci_cardnumber_cmp($item->{patron},$patron_id)) { |
150 |
# I can't deal with this right now |
|
|
151 |
$circ->screen_msg("Item checked out to another patron"); |
150 |
$circ->screen_msg("Item checked out to another patron"); |
152 |
} else { |
151 |
} else { |
153 |
$circ->do_checkout(); |
152 |
$circ->do_checkout(); |
Lines 155-161
sub checkout {
Link Here
|
155 |
$debug and warn "circ is ok"; |
154 |
$debug and warn "circ is ok"; |
156 |
# If the item is already associated with this patron, then |
155 |
# If the item is already associated with this patron, then |
157 |
# we're renewing it. |
156 |
# we're renewing it. |
158 |
$circ->renew_ok($item->{patron} && ($item->{patron} eq $patron_id)); |
157 |
$circ->renew_ok($item->{patron} && _ci_cardnumber_cmp($item->{patron}, $patron_id)); |
159 |
|
158 |
|
160 |
$item->{patron} = $patron_id; |
159 |
$item->{patron} = $patron_id; |
161 |
$item->{due_date} = $circ->{due}; |
160 |
$item->{due_date} = $circ->{due}; |
Lines 174-179
sub checkout {
Link Here
|
174 |
return $circ; |
173 |
return $circ; |
175 |
} |
174 |
} |
176 |
|
175 |
|
|
|
176 |
sub _ci_cardnumber_cmp { |
177 |
my ( $s1, $s2) = @_; |
178 |
# As the database is case insensitive we need to normalize two strings |
179 |
# before comparing them |
180 |
return ( uc($s1) eq uc($s2) ); |
181 |
} |
182 |
|
177 |
sub checkin { |
183 |
sub checkin { |
178 |
my ( $self, $item_id, $trans_date, $return_date, $current_loc, $item_props, $cancel, $checked_in_ok ) = @_; |
184 |
my ( $self, $item_id, $trans_date, $return_date, $current_loc, $item_props, $cancel, $checked_in_ok ) = @_; |
179 |
my ( $patron, $item, $circ ); |
185 |
my ( $patron, $item, $circ ); |
180 |
- |
|
|