Bug 18072 - Add Koha objects for Branch Transfer Limits
Summary: Add Koha objects for Branch Transfer Limits
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lari Taskula
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 7614
  Show dependency treegraph
 
Reported: 2017-02-07 14:37 UTC by Lari Taskula
Modified: 2019-10-14 19:56 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 18072: Add Koha objects for Branch Transfer Limit (3.93 KB, patch)
2017-02-07 14:41 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 18072: Add Koha::Item->can_be_transferred (5.63 KB, patch)
2017-02-07 14:41 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit functions (1.32 KB, patch)
2017-02-07 14:41 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 18072: Add Koha::Item->can_be_transferred (6.43 KB, patch)
2017-02-07 15:27 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 18072: Add Koha objects for Branch Transfer Limit (3.99 KB, patch)
2017-02-08 14:12 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit functions (1.38 KB, patch)
2017-02-08 14:12 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 18072: Add Koha::Item->can_be_transferred (6.49 KB, patch)
2017-02-08 14:12 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 18072: (QA-follow-up) let Koha::Item->can_be_transferred take HASHref as param (3.62 KB, patch)
2017-02-10 14:30 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 18072: Add Koha::Biblio->can_be_transferred (9.43 KB, patch)
2017-02-10 14:30 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 18072: Add Koha::Item->can_be_transferred (6.46 KB, patch)
2017-03-01 14:49 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 18072: (QA-follow-up) let Koha::Item->can_be_transferred take HASHref as param (3.62 KB, patch)
2017-03-01 14:51 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 18072: Add Koha::Biblio->can_be_transferred (9.43 KB, patch)
2017-03-01 14:51 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 18072: Add Koha objects for Branch Transfer Limit (3.99 KB, patch)
2017-05-24 07:26 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit functions (1.38 KB, patch)
2017-05-24 07:26 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 18072: Add Koha::Item->can_be_transferred (6.51 KB, patch)
2017-05-24 07:26 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 18072: (QA-follow-up) let Koha::Item->can_be_transferred take HASHref as param (3.67 KB, patch)
2017-05-24 07:27 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 18072: Add Koha::Biblio->can_be_transferred (9.60 KB, patch)
2017-05-24 07:27 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 18072: Add Koha::Biblio->can_be_transferred (9.61 KB, patch)
2017-09-01 12:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18072: Add Koha objects for Branch Transfer Limit (4.04 KB, patch)
2017-09-11 18:39 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit functions (1.43 KB, patch)
2017-09-11 18:39 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 18072: Add Koha::Item->can_be_transferred (6.56 KB, patch)
2017-09-11 18:39 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 18072: (QA-follow-up) let Koha::Item->can_be_transferred take HASHref as param (3.73 KB, patch)
2017-09-11 18:39 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 18072: Add Koha::Biblio->can_be_transferred (9.64 KB, patch)
2017-09-11 18:39 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 18072: (QA followup) Remove warning from tests (4.08 KB, patch)
2017-09-11 18:39 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 18072: Only accept Koha::Library in parameters (12.02 KB, patch)
2017-09-19 13:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18072: Add Koha objects for Branch Transfer Limit (4.08 KB, patch)
2018-06-22 13:52 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit functions (1.45 KB, patch)
2018-06-22 13:52 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 18072: Add Koha::Item->can_be_transferred (6.60 KB, patch)
2018-06-22 13:52 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 18072: (QA-follow-up) let Koha::Item->can_be_transferred take HASHref as param (3.76 KB, patch)
2018-06-22 13:52 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 18072: Add Koha::Biblio->can_be_transferred (9.61 KB, patch)
2018-06-22 13:52 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 18072: (QA followup) Remove warning from tests (4.14 KB, patch)
2018-06-22 13:52 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 18072: Only accept Koha::Library in parameters (12.05 KB, patch)
2018-06-22 13:52 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 18072: Add Koha objects for Branch Transfer Limit (4.14 KB, patch)
2018-06-22 14:44 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit functions (1.51 KB, patch)
2018-06-22 14:44 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 18072: Add Koha::Item->can_be_transferred (6.65 KB, patch)
2018-06-22 14:44 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 18072: (QA-follow-up) let Koha::Item->can_be_transferred take HASHref as param (3.81 KB, patch)
2018-06-22 14:44 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 18072: Add Koha::Biblio->can_be_transferred (9.67 KB, patch)
2018-06-22 14:44 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 18072: (QA followup) Remove warning from tests (4.20 KB, patch)
2018-06-22 14:44 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 18072: Only accept Koha::Library in parameters (12.10 KB, patch)
2018-06-22 14:44 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lari Taskula 2017-02-07 14:37:03 UTC
Add Koha objects for Branch Transfer Limits
Comment 1 Lari Taskula 2017-02-07 14:41:19 UTC
Created attachment 59979 [details] [review]
Bug 18072: Add Koha objects for Branch Transfer Limit

