|
Lines 284-290
subtest "NoIssuesChargeGuarantees tests" => sub {
Link Here
|
| 284 |
|
284 |
|
| 285 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
285 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
| 286 |
my $child = $builder->build_object({ class => 'Koha::Patrons' }); |
286 |
my $child = $builder->build_object({ class => 'Koha::Patrons' }); |
|
|
287 |
my $sibling = $builder->build_object({ class => 'Koha::Patrons' }); |
| 287 |
$child->add_guarantor({ guarantor_id => $patron->borrowernumber, relationship => 'parent' }); |
288 |
$child->add_guarantor({ guarantor_id => $patron->borrowernumber, relationship => 'parent' }); |
|
|
289 |
$sibling->add_guarantor({ guarantor_id => $patron->borrowernumber, relationship => 'parent' }); |
| 288 |
|
290 |
|
| 289 |
t::lib::Mocks::mock_preference('noissuescharge', 50); |
291 |
t::lib::Mocks::mock_preference('noissuescharge', 50); |
| 290 |
t::lib::Mocks::mock_preference('NoIssuesChargeGuarantees', 11.01); |
292 |
t::lib::Mocks::mock_preference('NoIssuesChargeGuarantees', 11.01); |
|
Lines 312-322
subtest "NoIssuesChargeGuarantees tests" => sub {
Link Here
|
| 312 |
} |
314 |
} |
| 313 |
)->store; |
315 |
)->store; |
| 314 |
|
316 |
|
|
|
317 |
my $fee3 = $builder->build_object( |
| 318 |
{ |
| 319 |
class => 'Koha::Account::Lines', |
| 320 |
value => { |
| 321 |
borrowernumber => $sibling->borrowernumber, |
| 322 |
amountoutstanding => 11.11, |
| 323 |
} |
| 324 |
} |
| 325 |
)->store; |
| 326 |
|
| 315 |
my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber ); |
327 |
my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber ); |
| 316 |
|
328 |
|
| 317 |
is( $sip_patron->fines_amount, 11, "Only patron's fines are reported in total"); |
329 |
is( $sip_patron->fines_amount, 11, "Only patron's fines are reported in total"); |
| 318 |
ok( !$sip_patron->charge_ok, "Guarantor blocked"); |
330 |
ok( !$sip_patron->charge_ok, "Guarantor blocked"); |
| 319 |
like( $sip_patron->screen_msg, qr/Patron blocked by fines \(11\.11\) on guaranteed accounts/,"Screen message includes related fines total"); |
331 |
like( $sip_patron->screen_msg, qr/Patron blocked by fines \(22\.22\) on guaranteed accounts/,"Screen message includes related fines total"); |
| 320 |
|
332 |
|
| 321 |
$sip_patron = C4::SIP::ILS::Patron->new( $child->cardnumber ); |
333 |
$sip_patron = C4::SIP::ILS::Patron->new( $child->cardnumber ); |
| 322 |
|
334 |
|
| 323 |
- |
|
|