Bug 16089 - Acquisitions -> Invoice broken by Bug 15084
Summary: Acquisitions -> Invoice broken by Bug 15084
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low blocker (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL: /cgi-bin/koha/acqui/invoice.pl?invoic...
Keywords:
Depends on: 15084
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-17 13:45 UTC by Owen Leonard
Modified: 2019-06-27 09:24 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16089: Acquisitions -> Invoice broken by Bug 15084 (1.01 KB, patch)
2016-03-17 15:03 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16089: Acquisitions -> Invoice broken by Bug 15084 (1.11 KB, patch)
2016-03-17 15:34 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16089: (Follow up) Display currency symbol properly (2.02 KB, patch)
2016-03-17 16:13 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 16089: Acquisitions -> Invoice broken by Bug 15084 (1.13 KB, patch)
2016-03-18 10:25 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16089: (Follow up) Display currency symbol properly (2.09 KB, patch)
2016-03-18 10:25 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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