Lines 834-851
subtest 'get_transfers' => sub {
Link Here
|
834 |
}; |
834 |
}; |
835 |
|
835 |
|
836 |
subtest 'Tests for relationship between item and item_orders via aqorders_item' => sub { |
836 |
subtest 'Tests for relationship between item and item_orders via aqorders_item' => sub { |
837 |
plan tests => 2; |
837 |
plan tests => 3; |
838 |
|
838 |
|
839 |
$schema->storage->txn_begin; |
839 |
$schema->storage->txn_begin; |
840 |
|
840 |
|
841 |
my $biblio = $builder->build_sample_biblio(); |
841 |
my $biblio = $builder->build_sample_biblio(); |
842 |
my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); |
842 |
my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); |
843 |
my $aq_budget = $builder->build({ |
843 |
|
844 |
source => 'Aqbudget', |
844 |
my $orders = $item->orders; |
845 |
value => { |
845 |
is ($orders->count, 0, 'No order on this item yet'); |
846 |
budget_notes => 'test', |
|
|
847 |
}, |
848 |
}); |
849 |
|
846 |
|
850 |
my $order_note = 'Order for ' . $item->itemnumber; |
847 |
my $order_note = 'Order for ' . $item->itemnumber; |
851 |
|
848 |
|
Lines 853-859
subtest 'Tests for relationship between item and item_orders via aqorders_item'
Link Here
|
853 |
class => 'Koha::Acquisition::Orders', |
850 |
class => 'Koha::Acquisition::Orders', |
854 |
value => { |
851 |
value => { |
855 |
biblionumber => $biblio->biblionumber, |
852 |
biblionumber => $biblio->biblionumber, |
856 |
budget_id => $aq_budget->{budget_id}, |
|
|
857 |
order_internalnote => $order_note, |
853 |
order_internalnote => $order_note, |
858 |
}, |
854 |
}, |
859 |
}); |
855 |
}); |
Lines 861-867
subtest 'Tests for relationship between item and item_orders via aqorders_item'
Link Here
|
861 |
class => 'Koha::Acquisition::Orders', |
857 |
class => 'Koha::Acquisition::Orders', |
862 |
value => { |
858 |
value => { |
863 |
biblionumber => $biblio->biblionumber, |
859 |
biblionumber => $biblio->biblionumber, |
864 |
budget_id => $aq_budget->{budget_id}, |
|
|
865 |
}, |
860 |
}, |
866 |
}); |
861 |
}); |
867 |
my $aq_order_item1 = $builder->build({ |
862 |
my $aq_order_item1 = $builder->build({ |
Lines 872-878
subtest 'Tests for relationship between item and item_orders via aqorders_item'
Link Here
|
872 |
}, |
867 |
}, |
873 |
}); |
868 |
}); |
874 |
|
869 |
|
875 |
my $orders = $item->orders; |
870 |
$orders = $item->orders; |
876 |
is ($orders->count, 1, 'One order found by item with the relationship'); |
871 |
is ($orders->count, 1, 'One order found by item with the relationship'); |
877 |
is ($orders->next->order_internalnote, $order_note, 'Correct order found by item with the relationship'); |
872 |
is ($orders->next->order_internalnote, $order_note, 'Correct order found by item with the relationship'); |
878 |
}; |
873 |
}; |
879 |
- |
|
|