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

(-)a/t/db_dependent/SIP/Patron.t (-2 / +13 lines)
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 310-320 subtest "NoIssuesChargeGuarantees tests" => sub { Link Here
310
        }
312
        }
311
    )->store;
313
    )->store;
312
314
315
    my $fee3 = $builder->build_object(
316
        {
317
            class => 'Koha::Account::Lines',
318
            value  => {
319
                borrowernumber => $sibling->borrowernumber,
320
                amountoutstanding => 11.11,
321
            }
322
        }
323
    )->store;
324
313
    my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber );
325
    my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber );
314
326
315
    is( $sip_patron->fines_amount, 11, "Only patron's fines are reported in total");
327
    is( $sip_patron->fines_amount, 11, "Only patron's fines are reported in total");
316
    ok( !$sip_patron->charge_ok, "Guarantor blocked");
328
    ok( !$sip_patron->charge_ok, "Guarantor blocked");
317
    like( $sip_patron->screen_msg, qr/Patron blocked by fines \(11\.11\) on guaranteed accounts/,"Screen message includes related fines total");
329
    like( $sip_patron->screen_msg, qr/Patron blocked by fines \(22\.22\) on guaranteed accounts/,"Screen message includes related fines total");
318
330
319
    $sip_patron = C4::SIP::ILS::Patron->new( $child->cardnumber );
331
    $sip_patron = C4::SIP::ILS::Patron->new( $child->cardnumber );
320
332
321
- 

Return to bug 33411