Commit graph

5074 commits

Author SHA1 Message Date
c0e6f2526e
Bug 31333: Unit tests
Test plan:
1. Run tests (Categories.t has been updated by me, and I suggest running
Suggestions.t to confirm it still passes):

sudo koha-shell kohadev
prove t/db_dependent/Koha/Patron/Categories.t
prove t/db_dependent/Koha/Suggestions.t

Sponsored-by: Catalyst IT, New Zealand

Signed-off-by: Rhonda Kuiper <rkuiper@roundrocktexas.gov>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-04 08:44:25 -03:00
640814c4cf
Bug 25936: (QA follow-up) Spelling and wording
[1] NotifyPassowrdChange => NotifyPasswordChange
[2] Someone has changed your library user account password.
    Scary? Changed it myself. Reworded it a bit.
[3] is( $THE_notice->status, 'failed', "The notice was sent immediately");
    Note that THE_notice is imo horrible :) Wont touch it though.
    But I think we should reword 'sent' since it just failed.
    And we actually should mock sending mail here. Adding FIXME.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-03 14:25:43 -03:00
1cea470b67
Bug 25936: Unit tests
This patch adds a unit test to check that the notice is enqueued and
sending is attempted immediately.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-03 14:25:42 -03:00
762fa03432
Bug 30646: Unit tests for Auth_with_ldap
This patch adds a unit test to the Auth_with_ldap.t to confirm welcome
notices are send when replace + welcome are enabled in the
configuration.

We also add a snippet to hide 'Subroutine redefined' warnings in this
test as it makes the test output rather challenging to read and the way
the test is written these warning are expected.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-03 14:02:40 -03:00
76bf4a898e
Bug 23538: (follow-up) Workaround to fix Patron.t
See comment36 and comment37. This needs more attention but
serves as a quick fix only.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-03 12:28:39 -03:00
499562f0b8
Bug 31593: Remove Test::DBIx::Class from Context.t
No need to keep it.
Fixing a test description too.

Test plan:
Run t/db_dependent/Context.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-03 11:43:58 -03:00
Frank Hansen
772cadd595
Bug 30280: Add Unit tests
Sponsored-by: Lund University Library, Sweden

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-03 10:00:12 -03:00
Julian Maurice
389b9dfaf4
Bug 31441: Fix Koha::Item::as_marc_field when kohafield = ''
marc_subfield_structure.kohafield can be NULL, but it can also be an
empty string. But in that case, Koha::Item::as_marc_field ignores them,
which means the resulting MARC::Field object has missing data.
This can produce a bug in OPAC ISBD view (and probably other places
where this method is used)

Test plan:
1. Edit the default biblio MARC framework for the item field: find or
   create a subfield that is not linked to a DB column.
   Save even if you made no changes to make sure that
   marc_subfield_structure.kohafield is set to an empty string.
   I'll use 995$Z as an example for the following steps.
2. Add the following to syspref OPACISBD:
    #995|<br>Item:|{995Z}|
3. Create a biblio with an item and put a value into 995$Z
4. Go to the ISBD detail page for this record at OPAC. Confirm that the
   value you entered in 995$Z is not visible
5. Apply patch and restart koha
6. Refresh the ISBD detail page. Confirm that the 995$Z is now visible.
7. Run `prove t/db_dependent/Koha/Item.t`

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-03 08:40:01 -03:00
6f8088805d
Bug 30571: Z3950Servers.t - Add another subtest
Subtest for testing nullability of host, syntax and encoding.

Test plan:
Run prove t/db_dependent/Koha/Z3950Servers.t.
(Note: you need strict mode to pass this test.)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-03 08:29:25 -03:00
c24a67a28d
Bug 30571: Z3950Servers.t - Create subtest for existing tests
No real changes, just moving code and indentation.
Ground work for following patch.

Test plan:
To let the test pass, disable strict_mode in koha-conf.
Run perl t/db_dependent/Koha/Z3950Servers.t. Should pass now.
However, in strict mode or with prove, it should fail.
Run prove t/db_dependent/Koha/Z3950Servers.t. Failed?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-03 08:29:24 -03:00
Julian Maurice
a4f09abd5c
Bug 25375: Fix QueryBuilder.t tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-26 09:53:23 -03:00
aa4dc15b97
Bug 31105: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-23 09:56:46 -03:00
3f70c9d6bc
Bug 23538: Unit tests
Test plan:
1. Run unit tests:
sudo koha-shell <instance>
cd t/db_dependent/Koha
prove -v Patron.t

Sponsored-by: Catalyst IT

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-23 09:37:54 -03:00
87012104bd
Bug 30484: (follow-up) Fix tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-23 09:33:48 -03:00
Andrew Isherwood
3b8a4f21be
Bug 30484: Add unit tests
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

