Browse Source

Bug 22563: Be more descriptive with accountypes

Convert 'L' to 'LOST' to become more descriptive in it's use.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
remotes/origin/19.11.x
Martin Renvoize 4 years ago
parent
commit
e3c5892f52
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 2
      C4/Accounts.pm
  2. 2
      C4/Circulation.pm
  3. 12
      Koha/Account.pm
  4. 2
      Koha/Account/Line.pm
  5. 2
      koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc
  6. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt
  7. 2
      koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc
  8. 2
      opac/opac-user.pl
  9. 40
      t/db_dependent/Accounts.t
  10. 10
      t/db_dependent/Circulation.t

2
C4/Accounts.pm

@ -91,7 +91,7 @@ sub chargelostitem{
my $existing_charges = $account->lines->search(
{
itemnumber => $itemnumber,
accounttype => 'L',
accounttype => 'LOST',
}
)->count();

2
C4/Circulation.pm

@ -2407,7 +2407,7 @@ sub _FixAccountForLostAndReturned {
my $accountlines = Koha::Account::Lines->search(
{
itemnumber => $itemnumber,
accounttype => 'L',
accounttype => 'LOST',
},
{
order_by => { -desc => [ 'date', 'accountlines_id' ] }

12
Koha/Account.pm

@ -109,7 +109,10 @@ sub pay {
$balance_remaining = $balance_remaining - $amount_to_pay;
# Same logic exists in Koha::Account::Line::apply
if ( $new_amountoutstanding == 0 && $fine->itemnumber && $fine->accounttype && ( $fine->accounttype eq 'L' ) )
if ( $new_amountoutstanding == 0
&& $fine->itemnumber
&& $fine->accounttype
&& ( $fine->accounttype eq 'LOST' ) )
{
C4::Circulation::ReturnLostItem( $self->{patron_id}, $fine->itemnumber );
}
@ -165,7 +168,10 @@ sub pay {
$fine->amountoutstanding( $old_amountoutstanding - $amount_to_pay );
$fine->store();
if ( $fine->amountoutstanding == 0 && $fine->itemnumber && $fine->accounttype && ( $fine->accounttype eq 'L' ) )
if ( $fine->amountoutstanding == 0
&& $fine->itemnumber
&& $fine->accounttype
&& ( $fine->accounttype eq 'LOST' ) )
{
C4::Circulation::ReturnLostItem( $self->{patron_id}, $fine->itemnumber );
}
@ -727,7 +733,7 @@ our $account_type_credit = {
our $account_type_debit = {
'account' => 'A',
'overdue' => 'OVERDUE',
'lost_item' => 'L',
'lost_item' => 'LOST',
'new_card' => 'N',
'sundry' => 'M',
'processing' => 'PF',

2
Koha/Account/Line.pm

@ -226,7 +226,7 @@ sub apply {
if ( $debit->amountoutstanding == 0
&& $debit->itemnumber
&& $debit->accounttype
&& $debit->accounttype eq 'L' )
&& $debit->accounttype eq 'LOST' )
{
C4::Circulation::ReturnLostItem( $self->borrowernumber, $debit->itemnumber );
}

2
koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc

@ -8,7 +8,7 @@
[%- CASE 'OVERDUE' -%]<span>Fine
[%- CASE 'A' -%]<span>Account management fee
[%- CASE 'M' -%]<span>Sundry
[%- CASE 'L' -%]<span>Lost item
[%- CASE 'LOST' -%]<span>Lost item
[%- CASE 'W' -%]<span>Writeoff
[%- CASE 'HE' -%]<span>Hold waiting too long
[%- CASE 'Rent' -%]<span>Rental fee

2
koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt

@ -79,7 +79,7 @@
[% INCLUDE 'str/members-menu.inc' %]
[% Asset.js("js/members-menu.js") | $raw %]
<script>
var type_fees = {'L':'','OVERDUE':'','A':'','N':'','M':''};
var type_fees = {'LOST':'','OVERDUE':'','A':'','N':'','M':''};
[% FOREACH invoice_types_loo IN invoice_types_loop %]
type_fees['[% invoice_types_loo.authorised_value | html %]'] = "[% invoice_types_loo.lib | html %]";
[% END %]

2
koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc

@ -126,7 +126,7 @@
[%- CASE 'OVERDUE' -%]<span>Fine
[%- CASE 'A' -%]<span>Account management fee
[%- CASE 'M' -%]<span>Sundry
[%- CASE 'L' -%]<span>Lost item
[%- CASE 'LOST' -%]<span>Lost item
[%- CASE 'W' -%]<span>Writeoff
[%- CASE 'HE' -%]<span>Hold waiting too long
[%- CASE 'Rent' -%]<span>Rental fee

2
opac/opac-user.pl

@ -185,7 +185,7 @@ if ( $pending_checkouts->count ) { # Useless test
{
borrowernumber => $patron->borrowernumber,
amountoutstanding => { '>' => 0 },
accounttype => [ 'OVERDUE', 'L' ],
accounttype => [ 'OVERDUE', 'LOST' ],
itemnumber => $issue->{itemnumber}
},
);

40
t/db_dependent/Accounts.t

@ -77,7 +77,7 @@ my $item = $builder->build( { source => 'Item', value => { itype => $itemtype-
my $patron = $builder->build( { source => 'Borrower' } );
my $amount = '5.000000';
my $description = "Test fee!";
my $type = 'L';
my $type = 'LOST';
my $note = 'Test note!';
warning_like {
C4::Accounts::manualinvoice( $patron->{borrowernumber},
@ -580,38 +580,38 @@ subtest "C4::Accounts::chargelostitem tests" => sub {
t::lib::Mocks::mock_preference('useDefaultReplacementCost', '0');
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber1, 0, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, accounttype => 'PF' });
ok( !$lostfine, "No lost fine if no replacementcost or default when pref off");
ok( !$procfee, "No processing fee if no processing fee");
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber1, 6.12, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, accounttype => 'PF' });
ok( $lostfine->amount == 6.12, "Lost fine equals replacementcost when pref off and no default set");
ok( !$procfee, "No processing fee if no processing fee");
$lostfine->delete();
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber2, 0, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, accounttype => 'PF' });
ok( !$lostfine, "No lost fine if no replacementcost but default set when pref off");
ok( !$procfee, "No processing fee if no processing fee");
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber2, 6.12, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, accounttype => 'PF' });
ok( $lostfine->amount == 6.12 , "Lost fine equals replacementcost when pref off and default set");
ok( !$procfee, "No processing fee if no processing fee");
$lostfine->delete();
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber3, 0, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, accounttype => 'PF' });
ok( !$lostfine, "No lost fine if no replacementcost and no default set when pref off");
ok( $procfee->amount == 8.16, "Processing fee if processing fee");
is( $procfee->issue_id, $cli_issue_id_3, "Processing fee issue id is correct" );
$procfee->delete();
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber3, 6.12, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, accounttype => 'PF' });
ok( $lostfine->amount == 6.12 , "Lost fine equals replacementcost when pref off and no default set");
ok( $procfee->amount == 8.16, "Processing fee if processing fee");
@ -620,14 +620,14 @@ subtest "C4::Accounts::chargelostitem tests" => sub {
$procfee->delete();
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 0, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'PF' });
ok( !$lostfine, "No lost fine if no replacementcost but default set when pref off");
ok( $procfee->amount == 2.04, "Processing fee if processing fee");
is( $procfee->issue_id, $cli_issue_id_4, "Processing fee issue id is correct" );
$procfee->delete();
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 6.12, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'PF' });
ok( $lostfine->amount == 6.12 , "Lost fine equals replacementcost when pref off and default set");
ok( $procfee->amount == 2.04, "Processing fee if processing fee");
@ -638,44 +638,44 @@ subtest "C4::Accounts::chargelostitem tests" => sub {
t::lib::Mocks::mock_preference('useDefaultReplacementCost', '1');
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber1, 0, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, accounttype => 'PF' });
ok( !$lostfine, "No lost fine if no replacementcost or default when pref on");
ok( !$procfee, "No processing fee if no processing fee");
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber1, 6.12, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, accounttype => 'PF' });
is( $lostfine->amount, "6.120000", "Lost fine equals replacementcost when pref on and no default set");
ok( !$procfee, "No processing fee if no processing fee");
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber2, 0, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, accounttype => 'PF' });
is( $lostfine->amount(), "16.320000", "Lost fine is default if no replacementcost but default set when pref on");
ok( !$procfee, "No processing fee if no processing fee");
$lostfine->delete();
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber2, 6.12, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, accounttype => 'PF' });
is( $lostfine->amount, "6.120000" , "Lost fine equals replacementcost when pref on and default set");
ok( !$procfee, "No processing fee if no processing fee");
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber3, 0, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, accounttype => 'PF' });
ok( !$lostfine, "No lost fine if no replacementcost and default not set when pref on");
is( $procfee->amount, "8.160000", "Processing fee if processing fee");
is( $procfee->issue_id, $cli_issue_id_3, "Processing fee issue id is correct" );
$procfee->delete();
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber3, 6.12, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, accounttype => 'PF' });
is( $lostfine->amount, "6.120000", "Lost fine equals replacementcost when pref on and no default set");
is( $procfee->amount, "8.160000", "Processing fee if processing fee");
is( $procfee->issue_id, $cli_issue_id_3, "Processing fee issue id is correct" );
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 0, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'PF' });
is( $lostfine->amount, "4.080000", "Lost fine is default if no replacementcost but default set when pref on");
is( $procfee->amount, "2.040000", "Processing fee if processing fee");
@ -683,7 +683,7 @@ subtest "C4::Accounts::chargelostitem tests" => sub {
$lostfine->delete();
$procfee->delete();
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 6.12, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'PF' });
is( $lostfine->amount, "6.120000", "Lost fine equals replacementcost when pref on and default set");
is( $procfee->amount, "2.040000", "Processing fee if processing fee");
@ -699,7 +699,7 @@ subtest "C4::Accounts::chargelostitem tests" => sub {
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, '1.99', "Perdedor");
# Lost Item Fee
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'LOST' });
ok($lostfine, "Lost fine created");
is($lostfine->manager_id, $staff_id, "Lost fine manager_id set correctly");
is($lostfine->issue_id, $cli_issue_id_4, "Lost fine issue_id set correctly");
@ -726,7 +726,7 @@ subtest "C4::Accounts::chargelostitem tests" => sub {
t::lib::Mocks::mock_preference( 'FinesLog', 0 );
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 0, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'PF' });
is( $schema->resultset('ActionLog')->count(), $action_logs + 0, 'No logs were added' );
$lostfine->delete();
@ -734,7 +734,7 @@ subtest "C4::Accounts::chargelostitem tests" => sub {
t::lib::Mocks::mock_preference( 'FinesLog', 1 );
C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 0, "Perdedor");
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'L' });
$lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'LOST' });
$procfee = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, accounttype => 'PF' });
is( $schema->resultset('ActionLog')->count(), $action_logs + 2, 'Logs were added' );
$lostfine->delete();

