Lines 1-6
Link Here
|
1 |
use Modern::Perl; |
1 |
use Modern::Perl; |
2 |
|
2 |
|
3 |
use Test::More tests => 12; |
3 |
use Test::More tests => 7; |
4 |
|
4 |
|
5 |
use t::lib::TestBuilder; |
5 |
use t::lib::TestBuilder; |
6 |
|
6 |
|
Lines 80-89
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} ); |
|
|
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"); |
86 |
|
87 |
$dbh->do(q{DELETE FROM aqinvoices}); |
83 |
$dbh->do(q{DELETE FROM aqinvoices}); |
88 |
my $invoiceid = AddInvoice(invoicenumber => 'invoice1', booksellerid => $bookseller->id, unknown => "unknown"); |
84 |
my $invoiceid = AddInvoice(invoicenumber => 'invoice1', booksellerid => $bookseller->id, unknown => "unknown"); |
89 |
|
85 |
|
Lines 93-112
$invoice->{datereceived} = '2013-01-02';
Link Here
|
93 |
my ( $datereceived, $new_ordernumber ) = ModReceiveOrder( |
89 |
my ( $datereceived, $new_ordernumber ) = ModReceiveOrder( |
94 |
{ |
90 |
{ |
95 |
biblionumber => $biblionumber, |
91 |
biblionumber => $biblionumber, |
96 |
order => $order, |
92 |
order => $order->unblessed, |
97 |
quantityreceived => 1, |
93 |
quantityreceived => 1, |
98 |
budget_id => $budget_id, |
94 |
budget_id => $budget_id, |
99 |
invoice => $invoice, |
95 |
invoice => $invoice, |
100 |
} |
96 |
} |
101 |
); |
97 |
); |
102 |
|
98 |
|
103 |
$order = GetLastOrderReceivedFromSubscriptionid( $subscription->{subscriptionid} ); |
|
|
104 |
is ( $order->{subscriptionid}, $subscription->{subscriptionid}, "test subscriptionid for the last order received"); |
105 |
ok( $order->{ecost} == $cost, "test cost for the last order received"); |
106 |
|
107 |
$order = GetLastOrderNotReceivedFromSubscriptionid( $subscription->{subscriptionid} ); |
108 |
is ( $order, undef, "test no not received order for a received order"); |
109 |
|
110 |
my @invoices = GetInvoices(); |
99 |
my @invoices = GetInvoices(); |
111 |
my @invoices_linked_to_subscriptions = grep { $_->{is_linked_to_subscriptions} } @invoices; |
100 |
my @invoices_linked_to_subscriptions = grep { $_->{is_linked_to_subscriptions} } @invoices; |
112 |
is(scalar(@invoices_linked_to_subscriptions), 1, 'GetInvoices() can identify invoices that are linked to a subscription'); |
101 |
is(scalar(@invoices_linked_to_subscriptions), 1, 'GetInvoices() can identify invoices that are linked to a subscription'); |
113 |
- |
|
|