https://bugs.koha-community.org/show_bug.cgi?id=28909
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-23 09:18:46 -03:00
471facdf26
Bug 25375: Adjust tests and test itemlost, not notforloan
Previous commit correctly lists Zebra availability test, but was a
bad edit. This fixes the availability test to use itemlost

Additiionally, tests were written before limits were agreed. Adjusted
for the current settings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-23 09:01:25 -03:00
Julian Maurice
f48c5bbb8b
Bug 25375: Add tests for the "available" ES field
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-23 09:01:24 -03:00
aac6a2f155
Bug 30982: (QA follow-up) No userenv, no jobs
+    # Assume permission if context has no user
+    my $can_manage_background_jobs = 1;
=> This felt a bit unsafe.

Test plan:
Try interface for jobs. Call API with cookie. Call API with OAuth.
Run t/db_dependent/Koha/BackgroundJobs.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-23 08:57:51 -03:00
88cc881521
Bug 30982: API tweaks
This patch makes the following changes to the 'background_jobs' API:

* We now call them 'jobs'
* Removed deprecated query parameter definitions
* Added only_current query parameter
* Controller gets adapted to use $rs->filter_by_current when
  only_current is passed

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-23 08:57:49 -03:00
c1c9700c63
Bug 30982: Add Koha::BackgroundJobs->filter_by_current
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-23 08:57:49 -03:00
b9b3b93d93
Bug 30982: Add tests and implement GET /background_jobs/$id
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-23 08:57:48 -03:00
Julian Maurice
ca338bae1e
Bug 27550: Add unit test for CloneBudgetHierarchy
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-22 08:18:43 -03:00
9a92ee3194
Bug 31598: Fix random failure on Jenkins for Upload.t
At some point the warn is made conditional for permanent
files. So it failed when TestBuilder picked a zero value
for permanent. Trivial fix.

Test plan:
Run t/db_dependent/Upload.t a few times

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-22 08:07:01 -03:00
b1e3398e84
Bug 30359: Unit tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-21 19:02:22 -03:00
848813bccf
Bug 27421: (follow-up) Add exec flag
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-19 15:14:57 -03:00
89e4e2906a
Bug 27421: Add tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-19 15:14:57 -03:00
d8b15c685c
Bug 30025: Split BiblioAddsAuthorities into two sysprefs
This patch adds two new sysprefs:
AutoLinkBiblios
AllowManualAuthorityEditing

Both inherit the setting from BiblioAddsAuhtorities which is removed

To test:
1 -Apply patches
2 - Update database
3 - Confirm old setting is transferred to new option
4 - Confirm you can edit authoriteis manually if AllowManualAuthorityEditing set to allow
5 - Confirm you cannot edit authorities manually if AllowManualAuthorityEditing set to don't allow
6 - Confirm a new bib is linked when AutoLinkBiblios is enabled (set AllowManualAuthorityEditing to add unlinked heading)
7 - Confirm new bib notlinked when AutoLinkBiblios is disabled
8 - Confim new bib not linked when AutoLinkBiblios is enabled, but heading doesn't match an authority and  AutoCreateAuthorities is disabled
9 - Confim new bib linked to new authority when AutoLinkBiblios is enabled, but heading doesn't match an authority and  AutoCreateAuthorities is enabled

Signed-off-by: AFHDubCoLib <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-16 16:48:30 -03:00
2a1d85fc32
Bug 15348: Add estimated delivery date field to individual orders
This patch allows you to specify an estimated delivery date per order.
The specified estimated delivery date is also considered when searching
for late orders and exporting late orders. You can also edit the
estimated delivery date from the late orders page.

