Lines 3-13
use Test::More tests => 3;
Link Here
|
3 |
|
3 |
|
4 |
use C4::Context; |
4 |
use C4::Context; |
5 |
use C4::Members; |
5 |
use C4::Members; |
|
|
6 |
use C4::Branch; |
6 |
|
7 |
|
7 |
my $dbh = C4::Context->dbh; |
8 |
my $dbh = C4::Context->dbh; |
8 |
$dbh->{AutoCommit} = 0; |
9 |
$dbh->{AutoCommit} = 0; |
9 |
$dbh->{RaiseError} = 1; |
10 |
$dbh->{RaiseError} = 1; |
10 |
|
11 |
|
|
|
12 |
# Add branches if they don't exist |
13 |
if (not defined GetBranchDetail('CPL')) { |
14 |
ModBranch({add => 1, branchcode => 'CPL', branchname => 'Centerville'}); |
15 |
} |
16 |
if (not defined GetBranchDetail('MPL')) { |
17 |
ModBranch({add => 1, branchcode => 'MPL', branchname => 'Midway'}); |
18 |
} |
19 |
|
20 |
# Add default categories. |
21 |
$dbh->do("DELETE FROM categories WHERE categorycode='K';"); |
22 |
$dbh->do("DELETE FROM categories WHERE categorycode='J';"); |
23 |
$dbh->do("DELETE FROM categories WHERE categorycode='YA';"); |
24 |
my $sql = "INSERT INTO categories (categorycode, description, |
25 |
enrolmentperiod, upperagelimit, dateofbirthrequired, finetype, |
26 |
bulk, enrolmentfee, overduenoticerequired, issuelimit, |
27 |
reservefee, category_type) VALUES |
28 |
('K','Kid',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C'), |
29 |
('J','Juvenile',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C'), |
30 |
('YA','Young Adult',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C');"; |
31 |
$dbh->do($sql); |
32 |
|
11 |
my $enrolmentfee_K = 5; |
33 |
my $enrolmentfee_K = 5; |
12 |
my $enrolmentfee_J = 10; |
34 |
my $enrolmentfee_J = 10; |
13 |
my $enrolmentfee_YA = 20; |
35 |
my $enrolmentfee_YA = 20; |
14 |
- |
|
|