|
Lines 1-19
Link Here
|
| 1 |
use Modern::Perl; |
1 |
use Modern::Perl; |
| 2 |
|
2 |
|
| 3 |
use Test::More tests => 10; |
3 |
use Test::More tests => 12; |
| 4 |
use Data::Dumper; |
4 |
use Data::Dumper; |
| 5 |
|
5 |
|
| 6 |
use_ok('C4::Serials'); |
|
|
| 7 |
use_ok('C4::Budgets'); |
| 8 |
use_ok('C4::Acquisition'); |
6 |
use_ok('C4::Acquisition'); |
|
|
7 |
use_ok('C4::Biblio'); |
| 8 |
use_ok('C4::Budgets'); |
| 9 |
use_ok('C4::Serials'); |
| 9 |
my $supplierlist=eval{GetSuppliersWithLateIssues()}; |
10 |
my $supplierlist=eval{GetSuppliersWithLateIssues()}; |
| 10 |
ok(length($@)==0,"No SQL problem in GetSuppliersWithLateIssues"); |
11 |
ok(length($@)==0,"No SQL problem in GetSuppliersWithLateIssues"); |
| 11 |
|
12 |
|
| 12 |
my $biblionumber = 1; |
13 |
my $booksellerid = C4::Bookseller::AddBookseller( |
|
|
14 |
{ |
| 15 |
name => "my vendor", |
| 16 |
address1 => "bookseller's address", |
| 17 |
phone => "0123456", |
| 18 |
active => 1 |
| 19 |
} |
| 20 |
); |
| 21 |
|
| 22 |
my ($biblionumber, $biblioitemnumber) = AddBiblio(MARC::Record->new, ''); |
| 13 |
my $budgetid; |
23 |
my $budgetid; |
| 14 |
my $bpid = AddBudgetPeriod({ |
24 |
my $bpid = AddBudgetPeriod({ |
| 15 |
budget_period_startdate => '01-01-2015', |
25 |
budget_period_startdate => '01-01-2015', |
| 16 |
budget_period_enddate => '31-12-2015', |
26 |
budget_period_enddate => '12-31-2015', |
| 17 |
budget_description => "budget desc" |
27 |
budget_description => "budget desc" |
| 18 |
}); |
28 |
}); |
| 19 |
|
29 |
|
|
Lines 36-51
my $subscriptionid = NewSubscription(
Link Here
|
| 36 |
"intnotes", 0, undef, undef, 0, undef, '31-12-2013', |
46 |
"intnotes", 0, undef, undef, 0, undef, '31-12-2013', |
| 37 |
); |
47 |
); |
| 38 |
die unless $subscriptionid; |
48 |
die unless $subscriptionid; |
|
|
49 |
|
| 50 |
my ($basket, $basketno); |
| 51 |
ok($basketno = NewBasket($booksellerid, 1), "NewBasket( $booksellerid , 1 ) returns $basketno"); |
| 52 |
|
| 39 |
my $cost = 42.00; |
53 |
my $cost = 42.00; |
| 40 |
my $subscription = GetSubscription( $subscriptionid ); |
54 |
my $subscription = GetSubscription( $subscriptionid ); |
| 41 |
my ( $basketno, $ordernumber ) = NewOrder({ |
55 |
my $ordernumber; |
|
|
56 |
( $basketno, $ordernumber ) = NewOrder({ |
| 42 |
biblionumber => $subscription->{biblionumber}, |
57 |
biblionumber => $subscription->{biblionumber}, |
| 43 |
entrydate => '01-01-2013', |
58 |
entrydate => '01-01-2013', |
| 44 |
quantity => 1, |
59 |
quantity => 1, |
| 45 |
currency => 'USD', |
60 |
currency => 'USD', |
| 46 |
listprice => $cost, |
61 |
listprice => $cost, |
| 47 |
notes => "This is a note", |
62 |
notes => "This is a note", |
| 48 |
basketno => 1, |
63 |
basketno => $basketno, |
| 49 |
rrp => $cost, |
64 |
rrp => $cost, |
| 50 |
ecost => $cost, |
65 |
ecost => $cost, |
| 51 |
gstrate => 0.0500, |
66 |
gstrate => 0.0500, |
|
Lines 73-79
$order = GetLastOrderNotReceivedFromSubscriptionid( $subscription->{subscription
Link Here
|
| 73 |
is ( $order, undef, "test no not received order for a received order"); |
88 |
is ( $order, undef, "test no not received order for a received order"); |
| 74 |
|
89 |
|
| 75 |
# cleaning |
90 |
# cleaning |
| 76 |
DelSubscription( $subscription->{subscriptionid} ); |
91 |
END { |
| 77 |
DelOrder( $subscription->{biblionumber}, $ordernumber ); |
92 |
DelSubscription( $subscription->{subscriptionid} ); |
| 78 |
DelBudgetPeriod($bpid); |
93 |
DelOrder( $subscription->{biblionumber}, $ordernumber ); |
| 79 |
DelBudget($budget_id); |
94 |
DelBudgetPeriod($bpid); |
|
|
95 |
DelBudget($budget_id); |
| 96 |
DelBasket( $basketno ); |
| 97 |
DelBiblio($biblionumber); |
| 98 |
}; |
| 80 |
- |
|
|