|
Lines 174-179
subtest 'cashup' => sub {
Link Here
|
| 174 |
|
174 |
|
| 175 |
$schema->storage->txn_begin; |
175 |
$schema->storage->txn_begin; |
| 176 |
|
176 |
|
|
|
177 |
# Ensure reconciliation notes are not required for these tests |
| 178 |
t::lib::Mocks::mock_preference( 'CashupReconciliationNoteRequired', 0 ); |
| 179 |
|
| 177 |
my $register = $builder->build_object( { class => 'Koha::Cash::Registers' } ); |
180 |
my $register = $builder->build_object( { class => 'Koha::Cash::Registers' } ); |
| 178 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
181 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 179 |
|
182 |
|
|
Lines 343-348
subtest 'cashup_reconciliation' => sub {
Link Here
|
| 343 |
|
346 |
|
| 344 |
$schema->storage->txn_begin; |
347 |
$schema->storage->txn_begin; |
| 345 |
|
348 |
|
|
|
349 |
# Ensure reconciliation notes are not required for these tests |
| 350 |
t::lib::Mocks::mock_preference( 'CashupReconciliationNoteRequired', 0 ); |
| 351 |
|
| 346 |
my $register = $builder->build_object( { class => 'Koha::Cash::Registers' } ); |
352 |
my $register = $builder->build_object( { class => 'Koha::Cash::Registers' } ); |
| 347 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
353 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 348 |
|
354 |
|
|
Lines 417-423
subtest 'cashup_reconciliation' => sub {
Link Here
|
| 417 |
}; |
423 |
}; |
| 418 |
|
424 |
|
| 419 |
subtest 'surplus_cashup' => sub { |
425 |
subtest 'surplus_cashup' => sub { |
| 420 |
plan tests => 8; |
426 |
plan tests => 9; |
| 421 |
|
427 |
|
| 422 |
$schema->storage->txn_begin; |
428 |
$schema->storage->txn_begin; |
| 423 |
|
429 |
|
|
Lines 466-472
subtest 'cashup_reconciliation' => sub {
Link Here
|
| 466 |
sprintf( '%.0f', $surplus_line->amount ), sprintf( '%.0f', -$surplus ), |
472 |
sprintf( '%.0f', $surplus_line->amount ), sprintf( '%.0f', -$surplus ), |
| 467 |
'Surplus amount is correct (negative for credit)' |
473 |
'Surplus amount is correct (negative for credit)' |
| 468 |
); |
474 |
); |
| 469 |
is( $surplus_line->branchcode, $register2->branch, 'Surplus branchcode matches register branch' ); |
475 |
is( $surplus_line->branchcode, $register2->branch, 'Surplus branchcode matches register branch' ); |
|
|
476 |
is( $surplus_line->payment_type, 'CASH', 'Surplus payment_type is set to CASH' ); |
| 470 |
|
477 |
|
| 471 |
# Note should be undef for surplus without user note |
478 |
# Note should be undef for surplus without user note |
| 472 |
is( $surplus_line->note, undef, 'No note for surplus without user reconciliation note' ); |
479 |
is( $surplus_line->note, undef, 'No note for surplus without user reconciliation note' ); |
|
Lines 515-521
subtest 'cashup_reconciliation' => sub {
Link Here
|
| 515 |
}; |
522 |
}; |
| 516 |
|
523 |
|
| 517 |
subtest 'deficit_cashup' => sub { |
524 |
subtest 'deficit_cashup' => sub { |
| 518 |
plan tests => 8; |
525 |
plan tests => 9; |
| 519 |
|
526 |
|
| 520 |
$schema->storage->txn_begin; |
527 |
$schema->storage->txn_begin; |
| 521 |
|
528 |
|
|
Lines 564-570
subtest 'cashup_reconciliation' => sub {
Link Here
|
| 564 |
sprintf( '%.0f', $deficit_line->amount ), sprintf( '%.0f', $deficit ), |
571 |
sprintf( '%.0f', $deficit_line->amount ), sprintf( '%.0f', $deficit ), |
| 565 |
'Deficit amount is correct (positive for debit)' |
572 |
'Deficit amount is correct (positive for debit)' |
| 566 |
); |
573 |
); |
| 567 |
is( $deficit_line->branchcode, $register3->branch, 'Deficit branchcode matches register branch' ); |
574 |
is( $deficit_line->branchcode, $register3->branch, 'Deficit branchcode matches register branch' ); |
|
|
575 |
is( $deficit_line->payment_type, 'CASH', 'Deficit payment_type is set to CASH' ); |
| 568 |
|
576 |
|
| 569 |
# Note should be undef for deficit without user note |
577 |
# Note should be undef for deficit without user note |
| 570 |
is( $deficit_line->note, undef, 'No note for deficit without user reconciliation note' ); |
578 |
is( $deficit_line->note, undef, 'No note for deficit without user reconciliation note' ); |
| 571 |
- |
|
|