Test plan:
1. Update database, rebuild schema, restart services
2. Go to Acquisitions, search for a vendor, and create a new basket
3. Add an order to the basket. When filling in the accounting details,
notice the new 'estimated delivery date' field, but don't add a date.
Save the order.
4. Confirm no date shows in the estimated delivery date column in the
orders table.
5. Modify the order. Add a date in the estimated delivery date field and
save the order.
6. Confirm the date now shows in the orders table.
7. Close the basket.
8. Go to the Late Orders page.
9. Put estimated delivery date from and to parameters in the search
filters on the left. Ensure the from and to dates encapsulate the date
you entered in the estimated delivery date field for the order.
10. Click Filter and ensure the order shows.
11. Select the checkbox next to the order. Click the Export as CSV button.
12. Open the CSV and confirm the estimated delivery date that you
entered shows as expected in the file.
13. Click Edit under the estimated delivery date. Confirm the estimated
delivery date modal pops up with the correct order line number in the
modal header.
14. Remove the estimated delivery date and click Save.
15. Confirm that the estimated delivery date calculated by Koha now
shows in the late orders table.
16. Select the checkbox next to the order. Click the Export as CSV button.
17. Open the CSV and confirm the calculated estimated delivery date
shows in the CSV.
18. Confirm tests pass: t/db_dependent/Koha/Acquisition/Order.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-16 10:36:53 -03:00
2ed25b7442
Bug 29144: Remove opac_info from a few tests
Test plan:
Run t/db_dependent/Circulation/GetHardDueDate.t
Run t/db_dependent/Circulation/OfflineOperation.t
Run t/db_dependent/RotatingCollections.t
Run t/db_dependent/api/v1/libraries.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-16 09:55:20 -03:00
68a900132e
Bug 29144: Add $contents->find_best_match, $library->opac_info
Test plan:
Run t/db_dependent/Koha/AdditionalContents.t
Run t/db_dependent/Koha/Library.t

Note: You may need to set ListOwnershipUponPatronDeletion to
delete to fix a pending issue in patron->delete with lists.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-16 09:55:19 -03:00
14cfdfd727 Bug 31236: Add ability to send custom item fields via SIP using Template Toolkit
Koha has been able to send arbitrary item fields via the "item_field" parameter in the config. We have partners that need the ability to created custom item fields from templates, as the item_fields feature cannot accomplish what they need. We need to add a templated custom field feature for items, similar to what we have for patrons.

Test Plan:
1) Apply this patch
2) Choose a SIP login to use, edit that account and add the following
   *inside* the login section:
   <custom_item_field field="IN" template="[% item.itemnumber %]" />
3) Restart SIP
4) Run an item information query
5) Note the itemnumber is sent in the IN field!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: fixed tests count
2022-09-12 17:44:36 -03:00
1e9f6e61d5
Bug 20058: (QA follow-up) Simplify test code
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-12 17:39:38 -03:00
David Gustafsson
66d2696b3e
Bug 20058: Add tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-12 17:39:38 -03:00
daf2e4b3c2
Bug 30921: Replace C4::XSLT::transformMARCXML4XSLT with RecordProcessor
This patch removes the last remaining uses of transformMARCXML4XSLT and
replaced them with the equivilent RecordProcessor usage.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-12 16:26:34 -03:00
f60a9c50dc
Bug 27981: (QA follow-up) GetMarcBiblio was removed from codebase
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-12 15:28:08 -03:00
ab358f06da
Bug 27981: (follow-up) Fix tests
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-12 15:17:36 -03:00
Nuño López Ansótegui
62b2fc31bd
Bug 27981: Add option to automatically set 001 to the biblionumber
This patch adds a new system preference:
autoControlNumber

The option "biblionumber" will set field 001 to the biblionumber when you create a new record
or edit an existing record and clear the 001 field.

If a value is present in 001 when saving the record it will be preserved.

If set to 'OFF' the 001 field wil not be touched

When duplicating a record the 001 will be removed if autoControlNumber is set

To test:
 1 - Apply patches and updatedatabase
 2 - Create a new record with no 001 field
 3 - Save and view the MAC, confirm there is no 001
 4 - Set the system preference to 'biblionumber'
 5 - Edit the record you created previously
 6 - Note the 001 is prepopulated with the biblionumber
 7 - Delete the field
 8 - Save the record
 9 - View the MARC, the 001 is filled with biblionumber
10 - Edit the record
11 - Set the 001 to a different value "Not the biblionumber"
12 - Save
13 - View the marc and confirm the value you entered is retained
14 - Edit a record with an existing 001 that is not the biblionumber
15 - Save and confirm 001 is not updated

To test duplication:
1 - Edit a record as duplicate when using the advanced editor
2 - Confirm the 001 does not load, but record saves correctly
3 - Edit the record
4 - Switch to 'basic editor'
5 - Save, then view record
6 - Edit as duplicate in basic editor
7 - Confirm the 001 is removed
8 - Confirm the 001 is added on save

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Thomas Klausner <domm@plix.at>

Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-12 15:17:36 -03:00
14f52725d3
Bug 31351: (QA follow-up) Trivial string fix
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-07 14:04:41 -07:00
99b15ee5df
Bug 31351: (QA follow-up) Extend the encode/decode test
Adding some Unicode stuff.
And missing txn couple.

