Lines 226-232
subtest 'lines() tests' => sub {
Link Here
|
226 |
$schema->storage->txn_rollback; |
226 |
$schema->storage->txn_rollback; |
227 |
}; |
227 |
}; |
228 |
|
228 |
|
229 |
subtest 'normalize_balance' => sub { |
229 |
subtest 'reconcile_balance' => sub { |
230 |
|
230 |
|
231 |
plan tests => 3; |
231 |
plan tests => 3; |
232 |
|
232 |
|
Lines 260-266
subtest 'normalize_balance' => sub {
Link Here
|
260 |
is( $account->outstanding_debits->total_outstanding, 10, 'Outstanding debits sum 10' ); |
260 |
is( $account->outstanding_debits->total_outstanding, 10, 'Outstanding debits sum 10' ); |
261 |
is( $account->outstanding_credits->total_outstanding, -15, 'Outstanding credits sum -15' ); |
261 |
is( $account->outstanding_credits->total_outstanding, -15, 'Outstanding credits sum -15' ); |
262 |
|
262 |
|
263 |
$account->normalize_balance(); |
263 |
$account->reconcile_balance(); |
264 |
|
264 |
|
265 |
is( $account->balance(), -5, "Account balance is -5" ); |
265 |
is( $account->balance(), -5, "Account balance is -5" ); |
266 |
is( $account->outstanding_debits->total_outstanding, 0, 'No outstanding debits' ); |
266 |
is( $account->outstanding_debits->total_outstanding, 0, 'No outstanding debits' ); |
Lines 298-304
subtest 'normalize_balance' => sub {
Link Here
|
298 |
is( $account->outstanding_debits->total_outstanding, 10, 'Outstanding debits sum 10' ); |
298 |
is( $account->outstanding_debits->total_outstanding, 10, 'Outstanding debits sum 10' ); |
299 |
is( $account->outstanding_credits->total_outstanding, -10, 'Outstanding credits sum -10' ); |
299 |
is( $account->outstanding_credits->total_outstanding, -10, 'Outstanding credits sum -10' ); |
300 |
|
300 |
|
301 |
$account->normalize_balance(); |
301 |
$account->reconcile_balance(); |
302 |
|
302 |
|
303 |
is( $account->balance(), 0, "Account balance is 0" ); |
303 |
is( $account->balance(), 0, "Account balance is 0" ); |
304 |
is( $account->outstanding_debits->total_outstanding, 0, 'No outstanding debits' ); |
304 |
is( $account->outstanding_debits->total_outstanding, 0, 'No outstanding debits' ); |
Lines 337-343
subtest 'normalize_balance' => sub {
Link Here
|
337 |
is( $account->outstanding_debits->total_outstanding, 15, 'Outstanding debits sum 15' ); |
337 |
is( $account->outstanding_debits->total_outstanding, 15, 'Outstanding debits sum 15' ); |
338 |
is( $account->outstanding_credits->total_outstanding, -10, 'Outstanding credits sum -10' ); |
338 |
is( $account->outstanding_credits->total_outstanding, -10, 'Outstanding credits sum -10' ); |
339 |
|
339 |
|
340 |
$account->normalize_balance(); |
340 |
$account->reconcile_balance(); |
341 |
|
341 |
|
342 |
is( $account->balance(), 5, "Account balance is 5" ); |
342 |
is( $account->balance(), 5, "Account balance is 5" ); |
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 |
- |
|
|