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

(-)a/t/db_dependent/Accounts.t (-1 / +1 lines)
Lines 374-380 subtest "Koha::Account::pay writeoff tests" => sub { Link Here
374
374
375
    my $writeoff = Koha::Account::Lines->find( $id );
375
    my $writeoff = Koha::Account::Lines->find( $id );
376
376
377
    is( $writeoff->accounttype, 'W', 'Type is correct for writeoff' );
377
    is( $writeoff->credit_type_code, 'W', 'Type is correct for writeoff' );
378
    is( $writeoff->description, 'Writeoff', 'Description is correct' );
378
    is( $writeoff->description, 'Writeoff', 'Description is correct' );
379
    is( $writeoff->amount, '-42.000000', 'Amount is correct' );
379
    is( $writeoff->amount, '-42.000000', 'Amount is correct' );
380
};
380
};
(-)a/t/db_dependent/Circulation.t (-3 / +3 lines)
Lines 2219-2225 subtest '_FixAccountForLostAndReturned' => sub { Link Here
2219
        my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item->itemnumber, $patron->id );
2219
        my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item->itemnumber, $patron->id );
2220
        my $credit_return = Koha::Account::Lines->find($credit_return_id);
2220
        my $credit_return = Koha::Account::Lines->find($credit_return_id);
