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

(-)a/C4/SIP/ILS.pm (-19 / +23 lines)
Lines 172-205 sub checkout { Link Here
172
}
172
}
173
173
174
sub checkin {
174
sub checkin {
175
    my ($self, $item_id, $trans_date, $return_date,
175
    my ( $self, $item_id, $trans_date, $return_date, $current_loc, $item_props, $cancel, $checked_in_ok ) = @_;
176
	$current_loc, $item_props, $cancel) = @_;
176
    my ( $patron, $item, $circ );
177
    my ($patron, $item, $circ);
178
177
179
    $circ = new ILS::Transaction::Checkin;
178
    $circ = new ILS::Transaction::Checkin;
179
180
    # BEGIN TRANSACTION
180
    # BEGIN TRANSACTION
181
    $circ->item($item = new ILS::Item $item_id);
181
    $circ->item( $item = new ILS::Item $item_id);
182
182
183
    if ($item) {
183
    if ($item) {
184
        $circ->do_checkin($current_loc, $return_date);
184
        $circ->do_checkin( $current_loc, $return_date );
185
    } else {
185
    }
186
    else {
186
        $circ->alert(1);
187
        $circ->alert(1);
187
        $circ->alert_type(99);
188
        $circ->alert_type(99);
188
        $circ->screen_msg('Invalid Item');
189
        $circ->screen_msg('Invalid Item');
189
    }
190
    }
190
	# It's ok to check it in if it exists, and if it was checked out
191
191
	$circ->ok($item && $item->{patron});
192
    # It's ok to check it in if it exists, and if it was checked out
192
193
    $circ->ok( $item && $item->{patron} );
193
	if (!defined($item->{patron})) {
194
194
		$circ->screen_msg("Item not checked out");
195
    if ( !defined( $item->{patron} ) && !$checked_in_ok ) {
195
	} else {
196
        $circ->screen_msg("Item not checked out");
196
		if ($circ->ok) {
197
    }
197
			$circ->patron($patron = new ILS::Patron $item->{patron});
198
    else {
198
			delete $item->{patron};
199
        if ( $circ->ok ) {
199
			delete $item->{due_date};
200
            $circ->patron( $patron = new ILS::Patron $item->{patron} );
200
			$patron->{items} = [ grep {$_ ne $item_id} @{$patron->{items}} ];
201
            delete $item->{patron};
201
		}
202
            delete $item->{due_date};
202
	}
203
            $patron->{items} = [ grep { $_ ne $item_id } @{ $patron->{items} } ];
204
        }
205
    }
206
203
    # END TRANSACTION
207
    # END TRANSACTION
204
208
205
    return $circ;
209
    return $circ;
(-)a/C4/SIP/Sip/MsgType.pm (-1 / +1 lines)
Lines 639-645 sub handle_checkin { Link Here
639
        syslog("LOG_WARNING", "received no-block checkin from terminal '%s'", $account->{id});
639
        syslog("LOG_WARNING", "received no-block checkin from terminal '%s'", $account->{id});
640
        $status = $ils->checkin_no_block($item_id, $trans_date, $return_date, $item_props, $cancel);
640
        $status = $ils->checkin_no_block($item_id, $trans_date, $return_date, $item_props, $cancel);
641
    } else {
641
    } else {
642
        $status = $ils->checkin($item_id, $trans_date, $return_date, $my_branch, $item_props, $cancel);
642
        $status = $ils->checkin($item_id, $trans_date, $return_date, $my_branch, $item_props, $cancel, $account->{checked_in_ok});
643
    }
643
    }
644
644
645
    $patron = $status->patron;
645
    $patron = $status->patron;
(-)a/etc/SIPconfig.xml (-2 / +1 lines)
Lines 36-42 Link Here
36
  </listeners>
36
  </listeners>
37
37
38
  <accounts>
38
  <accounts>
39
      <login id="term1"  password="term1" delimiter="|" error-detect="enabled" institution="CPL" encoding="ascii" />
39
      <login id="term1"  password="term1" delimiter="|" error-detect="enabled" institution="CPL" encoding="ascii" checked_in_ok="1" />
40
      <login id="koha"   password="koha"  delimiter="|" error-detect="enabled" institution="kohalibrary" encoding="utf8" />
40
      <login id="koha"   password="koha"  delimiter="|" error-detect="enabled" institution="kohalibrary" encoding="utf8" />
41
      <login id="koha2"  password="koha" institution="kohalibrary2" terminator="CR" />
41
      <login id="koha2"  password="koha" institution="kohalibrary2" terminator="CR" />
42
      <login id="lpl-sc" password="1234" institution="LPL" />
42
      <login id="lpl-sc" password="1234" institution="LPL" />
43
- 

Return to bug 13411