);
my $line = Koha::Account::Lines->search({ borrowernumber => $renewing_borrower->{borrowernumber} })->next();
- is( $line->accounttype, 'OVERDUE', 'Account line type is OVERDUE' );
+ is( $line->debit_type_code, 'OVERDUE', 'Account line type is OVERDUE' );
is( $line->status, 'UNRETURNED', 'Account line status is UNRETURNED' );
is( $line->amountoutstanding, '15.000000', 'Account line amount outstanding is 15.00' );
is( $line->amount, '15.000000', 'Account line amount is 15.00' );
LostItem( $item_1->itemnumber, 'test', 1 );
$line = Koha::Account::Lines->find($line->id);
- is( $line->accounttype, 'OVERDUE', 'Account type remains as OVERDUE' );
+ is( $line->debit_type_code, 'OVERDUE', 'Account type remains as OVERDUE' );
isnt( $line->status, 'UNRETURNED', 'Account status correctly changed from UNRETURNED to RETURNED' );
my $item = Koha::Items->find($item_1->itemnumber);
LostItem( $item->itemnumber, 1 );
my $processing_fee_lines = Koha::Account::Lines->search(
- { borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'PF' } );
+ { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'PF' } );
is( $processing_fee_lines->count, 1, 'Only one processing fee produced' );
my $processing_fee_line = $processing_fee_lines->next;
is( $processing_fee_line->amount + 0,
$processfee_amount, 'The right PF amountoutstanding is generated' );
my $lost_fee_lines = Koha::Account::Lines->search(
- { borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'LOST' } );
+ { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'LOST' } );
is( $lost_fee_lines->count, 1, 'Only one lost item fee produced' );
my $lost_fee_line = $lost_fee_lines->next;
is( $lost_fee_line->amount + 0, $replacement_amount, 'The right LOST amount is generated' );
$lost_fee_line->discard_changes; # reload from DB
is( $lost_fee_line->amountoutstanding + 0, 0, 'Lost fee has no outstanding amount' );
- is( $lost_fee_line->accounttype,
+ is( $lost_fee_line->debit_type_code,
'LOST', 'Lost fee now still has account type of LOST' );
is( $lost_fee_line->status, 'RETURNED', "Lost fee now has account status of RETURNED");
LostItem( $item->itemnumber, 1 );
my $processing_fee_lines = Koha::Account::Lines->search(
- { borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'PF' } );
+ { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'PF' } );
is( $processing_fee_lines->count, 1, 'Only one processing fee produced' );
my $processing_fee_line = $processing_fee_lines->next;
is( $processing_fee_line->amount + 0,
$processfee_amount, 'The right PF amountoutstanding is generated' );
my $lost_fee_lines = Koha::Account::Lines->search(
- { borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'LOST' } );
+ { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'LOST' } );
is( $lost_fee_lines->count, 1, 'Only one lost item fee produced' );
my $lost_fee_line = $lost_fee_lines->next;
is( $lost_fee_line->amount + 0, $replacement_amount, 'The right LOST amount is generated' );
$lost_fee_line->discard_changes;
is( $lost_fee_line->amountoutstanding + 0, 0, 'Lost fee has no outstanding amount' );
- is( $lost_fee_line->accounttype,
+ is( $lost_fee_line->debit_type_code,
'LOST', 'Lost fee now still has account type of LOST' );
is( $lost_fee_line->status, 'RETURNED', "Lost fee now has account status of RETURNED");
LostItem( $item->itemnumber, 1 );
my $processing_fee_lines = Koha::Account::Lines->search(
- { borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'PF' } );
+ { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'PF' } );
is( $processing_fee_lines->count, 1, 'Only one processing fee produced' );
my $processing_fee_line = $processing_fee_lines->next;
is( $processing_fee_line->amount + 0,
$processfee_amount, 'The right PF amountoutstanding is generated' );
my $lost_fee_lines = Koha::Account::Lines->search(
- { borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'LOST' } );
+ { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'LOST' } );
is( $lost_fee_lines->count, 1, 'Only one lost item fee produced' );
my $lost_fee_line = $lost_fee_lines->next;
is( $lost_fee_line->amount + 0, $replacement_amount, 'The right LOST amount is generated' );
$lost_fee_line->discard_changes;
is( $lost_fee_line->amountoutstanding + 0, 0, 'Lost fee has no outstanding amount' );
- is( $lost_fee_line->accounttype,
+ is( $lost_fee_line->debit_type_code,
'LOST', 'Lost fee now still has account type of LOST' );
is( $lost_fee_line->status, 'RETURNED', "Lost fee now has account status of RETURNED");
LostItem( $item->itemnumber, 1 );
my $processing_fee_lines = Koha::Account::Lines->search(
- { borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'PF' } );
+ { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'PF' } );
is( $processing_fee_lines->count, 1, 'Only one processing fee produced' );
my $processing_fee_line = $processing_fee_lines->next;
is( $processing_fee_line->amount + 0,
$processfee_amount, 'The right PF amountoutstanding is generated' );
my $lost_fee_lines = Koha::Account::Lines->search(
- { borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'LOST' } );
+ { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'LOST' } );
is( $lost_fee_lines->count, 1, 'Only one lost item fee produced' );
my $lost_fee_line = $lost_fee_lines->next;
is( $lost_fee_line->amount + 0, $replacement_amount, 'The right LOST amount is generated' );
$lost_fee_line->discard_changes;
is( $lost_fee_line->amountoutstanding + 0, 0, 'Lost fee has no outstanding amount' );
- is( $lost_fee_line->accounttype,
+ is( $lost_fee_line->debit_type_code,
'LOST', 'Lost fee now still has account type of LOST' );
is( $lost_fee_line->status, 'RETURNED', "Lost fee now has account status of RETURNED");
LostItem( $item_id, 1 );
my $lost_fee_lines = Koha::Account::Lines->search(
- { borrowernumber => $patron->id, itemnumber => $item_id, accounttype => 'LOST' } );
+ { borrowernumber => $patron->id, itemnumber => $item_id, debit_type_code => 'LOST' } );
is( $lost_fee_lines->count, 1, 'Only one lost item fee produced' );
my $lost_fee_line = $lost_fee_lines->next;
is( $lost_fee_line->amount + 0, $replacement_amount, 'The right LOST amount is generated' );
is( $account->balance, $manual_debit_amount - $payment_amount, 'Balance is PF - payment (LOST_RETURN)' );
- my $manual_debit = Koha::Account::Lines->search({ borrowernumber => $patron->id, accounttype => 'OVERDUE', status => 'UNRETURNED' })->next;
+ my $manual_debit = Koha::Account::Lines->search({ borrowernumber => $patron->id, debit_type_code => 'OVERDUE', status => 'UNRETURNED' })->next;
is( $manual_debit->amountoutstanding + 0, $manual_debit_amount - $payment_amount, 'reconcile_balance was called' );
};
};
my $accountline = Koha::Account::Line->new(
{
borrowernumber => $patron->{borrowernumber},
- accounttype => 'OVERDUE',
+ debit_type_code => 'OVERDUE',
status => 'UNRETURNED',
itemnumber => $item->itemnumber,
amount => 99.00,
## Run again, with exemptfine enabled
$accountline->set(
{
- accounttype => 'OVERDUE',
+ debit_type_code => 'OVERDUE',
status => 'UNRETURNED',
amountoutstanding => 99.00,
}
my $accountline = Koha::Account::Line->new(
{
borrowernumber => $patron->id,
- accounttype => 'L',
+ debit_type_code => 'LOST',
status => undef,
itemnumber => $item->itemnumber,
amount => 99.00,
is( $lines->count, 2 );
my $line = $lines->next;
- is( $line->accounttype, 'RENT', 'The issue of item with issuing charge generates an accountline of the correct type' );
+ is( $line->debit_type_code, 'RENT', 'The issue of item with issuing charge generates an accountline of the correct type' );
is( $line->branchcode, $library->id, 'AddIssuingCharge correctly sets branchcode' );
is( $line->description, '', 'AddIssue does not set a hardcoded description for the accountline' );
$line = $lines->next;
- is( $line->accounttype, 'RENT_RENEW', 'The renewal of item with issuing charge generates an accountline of the correct type' );
+ is( $line->debit_type_code, 'RENT_RENEW', 'The renewal of item with issuing charge generates an accountline of the correct type' );
is( $line->branchcode, $library->id, 'AddRenewal correctly sets branchcode' );
is( $line->description, '', 'AddRenewal does not set a hardcoded description for the accountline' );