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

(-)a/t/db_dependent/Koha/Cash/Register.t (-7 / +7 lines)
Lines 1377-1392 subtest 'add_cashup' => sub { Link Here
1377
1377
1378
    # Test 3: Invalid amount parameter
1378
    # Test 3: Invalid amount parameter
1379
    subtest 'invalid_amount' => sub {
1379
    subtest 'invalid_amount' => sub {
1380
        plan tests => 4;
1380
        plan tests => 6;
1381
1381
1382
        my $register3 = $builder->build_object( { class => 'Koha::Cash::Registers' } );
1382
        my $register3 = $builder->build_object( { class => 'Koha::Cash::Registers' } );
1383
1383
1384
        # Zero amount
1384
        # Zero amount is now valid (for non-cash transaction scenarios)
1385
        throws_ok {
1385
        my $zero_cashup;
1386
            $register3->add_cashup( { manager_id => $manager->id, amount => '0.00' } );
1386
        lives_ok {
1387
            $zero_cashup = $register3->add_cashup( { manager_id => $manager->id, amount => '0.00' } );
1387
        }
1388
        }
1388
        'Koha::Exceptions::Account::AmountNotPositive',
1389
        'Zero amount is accepted for non-cash transaction scenarios';
1389
            'Zero amount throws AmountNotPositive exception';
1390
        is( $zero_cashup->amount + 0, 0, 'Zero amount stored correctly' );
1390
1391
1391
        # Negative amount is now valid (for float deficits)
1392
        # Negative amount is now valid (for float deficits)
1392
        my $negative_cashup;
1393
        my $negative_cashup;
1393
- 

Return to bug 40445