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 256-262
subtest "Koha::Account::pay tests" => sub {
Link Here
|
256 |
is($note,'$200.00 payment note', '$200.00 payment note is registered'); |
256 |
is($note,'$200.00 payment note', '$200.00 payment note is registered'); |
257 |
}; |
257 |
}; |
258 |
|
258 |
|
259 |
subtest "makepayment() tests" => sub { |
259 |
subtest "More Koha::Account::pay tests" => sub { |
260 |
|
260 |
|
261 |
plan tests => 6; |
261 |
plan tests => 6; |
262 |
|
262 |
|
Lines 283-295
subtest "makepayment() tests" => sub {
Link Here
|
283 |
|
283 |
|
284 |
is( $rs->count(), 1, 'Accountline created' ); |
284 |
is( $rs->count(), 1, 'Accountline created' ); |
285 |
|
285 |
|
|
|
286 |
my $account = Koha::Account->new( { patron_id => $borrowernumber } ); |
287 |
my $line = Koha::Account::Lines->find( $accountline->{ accountlines_id } ); |
286 |
# make the full payment |
288 |
# make the full payment |
287 |
makepayment( |
289 |
$account->pay({ lines => [$line], amount => $amount, library_id => $branch, note => 'A payment note' }); |
288 |
$accountline->{ accountlines_id }, $borrowernumber, |
|
|
289 |
$accountline->{ accountno }, $amount, |
290 |
$borrowernumber, $branch, 'A payment note' ); |
291 |
|
292 |
# TODO: someone should write actual tests for makepayment() |
293 |
|
290 |
|
294 |
my $stat = $schema->resultset('Statistic')->search({ |
291 |
my $stat = $schema->resultset('Statistic')->search({ |
295 |
branch => $branch, |
292 |
branch => $branch, |
296 |
- |
|
|