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

(-)a/C4/SIP/ILS.pm (-2 / +2 lines)
Lines 121-127 sub offline_ok { Link Here
121
# the response.
121
# the response.
122
#
122
#
123
sub checkout {
123
sub checkout {
124
    my ( $self, $patron_id, $item_id, $sc_renew, $fee_ack, $account ) = @_;
124
    my ( $self, $patron_id, $item_id, $sc_renew, $fee_ack, $account, $no_block_due_date ) = @_;
125
    my ( $patron, $item, $circ );
125
    my ( $patron, $item, $circ );
126
    $circ = C4::SIP::ILS::Transaction::Checkout->new();
126
    $circ = C4::SIP::ILS::Transaction::Checkout->new();
127
    # BEGIN TRANSACTION
127
    # BEGIN TRANSACTION
Lines 153-159 sub checkout { Link Here
153
        $circ->screen_msg("Item checked out to another patron");
153
        $circ->screen_msg("Item checked out to another patron");
154
    }
154
    }
155
    else {
155
    else {
156
        $circ->do_checkout($account);
156
        $circ->do_checkout($account, $no_block_due_date);
157
        if ( $circ->ok ) {
157
        if ( $circ->ok ) {
158
158
159
            # If the item is already associated with this patron, then
159
            # If the item is already associated with this patron, then
(-)a/C4/SIP/ILS/Transaction/Checkout.pm (-1 / +21 lines)
Lines 17-23 use C4::SIP::ILS::Transaction; Link Here
17
use C4::Context;
17
use C4::Context;
18
use C4::Circulation qw( AddIssue GetIssuingCharges CanBookBeIssued );
18
use C4::Circulation qw( AddIssue GetIssuingCharges CanBookBeIssued );
19
use C4::Members;
19
use C4::Members;
20
use Koha::DateUtils;
20
use Koha::DateUtils qw( dt_from_string );
21
21
22
use parent qw(C4::SIP::ILS::Transaction);
22
use parent qw(C4::SIP::ILS::Transaction);
23
23
Lines 41-46 sub new { Link Here
41
sub do_checkout {
41
sub do_checkout {
42
	my $self = shift;
42
	my $self = shift;
43
    my $account = shift;
43
    my $account = shift;
44
    my $no_block_due_date = shift;
44
	siplog('LOG_DEBUG', "ILS::Transaction::Checkout performing checkout...");
45
	siplog('LOG_DEBUG', "ILS::Transaction::Checkout performing checkout...");
45
    my $shelf          = $self->{item}->hold_attached;
46
    my $shelf          = $self->{item}->hold_attached;
46
	my $barcode        = $self->{item}->id;
47
	my $barcode        = $self->{item}->id;
Lines 49-54 sub do_checkout { Link Here
49
    my $prevcheckout_block_checkout  = $account->{prevcheckout_block_checkout};
50
    my $prevcheckout_block_checkout  = $account->{prevcheckout_block_checkout};
50
    my ($issuingimpossible, $needsconfirmation) = _can_we_issue($patron, $barcode, 0);
51
    my ($issuingimpossible, $needsconfirmation) = _can_we_issue($patron, $barcode, 0);
51
52
53
    if ( $no_block_due_date ) {
54
        my $year = substr($no_block_due_date,0,4);
55
        my $month = substr($no_block_due_date,4,2);
56
        my $day = substr($no_block_due_date,6,2);
57
        my $hour = substr($no_block_due_date,12,2);
58
        my $minute = substr($no_block_due_date,14,2);
59
        my $second = substr($no_block_due_date,16,2);
60
61
        my $iso = "$year-$month-$day $hour:$minute:$second";
62
        $no_block_due_date = dt_from_string( $iso, "iso" );
63
    }
64
52
    my $noerror=1;  # If set to zero we block the issue
65
    my $noerror=1;  # If set to zero we block the issue
53
    if (keys %{$issuingimpossible}) {
66
    if (keys %{$issuingimpossible}) {
54
        foreach (keys %{$issuingimpossible}) {
67
        foreach (keys %{$issuingimpossible}) {
Lines 113-122 sub do_checkout { Link Here
113
            $noerror = 0;
126
            $noerror = 0;
114
        }
127
        }
115
    }
128
    }
129
130
    if ( $no_block_due_date ) {
131
        $overridden_duedate = $no_block_due_date;
132
        $noerror = 1;
133
    }
134
116
	unless ($noerror) {
135
	unless ($noerror) {
117
		$self->ok(0);
136
		$self->ok(0);
118
		return $self;
137
		return $self;
119
	}
138
	}
139
120
	# can issue
140
	# can issue
121
    my $issue = AddIssue( $patron->unblessed, $barcode, $overridden_duedate, 0 );
141
    my $issue = AddIssue( $patron->unblessed, $barcode, $overridden_duedate, 0 );
122
    $self->{due} = $self->duedatefromissue($issue, $itemnumber);
142
    $self->{due} = $self->duedatefromissue($issue, $itemnumber);
(-)a/C4/SIP/Sip/MsgType.pm (-2 / +1 lines)
Lines 532-538 sub handle_checkout { Link Here
532
        # not a lot we can do about it
532
        # not a lot we can do about it
533
        siplog( "LOG_WARNING", "received no-block checkout from terminal '%s'", $account->{id} );
533
        siplog( "LOG_WARNING", "received no-block checkout from terminal '%s'", $account->{id} );
534
534
535
        $status = $ils->checkout_no_block( $patron_id, $item_id, $sc_renewal_policy, $trans_date, $nb_due_date );
535
        $status = $ils->checkout( $patron_id, $item_id, $sc_renewal_policy, $fee_ack, $account, $nb_due_date );
536
    } else {
536
    } else {
537
537
538
        # Does the transaction date really matter for items that are
538
        # Does the transaction date really matter for items that are
539
- 

Return to bug 12225