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