@@ -, +, @@ --- C4/Reserves.pm | 2 +- Koha/Account.pm | 8 ++++---- installer/data/mysql/account_debit_types.sql | 2 +- installer/data/mysql/atomicupdate/bug_23049_debit.perl | 9 ++++++++- .../data/mysql/en/mandatory/account_debit_types.sql | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc | 2 +- .../opac-tmpl/bootstrap/en/includes/account-table.inc | 2 +- opac/sco/sco-main.pl | 2 +- t/db_dependent/Accounts.t | 2 +- t/db_dependent/Reserves.t | 2 +- 10 files changed, 20 insertions(+), 13 deletions(-) --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -578,7 +578,7 @@ sub ChargeReserveFee { library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, interface => C4::Context->interface, invoice_type => undef, - type => 'reserve', + type => 'RESERVE', item_id => undef } ); --- a/Koha/Account.pm +++ a/Koha/Account.pm @@ -456,7 +456,7 @@ $debit_type can be any of: - rent_daily - rent_renew - rent_daily_renew - - reserve + - RESERVE - manual_debit =cut @@ -632,7 +632,7 @@ sub non_issues_charges { #NOTE: With bug 23049 these preferences could be moved to being attached #to individual debit types to give more flexability and specificity. my @not_fines; - push @not_fines, 'Res' + push @not_fines, 'RESERVE' unless C4::Context->preference('HoldsInNoissuesCharge'); push @not_fines, ( 'RENT', 'RENT_DAILY', 'RENT_RENEW', 'RENT_DAILY_RENEW' ) unless C4::Context->preference('RentalsInNoissuesCharge'); @@ -711,7 +711,7 @@ our $offset_type = { 'writeoff' => 'Writeoff', 'account' => 'Account Fee', 'account_renew' => 'Account Fee', - 'reserve' => 'Reserve Fee', + 'RESERVE' => 'Reserve Fee', 'processing' => 'Processing Fee', 'lost_item' => 'Lost Item', 'rent' => 'Rental Fee', @@ -752,7 +752,7 @@ our $account_type_debit = { 'rent_daily' => 'RENT_DAILY', 'rent_renew' => 'RENT_RENEW', 'rent_daily_renew' => 'RENT_DAILY_RENEW', - 'reserve' => 'Res', + 'RESERVE' => 'RESERVE', 'manual_debit' => 'M' }; --- a/installer/data/mysql/account_debit_types.sql +++ a/installer/data/mysql/account_debit_types.sql @@ -11,4 +11,4 @@ INSERT INTO account_debit_types ( code, description, can_be_added_manually, defa ('RENT_DAILY', 'Daily rental fee', 0, NULL, 1), ('RENT_RENEW', 'Renewal of rental item', 0, NULL, 1), ('RENT_DAILY_RENEW', 'Rewewal of daily rental item', 0, NULL, 1), -('Res', 'Hold fee', 0, NULL, 1); +('RESERVE', 'Hold fee', 0, NULL, 1); --- a/installer/data/mysql/atomicupdate/bug_23049_debit.perl +++ a/installer/data/mysql/atomicupdate/bug_23049_debit.perl @@ -50,7 +50,14 @@ if ( CheckVersion($DBversion) ) { ('RENT_DAILY', 'Daily rental fee', 0, NULL, 1), ('RENT_RENEW', 'Renewal of rental item', 0, NULL, 1), ('RENT_DAILY_RENEW', 'Rewewal of daily rental item', 0, NULL, 1), - ('Res', 'Hold fee', 0, NULL, 1) + ('RESERVE', 'Hold fee', 0, NULL, 1) + } + ); + + # Update accountype 'Res' to 'RESERVE' + $dbh->do( + qq{ + UPDATE accountlines SET accounttype = 'RESERVE' WHERE accounttype = 'Res' } ); --- a/installer/data/mysql/en/mandatory/account_debit_types.sql +++ a/installer/data/mysql/en/mandatory/account_debit_types.sql @@ -11,4 +11,4 @@ INSERT INTO account_debit_types ( code, description, can_be_added_manually, defa ('RENT_DAILY', 'Daily rental fee', 0, NULL, 1), ('RENT_RENEW', 'Renewal of rental item', 0, NULL, 1), ('RENT_DAILY_RENEW', 'Rewewal of daily rental item', 0, NULL, 1), -('Res', 'Hold fee', 0, NULL, 1); +('RESERVE', 'Hold fee', 0, NULL, 1); --- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc @@ -25,7 +25,7 @@ [%- CASE 'RENT_DAILY' -%]Daily rental fee [%- CASE 'RENT_RENEW' -%]Renewal of rental item [%- CASE 'RENT_DAILY_RENEW' -%]Rewewal of daily rental item - [%- CASE 'Res' -%]Hold fee + [%- CASE 'RESERVE' -%]Hold fee [%- CASE -%][% account.debit_type.description | html %] [%- END -%] [%- END -%] --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc @@ -196,7 +196,7 @@ [%- CASE 'RENT_DAILY' -%]Daily rental fee [%- CASE 'RENT_RENEW' -%]Renewal of rental item [%- CASE 'RENT_DAILY_RENEW' -%]Rewewal of daily rental item - [%- CASE 'Res' -%]Hold fee + [%- CASE 'RESERVE' -%]Hold fee [%- CASE -%][% account.debit_type.description | html %] [%- END -%] [%- END -%] --- a/opac/sco/sco-main.pl +++ a/opac/sco/sco-main.pl @@ -241,7 +241,7 @@ elsif ( $patron && ( $op eq 'checkout' || $op eq 'renew' ) ) { patron_has_hold_fee => Koha::Account::Lines->search( { borrowernumber => $borrower->{borrowernumber}, - debit_type_code => 'Res', + debit_type_code => 'RESERVE', description => $item->biblio->title, date => $dtf->format_date(dt_from_string) } --- a/t/db_dependent/Accounts.t +++ a/t/db_dependent/Accounts.t @@ -774,7 +774,7 @@ subtest "Koha::Account::non_issues_charges tests" => sub { $account->add_debit( { description => 'a Res fee', - type => 'reserve', + type => 'RESERVE', amount => $res, interface => 'commandline' } --- a/t/db_dependent/Reserves.t +++ a/t/db_dependent/Reserves.t @@ -739,7 +739,7 @@ subtest 'ChargeReserveFee tests' => sub { is( ref($line), 'Koha::Account::Line' , 'Returns a Koha::Account::Line object'); ok( $line->is_debit, 'Generates a debit line' ); - is( $line->debit_type_code, 'Res' , 'generates Res debit_type'); + is( $line->debit_type_code, 'RESERVE' , 'generates RESERVE debit_type'); is( $line->borrowernumber, $patron->id , 'generated line belongs to the passed patron'); is( $line->amount, $fee , 'amount set correctly'); is( $line->amountoutstanding, $fee , 'amountoutstanding set correctly'); --