Bug 10664 - Software error in overdue_notices.pl if there is no active currency
Summary: Software error in overdue_notices.pl if there is no active currency
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P4 normal (vote)
Assignee: Sophie MEYNIEUX
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-31 06:00 UTC by Sophie MEYNIEUX
Modified: 2014-12-07 20:02 UTC (History)
5 users (show)

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


Attachments
Bug 10664 : Software error in overdue_notices.pl if there is no active currency (1.58 KB, patch)
2013-07-31 06:09 UTC, Sophie MEYNIEUX
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 10664 : Software error in overdue_notices.pl if there is no active currency (1.63 KB, patch)
2013-08-01 06:12 UTC, Srdjan Jankovic
Details | Diff | Splinter Review
Bug 10664 : Software error in overdue_notices.pl if there is no active currency (1.68 KB, patch)
2013-08-16 11:23 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 10664 [QA Followup] - Software error in overdue_notices.pl if there is no active currency (1.09 KB, patch)
2013-08-16 11:23 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Sophie MEYNIEUX 2013-07-31 06:00:48 UTC
Bug introduced by http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8378

If there is no active currency, when running overdue_notices.pl you get a sofware error "Can't use an undefined value as a HASH reference" on GetCurrency() function call
Comment 1 Sophie MEYNIEUX 2013-07-31 06:09:50 UTC Comment hidden (obsolete)
Comment 2 Srdjan Jankovic 2013-08-01 06:12:13 UTC Comment hidden (obsolete)
Comment 3 Srdjan Jankovic 2013-08-01 06:14:37 UTC
Currency stuff should be moved out of Budgets.pm ASAP. It is ridiculous for Output.pm to depend on Budgets.pm
Comment 4 Kyle M Hall 2013-08-16 11:23:17 UTC
Created attachment 20396 [details] [review]
Bug 10664 : Software error in overdue_notices.pl if there is no active currency

If there is no active currency, when running overdue_notices.pl you get a sofware error "Can't use an undefined value as a HASH reference" on GetCurrency() function call

With this patch, if there is no active currency, fines are formated by default 0,00 and notices are correctly generated.

Test plan :
- have at least one borrower with overdue that should trigger a notice
- verify that there is no active currency (Adminitration > Currency & Exchange rates)
- run misc/cronjobs/overdue_notices.pl -v -n (to get the notice directly on output)

=> without the patch you get the software error
=> with the patch, notices are correctly generated

If an active currency is defined, the script overdue_notices.pl runs the same with or without patch

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Kyle M Hall 2013-08-16 11:23:29 UTC
Created attachment 20397 [details] [review]
Bug 10664 [QA Followup] - Software error in overdue_notices.pl if there is no active currency

Fixes the following koha-qa.pl error:
 FAIL   misc/cronjobs/overdue_notices.pl
    OK     pod
    OK     forbidden patterns
    OK     valid
    FAIL   critic
               # Variables::ProhibitConditionalDeclarations:
Comment 6 Galen Charlton 2013-08-16 14:40:04 UTC
Pushed to master.  Thanks, Sophie!
Comment 7 Tomás Cohen Arazi 2013-08-23 18:48:51 UTC
This patch has been pushed to 3.12.x, will be in 3.12.4.

Thanks Sophie!
Comment 8 Bernardo Gonzalez Kriegel 2013-09-14 19:09:45 UTC
Pushed to 3.10.x, will be in 3.10.11
Comment 9 Chris Hall 2013-10-20 06:58:10 UTC
Pushed to 3.8.x, will be in 3.8.19