|
Lines 356-368
subtest "makepartialpayment() tests" => sub {
Link Here
|
| 356 |
} |
356 |
} |
| 357 |
}; |
357 |
}; |
| 358 |
|
358 |
|
| 359 |
subtest 'get_balance' => sub { |
359 |
subtest 'balance' => sub { |
| 360 |
plan tests => 2; |
360 |
plan tests => 2; |
| 361 |
|
361 |
|
| 362 |
my $patron = $builder->build({source => 'Borrower'}); |
362 |
my $patron = $builder->build({source => 'Borrower'}); |
| 363 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
363 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
| 364 |
my $account_lines = $patron->get_account_lines; |
364 |
my $account = $patron->account; |
| 365 |
is( $account_lines->get_balance, 0, 'get_balance should return 0 if the patron does not have fines' ); |
365 |
is( $account->balance, 0, 'balance should return 0 if the patron does not have fines' ); |
| 366 |
|
366 |
|
| 367 |
my $accountline_1 = $builder->build( |
367 |
my $accountline_1 = $builder->build( |
| 368 |
{ |
368 |
{ |
|
Lines 385-392
subtest 'get_balance' => sub {
Link Here
|
| 385 |
} |
385 |
} |
| 386 |
); |
386 |
); |
| 387 |
|
387 |
|
| 388 |
my $balance = $patron->get_account_lines->get_balance; |
388 |
my $balance = $patron->account->balance; |
| 389 |
is( int($balance), 29, 'get_balance should return the correct value'); |
389 |
is( int($balance), 29, 'balance should return the correct value'); |
| 390 |
|
390 |
|
| 391 |
$patron->delete; |
391 |
$patron->delete; |
| 392 |
}; |
392 |
}; |
| 393 |
- |
|
|