Koha/t/db_dependent/Circulation
Kyle M Hall 2c67648093 Bug 17781 - Improper branchcode set during renewal
For no discernable reason, when AddIssue calls AddRenewal, it passes the
branchcode generated from _GetCircControlBranch. Assume
_GetCircControlBranch is set to return items.homebranch. So:
1) If an item owned by LibraryA is checked out at LibraryB, the
  statistic line branchcode will be LibraryB
2) If an item is renewed via the ajax datatables renewal function, the
  statistic line branchcode will be LibraryB the
3) If an item is renewed via scanning the item into the checkout again,
  statistic line branchcode will be *LibraryA*

This is clearly improper behavior. The renewal is taking place at
LibraryB, so the branchcode passed to AddRenewal should be LibraryB,
the logged in library. This also jives with the documentation for
the subroutine.

Test Plan:
1) Set CircControl to "the library the item is from" aka ( ItemHomeLibrary )
2) Set HomeOrHoldingBranch to 'The library the items is from" ( aka homebranch )
3) Create item with homebranch of LibraryA and holdingbranch of LibraryB
4) Set the logged in library to LibraryB
4) Check the item out to a patron at LibraryB
5) Note the statistics line has a branchcode of LibraryB
6) Check the item out again to trigger a renewal, renew the item
7) Note the statistic line has a branchcode of LibraryA!
8) Apply this patch
9) Repeat step 6
10) Note the statistics line has a branchcode of LibraryB!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: David Kuhn <kuhn@monterey.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-12-28 13:35:46 +00:00
..
IssuingRules Bug 17599: Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule 2016-11-15 15:41:43 +00:00
AnonymiseIssueHistory.t Bug 16155: Adjust a few other tests 2016-05-04 13:47:58 +00:00
Branch.t Bug 17599: Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule 2016-11-15 15:41:43 +00:00
CalcDateDue.t Bug 12787: (QA followup) small QA fixes 2016-04-22 00:54:35 +00:00
CalcFine.t Bug 16155: Adjust a few other tests 2016-05-04 13:47:58 +00:00
CheckIfIssuedToPatron.t Bug 17653: Remove itemtype-related t/db_dependent/Circulation* warnings 2016-11-18 14:02:49 +00:00
CheckValidBarcode.t Bug 15629: Koha::Libraries - Remove ModBranch 2016-02-24 03:55:06 +00:00
dateexpiry.t Bug 12787: Reorganise t/db_dependent files 2016-04-22 00:54:35 +00:00
GetHardDueDate.t Bug 17599: Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule 2016-11-15 15:41:43 +00:00
GetPendingOnSiteCheckouts.t Bug 17678: C4::Circulation - Replace GetIssues with Koha::Issues 2016-12-23 11:46:20 +00:00
GetTopIssues.t Bug 11998: Use t::lib::Mocks::mock_preference in tests 2016-03-15 07:08:28 +00:00
IsItemIssued.t Bug 17653: Remove itemtype-related t/db_dependent/Circulation* warnings 2016-11-18 14:02:49 +00:00
issue.t Bug 17781 - Improper branchcode set during renewal 2016-12-28 13:35:46 +00:00
MarkIssueReturned.t Bug 17430: Make MarkIssueReturned.t create its own data 2016-10-17 22:55:37 +00:00
NoIssuesChargeGuarantees.t Bug 17633: Do not call set_preference from tests 2016-11-16 15:31:01 +00:00
OfflineOperation.t Bug 12787: Reorganise t/db_dependent files 2016-04-22 00:54:35 +00:00
Returns.t Bug 17633: (QA followup) Remove unneeded warnings 2016-11-16 15:31:01 +00:00
SwitchOnSiteCheckouts.t Bug 15758: (QA followup) Remove leftover reference to C4::Branch 2016-09-09 14:46:22 +00:00
TooMany.t Bug 17599: Make the tests pass 2016-11-15 15:54:24 +00:00
transfers.t Bug 17653: Remove itemtype-related t/db_dependent/Circulation* warnings 2016-11-18 14:02:49 +00:00