Lines 24-29
use Test::Warn;
Link Here
|
24 |
|
24 |
|
25 |
use t::lib::TestBuilder; |
25 |
use t::lib::TestBuilder; |
26 |
|
26 |
|
|
|
27 |
use Koha::Account; |
27 |
use Koha::Account::Lines; |
28 |
use Koha::Account::Lines; |
28 |
use Koha::Account::Line; |
29 |
use Koha::Account::Line; |
29 |
|
30 |
|
Lines 36-42
BEGIN {
Link Here
|
36 |
|
37 |
|
37 |
can_ok( 'C4::Accounts', |
38 |
can_ok( 'C4::Accounts', |
38 |
qw( |
39 |
qw( |
39 |
makepayment |
|
|
40 |
getnextacctno |
40 |
getnextacctno |
41 |
chargelostitem |
41 |
chargelostitem |
42 |
manualinvoice |
42 |
manualinvoice |
Lines 305-311
subtest "Koha::Account::pay particular line tests" => sub {
Link Here
|
305 |
is( $line4->amountoutstanding, "4.000000", "Line 4 was not paid" ); |
305 |
is( $line4->amountoutstanding, "4.000000", "Line 4 was not paid" ); |
306 |
}; |
306 |
}; |
307 |
|
307 |
|
308 |
subtest "makepayment() tests" => sub { |
308 |
subtest "More Koha::Account::pay tests" => sub { |
309 |
|
309 |
|
310 |
plan tests => 6; |
310 |
plan tests => 6; |
311 |
|
311 |
|
Lines 332-344
subtest "makepayment() tests" => sub {
Link Here
|
332 |
|
332 |
|
333 |
is( $rs->count(), 1, 'Accountline created' ); |
333 |
is( $rs->count(), 1, 'Accountline created' ); |
334 |
|
334 |
|
|
|
335 |
my $account = Koha::Account->new( { patron_id => $borrowernumber } ); |
336 |
my $line = Koha::Account::Lines->find( $accountline->{ accountlines_id } ); |
335 |
# make the full payment |
337 |
# make the full payment |
336 |
makepayment( |
338 |
$account->pay({ lines => [$line], amount => $amount, library_id => $branch, note => 'A payment note' }); |
337 |
$accountline->{ accountlines_id }, $borrowernumber, |
|
|
338 |
$accountline->{ accountno }, $amount, |
339 |
$borrowernumber, $branch, 'A payment note' ); |
340 |
|
341 |
# TODO: someone should write actual tests for makepayment() |
342 |
|
339 |
|
343 |
my $stat = $schema->resultset('Statistic')->search({ |
340 |
my $stat = $schema->resultset('Statistic')->search({ |
344 |
branch => $branch, |
341 |
branch => $branch, |
345 |
- |
|
|