Bug 12415 - Fee receipt: description of charges is empty
Summary: Fee receipt: description of charges is empty
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 2546
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-13 09:17 UTC by Jonathan Druart
Modified: 2015-06-04 23:33 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 12415: Fee receipt: a charges description should be displayed in all cases (5.54 KB, patch)
2014-06-13 10:20 UTC, Jonathan Druart
Details | Diff | Splinter Review
account line (13.92 KB, image/png)
2014-06-18 20:25 UTC, Nicole C. Engard
Details
receipt for account line (26.21 KB, image/png)
2014-06-18 20:25 UTC, Nicole C. Engard
Details
Payment Thanks value entered into accountlines.description (896.17 KB, application/zip)
2014-09-11 10:31 UTC, Nick Clemens
Details
Bug 12415: Fee receipt: a charges description should be displayed in all cases (7.37 KB, patch)
2014-09-15 11:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED OFF] Bug 12415: Fee receipt: a charges description should be displayed in all cases (7.44 KB, patch)
2014-09-18 19:01 UTC, Nick Clemens
Details | Diff | Splinter Review
[PASSED QA] Bug 12415: Fee receipt: a charges description should be displayed in all cases (7.81 KB, patch)
2014-10-15 20:59 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 12415: Fee receipt: a charges description should be displayed in all cases (6.53 KB, patch)
2014-11-21 19:29 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2014-06-13 09:17:37 UTC

    
Comment 1 Jonathan Druart 2014-06-13 09:19:45 UTC
Bug 2546 removes the description DB field in some case (3.15.00.003).
But the receipt generated by scripts members/printfeercpt.pl and members/printinvoice.pl display this field.
When the description field is empty, the default value (based on accountlines.accounttype) should be displayed.
Comment 2 Jonathan Druart 2014-06-13 10:20:20 UTC Comment hidden (obsolete)
Comment 3 Nicole C. Engard 2014-06-18 20:25:06 UTC
I tested this and what I got is in the attached images.  I see a description on the account tab, but when I go to print I see payment thanks 2 times - without the patch I see payment thanks 1 time - but I never see the full description that I see on the accounts tab.
Comment 4 Nicole C. Engard 2014-06-18 20:25:19 UTC
Created attachment 28958 [details]
account line
Comment 5 Nicole C. Engard 2014-06-18 20:25:36 UTC
Created attachment 28959 [details]
receipt for account line
Comment 6 Jonathan Druart 2014-06-19 08:26:16 UTC
(In reply to Nicole C. Engard from comment #3)
> I tested this and what I got is in the attached images.  I see a description
> on the account tab, but when I go to print I see payment thanks 2 times -
> without the patch I see payment thanks 1 time - but I never see the full
> description that I see on the accounts tab.

Hi Nicole,
This means you have "Payment,Thanks" in one or more accountlines.description fields.
The updatedb entry of bug 2546 should have removed them.
Did you get error on updating your DB? Are you sure this updatedb entry have been executed?
Comment 7 Nicole C. Engard 2014-06-19 13:18:25 UTC
(In reply to Jonathan Druart from comment #6)
> Hi Nicole,
> This means you have "Payment,Thanks" in one or more accountlines.description
> fields.
> The updatedb entry of bug 2546 should have removed them.
> Did you get error on updating your DB? Are you sure this updatedb entry have
> been executed?

I'm never 100% sure about anything :) but I can tell you that all other things that have been fixed since then are updated in my db. So I have the new sys prefs and the new version number and many other updates to my db so I should have that one as well.  I did a fresh fetch right before applying the patch.

Nicole
Comment 8 Jonathan Druart 2014-06-20 08:22:46 UTC
I switch back to needs signoff to get some more feedbacks.
The accountlines.description should not contain this string.
Comment 9 Nick Clemens 2014-09-11 00:51:44 UTC
Hi Jonathan,

I tested a bit and can recreate the doubled "Payment, Thanks" by simply partially paying a fine.  For any payment that doesn't zero out the remaining balance the "Payment, Thanks" is added into accountlines.description. 

I also noted that manual credits show only 'C' in the receipt description if no other info is entered.

-Nick
Comment 10 Jonathan Druart 2014-09-11 09:20:45 UTC
I am sorry but I cannot recreate.
Could you please detail step by step or with screenshot/screencast?
Comment 11 Nick Clemens 2014-09-11 10:26:53 UTC
Here was my test plan:

1 - Create a manual invoice - Lost Item, $5.00
2 - Pay fine partially, $2.50
3 - Switch to account tab - Payment, Thanks appears twice in description
4 - Check database via repot (SELECT * FROM accountlines WHERE borrowernumber=5)

I tested again with a manual invoice - Fine and got the same results, zip of screenshots will be attached
Comment 12 Nick Clemens 2014-09-11 10:31:59 UTC
Created attachment 31525 [details]
Payment Thanks value entered into accountlines.description

Sequential screenshots of how I got the error
Comment 13 Jonathan Druart 2014-09-15 11:54:33 UTC Comment hidden (obsolete)
Comment 14 Jonathan Druart 2014-09-15 11:55:03 UTC
(In reply to Nick Clemens from comment #12)
> Created attachment 31525 [details]
> Payment Thanks value entered into accountlines.description
> 
> Sequential screenshots of how I got the error

Thanks, very useful!
This should be fixed with the last patch.
Comment 15 Nick Clemens 2014-09-15 15:53:51 UTC
Yep, I cannot recreate the 'Payment, Thanks' error

I still notice that if I use the "Create Manual Credit" tab to add a credit type of either 'Credit' or 'Forgiven' the description on the receipt does not match the display in the account tab.

For 'Credit' the receipt displays 'C'
For 'Forgiven' the receipt displays 'FOR'

Last notes may be beyond this bug:
1 - The 'description' field on the 'Create manual invoice' tab prefills to the type code for any type except 'Lost item' (i.e 'F' for fine, 'A' for 'Account manag...')  It seems to me that with this patch there is no reason not to leave that field empty
2 - Copier fees description defaults to 'Copier fees' and the amount to "0.25" which is just an odd assumption unless that is configurable.  Additionally, the account type for 'Copier Fees' shows as 'Copie' in both the accounts tab and on receipts.  For English that should probably be either 'Copy' or stay with 'Copier fees'
Comment 16 Jonathan Druart 2014-09-16 07:20:50 UTC
Nick,
What you described looks to be something else to fix.
Maybe you could open a new bug report with the different issues listed.
Comment 17 Nick Clemens 2014-09-18 19:01:12 UTC Comment hidden (obsolete)
Comment 18 Nick Clemens 2014-09-18 19:01:59 UTC
Other issues reported as Bug 12960 and Bug 12961
Comment 19 Katrin Fischer 2014-10-15 20:59:51 UTC Comment hidden (obsolete)
Comment 20 Katrin Fischer 2014-11-21 19:29:52 UTC
Created attachment 33800 [details] [review]
Bug 12415: Fee receipt: a charges description should be displayed in all cases

Bug 2546 removes the description DB field value in some case (3.15.00.003).
But the receipt generated by scripts members/printfeercpt.pl and
members/printinvoice.pl displays this field.
When the description field is empty, the default value (based on
accountlines.accounttype) should be displayed.

Test plan:
- Generate and pay some different kinds of fees for a patron without
  filling the 'description' field.
- In Fines>Account, click on the 'print' link.
- Before this patch, the "description of charges" values is empty if no
  description was given.
  It is a regression introduced by bug 2546, a default value was
  inserted in the description field depending on the account type
  selected.
- After this patch, the "description of charges" values should be based
  on the account type. The string display on printing receipt should be
  the same as on the account screen (staff and opac).

Note for QA: If removed the "payment" key, it is not used in template
and generated a warning ("odd number of elements...").

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This fixes the display of payments and other charges on the
fines slip.

Note: This patch fixes a line where the description in the
database was still updated to say "Payment thanks" for partial
payments. It might be worth to do a follow-up correcting the
accountlines table and removing the unwanted comment (see bug 2546).
Comment 21 Katrin Fischer 2014-11-21 19:30:55 UTC
Rebased patch: The original patch included a typo fix in an opac prog template file that is no longer needed. Also checked bootstrap, the strings are already fixed there.
Comment 22 Tomás Cohen Arazi 2014-11-21 23:33:48 UTC
Patch pushed to master

Thanks Jonathan!