|
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 303-309
subtest "Koha::Account::pay particular line tests" => sub {
Link Here
|
| 303 |
is( $line4->amountoutstanding, "4.000000", "Line 4 was not paid" ); |
303 |
is( $line4->amountoutstanding, "4.000000", "Line 4 was not paid" ); |
| 304 |
}; |
304 |
}; |
| 305 |
|
305 |
|
| 306 |
subtest "makepayment() tests" => sub { |
306 |
subtest "More Koha::Account::pay tests" => sub { |
| 307 |
|
307 |
|
| 308 |
plan tests => 6; |
308 |
plan tests => 6; |
| 309 |
|
309 |
|
|
Lines 330-342
subtest "makepayment() tests" => sub {
Link Here
|
| 330 |
|
330 |
|
| 331 |
is( $rs->count(), 1, 'Accountline created' ); |
331 |
is( $rs->count(), 1, 'Accountline created' ); |
| 332 |
|
332 |
|
|
|
333 |
my $account = Koha::Account->new( { patron_id => $borrowernumber } ); |
| 334 |
my $line = Koha::Account::Lines->find( $accountline->{ accountlines_id } ); |
| 333 |
# make the full payment |
335 |
# make the full payment |
| 334 |
makepayment( |
336 |
$account->pay({ lines => [$line], amount => $amount, library_id => $branch, note => 'A payment note' }); |
| 335 |
$accountline->{ accountlines_id }, $borrowernumber, |
|
|
| 336 |
$accountline->{ accountno }, $amount, |
| 337 |
$borrowernumber, $branch, 'A payment note' ); |
| 338 |
|
| 339 |
# TODO: someone should write actual tests for makepayment() |
| 340 |
|
337 |
|
| 341 |
my $stat = $schema->resultset('Statistic')->search({ |
338 |
my $stat = $schema->resultset('Statistic')->search({ |
| 342 |
branch => $branch, |
339 |
branch => $branch, |
| 343 |
- |
|
|