Bugzilla – Attachment 88549 Details for
Bug 11573
Fine descriptions related to Rentals are untranslatable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11573: Make rental accountlines translatable
Bug-11573-Make-rental-accountlines-translatable.patch (text/plain), 10.99 KB, created by
Martin Renvoize (ashimema)
on 2019-04-23 17:10:53 UTC
(
hide
)
Description:
Bug 11573: Make rental accountlines translatable
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-04-23 17:10:53 UTC
Size:
10.99 KB
patch
obsolete
>From c9ded4ff2fb86d44f1061170c85c87ae5dc01f69 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 23 Apr 2019 18:05:05 +0100 >Subject: [PATCH] Bug 11573: Make rental accountlines translatable > >To test: > >1. Set up an item type with a rental charge >2. Issue an item with that item type >3. Check fines - the rental charge does not show the title of the issued >item >4. Renew that item, the renewal charge does show the title of the issued >item >5. Apply the patch >6. Repeat steps 1-4, both should show the title of the issued item in >the description. >7. Repeat steps 1-6 for an item type with a daily rental charge > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Circulation.pm | 18 +++----- > Koha/Account.pm | 29 ++++++++----- > .../prog/en/includes/accounts.inc | 43 ++++++++++--------- > .../bootstrap/en/includes/account-table.inc | 5 ++- > 4 files changed, 53 insertions(+), 42 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 517d007209..0f78ca1a58 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1471,15 +1471,14 @@ sub AddIssue { > # If it costs to borrow this book, charge it to the patron's account. > my ( $charge, $itemtype ) = GetIssuingCharges( $item_object->itemnumber, $borrower->{'borrowernumber'} ); > if ( $charge > 0 ) { >- my $description = "Rental"; >- AddIssuingCharge( $issue, $charge, $description ); >+ AddIssuingCharge( $issue, $charge, 'rent' ); > } > > my $itemtype_object = Koha::ItemTypes->find( $item_object->effective_itemtype ); > if ( $itemtype_object ) { > my $accumulate_charge = $fees->accumulate_rentalcharge(); > if ( $accumulate_charge > 0 ) { >- AddIssuingCharge( $issue, $accumulate_charge, 'Daily rental' ) if $accumulate_charge > 0; >+ AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily' ) if $accumulate_charge > 0; > $charge += $accumulate_charge; > $item_unblessed->{charge} = $charge; > } >@@ -2888,8 +2887,7 @@ sub AddRenewal { > # Charge a new rental fee, if applicable > my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); > if ( $charge > 0 ) { >- my $description = "Renewal of Rental Item " . $biblio->title . " " .$item_object->barcode; >- AddIssuingCharge($issue, $charge, $description); >+ AddIssuingCharge($issue, $charge, 'rent_renewal'); > } > > # Charge a new accumulate rental fee, if applicable >@@ -2897,8 +2895,7 @@ sub AddRenewal { > if ( $itemtype_object ) { > my $accumulate_charge = $fees->accumulate_rentalcharge(); > if ( $accumulate_charge > 0 ) { >- my $type_desc = "Renewal of Daily Rental Item " . $biblio->title . " $item_unblessed->{'barcode'}"; >- AddIssuingCharge( $issue, $accumulate_charge, $type_desc ) >+ AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily_renewal' ) > } > $charge += $accumulate_charge; > } >@@ -3220,12 +3217,12 @@ sub _get_discount_from_rule { > > =head2 AddIssuingCharge > >- &AddIssuingCharge( $checkout, $charge, [$description] ) >+ &AddIssuingCharge( $checkout, $charge, $type ) > > =cut > > sub AddIssuingCharge { >- my ( $checkout, $charge, $description ) = @_; >+ my ( $checkout, $charge, $type ) = @_; > > # FIXME What if checkout does not exist? > >@@ -3233,12 +3230,11 @@ sub AddIssuingCharge { > my $accountline = $account->add_debit( > { > amount => $charge, >- description => $description, > note => undef, > user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef, > library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, > interface => C4::Context->interface, >- type => 'rent', >+ type => $type, > item_id => $checkout->itemnumber, > issue_id => $checkout->issue_id, > } >diff --git a/Koha/Account.pm b/Koha/Account.pm >index 0239bac73c..7018a2c183 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -432,6 +432,9 @@ $debit_type can be any of: > - sundry > - processing > - rent >+ - rent_daily >+ - rent_renewal >+ - rent_daily_renewal > - reserve > - manual > >@@ -697,6 +700,9 @@ our $offset_type = { > 'processing' => 'Processing Fee', > 'lost_item' => 'Lost Item', > 'rent' => 'Rental Fee', >+ 'rent_daily' => 'Rental Fee', >+ 'rent_renew' => 'Rental Fee', >+ 'rent_daily_renew' => 'Rental Fee', > 'overdue' => 'OVERDUE', > 'manual_debit' => 'Manual Debit', > 'hold_expired' => 'Hold Expired' >@@ -719,16 +725,19 @@ our $account_type_credit = { > =cut > > our $account_type_debit = { >- 'account' => 'A', >- 'overdue' => 'OVERDUE', >- 'lost_item' => 'LOST', >- 'new_card' => 'N', >- 'sundry' => 'M', >- 'processing' => 'PF', >- 'rent' => 'Rent', >- 'reserve' => 'Res', >- 'manual_debit' => 'M', >- 'hold_expired' => 'HE' >+ 'account' => 'A', >+ 'overdue' => 'OVERDUE', >+ 'lost_item' => 'LOST', >+ 'new_card' => 'N', >+ 'sundry' => 'M', >+ 'processing' => 'PF', >+ 'rent' => 'RENT', >+ 'rent_daily' => 'RENT_DAILY', >+ 'rent_renew' => 'RENT_RENEW', >+ 'rent_daily_renew' => 'RENT_DAILY_RENEW', >+ 'reserve' => 'Res', >+ 'manual_debit' => 'M', >+ 'hold_expired' => 'HE' > }; > > =head1 AUTHORS >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >index 1c2e18c563..53217187ef 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >@@ -1,25 +1,28 @@ > [%- BLOCK account_type_description -%] > [%- SWITCH account.accounttype -%] >- [%- CASE 'Pay' -%]<span>Payment, thanks</span> >- [%- CASE 'Pay00' -%]<span>Payment, thanks (cash via SIP2)</span> >- [%- CASE 'Pay01' -%]<span>Payment, thanks (VISA via SIP2)</span> >- [%- CASE 'Pay02' -%]<span>Payment, thanks (credit card via SIP2)</span> >- [%- CASE 'N' -%]<span>New card</span> >- [%- CASE 'OVERDUE' -%]<span>Fine[%- PROCESS account_status_description account=account -%]</span> >- [%- CASE 'A' -%]<span>Account management fee</span> >- [%- CASE 'M' -%]<span>Sundry</span> >- [%- CASE 'LOST' -%]<span>Lost item[%- PROCESS account_status_description account=account -%]</span> >- [%- CASE 'W' -%]<span>Writeoff[%- PROCESS account_status_description account=account -%]</span> >- [%- CASE 'HE' -%]<span>Hold waiting too long</span> >- [%- CASE 'Rent' -%]<span>Rental fee</span> >- [%- CASE 'FOR' -%]<span>Forgiven[%- PROCESS account_status_description account=account -%]</span> >- [%- CASE 'PF' -%]<span>Lost item processing fee</span> >- [%- CASE 'PAY' -%]<span>Payment[%- PROCESS account_status_description account=account -%]</span> >- [%- CASE 'WO' -%]<span>Writeoff[%- PROCESS account_status_description account=account -%]</span> >- [%- CASE 'C' -%]<span>Credit[%- PROCESS account_status_description account=account -%]</span> >- [%- CASE 'LOST_RETURN' -%]<span>Lost item fee refund[%- PROCESS account_status_description account=account -%]</span> >- [%- CASE 'Res' -%]<span>Hold fee</span> >- [%- CASE -%][% account.accounttype | html %] >+ [%- CASE 'Pay' -%]<span>Payment, thanks</span> >+ [%- CASE 'Pay00' -%]<span>Payment, thanks (cash via SIP2)</span> >+ [%- CASE 'Pay01' -%]<span>Payment, thanks (VISA via SIP2)</span> >+ [%- CASE 'Pay02' -%]<span>Payment, thanks (credit card via SIP2)</span> >+ [%- CASE 'N' -%]<span>New card</span> >+ [%- CASE 'OVERDUE' -%]<span>Fine[%- PROCESS account_status_description account=account -%]</span> >+ [%- CASE 'A' -%]<span>Account management fee</span> >+ [%- CASE 'M' -%]<span>Sundry</span> >+ [%- CASE 'LOST' -%]<span>Lost item[%- PROCESS account_status_description account=account -%]</span> >+ [%- CASE 'W' -%]<span>Writeoff[%- PROCESS account_status_description account=account -%]</span> >+ [%- CASE 'HE' -%]<span>Hold waiting too long</span> >+ [%- CASE 'RENT' -%]<span>Rental fee</span> >+ [%- CASE 'RENT_DAILY' -%]<span>Daily rental fee</span> >+ [%- CASE 'RENT_RENEW' -%]<span>Renewal of rental item</span> >+ [%- CASE 'RENT_DAILY_RENEW' -%]<span>Rewewal of daily rental item</span> >+ [%- CASE 'FOR' -%]<span>Forgiven[%- PROCESS account_status_description account=account -%]</span> >+ [%- CASE 'PF' -%]<span>Lost item processing fee</span> >+ [%- CASE 'PAY' -%]<span>Payment[%- PROCESS account_status_description account=account -%]</span> >+ [%- CASE 'WO' -%]<span>Writeoff[%- PROCESS account_status_description account=account -%]</span> >+ [%- CASE 'C' -%]<span>Credit[%- PROCESS account_status_description account=account -%]</span> >+ [%- CASE 'LOST_RETURN' -%]<span>Lost item fee refund[%- PROCESS account_status_description account=account -%]</span> >+ [%- CASE 'Res' -%]<span>Hold fee</span> >+ [%- CASE -%][% account.accounttype | html %] > [%- END -%] > [%- END -%] > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >index 79fb50fb99..36ecf2966b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >@@ -41,7 +41,10 @@ > [% CASE 'LOST' %]Lost item[%- PROCESS account_status_description account=account -%] > [% CASE 'W' %]Writeoff[%- PROCESS account_status_description account=account -%] > [% CASE 'HE' %]Hold waiting too long >- [% CASE 'Rent' %]Rental fee >+ [% CASE 'RENT' %]Rental fee >+ [% CASE 'RENT_DAILY' %]Daily rental fee >+ [% CASE 'RENT_RENEW' %]Renewal of rental item >+ [% CASE 'RENT_DAILT_RENEW' %]Renewal of dailt rental item > [% CASE 'FOR' %]Forgiven[%- PROCESS account_status_description account=account -%] > [% CASE 'PF' %]Lost item processing fee > [% CASE 'PAY' %]Payment[%- PROCESS account_status_description account=account -%] >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11573
:
24473
|
24485
|
24486
|
25715
|
27822
|
27823
|
27824
|
47236
|
47237
|
47238
|
47239
|
47240
|
47241
|
47242
|
47288
|
47289
|
47290
|
47291
|
88549
|
88600
|
88601
|
88602
|
88603
|
88604
|
88605
|
88606
|
88726
|
88727
|
88728
|
88729
|
90231
|
90232
|
90233
|
90234
|
90246
|
90256
|
90313
|
90314
|
90315
|
90316
|
91529
|
91530
|
91531
|
91532
|
91800
|
91801
|
91802
|
91803
|
91804
|
91805
|
91806