View | Details | Raw Unified | Return to bug 13457
Collapse All | Expand All

(-)a/t/db_dependent/Suggestions.t (-2 / +22 lines)
Lines 20-25 use Modern::Perl; Link Here
20
use C4::Context;
20
use C4::Context;
21
use C4::Members;
21
use C4::Members;
22
use C4::Letters;
22
use C4::Letters;
23
use C4::Branch;
23
use C4::Budgets;
24
use C4::Budgets;
24
25
25
use Koha::DateUtils qw( dt_from_string );
26
use Koha::DateUtils qw( dt_from_string );
Lines 33-38 BEGIN { Link Here
33
}
34
}
34
35
35
my $dbh = C4::Context->dbh;
36
my $dbh = C4::Context->dbh;
37
my $sql;
36
38
37
# Start transaction
39
# Start transaction
38
$dbh->{AutoCommit} = 0;
40
$dbh->{AutoCommit} = 0;
Lines 40-46 $dbh->{RaiseError} = 1; Link Here
40
42
41
# Reset item types to only the default ones
43
# Reset item types to only the default ones
42
$dbh->do(q|DELETE FROM itemtypes;|);
44
$dbh->do(q|DELETE FROM itemtypes;|);
43
my $sql = "
45
$sql = "
44
INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan, imageurl, summary) VALUES
46
INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan, imageurl, summary) VALUES
45
('BK', 'Books',5,0,'bridge/book.gif',''),
47
('BK', 'Books',5,0,'bridge/book.gif',''),
46
('MX', 'Mixed Materials',5,0,'bridge/kit.gif',''),
48
('MX', 'Mixed Materials',5,0,'bridge/kit.gif',''),
Lines 58-63 $dbh->do(q|DELETE FROM letter|); Link Here
58
$dbh->do(q|DELETE FROM message_queue|);
60
$dbh->do(q|DELETE FROM message_queue|);
59
$dbh->do(q|INSERT INTO letter(module, code, content) VALUES ('suggestions', 'CHECKED', 'my content')|);
61
$dbh->do(q|INSERT INTO letter(module, code, content) VALUES ('suggestions', 'CHECKED', 'my content')|);
60
62
63
# Add CPL if missing.
64
if (not defined GetBranchDetail('CPL')) {
65
    ModBranch({add => 1, branchcode => 'CPL', branchname => 'Centerville'});
66
}
67
68
my $sth = $dbh->prepare("SELECT * FROM categories WHERE categorycode='S';");
69
$sth->execute();
70
if (!$sth->fetchrow_hashref) {
71
    $sql = "INSERT INTO categories
72
                (categorycode,description,enrolmentperiod,upperagelimit,
73
                 dateofbirthrequired,finetype,bulk,enrolmentfee,
74
                 overduenoticerequired,issuelimit,reservefee,category_type)
75
            VALUES
76
                ('S','Staff',99,999,
77
                 18,NULL,NULL,'0.000000',
78
                 0,NULL,'0.000000','S');";
79
    $dbh->do($sql);
80
}
81
61
my $member = {
82
my $member = {
62
    firstname => 'my firstname',
83
    firstname => 'my firstname',
63
    surname => 'my surname',
84
    surname => 'my surname',
64
- 

Return to bug 13457