Lines 95-101
is_deeply(
Link Here
|
95 |
); |
95 |
); |
96 |
|
96 |
|
97 |
# Test GetBranchcodesWithOverdueRules |
97 |
# Test GetBranchcodesWithOverdueRules |
98 |
$dbh->do(q|DELETE FROM overduerules|); |
98 |
$dbh->do(q|DELETE FROM circulation_rules WHERE rule_name LIKE 'overdue_%' |); |
99 |
|
99 |
|
100 |
my @overdue_branches; |
100 |
my @overdue_branches; |
101 |
warnings_are { @overdue_branches = C4::Overdues::GetBranchcodesWithOverdueRules(); } [], |
101 |
warnings_are { @overdue_branches = C4::Overdues::GetBranchcodesWithOverdueRules(); } [], |
Lines 103-112
warnings_are { @overdue_branches = C4::Overdues::GetBranchcodesWithOverdueRules(
Link Here
|
103 |
|
103 |
|
104 |
$dbh->do( |
104 |
$dbh->do( |
105 |
q| |
105 |
q| |
106 |
INSERT INTO overduerules |
106 |
INSERT INTO circulation_rules |
107 |
( branchcode,categorycode, delay1,letter1,debarred1, delay2,letter2,debarred2, delay3,letter3,debarred3 ) |
107 |
( branchcode, categorycode, itemtype, rule_name, rule_value ) |
108 |
VALUES |
108 |
VALUES |
109 |
( '', '', 1, 'LETTER_CODE1', 1, 5, 'LETTER_CODE2', 1, 10, 'LETTER_CODE3', 1 ) |
109 |
( NULL, NULL, NULL, 'overdue_1_delay', 1 ) |
110 |
| |
110 |
| |
111 |
); |
111 |
); |
112 |
|
112 |
|
Lines 120-129
is_deeply(
Link Here
|
120 |
|
120 |
|
121 |
$dbh->do( |
121 |
$dbh->do( |
122 |
q| |
122 |
q| |
123 |
INSERT INTO overduerules |
123 |
INSERT INTO circulation_rules |
124 |
( branchcode,categorycode, delay1,letter1,debarred1, delay2,letter2,debarred2, delay3,letter3,debarred3 ) |
124 |
( branchcode, categorycode, itemtype, rule_name, rule_value ) |
125 |
VALUES |
125 |
VALUES |
126 |
( 'CPL', '', 1, 'LETTER_CODE1', 1, 5, 'LETTER_CODE2', 1, 10, 'LETTER_CODE3', 1 ) |
126 |
( 'CPL', NULL, NULL, 'overdue_1_delay', 1 ) |
127 |
| |
127 |
| |
128 |
); |
128 |
); |
129 |
|
129 |
|
Lines 133-159
is_deeply(
Link Here
|
133 |
'If a default rule exists and a specific rule exists, all branches should be returned' |
133 |
'If a default rule exists and a specific rule exists, all branches should be returned' |
134 |
); |
134 |
); |
135 |
|
135 |
|
136 |
$dbh->do(q|DELETE FROM overduerules|); |
136 |
$dbh->do(q|DELETE FROM circulation_rules WHERE rule_name LIKE 'overdue_%' |); |
137 |
$dbh->do( |
137 |
$dbh->do( |
138 |
q| |
138 |
q| |
139 |
INSERT INTO overduerules |
139 |
INSERT INTO circulation_rules |
140 |
( branchcode,categorycode, delay1,letter1,debarred1, delay2,letter2,debarred2, delay3,letter3,debarred3 ) |
140 |
( branchcode, categorycode, itemtype, rule_name, rule_value ) |
141 |
VALUES |
141 |
VALUES |
142 |
( 'CPL', '', 1, 'LETTER_CODE1', 1, 5, 'LETTER_CODE2', 1, 10, 'LETTER_CODE3', 1 ) |
142 |
( 'CPL', NULL, NULL, 'overdue_1_delay', 1 ) |
143 |
| |
143 |
| |
144 |
); |
144 |
); |
145 |
|
145 |
|
146 |
@overdue_branches = C4::Overdues::GetBranchcodesWithOverdueRules(); |
146 |
@overdue_branches = C4::Overdues::GetBranchcodesWithOverdueRules(); |
147 |
is_deeply( \@overdue_branches, ['CPL'], 'If only a specific rule exist, only 1 branch should be returned' ); |
147 |
is_deeply( \@overdue_branches, ['CPL'], 'If only a specific rule exist, only 1 branch should be returned' ); |
148 |
|
148 |
|
149 |
$dbh->do(q|DELETE FROM overduerules|); |
149 |
$dbh->do(q|DELETE FROM circulation_rules WHERE rule_name LIKE 'overdue_%' |); |
150 |
$dbh->do( |
150 |
$dbh->do( |
151 |
q| |
151 |
q| |
152 |
INSERT INTO overduerules |
152 |
INSERT INTO circulation_rules |
153 |
( branchcode,categorycode, delay1,letter1,debarred1, delay2,letter2,debarred2, delay3,letter3,debarred3 ) |
153 |
( branchcode, categorycode, itemtype, rule_name, rule_value ) |
154 |
VALUES |
154 |
VALUES |
155 |
( 'CPL', '', 1, 'LETTER_CODE1_CPL', 1, 5, 'LETTER_CODE2_CPL', 1, 10, 'LETTER_CODE3_CPL', 1 ), |
155 |
( 'CPL', NULL, NULL, 'overdue_1_delay', 1 ), |
156 |
( 'MPL', '', 1, 'LETTER_CODE1_MPL', 1, 5, 'LETTER_CODE2_MPL', 1, 10, 'LETTER_CODE3_MPL', 1 ) |
156 |
( 'MPL', NULL, NULL, 'overdue_1_delay', 1 ) |
157 |
| |
157 |
| |
158 |
); |
158 |
); |
159 |
|
159 |
|
160 |
- |
|
|