[Koha-patches] [PATCH 12/55] CirculationRule : TooMany HomeOrHoldingBranch mgt
Henri-Damien LAURENT
henridamien.laurent at biblibre.com
Wed Mar 10 22:25:54 CET 2010
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
More information about the Koha-patches
mailing list