Bug 16089

Summary: Acquisitions -> Invoice broken by Bug 15084
Product: Koha Reporter: Owen Leonard <oleonard>
Component: AcquisitionsAssignee: Marc Véron <veron>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: blocker    
Priority: P5 - low CC: brendan, jonathan.druart, julian.maurice, veron
Version: master   
Hardware: All   
OS: All   
URL: /cgi-bin/koha/acqui/invoice.pl?invoiceid=X
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 15084    
Bug Blocks:    
Attachments: Bug 16089: Acquisitions -> Invoice broken by Bug 15084
[SIGNED-OFF] Bug 16089: Acquisitions -> Invoice broken by Bug 15084
Bug 16089: (Follow up) Display currency symbol properly
Bug 16089: Acquisitions -> Invoice broken by Bug 15084
Bug 16089: (Follow up) Display currency symbol properly

Description Owen Leonard 2016-03-17 13:45:01 UTC
I'm getting an error from acqui/invoice.pl:

Software error:

Can't use string ("Koha::Acquisition::Currency") as a HASH ref while "strict refs" in use at /Koha/Object.pm line 248.

git bisect points to Bug 15084
Comment 1 Marc Véron 2016-03-17 14:29:03 UTC
Confirmed. Log says:

[Thu Mar 17 15:25:50 2016] invoice.pl: Use of uninitialized value in addition (+) at /usr/share/kohaclone/acqui/invoice.pl line 164., referer: http://192.168.1.24:8080/cgi-bin/koha/acqui/invoices.pl?op=do_search

[Thu Mar 17 15:25:50 2016] invoice.pl: Use of uninitialized value in addition (+) at /usr/share/kohaclone/acqui/invoice.pl line 164., referer: http://192.168.1.24:8080/cgi-bin/koha/acqui/invoices.pl?op=do_search

[Thu Mar 17 15:25:50 2016] invoice.pl: Can't use string ("Koha::Acquisition::Currency") as a HASH ref while "strict refs" in use at /usr/share/kohaclone/Koha/Object.pm line 248., referer: http://192.168.1.24:8080/cgi-bin/koha/acqui/invoices.pl?op=do_search
Comment 2 Marc Véron 2016-03-17 14:42:15 UTC
Seems to be related to invoice.pl line 181:
currency         => Koha::Acquisition::Currency->get_active->currency,

If I comment out this line, the error disappears.

However, curency is used 3 times in
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt
Comment 3 Marc Véron 2016-03-17 15:03:57 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2016-03-17 15:34:02 UTC Comment hidden (obsolete)
Comment 5 Owen Leonard 2016-03-17 15:39:26 UTC
Another issue I just noticed, and I assume it is at least related. In the table of invoice details where it used to show the currency code

Total tax exc. (USD)

it now reads 

Total tax exc. (Koha::Acquisition::Currency=HASH(0x7587d38))

A separate issue, or the fix is incomplete?
Comment 6 Marc Véron 2016-03-17 16:13:07 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2016-03-18 10:25:32 UTC
Created attachment 49305 [details] [review]
Bug 16089: Acquisitions -> Invoice broken by Bug 15084

To test:
- Reproduce error described in first comment.
- Apply patch
- Try to reproduce error. Page will display as expected.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2016-03-18 10:25:37 UTC
Created attachment 49306 [details] [review]
Bug 16089: (Follow up) Display currency symbol properly

This patch fixes the display of the currency symbol on invoice.tt

See comment #5

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2016-03-18 10:26:17 UTC
Thanks Marc for the patch, and Owen for the catch! :)
Comment 10 Jonathan Druart 2016-03-18 10:27:58 UTC
  git grep 'Currency->get_active'
does not return any results with this patch applied.
Comment 11 Brendan Gallagher 2016-03-21 16:06:35 UTC
Pushed to Master - Should be in the May 2016 Release.  Thanks!
Comment 12 Julian Maurice 2016-03-23 06:30:24 UTC
Does not concern stable versions, status changed to RESOLVED