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

(-)a/Koha/REST/V1/Checkouts.pm (-1 / +1 lines)
Lines 263-269 sub add { Link Here
263
        }
263
        }
264
264
265
        # Call 'AddIssue'
265
        # Call 'AddIssue'
266
        my $checkout = AddIssue( $patron->unblessed, $item->barcode );
266
        my $checkout = AddIssue( $patron, $item->barcode );
267
        if ($checkout) {
267
        if ($checkout) {
268
            $c->res->headers->location(
268
            $c->res->headers->location(
269
                $c->req->url->to_string . '/' . $checkout->id );
269
                $c->req->url->to_string . '/' . $checkout->id );
(-)a/t/db_dependent/Circulation/issue.t (-4 / +3 lines)
Lines 598-614 my $itemnumber4 = Koha::Item->new( Link Here
598
)->store->itemnumber;
598
)->store->itemnumber;
599
599
600
t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckout', q{} );
600
t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckout', q{} );
601
AddIssue( $borrower_2, 'barcode_6', dt_from_string );
601
AddIssue( $patron_2, 'barcode_6', dt_from_string );
602
$item = Koha::Items->find( $itemnumber4 );
602
$item = Koha::Items->find( $itemnumber4 );
603
ok( $item->notforloan eq -1, 'UpdateNotForLoanStatusOnCheckout does not modify value when not enabled' );
603
ok( $item->notforloan eq -1, 'UpdateNotForLoanStatusOnCheckout does not modify value when not enabled' );
604
604
605
t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckout', '-1: 0' );
605
t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckout', '-1: 0' );
606
AddReturn( 'barcode_6', $branchcode_1 );
606
AddReturn( 'barcode_6', $branchcode_1 );
607
my $test = AddIssue( $borrower_2, 'barcode_6', dt_from_string );
607
my $test = AddIssue( $patron_2, 'barcode_6', dt_from_string );
608
$item = Koha::Items->find( $itemnumber4 );
608
$item = Koha::Items->find( $itemnumber4 );
609
ok( $item->notforloan eq 0, q{UpdateNotForLoanStatusOnCheckout updates notforloan value from -1 to 0 with setting "-1: 0"} );
609
ok( $item->notforloan eq 0, q{UpdateNotForLoanStatusOnCheckout updates notforloan value from -1 to 0 with setting "-1: 0"} );
610
610
611
AddIssue( $borrower_2, 'barcode_6', dt_from_string );
611
AddIssue( $patron_2, 'barcode_6', dt_from_string );
612
AddReturn( 'barcode_6', $branchcode_1 );
612
AddReturn( 'barcode_6', $branchcode_1 );
613
$item = Koha::Items->find( $itemnumber4 );
613
$item = Koha::Items->find( $itemnumber4 );
614
ok( $item->notforloan eq 0, q{UpdateNotForLoanStatusOnCheckout does not update notforloan value from 0 with setting "-1: 0"} );
614
ok( $item->notforloan eq 0, q{UpdateNotForLoanStatusOnCheckout does not update notforloan value from 0 with setting "-1: 0"} );
615
- 

Return to bug 32496