Commit graph

7 commits

Author SHA1 Message Date
Jonathan Druart
89eb48b1e1 Bug 10859: (follow-up) GetIssues.t - Execute unit tests in a transaction
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-21 05:30:25 +00:00
Jonathan Druart
b7d47ac66b Bug 10859: Alert if a borrower already has an issue for the same biblio
This patch adds a new system preference, AllowMultipleIssuesOnABiblio.

If this system preference is OFF, an alert is raised if a patron
tries to check out an item even when they already have a different
item checked out from that bib.

The librarian can force the checkout anyway.

It doesn't alert the librarian if the biblio is a subscription

Test plan:
1. Create a biblio with at least 2 items
2. Checkout the first item for a borrower
3. Set syspref AllowMultipleIssuesOnABiblio to OFF.
4. Try to checkout the second item with the same borrower. A message
should appear telling you that this borrower already borrowed an item
from this biblio.
If you have the permission 'force_checkout' You should also see two
buttons to confirm (or not) the checkout
5. Click on 'No'. The checkout is not done
6. Repeat step 4 and click 'Yes', the checkout is done.
7. Return the second item.
8. Set syspref AllowMultipleIssuesOnABiblio to ON
9. Try to checkout the second item with the same borrower. This time
the checkout is done without warnings.

Followed test plan. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass, works well. Tested:

* Permission to override
  * check out a second item from a record with subscriptions works
  * check out a second item from a 'normal' record is warned about,
  but can be done

* No permission to override
  * subscription item: can be checked out
  * normal item: can't be checked out

* Feature turned off
  * Check out never warns/blocks

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-21 05:28:05 +00:00
Jonathan Druart
25451ce624 Bug 11630: (follow-up) unit tests can be independent of DB
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-16 14:55:39 +00:00
31995cbcd1 Bug 11630: (QA Followup) Move code to subroutine, add unit tests
Patch behaves as expected.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-16 14:55:08 +00:00
Galen Charlton
18888359b6 Bug 11338: add unit tests for DelItemCheck
This patch adds unit tests for two parts of DelItemCheck: checking
if the item is on loan, and checking if it is waiting on the hold
shelf.

To test:

[1] Verify that prove -v t/db_dependent/Circulation/IsItemIssued.t
    is successful.
[2] Verify that prove -v t/db_dependent/Reserves.t is *not*
    successful -- as it turns out, there was a latent bug where items
    waiting on the hold shelf or in transit to fill a hold could still
    be deleted without any warning.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-12-25 17:07:53 +00:00
Galen Charlton
304b8d7de3 Bug 10599: (follow-up) fix incomplete test case
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-09-18 16:56:23 +00:00
Jonathan Druart
5ed940b18e Bug 10599: add option to unselect on loan items on the batch item modification tool
Sometimes when using the batch item modification tool, we would like to
automatically uncheck on loan items.

This patch also adds a new routine in C4::Circulation, IsItemIssued(),
which, when passed an itemnumber, returns whether the item is
currently on loan.

Test plan:
1/ Go to tools/batchMod.pl.
2/ Enter some barcode (at least 1 should be on loan).
3/ Click on the Continue button.
4/ Click on the "Clear on loan" link.
5/ Check that on loan items are unchecked.

Launch the unit test file:
prove t/db_dependent/Circulation/IsItemIssued.t

http://bugs.koha-community.org/show_bug.cgi?id=10572
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Works as expected, only modifies items that are checked (still). No regression noted.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-09-18 16:45:24 +00:00