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