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

(-)a/t/db_dependent/Circulation.t (-2 / +2 lines)
Lines 1233-1239 subtest 'CanBookBeIssued & AllowReturnToBranch' => sub { Link Here
1233
    set_userenv($holdingbranch);
1233
    set_userenv($holdingbranch);
1234
1234
1235
    my $issue = AddIssue( $patron_1->unblessed, $item->{barcode} );
1235
    my $issue = AddIssue( $patron_1->unblessed, $item->{barcode} );
1236
    is( ref($issue), 'Koha::Schema::Result::Issue' );    # FIXME Should be Koha::Checkout
1236
    is( ref($issue), 'Koha::Checkout' );    # FIXME Should be Koha::Checkout
1237
1237
1238
    my ( $error, $question, $alerts );
1238
    my ( $error, $question, $alerts );
1239
1239
Lines 1326-1332 subtest 'AddIssue & AllowReturnToBranch' => sub { Link Here
1326
1326
1327
    set_userenv($holdingbranch);
1327
    set_userenv($holdingbranch);
1328
1328
1329
    my $ref_issue = 'Koha::Schema::Result::Issue'; # FIXME Should be Koha::Checkout
1329
    my $ref_issue = 'Koha::Checkout'; # FIXME Should be Koha::Checkout
1330
    my $issue = AddIssue( $patron_1, $item->{barcode} );
1330
    my $issue = AddIssue( $patron_1, $item->{barcode} );
1331
1331
1332
    my ( $error, $question, $alerts );
1332
    my ( $error, $question, $alerts );
(-)a/t/db_dependent/Circulation/issue.t (-3 / +3 lines)
Lines 183-195 $sth->execute; Link Here
183
my $countissue = $sth -> fetchrow_array;
183
my $countissue = $sth -> fetchrow_array;
184
is ($countissue ,0, "there is no issue");
184
is ($countissue ,0, "there is no issue");
185
my $issue1 = C4::Circulation::AddIssue( $borrower_1, $barcode_1, $daysago10,0, $today, '' );
185
my $issue1 = C4::Circulation::AddIssue( $borrower_1, $barcode_1, $daysago10,0, $today, '' );
186
is( ref $issue1, 'Koha::Schema::Result::Issue',
186
is( ref $issue1, 'Koha::Checkout',
187
       'AddIssue returns a Koha::Schema::Result::Issue object' );
187
       'AddIssue returns a Koha::Checkout object' );
188
my $datedue1 = dt_from_string( $issue1->date_due() );
188
my $datedue1 = dt_from_string( $issue1->date_due() );
189
like(
189
like(
190
    $datedue1,
190
    $datedue1,
191
    qr/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,
191
    qr/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,
192
    "Koha::Schema::Result::Issue->date_due() returns a date"
192
    "Koha::Checkout->date_due() returns a date"
193
);
193
);
194
my $issue_id1 = $issue1->issue_id;
194
my $issue_id1 = $issue1->issue_id;
195
195
(-)a/t/db_dependent/Letters/TemplateToolkit.t (-8 / +7 lines)
Lines 653-663 EOF Link Here
653
        reset_template( { template => $template, code => $code, module => 'circulation' } );
653
        reset_template( { template => $template, code => $code, module => 'circulation' } );
654
654
655
        my $checkout = C4::Circulation::AddIssue( $patron, $item1->{barcode} ); # Add a first checkout
655
        my $checkout = C4::Circulation::AddIssue( $patron, $item1->{barcode} ); # Add a first checkout
656
        $checkout->set_columns( { timestamp => $now, issuedate => $one_minute_ago } )->update; # FIXME $checkout is a Koha::Schema::Result::Issues, must be a Koha::Checkout
656
        $checkout->set( { timestamp => $now, issuedate => $one_minute_ago } )->store;
657
        my $first_slip = C4::Members::IssueSlip( $branchcode, $patron->{borrowernumber} );
657
        my $first_slip = C4::Members::IssueSlip( $branchcode, $patron->{borrowernumber} );
658
658
659
        $checkout = C4::Circulation::AddIssue( $patron, $item2->{barcode} ); # Add a second checkout
659
        $checkout = C4::Circulation::AddIssue( $patron, $item2->{barcode} ); # Add a second checkout
660
        $checkout->set_columns( { timestamp => $now, issuedate => $now } )->update;
660
        $checkout->set( { timestamp => $now, issuedate => $now } )->store;
661
        my $yesterday = dt_from_string->subtract( days => 1 );
661
        my $yesterday = dt_from_string->subtract( days => 1 );
662
        C4::Circulation::AddIssue( $patron, $item3->{barcode}, $yesterday ); # Add an overdue
662
        C4::Circulation::AddIssue( $patron, $item3->{barcode}, $yesterday ); # Add an overdue
663
        my $second_slip = C4::Members::IssueSlip( $branchcode, $patron->{borrowernumber} );
663
        my $second_slip = C4::Members::IssueSlip( $branchcode, $patron->{borrowernumber} );
Lines 713-723 EOF Link Here
713
        reset_template( { template => $tt_template, code => $code, module => 'circulation' } );
713
        reset_template( { template => $tt_template, code => $code, module => 'circulation' } );
714
714
715
        $checkout = C4::Circulation::AddIssue( $patron, $item1->{barcode} ); # Add a first checkout
715
        $checkout = C4::Circulation::AddIssue( $patron, $item1->{barcode} ); # Add a first checkout
716
        $checkout->set_columns( { timestamp => $now, issuedate => $one_minute_ago } )->update;
716
        $checkout->set( { timestamp => $now, issuedate => $one_minute_ago } )->store;
717
        my $first_tt_slip = C4::Members::IssueSlip( $branchcode, $patron->{borrowernumber} );
717
        my $first_tt_slip = C4::Members::IssueSlip( $branchcode, $patron->{borrowernumber} );
718
718
719
        $checkout = C4::Circulation::AddIssue( $patron, $item2->{barcode} ); # Add a second checkout
719
        $checkout = C4::Circulation::AddIssue( $patron, $item2->{barcode} ); # Add a second checkout
720
        $checkout->set_columns( { timestamp => $now, issuedate => $now } )->update;
720
        $checkout->set( { timestamp => $now, issuedate => $now } )->store;
721
        C4::Circulation::AddIssue( $patron, $item3->{barcode}, $yesterday ); # Add an overdue
721
        C4::Circulation::AddIssue( $patron, $item3->{barcode}, $yesterday ); # Add an overdue
722
        my $second_tt_slip = C4::Members::IssueSlip( $branchcode, $patron->{borrowernumber} );
722
        my $second_tt_slip = C4::Members::IssueSlip( $branchcode, $patron->{borrowernumber} );
723
723
Lines 776-784 EOF Link Here
776
        my $issue1 = C4::Circulation::AddIssue( $patron, $item1->{barcode} ); # Add a first checkout
776
        my $issue1 = C4::Circulation::AddIssue( $patron, $item1->{barcode} ); # Add a first checkout
777
        my $issue2 = C4::Circulation::AddIssue( $patron, $item2->{barcode}, $yesterday ); # Add an first overdue
777
        my $issue2 = C4::Circulation::AddIssue( $patron, $item2->{barcode}, $yesterday ); # Add an first overdue
778
        my $issue3 = C4::Circulation::AddIssue( $patron, $item3->{barcode}, $two_days_ago ); # Add an second overdue
778
        my $issue3 = C4::Circulation::AddIssue( $patron, $item3->{barcode}, $two_days_ago ); # Add an second overdue
779
        $issue1 = Koha::Checkout->_new_from_dbic( $issue1 )->unblessed; # ->unblessed should be enough but AddIssue does not return a Koha::Checkout object
779
        $issue1 = $issue1->unblessed;
780
        $issue2 = Koha::Checkout->_new_from_dbic( $issue2 )->unblessed;
780
        $issue2 = $issue2->unblessed;
781
        $issue3 = Koha::Checkout->_new_from_dbic( $issue3 )->unblessed;
781
        $issue3 = $issue3->unblessed;
782
782
783
        # For items.content
783
        # For items.content
784
        my @item_fields = qw( date_due title barcode author itemnumber );
784
        my @item_fields = qw( date_due title barcode author itemnumber );
785
- 

Return to bug 21999