10
t/db_dependent/Circulation.t

@ -2208,7 +2208,7 @@ subtest '_FixAccountForLostAndReturned' => sub {
$processfee_amount, 'The right PF amountoutstanding is generated' );
my $lost_fee_lines = Koha::Account::Lines->search(
{ borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'L' } );
{ borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => '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 L amount is generated' );
@ -2269,7 +2269,7 @@ subtest '_FixAccountForLostAndReturned' => sub {
$processfee_amount, 'The right PF amountoutstanding is generated' );
my $lost_fee_lines = Koha::Account::Lines->search(
{ borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'L' } );
{ borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => '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 L amount is generated' );
@ -2338,7 +2338,7 @@ subtest '_FixAccountForLostAndReturned' => sub {
$processfee_amount, 'The right PF amountoutstanding is generated' );
my $lost_fee_lines = Koha::Account::Lines->search(
{ borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'L' } );
{ borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => '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 L amount is generated' );
@ -2389,7 +2389,7 @@ subtest '_FixAccountForLostAndReturned' => sub {
$processfee_amount, 'The right PF amountoutstanding is generated' );
my $lost_fee_lines = Koha::Account::Lines->search(
{ borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'L' } );
{ borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => '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 L amount is generated' );
@ -2492,7 +2492,7 @@ subtest '_FixAccountForLostAndReturned' => sub {
LostItem( $item_id, 1 );
my $lost_fee_lines = Koha::Account::Lines->search(
{ borrowernumber => $patron->id, itemnumber => $item_id, accounttype => 'L' } );
{ borrowernumber => $patron->id, itemnumber => $item_id, accounttype => '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 L amount is generated' );

Loading…
Cancel
Save