Lines 79-85
my $ordernumber = $order->ordernumber;
Link Here
|
79 |
my $is_currently_on_order = subscriptionCurrentlyOnOrder( $subscription->{subscriptionid} ); |
79 |
my $is_currently_on_order = subscriptionCurrentlyOnOrder( $subscription->{subscriptionid} ); |
80 |
is ( $is_currently_on_order, 1, "The subscription is currently on order"); |
80 |
is ( $is_currently_on_order, 1, "The subscription is currently on order"); |
81 |
|
81 |
|
82 |
$order = GetLastOrderNotReceivedFromSubscriptionid( $subscription->{subscriptionid} ); |
82 |
$order = Koha::Acquisition::Orders->search({ subscriptionid => $subscription->{subscriptionid}, datereceived => undef })->next->unblessed; |
83 |
is ( $order->{subscriptionid}, $subscription->{subscriptionid}, "test subscriptionid for the last order not received"); |
83 |
is ( $order->{subscriptionid}, $subscription->{subscriptionid}, "test subscriptionid for the last order not received"); |
84 |
ok( $order->{ecost} == $cost, "test cost for the last order not received"); |
84 |
ok( $order->{ecost} == $cost, "test cost for the last order not received"); |
85 |
|
85 |
|
Lines 99-110
my ( $datereceived, $new_ordernumber ) = ModReceiveOrder(
Link Here
|
99 |
} |
99 |
} |
100 |
); |
100 |
); |
101 |
|
101 |
|
102 |
$order = GetLastOrderReceivedFromSubscriptionid( $subscription->{subscriptionid} ); |
102 |
$order = Koha::Acquisition::Orders->search( |
|
|
103 |
{ |
104 |
subscriptionid => $subscriptionid, |
105 |
datereceived => { '!=' => undef } |
106 |
}, |
107 |
{ |
108 |
order_by => [ { -desc => 'datereceived' }, { -desc => 'ordernumber' } ] |
109 |
} |
110 |
)->next->unblessed; |
111 |
|
103 |
is ( $order->{subscriptionid}, $subscription->{subscriptionid}, "test subscriptionid for the last order received"); |
112 |
is ( $order->{subscriptionid}, $subscription->{subscriptionid}, "test subscriptionid for the last order received"); |
104 |
ok( $order->{ecost} == $cost, "test cost for the last order received"); |
113 |
ok( $order->{ecost} == $cost, "test cost for the last order received"); |
105 |
|
114 |
|
106 |
$order = GetLastOrderNotReceivedFromSubscriptionid( $subscription->{subscriptionid} ); |
115 |
$order = Koha::Acquisition::Orders->search({ subscriptionid => $subscription->{subscriptionid}, datereceived => undef }); |
107 |
is ( $order, undef, "test no not received order for a received order"); |
116 |
is ( $order->count, 0, "test no not received order for a received order"); |
108 |
|
117 |
|
109 |
my @invoices = GetInvoices(); |
118 |
my @invoices = GetInvoices(); |
110 |
my @invoices_linked_to_subscriptions = grep { $_->{is_linked_to_subscriptions} } @invoices; |
119 |
my @invoices_linked_to_subscriptions = grep { $_->{is_linked_to_subscriptions} } @invoices; |
111 |
- |
|
|