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( recordpayment |
39 |
qw( recordpayment |
39 |
makepayment |
|
|
40 |
getnextacctno |
40 |
getnextacctno |
41 |
chargelostitem |
41 |
chargelostitem |
42 |
manualinvoice |
42 |
manualinvoice |
Lines 248-254
subtest "recordpayment() tests" => sub {
Link Here
|
248 |
is($note,'$200.00 payment note', '$200.00 payment note is registered'); |
248 |
is($note,'$200.00 payment note', '$200.00 payment note is registered'); |
249 |
}; |
249 |
}; |
250 |
|
250 |
|
251 |
subtest "makepayment() tests" => sub { |
251 |
subtest "More Koha::Account::pay tests" => sub { |
252 |
|
252 |
|
253 |
plan tests => 6; |
253 |
plan tests => 6; |
254 |
|
254 |
|
Lines 275-287
subtest "makepayment() tests" => sub {
Link Here
|
275 |
|
275 |
|
276 |
is( $rs->count(), 1, 'Accountline created' ); |
276 |
is( $rs->count(), 1, 'Accountline created' ); |
277 |
|
277 |
|
|
|
278 |
my $account = Koha::Account->new( { patron_id => $borrowernumber } ); |
279 |
my $line = Koha::Account::Lines->find( $accountline->{ accountlines_id } ); |
278 |
# make the full payment |
280 |
# make the full payment |
279 |
makepayment( |
281 |
$account->pay({ lines => [$line], amount => $amount, library_id => $branch, note => 'A payment note' }); |
280 |
$accountline->{ accountlines_id }, $borrowernumber, |
|
|
281 |
$accountline->{ accountno }, $amount, |
282 |
$borrowernumber, $branch, 'A payment note' ); |
283 |
|
284 |
# TODO: someone should write actual tests for makepayment() |
285 |
|
282 |
|
286 |
my $stat = $schema->resultset('Statistic')->search({ |
283 |
my $stat = $schema->resultset('Statistic')->search({ |
287 |
branch => $branch, |
284 |
branch => $branch, |
288 |
- |
|
|