From 90749bba13d9e40e9b59d6e76c825d086fb5501f Mon Sep 17 00:00:00 2001
From: Kyle M Hall <kyle@bywatersolutions.com>
Date: Mon, 18 Jun 2012 08:15:59 -0400
Subject: [PATCH] [SIGNED-OFF] 8110 - Fines accruing on closed days - Fix Day/Month Holidays Bug

This patch fixes a bug in which day/month holidays are stored in the
Koha::Calendar internal hash not by month/day but incorrectly by day/month.

To test:
1) Apply 'Holidays Test Plan - DB Dependent' patch, create MPL
   holidays for Sunday, New Years Day, and Christmas.

2) Run test plan, only Christmas should fail ( New Years does not
   because 1-1 means the day and month position do not matter ).

3) Apply this patch

4) Run test plan again

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Test plan works as advertised.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Test runs flawlessly. I originaly missed to set the expected branchcode
---
 Koha/Calendar.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm
index f63e7eb..9a4c13a 100644
--- a/Koha/Calendar.pm
+++ b/Koha/Calendar.pm
@@ -45,7 +45,7 @@ sub _init {
     $repeat_sth->execute( $branch, 1 );
     $self->{day_month_closed_days} = {};
     while ( my $tuple = $repeat_sth->fetchrow_hashref ) {
-        $self->{day_month_closed_days}->{ $tuple->{day} }->{ $tuple->{month} } =
+        $self->{day_month_closed_days}->{ $tuple->{month} }->{ $tuple->{day} } =
           1;
     }
     my $special = $dbh->prepare(
-- 
1.7.2.5