HomeOrHolding Branch system preference was not used in TooMany
Thus, Circulation Rules were always checked against homebranch and not
on the system preference designed field
---
 C4/Circulation.pm |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index 98f324c..84814a6 100644
--- a/C4/Circulation.pm
+++ b/C4/Circulation.pm
@@ -403,7 +403,8 @@ sub TooMany {
             } elsif (C4::Context->preference('CircControl') eq 
'PatronLibrary') {
                 ; # if branch is the patron's home branch, then count all 
loans by patron
             } else {
-                $count_query .= " AND items.homebranch = ? ";
+                               my 
$branchfield=C4::Context->Preference('HomeOrHoldingBranch')||"homebranch";
+                $count_query .= " AND items.$branchfield = ? ";
                 push @bind_params, $branch;
             }
         }
@@ -433,7 +434,8 @@ sub TooMany {
         } elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') {
             ; # if branch is the patron's home branch, then count all loans by 
patron
         } else {
-            $branch_count_query .= " AND items.homebranch = ? ";
+                       my 
$branchfield=C4::Context->Preference('HomeOrHoldingBranch')||"homebranch";
+            $branch_count_query .= " AND items.$branchfield = ? ";
             push @bind_params, $branch;
         }
         my $branch_count_sth = $dbh->prepare($branch_count_query);
-- 
1.6.3.3

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches

Reply via email to