|
Lines 132-143
sub checkout {
Link Here
|
| 132 |
# BEGIN TRANSACTION |
132 |
# BEGIN TRANSACTION |
| 133 |
$circ->patron( $patron = C4::SIP::ILS::Patron->new($patron_id) ); |
133 |
$circ->patron( $patron = C4::SIP::ILS::Patron->new($patron_id) ); |
| 134 |
$circ->item( $item = C4::SIP::ILS::Item->new($item_id) ); |
134 |
$circ->item( $item = C4::SIP::ILS::Item->new($item_id) ); |
|
|
135 |
|
| 135 |
if ($fee_ack) { |
136 |
if ($fee_ack) { |
| 136 |
$circ->fee_ack($fee_ack); |
137 |
$circ->fee_ack($fee_ack); |
| 137 |
} |
138 |
} |
|
|
139 |
|
| 138 |
if ( !$patron ) { |
140 |
if ( !$patron ) { |
| 139 |
$circ->screen_msg("Invalid Patron"); |
141 |
$circ->screen_msg("Invalid Patron"); |
| 140 |
} |
142 |
} |
|
|
143 |
elsif ( !$item ) { |
| 144 |
$circ->screen_msg("Invalid Item"); |
| 145 |
} |
| 146 |
elsif ( $no_block_due_date ) { |
| 147 |
# A no block due date means we need check this item out to the patron |
| 148 |
# regardless if fines, restrictions or any other things that would |
| 149 |
# typically prevent a patron from checking out. |
| 150 |
# A no block transaction is used for send offline ( store and forward ) |
| 151 |
# transaction to Koha. The patron already has possesion of the item |
| 152 |
# so it should be checked out to the patron no matter what. |
| 153 |
$circ->do_checkout( $account, $no_block_due_date ); |
| 154 |
|
| 155 |
$item->{borrowernumber} = $patron_id; |
| 156 |
$item->{due_date} = $circ->{due}; |
| 157 |
push( @{ $patron->{items} }, { barcode => $item_id } ); |
| 158 |
$circ->desensitize( !$item->magnetic_media ); |
| 159 |
|
| 160 |
siplog( |
| 161 |
"LOG_DEBUG", "ILS::Checkout: patron %s has checked out %s via a no block checkout", |
| 162 |
$patron_id, join( ', ', map { $_->{barcode} } @{ $patron->{items} } ) |
| 163 |
); |
| 164 |
} |
| 141 |
elsif ( !$patron->charge_ok ) { |
165 |
elsif ( !$patron->charge_ok ) { |
| 142 |
if ($patron->debarred) { |
166 |
if ($patron->debarred) { |
| 143 |
$circ->screen_msg("Patron debarred"); |
167 |
$circ->screen_msg("Patron debarred"); |
|
Lines 157-165
sub checkout {
Link Here
|
| 157 |
$circ->screen_msg("Patron blocked"); |
181 |
$circ->screen_msg("Patron blocked"); |
| 158 |
} |
182 |
} |
| 159 |
} |
183 |
} |
| 160 |
elsif ( !$item ) { |
|
|
| 161 |
$circ->screen_msg("Invalid Item"); |
| 162 |
} |
| 163 |
elsif ( $item->{borrowernumber} |
184 |
elsif ( $item->{borrowernumber} |
| 164 |
&& !_ci_cardnumber_cmp( $item->{borrowernumber}, $patron->borrowernumber ) ) |
185 |
&& !_ci_cardnumber_cmp( $item->{borrowernumber}, $patron->borrowernumber ) ) |
| 165 |
{ |
186 |
{ |
|
Lines 169-175
sub checkout {
Link Here
|
| 169 |
$circ->screen_msg("Item type cannot be checked out at this checkout location"); |
190 |
$circ->screen_msg("Item type cannot be checked out at this checkout location"); |
| 170 |
} |
191 |
} |
| 171 |
else { |
192 |
else { |
| 172 |
$circ->do_checkout($account, $no_block_due_date); |
193 |
# No block checkouts were handled earlier so there is no need |
|
|
194 |
# to bass the no block due date here. |
| 195 |
$circ->do_checkout($account); |
| 173 |
if ( $circ->ok ) { |
196 |
if ( $circ->ok ) { |
| 174 |
|
197 |
|
| 175 |
# If the item is already associated with this patron, then |
198 |
# If the item is already associated with this patron, then |
| 176 |
- |
|
|