Lines 269-275
subtest 'reconcile_balance' => sub {
Link Here
|
269 |
$schema->storage->txn_rollback; |
269 |
$schema->storage->txn_rollback; |
270 |
}; |
270 |
}; |
271 |
|
271 |
|
272 |
subtest 'same debit than credit' => sub { |
272 |
subtest 'same debit as credit' => sub { |
273 |
|
273 |
|
274 |
plan tests => 6; |
274 |
plan tests => 6; |
275 |
|
275 |
|
Lines 309-315
subtest 'reconcile_balance' => sub {
Link Here
|
309 |
|
309 |
|
310 |
subtest 'more debit than credit' => sub { |
310 |
subtest 'more debit than credit' => sub { |
311 |
|
311 |
|
312 |
plan tests => 6; |
312 |
plan tests => 7; |
313 |
|
313 |
|
314 |
$schema->storage->txn_begin; |
314 |
$schema->storage->txn_begin; |
315 |
|
315 |
|
Lines 327-333
subtest 'reconcile_balance' => sub {
Link Here
|
327 |
Koha::Account::Line->new({ borrowernumber => $patron->id, amount => 2, amountoutstanding => 2 })->store; |
327 |
Koha::Account::Line->new({ borrowernumber => $patron->id, amount => 2, amountoutstanding => 2 })->store; |
328 |
Koha::Account::Line->new({ borrowernumber => $patron->id, amount => 3, amountoutstanding => 3 })->store; |
328 |
Koha::Account::Line->new({ borrowernumber => $patron->id, amount => 3, amountoutstanding => 3 })->store; |
329 |
Koha::Account::Line->new({ borrowernumber => $patron->id, amount => 4, amountoutstanding => 4 })->store; |
329 |
Koha::Account::Line->new({ borrowernumber => $patron->id, amount => 4, amountoutstanding => 4 })->store; |
330 |
Koha::Account::Line->new({ borrowernumber => $patron->id, amount => 5, amountoutstanding => 5 })->store; |
330 |
my $line5 = Koha::Account::Line->new({ borrowernumber => $patron->id, amount => 5, amountoutstanding => 5 })->store; |
331 |
|
331 |
|
332 |
# Paid Off |
332 |
# Paid Off |
333 |
Koha::Account::Line->new({ borrowernumber => $patron->id, amount => 1, amountoutstanding => 0 })->store; |
333 |
Koha::Account::Line->new({ borrowernumber => $patron->id, amount => 1, amountoutstanding => 0 })->store; |
Lines 343-348
subtest 'reconcile_balance' => sub {
Link Here
|
343 |
is( $account->outstanding_debits->total_outstanding, 5, 'Outstanding debits sum 5' ); |
343 |
is( $account->outstanding_debits->total_outstanding, 5, 'Outstanding debits sum 5' ); |
344 |
is( $account->outstanding_credits->total_outstanding, 0, 'Outstanding credits sum 0' ); |
344 |
is( $account->outstanding_credits->total_outstanding, 0, 'Outstanding credits sum 0' ); |
345 |
|
345 |
|
|
|
346 |
is( $line5->get_from_storage->amountoutstanding, '5.000000', 'First In First Out method of payment selection used'); |
347 |
|
346 |
$schema->storage->txn_rollback; |
348 |
$schema->storage->txn_rollback; |
347 |
}; |
349 |
}; |
348 |
}; |
350 |
}; |
349 |
- |
|
|