Lines 88-94
sub t_fines_checkout_less_than_max {
Link Here
|
88 |
borrowernumber => $patron->borrowernumber, |
88 |
borrowernumber => $patron->borrowernumber, |
89 |
amountoutstanding => 9000, |
89 |
amountoutstanding => 9000, |
90 |
})->store; |
90 |
})->store; |
91 |
my ($outstanding) = C4::Members::GetMemberAccountRecords($patron->borrowernumber); |
91 |
my $outstanding = $patron->account->balance; |
92 |
my $maxoutstanding = C4::Context->preference('noissuescharge'); |
92 |
my $maxoutstanding = C4::Context->preference('noissuescharge'); |
93 |
my $patroncalc = Koha::Availability::Checks::Patron->new($patron); |
93 |
my $patroncalc = Koha::Availability::Checks::Patron->new($patron); |
94 |
my $debt = $patroncalc->debt_checkout; |
94 |
my $debt = $patroncalc->debt_checkout; |
Lines 120-126
sub t_fines_checkout_more_than_max {
Link Here
|
120 |
borrowernumber => $patron->borrowernumber, |
120 |
borrowernumber => $patron->borrowernumber, |
121 |
amountoutstanding => 9001, |
121 |
amountoutstanding => 9001, |
122 |
})->store; |
122 |
})->store; |
123 |
my ($outstanding) = C4::Members::GetMemberAccountRecords($patron->borrowernumber); |
123 |
my $outstanding = $patron->account->balance; |
124 |
my $maxoutstanding = C4::Context->preference('noissuescharge'); |
124 |
my $maxoutstanding = C4::Context->preference('noissuescharge'); |
125 |
my $patroncalc = Koha::Availability::Checks::Patron->new($patron); |
125 |
my $patroncalc = Koha::Availability::Checks::Patron->new($patron); |
126 |
my $debt = $patroncalc->debt_checkout; |
126 |
my $debt = $patroncalc->debt_checkout; |
Lines 146-152
sub t_fines_hold_less_than_max {
Link Here
|
146 |
borrowernumber => $patron->borrowernumber, |
146 |
borrowernumber => $patron->borrowernumber, |
147 |
amountoutstanding => 9000, |
147 |
amountoutstanding => 9000, |
148 |
})->store; |
148 |
})->store; |
149 |
my ($outstanding) = C4::Members::GetMemberAccountRecords($patron->borrowernumber); |
149 |
my $outstanding = $patron->account->balance; |
150 |
my $maxoutstanding = C4::Context->preference('maxoutstanding'); |
150 |
my $maxoutstanding = C4::Context->preference('maxoutstanding'); |
151 |
my $patroncalc = Koha::Availability::Checks::Patron->new($patron); |
151 |
my $patroncalc = Koha::Availability::Checks::Patron->new($patron); |
152 |
my $debt = $patroncalc->debt_hold; |
152 |
my $debt = $patroncalc->debt_hold; |
Lines 167-173
sub t_fines_hold_more_than_max {
Link Here
|
167 |
borrowernumber => $patron->borrowernumber, |
167 |
borrowernumber => $patron->borrowernumber, |
168 |
amountoutstanding => 9001, |
168 |
amountoutstanding => 9001, |
169 |
})->store; |
169 |
})->store; |
170 |
my ($outstanding) = C4::Members::GetMemberAccountRecords($patron->borrowernumber); |
170 |
my $outstanding = $patron->account->balance; |
171 |
my $maxoutstanding = C4::Context->preference('maxoutstanding'); |
171 |
my $maxoutstanding = C4::Context->preference('maxoutstanding'); |
172 |
my $patroncalc = Koha::Availability::Checks::Patron->new($patron); |
172 |
my $patroncalc = Koha::Availability::Checks::Patron->new($patron); |
173 |
my $debt = $patroncalc->debt_hold; |
173 |
my $debt = $patroncalc->debt_hold; |
Lines 193-199
sub t_fines_renew_opac_less_than_max {
Link Here
|
193 |
borrowernumber => $patron->borrowernumber, |
193 |
borrowernumber => $patron->borrowernumber, |
194 |
amountoutstanding => 9000, |
194 |
amountoutstanding => 9000, |
195 |
})->store; |
195 |
})->store; |
196 |
my ($outstanding) = C4::Members::GetMemberAccountRecords($patron->borrowernumber); |
196 |
my $outstanding = $patron->account->balance; |
197 |
my $maxoutstanding = C4::Context->preference('OPACFineNoRenewals'); |
197 |
my $maxoutstanding = C4::Context->preference('OPACFineNoRenewals'); |
198 |
my $patroncalc = Koha::Availability::Checks::Patron->new($patron); |
198 |
my $patroncalc = Koha::Availability::Checks::Patron->new($patron); |
199 |
my $debt = $patroncalc->debt_renew_opac; |
199 |
my $debt = $patroncalc->debt_renew_opac; |
Lines 214-220
sub t_fines_renew_opac_more_than_max {
Link Here
|
214 |
borrowernumber => $patron->borrowernumber, |
214 |
borrowernumber => $patron->borrowernumber, |
215 |
amountoutstanding => 9001, |
215 |
amountoutstanding => 9001, |
216 |
})->store; |
216 |
})->store; |
217 |
my ($outstanding) = C4::Members::GetMemberAccountRecords($patron->borrowernumber); |
217 |
my $outstanding = $patron->account->balance; |
218 |
my $maxoutstanding = C4::Context->preference('OPACFineNoRenewals'); |
218 |
my $maxoutstanding = C4::Context->preference('OPACFineNoRenewals'); |
219 |
my $patroncalc = Koha::Availability::Checks::Patron->new($patron); |
219 |
my $patroncalc = Koha::Availability::Checks::Patron->new($patron); |
220 |
my $debt = $patroncalc->debt_renew_opac; |
220 |
my $debt = $patroncalc->debt_renew_opac; |
Lines 268-281
sub t_guarantees_fines_checkout_more_than_max {
Link Here
|
268 |
$guarantee1->guarantorid($patron->borrowernumber)->store; |
268 |
$guarantee1->guarantorid($patron->borrowernumber)->store; |
269 |
my $guarantee2 = build_a_test_patron(); |
269 |
my $guarantee2 = build_a_test_patron(); |
270 |
$guarantee2->guarantorid($patron->borrowernumber)->store; |
270 |
$guarantee2->guarantorid($patron->borrowernumber)->store; |
271 |
my $line1 = Koha::Account::Line->new({ |
271 |
|
272 |
borrowernumber => $guarantee1->borrowernumber, |
272 |
my $line1 = $guarantee1->account->add_debit({ |
273 |
amountoutstanding => 3, |
273 |
amount => 3, |
274 |
})->store; |
274 |
type => 'fine', |
275 |
my $line2 = Koha::Account::Line->new({ |
275 |
}); |
276 |
borrowernumber => $guarantee2->borrowernumber, |
276 |
my $line2 = $guarantee2->account->add_debit({ |
277 |
amountoutstanding => 3, |
277 |
amount => 3, |
278 |
})->store; |
278 |
type => 'fine', |
|
|
279 |
}); |
280 |
|
279 |
my $patroncalc = Koha::Availability::Checks::Patron->new($patron); |
281 |
my $patroncalc = Koha::Availability::Checks::Patron->new($patron); |
280 |
my $debt = $patroncalc->debt_checkout_guarantees; |
282 |
my $debt = $patroncalc->debt_checkout_guarantees; |
281 |
my $expecting = 'Koha::Exceptions::Patron::DebtGuarantees'; |
283 |
my $expecting = 'Koha::Exceptions::Patron::DebtGuarantees'; |