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

(-)a/t/db_dependent/Accounts.t (-2 / +29 lines)
Lines 889-895 subtest "C4::Accounts::chargelostitem tests" => sub { Link Here
889
    };
889
    };
890
890
891
    subtest "further processing fee application tests" => sub {
891
    subtest "further processing fee application tests" => sub {
892
        plan tests => 8;
892
        plan tests => 10;
893
893
894
        my $branch_1 = $builder->build_object( { class => 'Koha::Libraries' } );
894
        my $branch_1 = $builder->build_object( { class => 'Koha::Libraries' } );
895
        my $branch_2 = $builder->build_object( { class => 'Koha::Libraries' } );
895
        my $branch_2 = $builder->build_object( { class => 'Koha::Libraries' } );
Lines 999-1004 subtest "C4::Accounts::chargelostitem tests" => sub { Link Here
999
        ok( $procfee, "Processing fee created" );
999
        ok( $procfee, "Processing fee created" );
1000
        is( $procfee->amount + 0, 4, "Processing fee chosen correctly" );
1000
        is( $procfee->amount + 0, 4, "Processing fee chosen correctly" );
1001
1001
1002
        # Test missing rule defaults to 0 (no processing fee)
1003
        diag("Test missing circulation rule defaults to 0");
1004
        my $branch_no_rule = $builder->build_object( { class => 'Koha::Libraries' } );
1005
        $borrower = $builder->build_object(
1006
            { class => 'Koha::Patrons', value => { branchcode => $branch_no_rule->branchcode } } );
1007
        $item = $builder->build_sample_item( { homebranch => $branch_no_rule->branchcode } );
1008
1009
        t::lib::Mocks::mock_preference( 'LostChargesControl', 'PatronLibrary' );
1010
        C4::Accounts::chargelostitem( $borrower->borrowernumber, $item->itemnumber, '1', "No rule test" );
1011
1012
        $procfee = Koha::Account::Lines->find(
1013
            {
1014
                borrowernumber  => $borrower->borrowernumber,
1015
                itemnumber      => $item->itemnumber,
1016
                debit_type_code => 'PROCESSING'
1017
            }
1018
        );
1019
        ok( !$procfee, "No processing fee created when circulation rule is missing" );
1020
1021
        my $lostfee = Koha::Account::Lines->find(
1022
            {
1023
                borrowernumber  => $borrower->borrowernumber,
1024
                itemnumber      => $item->itemnumber,
1025
                debit_type_code => 'LOST'
1026
            }
1027
        );
1028
        ok( $lostfee, "Lost fee still created even when processing fee rule is missing" );
1029
1002
    };
1030
    };
1003
1031
1004
    subtest "basic fields tests" => sub {
1032
    subtest "basic fields tests" => sub {
1005
- 

Return to bug 36506