View | Details | Raw Unified | Return to bug 38486
Collapse All | Expand All

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

Return to bug 38486