|
Lines 46-52
can_ok( 'C4::Accounts',
Link Here
|
| 46 |
getrefunds |
46 |
getrefunds |
| 47 |
ReversePayment |
47 |
ReversePayment |
| 48 |
recordpayment_selectaccts |
48 |
recordpayment_selectaccts |
| 49 |
makepartialpayment |
|
|
| 50 |
WriteOffFee |
49 |
WriteOffFee |
| 51 |
purge_zero_balance_fees ) |
50 |
purge_zero_balance_fees ) |
| 52 |
); |
51 |
); |
|
Lines 357-363
subtest "makepayment() tests" => sub {
Link Here
|
| 357 |
} |
356 |
} |
| 358 |
}; |
357 |
}; |
| 359 |
|
358 |
|
| 360 |
subtest "makepartialpayment() tests" => sub { |
359 |
subtest "Even more Koha::Account::pay tests" => sub { |
| 361 |
|
360 |
|
| 362 |
plan tests => 6; |
361 |
plan tests => 6; |
| 363 |
|
362 |
|
|
Lines 385-397
subtest "makepartialpayment() tests" => sub {
Link Here
|
| 385 |
|
384 |
|
| 386 |
is( $rs->count(), 1, 'Accountline created' ); |
385 |
is( $rs->count(), 1, 'Accountline created' ); |
| 387 |
|
386 |
|
|
|
387 |
my $account = Koha::Account->new( { patron_id => $borrowernumber } ); |
| 388 |
my $line = Koha::Account::Lines->find( $accountline->{ accountlines_id } ); |
| 388 |
# make the full payment |
389 |
# make the full payment |
| 389 |
makepartialpayment( |
390 |
$account->pay({ lines => [$line], amount => $partialamount, library_id => $branch, note => 'A payment note' }); |
| 390 |
$accountline->{ accountlines_id }, $borrowernumber, |
|
|
| 391 |
$accountline->{ accountno }, $partialamount, |
| 392 |
$borrowernumber, $branch, 'A payment note' ); |
| 393 |
|
| 394 |
# TODO: someone should write actual tests for makepartialpayment() |
| 395 |
|
391 |
|
| 396 |
my $stat = $schema->resultset('Statistic')->search({ |
392 |
my $stat = $schema->resultset('Statistic')->search({ |
| 397 |
branch => $branch, |
393 |
branch => $branch, |
| 398 |
- |
|
|