Test plan:
Run t/db_dependent/Koha/BackgroundJob.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-07 13:59:11 -07:00
727193dead
Bug 31351: (QA follow-up) Adjust tests accordingly
Test plan:
Run t/db_dependent/Koha/BackgroundJob.t
Run t/db_dependent/Koha/BackgroundJobs.t
Prove t/db_dependent/Koha/BackgroundJobs

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-07 13:59:07 -07:00
d32a205a69
Bug 27272: Remove GetItemsInfo, GetItemsLocationInfo and GetHostItemsInfo
With the different bug reports we removed the calls for those 3
subroutines. We can remove them now.

Test plan:
git grep their names and you should not find any occurrences in the code
base

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-31 17:50:51 -03:00
8bd4edebf9
Bug 29697: (QA follow-up) Remove useless warning
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-31 12:34:39 -03:00
73bde2cca3
Bug 29697: (QA follow-up) Make tests less fragile
This patch makes the tests less fragile to existing data. It does so by
making sure that when checking if the item would be hidden by
OpacHiddenItems and lost status, the item is not skipped, and thus the
notforloan value, as retrieved from the search engine is picked for the
notforloan_count calculation.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-31 12:31:53 -03:00
02326ebf24
Bug 30016: Remove GetOpenIssue subroutine
This patch adjusts the code that uses GetOpenIssue to use/find a Koha::Checkout object
instead

To test:
1 - Add a course to course reserves
2 - Create an item with barcode TESTKOC
3 - Add the item to a course
4 - Checkout the item
5 - View course details on stff and opac and confirm item shows as checked out and due date displays
6 - prove t/db_dependent/Circulation/issue.t t/db_dependent/Circulation.t t/db_dependent/CourseReserves.t
7 - Browse to Circulation->Upload offline circulation
8 - Upload a file to return the item: https://wiki.koha-community.org/wiki/Koha_offline_circulation_file_format
9 - Confirm item is returned

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-31 08:50:37 -03:00
3a5fb22ad8
Bug 31473: Fix fragile test about bad OpacHiddenItems conf
There's been a behavior change in recent MariaDB that made some cases
deal with truncated data in DOUBLE context instead of DECIMAL.

Probably this:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-27380

This made the affected test fail consistently on those versions.

This trick for checking OpacHiddenItems is correct (as introduced on bug
28125 doesn't really make use of the warning, just prints it in
about.pl) so one option was to just check for a warning.

I decided to keep the test, but add the optional DECIMAL|DOUBLE check on
the qr. This way other eventual changes will make it fail and serve as a
warning in case something more relevant changes.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ t/db_dependent/Koha/Items.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-26 16:49:30 -03:00
73c3c5d2f1
Bug 31112: (QA follow-up) Reduce database queries
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-26 15:59:24 -03:00
Joonas Kylmälä
15f622ecc1
Bug 31112: CanBookBeRenewed: take into account patrons with more than 1 hold to a biblio
If a single patron had more than 1 hold to a biblio and there was only one
available item we allowed incorrectly renewing the checkout when
AllowRenewalIfOtherItemsAvailable was set to "Allow". This
changes CanBookBeRenewed so that it makes sure all the holds are
filled and not just one per patron.

To test:
 1) prove t/db_dependent/Circulation.t
 2) (Optional, as unit test is provided)
    - Set AllowRenewalIfOtherItemsAvailable = Allow
    - Create biblio with three items
    - Checkout one item to patron A
    - Add two biblio-level holds for patron B
    - Try to renew patron A's checkout with and without this patch.
    - Notice that without this patch the renewal succeeds even though we
      one unfilled hold left. After applying the patch the renewal should
      fail.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-26 15:59:03 -03:00
07e5f13d90
Bug 20262: (QA follow-up) Update unit tests for changes to payin_amount
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-26 15:55:50 -03:00
11c05e3d81
Bug 20262: (QA follow-up) Fix spelling errors
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-26 15:55:46 -03:00
Stefan Berndtsson
e166f7612f
Bug 20262: Add ability to refund lost item fees without creating credits
Some libraries handle refunding of paid lost fees at a financial office and not within Koha. To facilitate this, it would be good for Koha to have the option to not generate lost returned credits by skipping fully paid lost items, and only refunding the outstanding balance on partially paid lost fees.

Test Plan:
1) Apply this patch
2) Set your lost item refund on return policies to 'Only if unpaid'
3) Mark an item lost, charging the lost fee
4) Return the item, a full refund should occur
5) Mark another item lost, charging the lost fee
6) Make a partial payment on this lost fee
7) Return the item
8) The remaining balance of that fee should be 0, but the patron should
   not recieve a credit for the already paid balance
8) Mark another item lost, charging the lost fee
9) Fully pay the lost fee
10) Return the item. The paid lost fee should be unaffected.
11) Run tests in t/db_dependent/Circulation.t

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-26 15:55:41 -03:00