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

(-)a/t/db_dependent/Accounts.t (-33 / +27 lines)
Lines 291-338 subtest "makepartialpayment() tests" => sub { Link Here
291
    }
291
    }
292
};
292
};
293
293
294
subtest "makepartialpayment() tests" => sub {
294
subtest "GetTotalFines tests" => sub {
295
295
296
    plan tests => 1;
296
    plan tests => 1;
297
297
298
    my $categorycode = $builder->build( { source => 'Category' } )->{categorycode};
298
    my $categorycode = $builder->build( { source => 'Category' } )->{categorycode};
299
299
300
    my $borrower = Koha::Borrower->new(
300
    my $borrower = $builder->build(
301
        {
301
        {
302
            surname      => 'Hall',
302
            source => 'Borrower',
303
            firstname    => 'Kyle',
303
            value  => {
304
            categorycode => $categorycode,
304
                categorycode => $categorycode,
305
            branchcode   => $branchcode,
305
                branchcode   => $branchcode,
306
            }
306
        }
307
        }
307
    )->store();
308
    );
308
309
309
    my $sth = $dbh->prepare(
310
    my $accountline1 = $builder->build(
310
        q{
311
        {
311
INSERT INTO accountlines (
312
            source => 'Accountline',
312
    borrowernumber ,
313
            value  => {
313
    accountno ,
314
                borrowernumber    => $borrower->{borrowernumber},
314
    itemnumber ,
315
                amountoutstanding => '1.00',
315
    date ,
316
            }
316
    amount ,
317
        }
317
    description ,
318
    );
318
    dispute ,
319
319
    accounttype ,
320
    my $accountline2 = $builder->build(
320
    amountoutstanding ,
321
        {
321
    lastincrement ,
322
            source => 'Accountline',
322
    timestamp ,
323
            value  => {
323
    notify_id ,
324
                borrowernumber    => $borrower->{borrowernumber},
324
    notify_level ,
325
                amountoutstanding => '2.00',
325
    note ,
326
            }
326
    manager_id
327
        }
327
    )
328
VALUES 
329
    ( ?,  '32766', NULL ,  '2013-07-31',  '1.000000', NULL , NULL , NULL ,  '1.000000', NULL ,  '2013-07-31 10:21:01',  '0',  '0', NULL , NULL),
330
    ( ?,  '32767', NULL ,  '2013-07-31',  '2.000000', NULL , NULL , NULL ,  '2.000000', NULL ,  '2013-07-31 10:21:01',  '0',  '0', NULL , NULL)
331
}
332
    );
328
    );
333
    $sth->execute( $borrower->borrowernumber, $borrower->borrowernumber );
334
329
335
    ok( GetTotalFines( $borrower->borrowernumber ) == 3, "GetTotalFines functions correctly" );
330
    is( GetTotalFines( $borrower->{borrowernumber} ), '3.000000', "GetTotalFines functions correctly" );
336
};
331
};
337
332
338
$dbh->rollback;
333
$dbh->rollback;
339
- 

Return to bug 7560