View | Details | Raw Unified | Return to bug 40445
Collapse All | Expand All

(-)a/Koha/Cash/Register.pm (+2 lines)
Lines 453-458 sub add_cashup { Link Here
453
                            credit_type_code => 'CASHUP_SURPLUS',
453
                            credit_type_code => 'CASHUP_SURPLUS',
454
                            manager_id       => $manager_id,
454
                            manager_id       => $manager_id,
455
                            interface        => 'intranet',
455
                            interface        => 'intranet',
456
                            branchcode       => $self->branch,
456
                            register_id      => $self->id,
457
                            register_id      => $self->id,
457
                            note             => $reconciliation_note
458
                            note             => $reconciliation_note
458
                        }
459
                        }
Lines 477-482 sub add_cashup { Link Here
477
                            debit_type_code => 'CASHUP_DEFICIT',
478
                            debit_type_code => 'CASHUP_DEFICIT',
478
                            manager_id      => $manager_id,
479
                            manager_id      => $manager_id,
479
                            interface       => 'intranet',
480
                            interface       => 'intranet',
481
                            branchcode      => $self->branch,
480
                            register_id     => $self->id,
482
                            register_id     => $self->id,
481
                            note            => $reconciliation_note
483
                            note            => $reconciliation_note
482
                        }
484
                        }
(-)a/t/db_dependent/Koha/Cash/Register.t (-4 / +5 lines)
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
- 

Return to bug 40445