This patch also fixes documentation in Koha/Item/Transfer.pm and
Koha/Item/Transfers.pm.
Comment 2 Lari Taskula 2017-02-07 14:41:30 UTC
Created attachment 59980 [details] [review]
Bug 18072: Add Koha::Item->can_be_transferred

This patch adds a new method Koha::Item->can_be_transferred.

Includes unit test.

To test:
1. prove t/db_dependent/Koha/Items.t
Comment 3 Lari Taskula 2017-02-07 14:41:50 UTC
Created attachment 59981 [details] [review]
Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit functions
Comment 4 Lari Taskula 2017-02-07 15:27:08 UTC
Created attachment 59982 [details] [review]
Bug 18072: Add Koha::Item->can_be_transferred

This patch adds a new method Koha::Item->can_be_transferred.

Includes unit test.

To test:
1. prove t/db_dependent/Koha/Items.t
Comment 5 Josef Moravec 2017-02-08 14:12:11 UTC
Created attachment 60009 [details] [review]
Bug 18072: Add Koha objects for Branch Transfer Limit

This patch also fixes documentation in Koha/Item/Transfer.pm and
Koha/Item/Transfers.pm.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 6 Josef Moravec 2017-02-08 14:12:16 UTC
Created attachment 60010 [details] [review]
Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit functions

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 7 Josef Moravec 2017-02-08 14:12:21 UTC
Created attachment 60011 [details] [review]
Bug 18072: Add Koha::Item->can_be_transferred

This patch adds a new method Koha::Item->can_be_transferred.

Includes unit test.

To test:
1. prove t/db_dependent/Koha/Items.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 8 Jonathan Druart 2017-02-09 13:16:43 UTC
I'd suggest to swap $to, $from in the parameters.
  ->can_be_transferred( $from, $to )
sounds more logical.
When could even pass $hashref { from => $from, to => $to } to avoid ambiguity.