2221
2221
2222
        is( $credit_return->accounttype, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' );
2222
        is( $credit_return->credit_type_code, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' );
2223
        is( $credit_return->amount + 0,
2223
        is( $credit_return->amount + 0,
2224
            -99.00, 'The account line of type LOST_RETURN has an amount of -99' );
2224
            -99.00, 'The account line of type LOST_RETURN has an amount of -99' );
2225
        is( $credit_return->amountoutstanding + 0,
2225
        is( $credit_return->amountoutstanding + 0,
Lines 2277-2283 subtest '_FixAccountForLostAndReturned' => sub { Link Here
2277
        my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item->itemnumber, $patron->id );
2277
        my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item->itemnumber, $patron->id );
2278
        my $credit_return = Koha::Account::Lines->find($credit_return_id);
2278
        my $credit_return = Koha::Account::Lines->find($credit_return_id);
2279
2279
2280
        is( $credit_return->accounttype, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' );
2280
        is( $credit_return->credit_type_code, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' );
2281
        is( $credit_return->amount + 0, -99.00, 'The account line of type LOST_RETURN has an amount of -99' );
2281
        is( $credit_return->amount + 0, -99.00, 'The account line of type LOST_RETURN has an amount of -99' );
2282
        is( $credit_return->amountoutstanding + 0, 0, 'The account line of type LOST_RETURN has an amountoutstanding of 0' );
2282
        is( $credit_return->amountoutstanding + 0, 0, 'The account line of type LOST_RETURN has an amountoutstanding of 0' );
2283
2283
Lines 2371-2377 subtest '_FixAccountForLostAndReturned' => sub { Link Here
2371
            'LOST', 'Lost fee now still has account type of LOST' );
2371
            'LOST', 'Lost fee now still has account type of LOST' );
2372
        is( $lost_fee_line->status, 'RETURNED', "Lost fee now has account status of RETURNED");
2372
        is( $lost_fee_line->status, 'RETURNED', "Lost fee now has account status of RETURNED");
2373
2373
2374
        is( $credit_return->accounttype, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' );
2374
        is( $credit_return->credit_type_code, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' );
2375
        is( $credit_return->amount + 0,
2375
        is( $credit_return->amount + 0,
2376
            ($payment_amount + $outstanding ) * -1,
2376
            ($payment_amount + $outstanding ) * -1,
2377
            'The account line of type LOST_RETURN has an amount equal to the payment + outstanding'
2377
            'The account line of type LOST_RETURN has an amount equal to the payment + outstanding'
(-)a/t/db_dependent/ILSDI_Services.t (-1 / +1 lines)
Lines 200-206 subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes Link Here
200
            source => 'Accountline',
200
            source => 'Accountline',
201
            value  => {
201
            value  => {
202
                borrowernumber    => $brwr->{borrowernumber},
202
                borrowernumber    => $brwr->{borrowernumber},
203
                accounttype       => 'xxx',
203
                credit_type_code  => 'Pay',
204
                amountoutstanding => 10
204
                amountoutstanding => 10
205
            }
205
            }
206
        }
206
        }
(-)a/t/db_dependent/Koha/Account.t (-2 / +2 lines)
Lines 201-207 subtest 'add_credit() tests' => sub { Link Here
201
    is( $account->balance, -25, 'Patron has a balance of -25' );
201
    is( $account->balance, -25, 'Patron has a balance of -25' );
202
    is( $schema->resultset('ActionLog')->count(), $action_logs + 0, 'No log was added' );
202
    is( $schema->resultset('ActionLog')->count(), $action_logs + 0, 'No log was added' );
203
    is( $schema->resultset('Statistic')->count(), $statistics + 1, 'Action added to statistics' );
203
    is( $schema->resultset('Statistic')->count(), $statistics + 1, 'Action added to statistics' );
204
    is( $line_1->accounttype, $Koha::Account::account_type_credit->{'payment'}, 'Account type is correctly set' );
204
    is( $line_1->credit_type_code, $Koha::Account::account_type_credit->{'payment'}, 'Account type is correctly set' );
205
205
206
    # Enable logs
206
    # Enable logs
207
    t::lib::Mocks::mock_preference( 'FinesLog', 1 );
207
    t::lib::Mocks::mock_preference( 'FinesLog', 1 );
Lines 219-225 subtest 'add_credit() tests' => sub { Link Here
219
    is( $account->balance, -62, 'Patron has a balance of -25' );
219
    is( $account->balance, -62, 'Patron has a balance of -25' );
220
    is( $schema->resultset('ActionLog')->count(), $action_logs + 1, 'Log was added' );
220
    is( $schema->resultset('ActionLog')->count(), $action_logs + 1, 'Log was added' );
221
    is( $schema->resultset('Statistic')->count(), $statistics + 2, 'Action added to statistics' );
221
    is( $schema->resultset('Statistic')->count(), $statistics + 2, 'Action added to statistics' );
222
    is( $line_2->accounttype, $Koha::Account::account_type_credit->{'payment'}, 'Account type is correctly set' );
222
    is( $line_2->credit_type_code, $Koha::Account::account_type_credit->{'payment'}, 'Account type is correctly set' );
223
223
224
    # offsets have the credit_id set to accountlines_id, and debit_id is undef
224
    # offsets have the credit_id set to accountlines_id, and debit_id is undef
225
    my $offset_1 = Koha::Account::Offsets->search({ credit_id => $line_1->id })->next;
225
    my $offset_1 = Koha::Account::Offsets->search({ credit_id => $line_1->id })->next;
(-)a/t/db_dependent/Koha/Account/Lines.t (-2 / +1 lines)
Lines 571-577 subtest "void() tests" => sub { Link Here
571
    $line1->_result->discard_changes();
571
    $line1->_result->discard_changes();
572
    $line2->_result->discard_changes();
572
    $line2->_result->discard_changes();
573
573
574
    is( $account_payment->accounttype, 'Pay', 'Voided payment accounttype is still Pay' );
574
    is( $account_payment->credit_type_code, 'Pay', 'Voided payment credit_type_code is still Pay' );
575
    is( $account_payment->status, 'VOID', 'Voided payment status is VOID' );
575
    is( $account_payment->status, 'VOID', 'Voided payment status is VOID' );
576
    is( $account_payment->amount+0, 0, 'Voided payment amount is 0' );
576
    is( $account_payment->amount+0, 0, 'Voided payment amount is 0' );
577
    is( $account_payment->amountoutstanding+0, 0, 'Voided payment amount outstanding is 0' );
577
    is( $account_payment->amountoutstanding+0, 0, 'Voided payment amount outstanding is 0' );
578
- 

Return to bug 23805