Bug 2546

Summary: Description of charges: string hardcoded
Product: Koha Reporter: Chris Cormack <chris>
Component: I18N/L10NAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: major    
Priority: P3 CC: fridolin.somers, gmcharlt, jonathan.druart, katrin.fischer, kyle, m.de.rooy, marjorie.barry-vila, oleonard, paul.poulain, pelletiermaxime
Version: 3.14   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6427
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11387
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 12165, 12415    
Attachments: opac screenshot
screenshot
Bug 2546: Description of charges is not translatable
Bug 2546: Description of charges is not translatable
Bug 2546: Description of charges is not translatable

Description Chris Cormack 2010-05-21 00:52:25 UTC


---- Reported by nicolas.morin@biblibre.com 2008-08-22 03:35:59 ----

In boraccount.pl / fines / account tab, the texts in the Description of charges column seem to be directly taken from the database, and thus cannot be translated: Writeoff, Account Management fee, etc.



---- Additional Comments From nicolas.morin@biblibre.com 2008-10-07 02:02:41 ----

Correction: the strings are not coming from the db, they're quite simply hardcoded in the template: intranet-tmpl/prog/en/modules/members/maninvoice.tmpl



---- Additional Comments From nengard@gmail.com 2009-12-23 17:59:26 ----

This bug hasn't been touched in nearly a year, please revisit and test and close if appropriate.



---- Additional Comments From nicolas.morin@biblibre.com 2009-12-28 10:54:48 ----

in C4/accounts.pm sub manualinvoice shouldn't directly write the description in the DB, only the type, because the 2 informations are redundant: $type eq 'F' /  $desc .= " Fine";

Next: the template should be the one writing the information. But since the template toolkit we ues can't really compare if value = F, we have to pass all the possible values as booleans to the tmpl




--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 00:52 UTC  ---

This bug was previously known as _bug_ 2546 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2546

Actual time not defined. Setting to 0.0
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: chris@bigballofwax.co.nz.
   Previous reporter was nicolas.morin@biblibre.com.
CC member nicolas.morin@biblibre.com does not have an account here

Comment 1 Katrin Fischer 2010-06-11 13:24:02 UTC
Created attachment 2243 [details]
opac screenshot

This is not only a problem in staff but also in opac. The English descriptions are confusing for patrons. (see screenshot)
Comment 2 Owen Leonard 2010-09-17 14:18:56 UTC
*** Bug 2188 has been marked as a duplicate of this bug. ***
Comment 3 Katrin Fischer 2011-02-07 11:55:21 UTC
Created attachment 3070 [details]
screenshot

This problem still exists in current master and 3.2.x branch. See updated screenshot.
Comment 4 Paul Poulain 2012-01-19 09:45:22 UTC
Christophe will:
* display the accountlines.accounttype column in the html table, expanding the code to display the full term, not only the code itself -and doing this in the template, to have a translatable string
* remove Accounts.pm/manualinvoice sub, lines 356 & following that add the non translatable string into desc

At the end:
* description will be only manually entered
* type will be displayed

Possible values for accounttype:
N=New Card
F=Fine
A=Account Management fee
M=Sundry
L=Lost Item
Comment 5 Maxime Pelletier 2012-11-14 19:37:51 UTC
10 months later this is still a major problem, so I guess it was not really assigned to Christophe, so i'm resetting to NEW.
Comment 6 Jonathan Druart 2013-10-23 11:35:58 UTC Comment hidden (obsolete)
Comment 7 Marcel de Rooy 2013-10-24 10:59:48 UTC Comment hidden (obsolete)
Comment 8 Mark Tompsett 2013-10-24 11:29:55 UTC
I was looking at the updatedatabase.pl portion of the diff. What descriptions aren't updated? Why is the table not altered and the description column just dropped?
Comment 9 Marcel de Rooy 2013-10-24 11:31:42 UTC
(In reply to M. Tompsett from comment #8)
> I was looking at the updatedatabase.pl portion of the diff. What
> descriptions aren't updated? Why is the table not altered and the
> description column just dropped?

The description may contain your typed-in comments etc.
We cannot drop it.
Go to Fines and pay something just to see..
Comment 10 Kyle M Hall 2013-11-22 13:10:06 UTC
Created attachment 23079 [details] [review]
Bug 2546: Description of charges is not translatable

The descriptions for charges are stored in English in the DB
(accountlines.description). So they are not translatable.

This patch removes the descriptions automatically added and generates
the string in the template.

Test plan:
1/ Execute the updatedatabase entry.
2/ Verify in the following pages the description is consistent:
    - members/pay.pl?borrowernumber=XXXX
    - members/boraccount.pl?borrowernumber=XXXX
    - opac-account.pl
3/ Launch the translate script and update the po files in order to
translate the new strings.
4/ Verify the strings are translated in the interface.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Works as advertised. Corrected few typos in the commit message.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 11 Kyle M Hall 2013-11-22 13:12:12 UTC
Bug 6427 will also obviate this issue. I believe it will be pushed to master before the 3.16 release, and would recommend *not* pushing this patch to master. However, it should definitely be pushed for 3.14.x and earlier.
Comment 12 Galen Charlton 2013-11-29 15:03:46 UTC
(In reply to Kyle M Hall from comment #11)
> Bug 6427 will also obviate this issue. I believe it will be pushed to master
> before the 3.16 release, and would recommend *not* pushing this patch to
> master. However, it should definitely be pushed for 3.14.x and earlier.

The accounts rewrite is still very much a work in progress and will require more discussion and testing, so it is premature to consider it a blocker for patches that implement current fixes -- particularly as it is preferable that patches destined for backporting to a maintenance branch show up in master first.

I don't see anything in Jonathan's patch that blocks anything proposed by the accounts rewrite.  If there is something, Kyle, this is your opportunity to speak up about it (although since you have already indicated that you believe it suitable for maintenance branches, I would assume that you don't know of any such blocker).
Comment 13 Kyle M Hall 2013-12-04 12:16:12 UTC
Agreed. Perhaps I'm being too optimistic ; )

(In reply to Galen Charlton from comment #12)
> (In reply to Kyle M Hall from comment #11)
> > Bug 6427 will also obviate this issue. I believe it will be pushed to master
> > before the 3.16 release, and would recommend *not* pushing this patch to
> > master. However, it should definitely be pushed for 3.14.x and earlier.
> 
> The accounts rewrite is still very much a work in progress and will require
> more discussion and testing, so it is premature to consider it a blocker for
> patches that implement current fixes -- particularly as it is preferable
> that patches destined for backporting to a maintenance branch show up in
> master first.
> 
> I don't see anything in Jonathan's patch that blocks anything proposed by
> the accounts rewrite.  If there is something, Kyle, this is your opportunity
> to speak up about it (although since you have already indicated that you
> believe it suitable for maintenance branches, I would assume that you don't
> know of any such blocker).
Comment 14 Galen Charlton 2013-12-05 18:47:09 UTC
Pushed to master.  Thanks, Jonathan!
Comment 15 Fridolin Somers 2013-12-17 17:28:35 UTC
This patch has been pushed to 3.14.x, will be in 3.14.1
(creates DBRev 3.14.00.003)
Comment 16 Katrin Fischer 2014-04-30 17:42:30 UTC
It looks like this needs a follow up for bootstrap! (bug 12165)