I am not sure the tests on the existence of the libraries are necessary.
Comment 9 Jonathan Druart 2017-02-09 13:19:29 UTC
(In reply to Josef Moravec from comment #6)
> Created attachment 60010 [details] [review] [review]
> Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit
> functions

Do you plan to replace this subroutine?
Comment 10 Lari Taskula 2017-02-09 14:03:20 UTC
(In reply to Jonathan Druart from comment #8)
> I'd suggest to swap $to, $from in the parameters.
>   ->can_be_transferred( $from, $to )
> sounds more logical.
> When could even pass $hashref { from => $from, to => $to } to avoid
> ambiguity.
I used this particular order because one may leave $from undefined, in which case the item's holdingbranch will be used as $from, and the typical use case would be simply $item->can_be_transferred($to). I agree with your point for the advantage of using hashref.

(In reply to Jonathan Druart from comment #9)
> (In reply to Josef Moravec from comment #6)
> > Created attachment 60010 [details] [review] [review] [review]
> > Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit
> > functions
> 
> Do you plan to replace this subroutine?
No. I would like to replace all of them and write proper tests for that, but unfortunately I don't have time to work with that now.
Comment 11 Lari Taskula 2017-02-10 14:30:35 UTC
Created attachment 60116 [details] [review]
Bug 18072: (QA-follow-up) let Koha::Item->can_be_transferred take HASHref as param

This patch changes Koha::Item->can_be_transferred to accept a HASHref as follows:
$item->can_be_transferred({ to => $library, from => $library2 })

To test:
1. prove t/db_dependent/Koha/Items.t
Comment 12 Lari Taskula 2017-02-10 14:30:58 UTC
Created attachment 60117 [details] [review]
Bug 18072: Add Koha::Biblio->can_be_transferred

This patch adds a new method Koha::Biblio->can_be_transferred. The method checks
if at least one of the item of that biblio can be transferred to desired location.

This method will be useful for building a smarter pickup location list for holds,
because we will be able to hide those libraries to which none of the items of
this biblio can be transferred to due to branch transfer limits (see Bug 7614).

To test:
1. prove t/db_dependent/Koha/Biblios.t
Comment 13 Lari Taskula 2017-03-01 14:49:41 UTC
Created attachment 60782 [details] [review]
Bug 18072: Add Koha::Item->can_be_transferred

This patch adds a new method Koha::Item->can_be_transferred.

Includes unit test.

To test:
1. prove t/db_dependent/Koha/Items.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 14 Lari Taskula 2017-03-01 14:51:14 UTC
Created attachment 60783 [details] [review]
Bug 18072: (QA-follow-up) let Koha::Item->can_be_transferred take HASHref as param

This patch changes Koha::Item->can_be_transferred to accept a HASHref as follows:
$item->can_be_transferred({ to => $library, from => $library2 })

To test:
1. prove t/db_dependent/Koha/Items.t
Comment 15 Lari Taskula 2017-03-01 14:51:27 UTC
Created attachment 60784 [details] [review]
Bug 18072: Add Koha::Biblio->can_be_transferred

This patch adds a new method Koha::Biblio->can_be_transferred. The method checks
if at least one of the item of that biblio can be transferred to desired location.

This method will be useful for building a smarter pickup location list for holds,
because we will be able to hide those libraries to which none of the items of
this biblio can be transferred to due to branch transfer limits (see Bug 7614).

To test:
1. prove t/db_dependent/Koha/Biblios.t
Comment 16 Lari Taskula 2017-03-01 14:51:45 UTC
Rebased on top of current master.
Comment 17 Josef Moravec 2017-05-24 07:26:47 UTC
Created attachment 63683 [details] [review]
Bug 18072: Add Koha objects for Branch Transfer Limit

This patch also fixes documentation in Koha/Item/Transfer.pm and
Koha/Item/Transfers.pm.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 18 Josef Moravec 2017-05-24 07:26:53 UTC
Created attachment 63684 [details] [review]
Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit functions

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 19 Josef Moravec 2017-05-24 07:26:58 UTC
Created attachment 63685 [details] [review]
Bug 18072: Add Koha::Item->can_be_transferred

This patch adds a new method Koha::Item->can_be_transferred.

Includes unit test.

To test:
1. prove t/db_dependent/Koha/Items.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 20 Josef Moravec 2017-05-24 07:27:04 UTC
Created attachment 63686 [details] [review]
Bug 18072: (QA-follow-up) let Koha::Item->can_be_transferred take HASHref as param

This patch changes Koha::Item->can_be_transferred to accept a HASHref as follows:
$item->can_be_transferred({ to => $library, from => $library2 })

To test:
1. prove t/db_dependent/Koha/Items.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 21 Josef Moravec 2017-05-24 07:27:09 UTC
Created attachment 63687 [details] [review]
Bug 18072: Add Koha::Biblio->can_be_transferred

This patch adds a new method Koha::Biblio->can_be_transferred. The method checks
if at least one of the item of that biblio can be transferred to desired location.

This method will be useful for building a smarter pickup location list for holds,
because we will be able to hide those libraries to which none of the items of
this biblio can be transferred to due to branch transfer limits (see Bug 7614).

To test:
1. prove t/db_dependent/Koha/Biblios.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 22 Jonathan Druart 2017-09-01 12:48:12 UTC
Created attachment 66724 [details] [review]
Bug 18072: Add Koha::Biblio->can_be_transferred

This patch adds a new method Koha::Biblio->can_be_transferred. The method checks
if at least one of the item of that biblio can be transferred to desired location.

This method will be useful for building a smarter pickup location list for holds,
because we will be able to hide those libraries to which none of the items of
this biblio can be transferred to due to branch transfer limits (see Bug 7614).

To test:
1. prove t/db_dependent/Koha/Biblios.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 23 Jonathan Druart 2017-09-01 12:48:39 UTC
Very easy conflict with bug 18292 fixed.
Comment 24 Tomás Cohen Arazi (tcohen) 2017-09-11 18:39:15 UTC
Created attachment 67049 [details] [review]
Bug 18072: Add Koha objects for Branch Transfer Limit

This patch also fixes documentation in Koha/Item/Transfer.pm and
Koha/Item/Transfers.pm.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 25 Tomás Cohen Arazi (tcohen) 2017-09-11 18:39:22 UTC
Created attachment 67050 [details] [review]
Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit functions

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 26 Tomás Cohen Arazi (tcohen) 2017-09-11 18:39:29 UTC
Created attachment 67051 [details] [review]
Bug 18072: Add Koha::Item->can_be_transferred

This patch adds a new method Koha::Item->can_be_transferred.

Includes unit test.

To test:
1. prove t/db_dependent/Koha/Items.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 27 Tomás Cohen Arazi (tcohen) 2017-09-11 18:39:35 UTC
Created attachment 67052 [details] [review]
Bug 18072: (QA-follow-up) let Koha::Item->can_be_transferred take HASHref as param

This patch changes Koha::Item->can_be_transferred to accept a HASHref as follows:
$item->can_be_transferred({ to => $library, from => $library2 })

To test:
1. prove t/db_dependent/Koha/Items.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 28 Tomás Cohen Arazi (tcohen) 2017-09-11 18:39:42 UTC
Created attachment 67053 [details] [review]
Bug 18072: Add Koha::Biblio->can_be_transferred

This patch adds a new method Koha::Biblio->can_be_transferred. The method checks
if at least one of the item of that biblio can be transferred to desired location.

This method will be useful for building a smarter pickup location list for holds,
because we will be able to hide those libraries to which none of the items of
this biblio can be transferred to due to branch transfer limits (see Bug 7614).

To test:
1. prove t/db_dependent/Koha/Biblios.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 29 Tomás Cohen Arazi (tcohen) 2017-09-11 18:39:49 UTC
Created attachment 67054 [details] [review]
Bug 18072: (QA followup) Remove warning from tests

This patch removes a warning from Items.t due to bad parameters. It also
makes the tests use Test::Exception.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 30 Jonathan Druart 2017-09-19 13:31:13 UTC
Created attachment 67209 [details] [review]
Bug 18072: Only accept Koha::Library in parameters

I do not think we should allowed branchode and Koha::Library objects, it
adds confusion in callers (we never know if we have a branchcode of a
library object).
Comment 31 Jonathan Druart 2017-09-19 13:32:03 UTC
(In reply to Jonathan Druart from comment #30)
> Created attachment 67209 [details] [review] [review]
> Bug 18072: Only accept Koha::Library in parameters
> 
> I do not think we should allowed branchode and Koha::Library objects, it
> adds confusion in callers (we never know if we have a branchcode of a
> library object).

Does this patch make sense?
Comment 32 Kyle M Hall (khall) 2018-06-22 13:52:16 UTC
Created attachment 76282 [details] [review]
Bug 18072: Add Koha objects for Branch Transfer Limit

This patch also fixes documentation in Koha/Item/Transfer.pm and
Koha/Item/Transfers.pm.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 33 Kyle M Hall (khall) 2018-06-22 13:52:24 UTC
Created attachment 76283 [details] [review]
Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit functions

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 34 Kyle M Hall (khall) 2018-06-22 13:52:28 UTC
Created attachment 76284 [details] [review]
Bug 18072: Add Koha::Item->can_be_transferred

This patch adds a new method Koha::Item->can_be_transferred.

Includes unit test.

To test:
1. prove t/db_dependent/Koha/Items.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 35 Kyle M Hall (khall) 2018-06-22 13:52:32 UTC
Created attachment 76285 [details] [review]
Bug 18072: (QA-follow-up) let Koha::Item->can_be_transferred take HASHref as param

This patch changes Koha::Item->can_be_transferred to accept a HASHref as follows:
$item->can_be_transferred({ to => $library, from => $library2 })

To test:
1. prove t/db_dependent/Koha/Items.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 36 Kyle M Hall (khall) 2018-06-22 13:52:36 UTC
Created attachment 76286 [details] [review]
Bug 18072: Add Koha::Biblio->can_be_transferred

This patch adds a new method Koha::Biblio->can_be_transferred. The method checks
if at least one of the item of that biblio can be transferred to desired location.

This method will be useful for building a smarter pickup location list for holds,
because we will be able to hide those libraries to which none of the items of
this biblio can be transferred to due to branch transfer limits (see Bug 7614).

To test:
1. prove t/db_dependent/Koha/Biblios.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 37 Kyle M Hall (khall) 2018-06-22 13:52:39 UTC
Created attachment 76287 [details] [review]
Bug 18072: (QA followup) Remove warning from tests

This patch removes a warning from Items.t due to bad parameters. It also
makes the tests use Test::Exception.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 38 Kyle M Hall (khall) 2018-06-22 13:52:43 UTC
Created attachment 76288 [details] [review]
Bug 18072: Only accept Koha::Library in parameters

I do not think we should allowed branchode and Koha::Library objects, it
adds confusion in callers (we never know if we have a branchcode of a
library object).
Comment 39 Kyle M Hall (khall) 2018-06-22 14:05:26 UTC
(In reply to Jonathan Druart from comment #31)
> (In reply to Jonathan Druart from comment #30)
> > Created attachment 67209 [details] [review] [review] [review]
> > Bug 18072: Only accept Koha::Library in parameters
> > 
> > I do not think we should allowed branchode and Koha::Library objects, it
> > adds confusion in callers (we never know if we have a branchcode of a
> > library object).
> 
> Does this patch make sense?

Yes, yes it does ;)
Comment 40 Kyle M Hall (khall) 2018-06-22 14:44:23 UTC
Created attachment 76292 [details] [review]
Bug 18072: Add Koha objects for Branch Transfer Limit

This patch also fixes documentation in Koha/Item/Transfer.pm and
Koha/Item/Transfers.pm.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 41 Kyle M Hall (khall) 2018-06-22 14:44:32 UTC
Created attachment 76293 [details] [review]
Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit functions

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 42 Kyle M Hall (khall) 2018-06-22 14:44:36 UTC
Created attachment 76294 [details] [review]
Bug 18072: Add Koha::Item->can_be_transferred

This patch adds a new method Koha::Item->can_be_transferred.

Includes unit test.

To test:
1. prove t/db_dependent/Koha/Items.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 43 Kyle M Hall (khall) 2018-06-22 14:44:41 UTC
Created attachment 76295 [details] [review]
Bug 18072: (QA-follow-up) let Koha::Item->can_be_transferred take HASHref as param

This patch changes Koha::Item->can_be_transferred to accept a HASHref as follows:
$item->can_be_transferred({ to => $library, from => $library2 })

To test:
1. prove t/db_dependent/Koha/Items.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 44 Kyle M Hall (khall) 2018-06-22 14:44:45 UTC
Created attachment 76296 [details] [review]
Bug 18072: Add Koha::Biblio->can_be_transferred

This patch adds a new method Koha::Biblio->can_be_transferred. The method checks
if at least one of the item of that biblio can be transferred to desired location.

This method will be useful for building a smarter pickup location list for holds,
because we will be able to hide those libraries to which none of the items of
this biblio can be transferred to due to branch transfer limits (see Bug 7614).

To test:
1. prove t/db_dependent/Koha/Biblios.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 45 Kyle M Hall (khall) 2018-06-22 14:44:49 UTC
Created attachment 76297 [details] [review]
Bug 18072: (QA followup) Remove warning from tests

This patch removes a warning from Items.t due to bad parameters. It also
makes the tests use Test::Exception.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 46 Kyle M Hall (khall) 2018-06-22 14:44:53 UTC
Created attachment 76298 [details] [review]
Bug 18072: Only accept Koha::Library in parameters

I do not think we should allowed branchode and Koha::Library objects, it
adds confusion in callers (we never know if we have a branchcode of a
library object).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 47 Nick Clemens (kidclamp) 2018-07-18 19:15:12 UTC
Awesome work all!

Pushed to master for 18.11
Comment 48 Martin Renvoize (ashimema) 2018-08-02 12:21:11 UTC
Enhancement, will not be backported to 18.05.x series.