|
Lines 417-423
subtest 'cashup_reconciliation' => sub {
Link Here
|
| 417 |
}; |
417 |
}; |
| 418 |
|
418 |
|
| 419 |
subtest 'surplus_cashup' => sub { |
419 |
subtest 'surplus_cashup' => sub { |
| 420 |
plan tests => 7; |
420 |
plan tests => 8; |
| 421 |
|
421 |
|
| 422 |
$schema->storage->txn_begin; |
422 |
$schema->storage->txn_begin; |
| 423 |
|
423 |
|
|
Lines 466-471
subtest 'cashup_reconciliation' => sub {
Link Here
|
| 466 |
sprintf( '%.0f', $surplus_line->amount ), sprintf( '%.0f', -$surplus ), |
466 |
sprintf( '%.0f', $surplus_line->amount ), sprintf( '%.0f', -$surplus ), |
| 467 |
'Surplus amount is correct (negative for credit)' |
467 |
'Surplus amount is correct (negative for credit)' |
| 468 |
); |
468 |
); |
|
|
469 |
is( $surplus_line->branchcode, $register2->branch, 'Surplus branchcode matches register branch' ); |
| 469 |
|
470 |
|
| 470 |
# Note should be undef for surplus without user note |
471 |
# Note should be undef for surplus without user note |
| 471 |
is( $surplus_line->note, undef, 'No note for surplus without user reconciliation note' ); |
472 |
is( $surplus_line->note, undef, 'No note for surplus without user reconciliation note' ); |
|
Lines 514-520
subtest 'cashup_reconciliation' => sub {
Link Here
|
| 514 |
}; |
515 |
}; |
| 515 |
|
516 |
|
| 516 |
subtest 'deficit_cashup' => sub { |
517 |
subtest 'deficit_cashup' => sub { |
| 517 |
plan tests => 7; |
518 |
plan tests => 8; |
| 518 |
|
519 |
|
| 519 |
$schema->storage->txn_begin; |
520 |
$schema->storage->txn_begin; |
| 520 |
|
521 |
|
|
Lines 563-568
subtest 'cashup_reconciliation' => sub {
Link Here
|
| 563 |
sprintf( '%.0f', $deficit_line->amount ), sprintf( '%.0f', $deficit ), |
564 |
sprintf( '%.0f', $deficit_line->amount ), sprintf( '%.0f', $deficit ), |
| 564 |
'Deficit amount is correct (positive for debit)' |
565 |
'Deficit amount is correct (positive for debit)' |
| 565 |
); |
566 |
); |
|
|
567 |
is( $deficit_line->branchcode, $register3->branch, 'Deficit branchcode matches register branch' ); |
| 566 |
|
568 |
|
| 567 |
# Note should be undef for deficit without user note |
569 |
# Note should be undef for deficit without user note |
| 568 |
is( $deficit_line->note, undef, 'No note for deficit without user reconciliation note' ); |
570 |
is( $deficit_line->note, undef, 'No note for deficit without user reconciliation note' ); |
|
Lines 894-900
subtest 'two_phase_cashup_workflow' => sub {
Link Here
|
| 894 |
|
896 |
|
| 895 |
# Test 9: outstanding_accountlines now includes new transaction |
897 |
# Test 9: outstanding_accountlines now includes new transaction |
| 896 |
$outstanding = $register->outstanding_accountlines; |
898 |
$outstanding = $register->outstanding_accountlines; |
| 897 |
is( $outstanding->count, 1, 'outstanding_accountlines includes transaction after completion' ); |
899 |
is( $outstanding->count, 1, 'outstanding_accountlines includes transaction after completion' ); |
| 898 |
is( $outstanding->total, -8.00, 'outstanding_accountlines total is correct after completion' ); |
900 |
is( $outstanding->total, -8.00, 'outstanding_accountlines total is correct after completion' ); |
| 899 |
|
901 |
|
| 900 |
$schema->storage->txn_rollback; |
902 |
$schema->storage->txn_rollback; |
| 901 |
- |
|
|