@@ -, +, @@ --- t/db_dependent/Accounts.t | 47 ++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 46 insertions(+), 1 deletions(-) --- a/t/db_dependent/Accounts.t +++ a/t/db_dependent/Accounts.t @@ -18,7 +18,7 @@ use Modern::Perl; -use Test::More tests => 8; +use Test::More tests => 9; use Test::MockModule; use Test::Warn; @@ -291,6 +291,51 @@ subtest "makepartialpayment() tests" => sub { } }; +subtest "makepartialpayment() tests" => sub { + + plan tests => 1; + + my $categorycode = $builder->build( { source => 'Category' } )->{categorycode}; + + my $borrower = Koha::Borrower->new( + { + surname => 'Hall', + firstname => 'Kyle', + categorycode => $categorycode, + branchcode => $branchcode, + } + )->store(); + + my $sth = $dbh->prepare( + q{ +INSERT INTO accountlines ( + borrowernumber , + accountno , + itemnumber , + date , + amount , + description , + dispute , + accounttype , + amountoutstanding , + lastincrement , + timestamp , + notify_id , + notify_level , + note , + manager_id + ) +VALUES + ( ?, '32766', NULL , '2013-07-31', '1.000000', NULL , NULL , NULL , '1.000000', NULL , '2013-07-31 10:21:01', '0', '0', NULL , NULL), + ( ?, '32767', NULL , '2013-07-31', '2.000000', NULL , NULL , NULL , '2.000000', NULL , '2013-07-31 10:21:01', '0', '0', NULL , NULL) +} + ); + $sth->execute( $borrower->borrowernumber, $borrower->borrowernumber ); + + ok( GetTotalFines( $borrower->borrowernumber ) == 3, "GetTotalFines functions correctly" ); +}; + $dbh->rollback; 1; + --