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

(-)a/t/db_dependent/Circulation/OfflineCirculation.t (+39 lines)
Lines 197-200 subtest "Bug 30114 - Koha offline circulation will always cancel the next hold w Link Here
197
    is( Koha::Holds->search( { biblionumber => $biblionumber } )->count, 2, "Still found two holds for the record" );
197
    is( Koha::Holds->search( { biblionumber => $biblionumber } )->count, 2, "Still found two holds for the record" );
198
};
198
};
199
199
200
subtest "Bug 32934: ProcessOfflineIssue returns checkout object for SIP no block due date" => sub {
201
    plan tests => 4;
202
203
    $branch = $builder->build( { source => 'Branch' } )->{branchcode};
204
    $manager_id = $builder->build( { source => 'Borrower' } )->{borrowernumber};
205
206
    my $borrower = $builder->build(
207
        {
208
            source => 'Borrower',
209
            value  => { branchcode => $branch }
210
        }
211
    );
212
213
    my $biblio = $builder->build_sample_biblio;
214
    my $item = $builder->build_sample_item(
215
        {
216
            biblionumber => $biblio->id,
217
            library      => $branch,
218
        }
219
    );
220
221
    my $due_date = dt_from_string->add( days => 7 )->ymd;
222
223
    # Test ProcessOfflineIssue returns both message and checkout object
224
    my ( $message, $checkout ) = ProcessOfflineIssue(
225
        {
226
            cardnumber => $borrower->{cardnumber},
227
            barcode    => $item->barcode,
228
            due_date   => $due_date,
229
            timestamp  => dt_from_string
230
        }
231
    );
232
233
    is( $message, "Success.", "ProcessOfflineIssue returns success message" );
234
    isa_ok( $checkout, 'Koha::Checkout', "ProcessOfflineIssue returns checkout object" );
235
    is( $checkout->borrowernumber, $borrower->{borrowernumber}, "Checkout has correct borrower" );
236
    is( $checkout->date_due->ymd, $due_date, "Checkout respects specified due_date" );
237
};
238
200
$schema->storage->txn_rollback;
239
$schema->storage->txn_rollback;
(-)a/t/db_dependent/SIP/Transaction.t (-2 / +17 lines)
Lines 983-989 subtest do_checkout_with_patron_blocked => sub { Link Here
983
};
983
};
984
984
985
subtest do_checkout_with_noblock => sub {
985
subtest do_checkout_with_noblock => sub {
986
    plan tests => 1;
986
    plan tests => 3;
987
987
988
    my $mockILS = Test::MockObject->new;
988
    my $mockILS = Test::MockObject->new;
989
    my $server  = { ils => $mockILS };
989
    my $server  = { ils => $mockILS };
Lines 1033-1038 subtest do_checkout_with_noblock => sub { Link Here
1033
        $patron->checkouts->count,
1033
        $patron->checkouts->count,
1034
        1, 'No Block checkout was performed for debarred patron'
1034
        1, 'No Block checkout was performed for debarred patron'
1035
    );
1035
    );
1036
1037
    # Test Bug 32934: SIP checkout with no_block_due_date should honor the specified due date
1038
    my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber );
1039
    my $sip_item_2 = C4::SIP::ILS::Item->new( $item->barcode );
1040
    my $transaction = C4::SIP::ILS::Transaction::Checkout->new();
1041
1042
    $transaction->patron($sip_patron);
1043
    $transaction->item($sip_item_2);
1044
1045
    # Set no_block_due_date to test the fix
1046
    my $expected_due_date = '20250115';
1047
    my $checkout_result = $transaction->do_checkout($expected_due_date);
1048
    
1049
    my $checkout_obj = $patron->checkouts->find({ itemnumber => $item->itemnumber });
1050
    isnt( $checkout_obj, undef, 'Checkout object exists after no block checkout' );
1051
    like( $checkout_obj->date_due->ymd(''), qr/^20250115/, 'No block due date is honored in SIP checkout' );
1036
};
1052
};
1037
1053
1038
subtest do_checkout_with_holds => sub {
1054
subtest do_checkout_with_holds => sub {
1039
- 

Return to bug 32934