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

(-)a/t/db_dependent/Circulation.t (-14 / +17 lines)
Lines 1763-1768 subtest "CanBookBeRenewed | bookings" => sub { Link Here
1763
    my $renewing_patron = $builder->build_object( { class => 'Koha::Patrons' } );
1763
    my $renewing_patron = $builder->build_object( { class => 'Koha::Patrons' } );
1764
    my $booked_patron   = $builder->build_object( { class => 'Koha::Patrons' } );
1764
    my $booked_patron   = $builder->build_object( { class => 'Koha::Patrons' } );
1765
    my $item            = $builder->build_sample_item( { bookable => 1 } );
1765
    my $item            = $builder->build_sample_item( { bookable => 1 } );
1766
    my $pickup_library  = $builder->build_object( { class => 'Koha::Libraries' } );
1766
1767
1767
    # issue
1768
    # issue
1768
    my $issue   = AddIssue( $renewing_patron, $item->barcode );
1769
    my $issue   = AddIssue( $renewing_patron, $item->barcode );
Lines 1772-1782 subtest "CanBookBeRenewed | bookings" => sub { Link Here
1772
    # item-level booking
1773
    # item-level booking
1773
    my $booking = Koha::Booking->new(
1774
    my $booking = Koha::Booking->new(
1774
        {
1775
        {
1775
            patron_id  => $booked_patron->borrowernumber,
1776
            patron_id         => $booked_patron->borrowernumber,
1776
            item_id    => $item->itemnumber,
1777
            pickup_library_id => $pickup_library->branchcode,
1777
            biblio_id  => $item->biblio->biblionumber,
1778
            item_id           => $item->itemnumber,
1778
            start_date => $datedue->clone()->add( days => 2 ),
1779
            biblio_id         => $item->biblio->biblionumber,
1779
            end_date   => $datedue->clone()->add( days => 10 ),
1780
            start_date        => $datedue->clone()->add( days => 2 ),
1781
            end_date          => $datedue->clone()->add( days => 10 ),
1780
        }
1782
        }
1781
    )->store();
1783
    )->store();
1782
1784
Lines 4746-4763 subtest 'CanBookBeIssued | bookings' => sub { Link Here
4746
    my $schema = Koha::Database->schema;
4748
    my $schema = Koha::Database->schema;
4747
    $schema->storage->txn_begin;
4749
    $schema->storage->txn_begin;
4748
4750
4749
    my $patron1 = $builder->build_object( { class => 'Koha::Patrons' } );
4751
    my $patron1        = $builder->build_object( { class => 'Koha::Patrons' } );
4750
    my $patron2 = $builder->build_object( { class => 'Koha::Patrons' } );
4752
    my $patron2        = $builder->build_object( { class => 'Koha::Patrons' } );
4751
    my $item    = $builder->build_sample_item( { bookable => 1 } );
4753
    my $pickup_library = $builder->build_object( { class => 'Koha::Libraries' } );
4754
    my $item           = $builder->build_sample_item( { bookable => 1 } );
4752
4755
4753
    # item-level booking
4756
    # item-level booking
4754
    my $booking = Koha::Booking->new(
4757
    my $booking = Koha::Booking->new(
4755
        {
4758
        {
4756
            patron_id  => $patron1->borrowernumber,
4759
            patron_id         => $patron1->borrowernumber,
4757
            item_id    => $item->itemnumber,
4760
            pickup_library_id => $pickup_library->branchcode,
4758
            biblio_id  => $item->biblio->biblionumber,
4761
            item_id           => $item->itemnumber,
4759
            start_date => dt_from_string()->subtract( days => 1 ),
4762
            biblio_id         => $item->biblio->biblionumber,
4760
            end_date   => dt_from_string()->add( days => 6 ),
4763
            start_date        => dt_from_string()->subtract( days => 1 ),
4764
            end_date          => dt_from_string()->add( days => 6 ),
4761
        }
4765
        }
4762
    )->store();
4766
    )->store();
4763
4767
4764
- 

Return to bug 36120