Lines 8-14
use Koha::Acquisition::Booksellers;
Link Here
|
8 |
use Koha::Acquisition::Orders; |
8 |
use Koha::Acquisition::Orders; |
9 |
use Koha::Database; |
9 |
use Koha::Database; |
10 |
|
10 |
|
11 |
use Test::More tests => 24; |
11 |
use Test::More tests => 27; |
12 |
|
12 |
|
13 |
BEGIN { |
13 |
BEGIN { |
14 |
use_ok('C4::Acquisition', qw( NewBasket GetBasket AddInvoice GetInvoice ModReceiveOrder GetInvoiceDetails GetInvoices ModInvoice CloseInvoice ReopenInvoice MergeInvoices DelInvoice )); |
14 |
use_ok('C4::Acquisition', qw( NewBasket GetBasket AddInvoice GetInvoice ModReceiveOrder GetInvoiceDetails GetInvoices ModInvoice CloseInvoice ReopenInvoice MergeInvoices DelInvoice )); |
Lines 99-104
my $invoiceid1 = AddInvoice(invoicenumber => 'invoice1', booksellerid => $bookse
Link Here
|
99 |
my $invoiceid2 = AddInvoice(invoicenumber => 'invoice2', booksellerid => $booksellerid, unknown => "unknown", |
99 |
my $invoiceid2 = AddInvoice(invoicenumber => 'invoice2', booksellerid => $booksellerid, unknown => "unknown", |
100 |
shipmentdate => '2012-12-24', |
100 |
shipmentdate => '2012-12-24', |
101 |
); |
101 |
); |
|
|
102 |
my $invoiceid_closed = AddInvoice( |
103 |
invoicenumber => 'invoice_close', |
104 |
booksellerid => $booksellerid, |
105 |
unknown => "unknown", |
106 |
shipmentdate => '2012-12-24', |
107 |
closedate => '2024-12-13', |
108 |
); |
109 |
|
102 |
|
110 |
|
103 |
my $invoice1 = GetInvoice( $invoiceid1 ); |
111 |
my $invoice1 = GetInvoice( $invoiceid1 ); |
104 |
my $invoice2 = GetInvoice( $invoiceid2 ); |
112 |
my $invoice2 = GetInvoice( $invoiceid2 ); |
Lines 162-167
is($invoices[0]->{invoicenumber}, 'invoice1', 'GetInvoices() to search by ISBN w
Link Here
|
162 |
@invoices = GetInvoices(isbneanissn => '123456789'); |
170 |
@invoices = GetInvoices(isbneanissn => '123456789'); |
163 |
is($invoices[0]->{invoicenumber}, 'invoice1', 'GetInvoices() to search by partial ISBN works (bug 8854)'); |
171 |
is($invoices[0]->{invoicenumber}, 'invoice1', 'GetInvoices() to search by partial ISBN works (bug 8854)'); |
164 |
|
172 |
|
|
|
173 |
@invoices = GetInvoices(booksellerid => $booksellerid, closedate => undef); |
174 |
is(scalar @invoices, 2, ); |
175 |
is($invoices[0]->{invoicenumber}, 'invoice1', 'GetInvoices()'); |
176 |
is($invoices[1]->{invoicenumber}, 'invoice2', 'GetInvoices()'); |
177 |
|
165 |
my $invoicesummary1 = GetInvoice($invoiceid1); |
178 |
my $invoicesummary1 = GetInvoice($invoiceid1); |
166 |
is($invoicesummary1->{'invoicenumber'}, 'invoice1', 'GetInvoice retrieves correct invoice'); |
179 |
is($invoicesummary1->{'invoicenumber'}, 'invoice1', 'GetInvoice retrieves correct invoice'); |
167 |
is($invoicesummary1->{'invoicenumber'}, $invoice1->{'invoicenumber'}, 'GetInvoice and GetInvoiceDetails retrieve same information'); |
180 |
is($invoicesummary1->{'invoicenumber'}, $invoice1->{'invoicenumber'}, 'GetInvoice and GetInvoiceDetails retrieve same information'); |
168 |
- |
|
|