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

(-)a/t/db_dependent/Members/IssueSlip.t (-13 / +4 lines)
Lines 125-130 $module->mock( 'userenv', sub { { branch => $branchcode } } ); Link Here
125
125
126
my $today = dt_from_string;
126
my $today = dt_from_string;
127
my $yesterday = dt_from_string->subtract_duration( DateTime::Duration->new( days => 1 ) );
127
my $yesterday = dt_from_string->subtract_duration( DateTime::Duration->new( days => 1 ) );
128
my $tomorrow = dt_from_string->add( DateTime::Duration->new( days => 1 ) );
128
129
129
subtest 'Issue slip' => sub {
130
subtest 'Issue slip' => sub {
130
    plan tests => 3;
131
    plan tests => 3;
Lines 153-172 EOS Link Here
153
        my $today_daily_as_formatted = output_pref( $today_daily );
154
        my $today_daily_as_formatted = output_pref( $today_daily );
154
        my $yesterday_daily = $yesterday->clone->set( hour => 23, minute => 59 );
155
        my $yesterday_daily = $yesterday->clone->set( hour => 23, minute => 59 );
155
        my $yesterday_daily_as_formatted = output_pref( $yesterday_daily );
156
        my $yesterday_daily_as_formatted = output_pref( $yesterday_daily );
157
        my $tomorrow_daily_as_formatted = output_pref( $tomorrow );
156
158
157
        my ( $date_due, $issue_date, $slip, $expected_slip );
159
        my ( $date_due, $issue_date, $slip, $expected_slip );
158
        $date_due = $today_daily;
160
        $date_due = $tomorrow;
159
        $issue_date = $today_daily->clone->subtract_duration( DateTime::Duration->new( minutes => 1 ) );
161
        $issue_date = $today_daily->clone->subtract_duration( DateTime::Duration->new( minutes => 1 ) );
160
        AddIssue( $borrower, $barcode1, $date_due, undef, $issue_date );
162
        AddIssue( $borrower, $barcode1, $date_due, undef, $issue_date );
161
        $date_due = $today_daily;
163
        $date_due = $today_daily;
162
        $issue_date = $yesterday_daily;
164
        $issue_date = $yesterday_daily;
163
        AddIssue( $borrower, $barcode2, $date_due, undef, $issue_date );
165
        AddIssue( $borrower, $barcode2, $date_due, undef, $issue_date );
164
166
165
        # Set timestamps to the same value to avoid a different order
166
        Koha::Checkouts->search(
167
            { borrowernumber => $borrower->{borrowernumber} }
168
        )->update( { timestamp => dt_from_string } );
169
170
        $expected_slip = <<EOS;
167
        $expected_slip = <<EOS;
171
Checked out:
168
Checked out:
172
169
Lines 177-183 Date due: $today_daily_as_formatted Link Here
177
174
178
Title: $title1
175
Title: $title1
179
Barcode: $barcode1
176
Barcode: $barcode1
180
Date due: $today_daily_as_formatted
177
Date due: $tomorrow_daily_as_formatted
181
178
182
179
183
Overdues:
180
Overdues:
Lines 235-245 EOS Link Here
235
        $issue_date = $yesterday->clone;
232
        $issue_date = $yesterday->clone;
236
        AddIssue( $borrower, $barcode2, $date_due_in_time, undef, $issue_date );
233
        AddIssue( $borrower, $barcode2, $date_due_in_time, undef, $issue_date );
237
234
238
        # Set timestamps to the same value to avoid a different order
239
        Koha::Checkouts->search(
240
            { borrowernumber => $borrower->{borrowernumber} }
241
        )->update( { timestamp => dt_from_string } );
242
243
        $expected_slip = <<EOS;
235
        $expected_slip = <<EOS;
244
Checked out:
236
Checked out:
245
237
246
- 

Return to bug 12388