Bug 10664: fix error in overdue_notices.pl if there is no active currency
authorSophie Meynieux <sophie.meynieux@biblibre.com>
Wed, 31 Jul 2013 06:04:25 +0000 (08:04 +0200)
committerChris Hall <followingthepath@gmail.com>
Sun, 20 Oct 2013 06:57:04 +0000 (19:57 +1300)
commit3f3785575c3c2137aef5bde6216eb65d4719137e
tree70e12695e97a2c74608a50da61f66bd1c3f9cf47
parent729cd95fc5baebdb7f3578e8ffabdfe06a5deb67
Bug 10664: fix 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>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a9a3bb7b3d7e8e862cf0f772246667258a20b786)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 5e12ca5684ee19c54685a4dc935fb242eaf0c3bc)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 5e12ca5684ee19c54685a4dc935fb242eaf0c3bc)
misc/cronjobs/overdue_notices.pl