Martin Renvoize [Wed, 28 Apr 2021 09:21:14 +0000 (10:21 +0100)]
Bug 27636: (QA follow-up) Fix tests and validate
This patch fixes the tests for when a negative amount is passed to the
pay method. Prior to now, a negative amount would have been passed
through and recorded. This was inconsistent with all other accounts
methods and has been deprecated to ensure consistent amounts handling.
This patch also introduces basic validation to prevent negatives being
entered into the UI.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28202: Pickup libraries must be sorted by name when placing hold
When placing hold, the pickup libraries are not sorted by name but by code.
You can see in other places : pickup_locations() calls
Koha::Libraries->search with { order_by => ['branchname'] }
Test plan :
1) Go to staff interface
2) Create a new libary with code 'AAA' and name 'ZZZ'.
2) Select a record
3) Begin placing hold
4) Look at list in "Pickup at:"
=> Without patch library 'ZZZ' is first
=> With patch library 'ZZZ' is last
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Andrew Nugged [Mon, 19 Apr 2021 12:02:09 +0000 (15:02 +0300)]
Bug 28169: Add quotes around value in template to render proper JS
There is code in request.tt:
homebranch: "[% ... %]",
holdallowed: [% ... %]
There only digits where expected earlier in holdallowed
but now it can be string value ('from_any_library' for example),
so it should be in quotes.
To reproduce the problem:
1. Add circulation rules which allow 1 hold only to the itemtype
2. Make sure AllowHoldPolicyOverride syspref enabled
3. Make 1 hold to patron for any biblio which has a few items available,
for example on "reset_all dev db set":
/cgi-bin/koha/reserve/request.pl?biblionumber=4&findborrower=1
(this biblio record has 4 items)
4. Start another hold for same patron on any biblio record or the same,
and keep browser's JS console open,
for example on "reset_all dev db set":
/cgi-bin/koha/reserve/request.pl?biblionumber=4&findborrower=1
5. You should see now JS error in browser console:
Uncaught ReferenceError: from_any_library is not defined
Uncaught ReferenceError: columns_settings_borrowers_table is not defined
6. Apply the patch
7. Repeat the steps 4-5 (reload the page) and now the JS error should be gone
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 14 Apr 2021 15:17:53 +0000 (15:17 +0000)]
Bug 28148: Remove 'print' class from 'Print transfer slip' when transfer exists
The 'print' class triggers JS to create the transfer and update a form
When a transfer exists we have no form and use 'openWin' to trigger the
print
Also, I remove a stray '1' in the template
To test:
1 - Set AutomaticItemReturn to "Don't"
2 - Check in an item from another branch
3 - Confirm the transfer
4 - Check it in again
5 - Click 'Print slip'
6 - Note error in console:
Uncaught TypeError: this.form is null
7 - apply patch
8 - Repeat
9 - No error!
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Sat, 27 Feb 2021 17:48:29 +0000 (17:48 +0000)]
Bug 27819: Fix Object POD
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Sat, 27 Feb 2021 17:24:56 +0000 (17:24 +0000)]
Bug 27819: Spurious item deletion errors from delete_records_via_leader.pl
The job reports errors when deleting items.
The issue seems to be that Koha::Object->delete claims in the POD to
return -1, 0, or 1 as a result, but it in fact returns the Object
itself on a successful deletion
The errors are reported as:
ERROR DELETING ITEM 501740: Koha::Item=HASH(0x55ce407a1a78)
To recreate:
1 - Find or create a record with some items
2 - Ensure those items can be deleted (not on loan, etc.)
3 - Edit the record leader and set position 5 to 'd'
4 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm
5 - Deletion succeeds, but reports failure on items
6 - Apply patch
7 - Find or create a new record as above, but this time add an
additional item and check it out to a patron
8 - perl misc/cronjobs/delete_records_via_leader.pl -i -v
9 - Test mode should report 1 item to be deleted, one with error
10 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm
11 - One item should be deleted, one item not, record not deleted
12 - check the item in
13 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm
14 - Successful deletion with no error reported
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 7 Apr 2021 13:56:56 +0000 (13:56 +0000)]
Bug 17202: Don't report an item in a collection if the collection doesn't exist
This simply adds a JOIN to the collections table - if the collection is gone
then the item is not considered to be in a rotating collection
Also remove variable to store the return that is not used later
To test:
Create a rotating collection
Add an item
Delete the rotating collection
View the db (SELECT * FROM collections_tracking;)
The item is still in the collection
Enable AutomaticItemReturn
Checkin the item at a branch not its home
The item does not get transferred home
Apply patch
Restart all the things
Check in the item, it is transferred home
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 26 Apr 2021 09:10:11 +0000 (11:10 +0200)]
Bug 28213: Prevent crash if patron or club deleted after search to hold
Deleting a patron or patron club causes server error on searching.
To recreate:
- create a club template
- create a club
- enroll a patron in the club
- from the clubs page, select Search To Hold for your club
- do a search, see that it says "Hold for [club name]" in your search results page
- go back to the clubs page and delete your club
- try to perform a search
=> Without this patch you get "Can't call method "name" on an undefined value at /kohadevbox/koha/catalogue/search.pl line 207"
Same when placing a hold for a patron (check the search result and the
detail pages)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 3 Mar 2021 11:21:33 +0000 (12:21 +0100)]
Bug 27842: Update serial.biblionumber when a subscription is linked with another record
It seems that a librarian can edit the biblionumber for a given subscription, however, when receiving serials the biblionumber is pulled from the existing serials, so all new received issues are received on the old biblionumber.
This is problematic in light of bug 21901 - you can change the biblionumber, the serials still point to the old biblionumber - and deleting the biblio deletes the serials. Additionally, the update will delete serials where this was the case
Test plan:
1 - Create a new subscription
2 - Receive an issue
3 - Edit the subscription and change the biblionumber
4 - Receive another issue
5 - SELECT biblionumber FROM serial
=> the biblionumber link must have been updated
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 3 Mar 2021 11:21:20 +0000 (12:21 +0100)]
Bug 27842: Add tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28230: Store C4::Message->{metadata} as Perl string always
When loading C4::Message->{metadata} we load it as perl string in all
other cases, see e.g. the subroutine find_last_message(). In this one
case we incorrectly populate the C4::Message->{metadata} as an UTF-8
octet instead of a Perl string. This causes a problem later on because
encode_utf8 later on in the line:
excepts a perl string and not a UTF-8 octet (please refer to the
functions perldoc). This breaks the encoding and causes an internal
server error:
To test the error is gone:
1. Create biblio with "AE" (bugzilla doesn't let me write the real
letter here, see it in the bugzilla comments) in title
2. Enable RenewalSendNotice
3. Enable "Item checkout and renewal" message preference for patron
4. Checkout an item from biblio "AE" to patron
5. Try to renew the patron's loan and notice the renewal fails
6. Apply patch and restart plack
7. Notice renewal works now and message h's the AE letter displayed correctly
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 27 Apr 2021 08:06:39 +0000 (10:06 +0200)]
Bug 28230: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 28230: Add execute bit to test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28234: TestBuilder->build_sample_biblio should set UTF-8 encoding for record
This patch makes the build_sample_biblio method, correctly set the UTF-8
flag for the MARC::Record object.
Tests are added.
To test:
1. Apply the regression tests patch
2. Run:
$ kshell
k$ prove t/db_dependent/TestBuilder.t
FAIL: Tests fail! An unexpected encoding warning shows
3. Apply this patch
4. Repeat 2
=> SUCCESS: No warning! Tests pass!
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Petro Vashchuk [Thu, 25 Feb 2021 10:28:17 +0000 (12:28 +0200)]
Bug 27790: separate earliest hold date into two different columns
Currently "Earliest hold date" and "Pickup place" are displayed
in one single column, but to make filtering possible it is necessary
to split those fields into separate ones.
This patch does exactly that and adds sorting list drop down feature to
the "Pickup place" column.
To reproduce:
1) Make a few holds and head over to "Circulations->Holds to pull".
2) Ensure that pickup place and earliest hold date are
in the same column "Earliest hold date"
3) Apply the patch.
4) Check "Circulations->Holds to pull list" again, this time
booking date and pickup place should have their own columns.
Ensure that filtering by "pickup location" works fine.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 19 Mar 2021 12:06:31 +0000 (12:06 +0000)]
Bug 27636: Update failing test
It would appear that ->pay didn't fully respect AccountAutoReconcile!
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 19 Mar 2021 12:00:36 +0000 (12:00 +0000)]
Bug 27636: Update ->pay to use ->payin_amount internally
This patch is an interim patch to update Koha::Account->pay to use the
new Koha::Account->payin_amount method internally. It simply utilises
that method for the logic and acts as an input/output shim for
compatability and to allow us to use the existing tests.
Test plan
1/ Run t/db_dependent/Koha/Account.t
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 5 Feb 2021 12:56:43 +0000 (12:56 +0000)]
Bug 27636: Add payin_amount to Koha::Account
This patch adds a `payin_amount` method to the Koha::Account as a modern
replacement to the `pay` method.
The new method uses the `add_credit` and `Koha::Account::Line->apply`
methods internally for consistency and returns the created credit
Koha::Account::Line result.
Test plan
1/ Run t/db_dependent/Koha/Account.t
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 19 Mar 2021 10:52:54 +0000 (10:52 +0000)]
Bug 27995: Update return for Koha::Account::Line->apply
This patch updates the return value of Koha::Account::Line->apply to return the
updated Koha::Account::Line object with Koha::Object::Messages embedded
for the results of any triggered renewals.
Available credit, the former return value, is still availabe via the
object directly as `amountoutstanding`.
Koha::REST::V1::Patrons::Account->add_credit has been updated to reflect
the change. No other area's of Koha relied upon the return value.
This patch also fixes a bug whereby if you passed a list of debits with
an outstanding debit larger than the outstanding credit then you could
end up with superflous offest lines with zero amounts that was
highlighted by the improved unit tests in
t/db_dependent/Koha/Account/Line.t
Test plan
1/ Run t/db_dependent/Koha/Account/Line.t
2/ Run t/db_dependent/api/v1/patrons_accounts.t
3/ If both tests pass then signoff
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 19 Mar 2021 09:45:45 +0000 (09:45 +0000)]
Bug 27995: Unit tests
This patch updates the unit tests for Koha::Account::Line->apply to
reflect the change we wish to make to the return value.
Instead of returning the scalar amount of available credit left on the
credit line after calling apply, we want to return the full, updated,
Koha::Account::Line object including Koha::Object::Messages for the
result of renewals that may have taken place.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 12 Mar 2021 14:21:41 +0000 (14:21 +0000)]
Bug 26734: (QA follow-up) Add 'tendered' and 'change' to notice
We include 'tendered' and 'change' parameters in the call to
GetPreparedLetter for the fee receipt slip.. we may as well include them
in the sample notice ;)
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Wed, 3 Feb 2021 14:49:04 +0000 (14:49 +0000)]
Bug 26734: (follow-up) Replace db update with backup and default
The inline update of variable for the notice template was proving
troublesome.. this patch replaces it was a backup of the existing notice
followed by replacing the notice with the default.
Test plan
1/ Run the database update
2/ Check that the templates have been replaced by the defaults (for all
languages enabled)
3/ Check that a backup of the original notices was made by naviagating
to view the action log (/tools/viewlog.pl) and selecting 'all modules' +
'all actions'
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Mon, 19 Oct 2020 13:11:11 +0000 (14:11 +0100)]
Bug 26734: Update existing notices to new syntax
This patch adds a database update to replace existing notice variable
used in ACCOUNT_CREDIT and ACCOUNT_DEBIT notices with the modern
equivilents.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Mon, 19 Oct 2020 12:54:58 +0000 (13:54 +0100)]
Bug 26734: Update sample notices to use standardised syntax
This patch updates the default notices shiped with Koha to use the new
syntax.
Test plan
1/ Install Koha afresh
2/ Check the notices print as expected
3/ Signoff
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Wed, 14 Oct 2020 10:58:26 +0000 (11:58 +0100)]
Bug 26734: Convert printfeercpt/printinvoice to use GetPreparedLetter
This patch updates C4::Letters to allow use of existing koha template
includes from notices, then updates the printfeercpt and printinvoice
slip print option to use GetPreparedLetter rather than calling getletter
directly.
As part of this work, we also add credits and debits handling to the
_parseletter_sth and _get_tt_params routines in C4::Letters to allow for
recognisable variable names in the notice template.
Test plan
1/ Update the ACCOUNT_CREDIT and ACCOUNT_DEBIT notices to use
'accounts.inc' include for account descriptions
1a/ Add `[% PROCESS 'accounts.inc' %]` to the top of the notice
1b/ Replace manual account descriptions with `[% PROCESS
account_type_description account=credit %]`
2/ Print one of each slip and check that descriptions are properly
substituted
3/ Clone the notice to another language
4/ Print the in the other language and note the translated descriptions
are properly substituted.
5/ Signoff
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 16 Jul 2020 08:42:20 +0000 (09:42 +0100)]
Bug 26734: Ratify account slip printing
This patch simplifies the members/print*.pl controller scripts to only
pass around the minimum required data for the templates.
Test plan
Slips should continue to print as they did prior to the patch
1/ Add a manual invoice and manual debit to a patrons account
2/ Print a slip for the manual invoice, compare to a printed slip prior
to the patch.
3/ Print a slip for the manual debit, compare to a printed slip prior to
the patch.
4/ Signoff.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Mon, 15 Mar 2021 14:49:09 +0000 (14:49 +0000)]
Bug 27455: (follow-up) Add automatic focus to library name when editing
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Katrin Fischer [Thu, 4 Mar 2021 09:35:37 +0000 (09:35 +0000)]
Bug 27455: (follow-up) Switch form JavaScript to focus class
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
ava li [Tue, 19 Jan 2021 01:36:27 +0000 (01:36 +0000)]
Bug 27455: Add focus to branch code when a new library is added
TEST PLAN:
From the koha home, go to administration, go to Libraries which is under
Basic parameters. Click +New library the focus should go to the first
field of the form (library/branch code) the patch has worked.
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 15563: add label and card creator batch deletion to cleanup_database
To test:
For item label batches:
1- Create 3 item label batches of at least 2 items each
2- Perform the following updates via the database
3- In Batch 1, set all items' timestamps to 10+ days prior to today
4- In Batch 2, set 1 item's timestamp to 10+ days prior to today
5- In Batch 3, do not update any timestamps
6- Run cron with --labels 9
7- Confirm batch 1 is deleted, batches 2 and 3 are not
Repeat with card creator batches
8- Create 3 card creator batches of at least 2 items each
9- Perform the following updates via the database
10- In Batch 1, set all cards' timestamps to 10+ days prior to today
11- In Batch 2, set 1 card's timestamp to 10+ days prior to today
12- In Batch 3, do not update any timestamps
13- Run cron with --cards 9
14- Confirm batch 1 is deleted, batches 2 and 3 are noti
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Deb Stephenson <dstephen@dubuque.lib.ia.us> Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Emmi Takkinen [Thu, 3 Dec 2020 08:41:47 +0000 (10:41 +0200)]
Bug 26405: Prevent Circulation.t failing on 'AddRenewal left both fines'
Bug 23051 added option to skip calculating fines even when
"CalculateFinesOnReturn" is enabled. Due this Circulation.t
fails on test "AddRenewal left both fines" if
"CalculateFinesOnReturn" is disabled on ones system.
Mocking syspref while testing fixes failig tests.
To test:
1. Disable "CalculateFinesOnReturn".
2. Run prove t/db_dependent/Circulation.t
=> Tests fail
3. Apply patch.
4. Run prove t/db_dependent/Circulation.t again
=> Tests are succesful
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Mon, 26 Apr 2021 12:40:48 +0000 (12:40 +0000)]
Bug 28223: Add data elements to negative budgets
To test:
1 - Have a parent fund and a child fund
2 - Order an amount from the child fund that is greater than the amount available
3 - Browse to acquisitions
4 - Confirm the totals look right
5 - Click on the over spent fund to go to 'Funds for main budget'
6 - Note the totals are incorrect
7 - Apply patch
8 - Reload
9 - Totals are now correct
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Tue, 13 Apr 2021 15:14:11 +0000 (15:14 +0000)]
Bug 28144: Check if issue_id defined
Historical OVERDUE fines may not have an issue_id - this causes
flooding of the logs when calling update fine
Trivial change, reading the code should be enough, but test plan below
To test:
1 - Create some fines without an issue_id
- Either checkout an old version of Koha and add manually or
- Checkout some items (backdated) to a patron, run fines.pl then
UPDATE accountlines SET issue_id = NULL;
2 - Checkout a backdated item with fines in the circ rule to the same patron
3 - Run fines.pl
4 - Note the errors
5 - Apply patch
6 - Repeat and note no errors
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Mon, 26 Apr 2021 10:30:17 +0000 (06:30 -0400)]
Bug 28221: Script process_message_queue.pl uses Try::Tiny but doesn't 'use' it
The message queue processor has a try/catch block, but does not have a 'use Try::Tiny' line. Because of this the following error ocurrs if an instance has any plugins installed that use the before_send_messages hook:
Can't locate object method "catch" via package "1" (perhaps you forgot to load "1"?) at /usr/share/koha/bin/cronjobs/process_message_queue.pl line 86.
Test Plan:
1) Install a plugin that uses the before_send_messages hook
2) Run the message queue processor
3) Note the error message
4) Apply this patch
5) Run the message queue processor again
6) No error!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 19 Apr 2021 10:11:36 +0000 (12:11 +0200)]
Bug 28178: Display the correct image in the image viewer
When there are several images attached to a bibliographic record, one can click
an image and see it in the image viewer. But the first image is always displayed.
Test plan:
0. Turn on LocalCoverImages and AllowMultipleCovers
1. Attach at least two images to a bibliographic record
2. Go to the detail page, click the "Images" tab and click the second
image.
=> With this patch applied you should see the image you selected
Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Fridolin Somers [Thu, 11 Mar 2021 10:46:46 +0000 (11:46 +0100)]
Bug 21818: Replace AutoCommit flag with DBIx transaction in stage-marc-import.pl
Like it was done in Bug 18806.
Test plan :
Use stage-marc-import.pl with and without patch, with a matcher to find
duplicates
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Thu, 22 Apr 2021 14:33:25 +0000 (14:33 +0000)]
Bug 28193: OpacLoginInstructions news block broken by Bug 20168
This patch fixes a regression which was introduced by Bug 20168, causing
the OpacLoginInstructions template code to revert back to the old system
preference behavior. This patch returns the correct markup.
To test, apply the patch and view the OPAC login page
(/cgi-bin/koha/opac-user.pl)
- With no news entry for OpacLoginInstructions you should see the
default: A block of text with two headings, "Don't have a password
yet?" and "Don't have a library card?"
- Go to Tools -> News and create an entry for OpacLoginInstructions.
- Return to the OPAC and confirm that your custom text appears.
- Try updating/installing another translation and adding a different
news entry for that language. Confirm that the correct entry appears.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 23 Apr 2021 13:37:28 +0000 (14:37 +0100)]
Bug 27281: (QA follow-up) Fix Indexer Test
With bug 27281 we removed a call to reset an items holdingbranch back to
the 'frombranch' of the transfer. This is correct, as with bug 23129
(and friends) we ensure that the holdingbranch was not changed at
transfer request time and instead would only be updated at the reciept
of transfer. As such, it's safe to remove the update here as it would be
just setting the same branch as is already present.
However, when removing this ModItem call, I neglected to realise that
also remoes the requirement for passing around the defered indexing bit
as we no longer need to trigger a re-index as there's not any change to
the item.
This patch therefore cleans up the POD for LostItem, removes the no
longer references 'params' parameter and drops the corresponding index
test.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Wed, 17 Mar 2021 16:23:56 +0000 (16:23 +0000)]
Bug 27971: Enhance unit tests
This patch adds some additional unit tests for extra functionality
included with this patchset.
Test plan
1/ t/db_dependent/Koha/Account/Line.t should pass
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Wed, 17 Mar 2021 09:10:17 +0000 (09:10 +0000)]
Bug 27971: Update void method to use double entry accounting
This patch adds double-entry accounting to the Koha::Account::Line->void method.
This results in the addition of a VOID debit type line that is offset
against the original credit type line that is being voided. This allows
us to accurately record when the void took place, at what branch and by
whome the void was triggered.
Test plan
1/ Apply the database update
2/ Add some debts to a borrower account
3/ Pay those debts
4/ Void the payment
5/ A new 'VOID' line should appear on the account for the full amount of
the original payment.
6/ Payments should have all been reversed
7/ t/db_dependent/Koha/Account/Line.t should still pass
8/ Signoff
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 5 Feb 2021 15:11:37 +0000 (15:11 +0000)]
Bug 24300: Add payout amount to boraccount page
Test plan
1/ Add some debts and credits to a patrons account, resulting in an
overall credit
2/ Note the appearance of a 'Payout amount' button next to the total due
line.
3/ Try paying out an amount with the button
4/ Signoff
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 5 Feb 2021 14:28:32 +0000 (14:28 +0000)]
Bug 24300: Add payout_amount method to Koha::Account
This patch adds a 'payout_amount' method to the Koha::Account class to
allow payout of an amount against a list of credits (or any outstanding
credits, oldest to newest).
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
ModItemTransfer is still used, sparingly. It force cancels transfers
regardles of whether they are already marked as in_transit. We do not,
however, want to enqueue a return transfer in this case as
ModItemTransfer is itself an enqueue function. This patch updates the
internal logic of ModItemTransfer to enqueue the passed transfer prior
to cancelling the pre-existing one.. in this way the result is one
cancelled transfer and one new transfer and not three transfers.
Test plan
1/ Run t/db_dependant/Items.t and verify it fails prior to applying this
patch
2/ Apply patch and run the test again, verifying it now passes.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Mon, 22 Mar 2021 14:57:06 +0000 (14:57 +0000)]
Bug 12362: Cancel transfer with hold cancelation
This patch adds a transfer cancellation when a hold is cancelled.
Test plan
1/ Check an item out from it's homebranch
2/ Place a hold on that item for another user at a different branch
3/ Check the item in at it's homebranch and accept the transfer
4/ Cancel the hold
5/ Change to the second branch and check the item in
6/ Note that a transfer is triggered with the reason 'Transfer was
cancelled whilst in transit'
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
JD amended patch: remove trailing whitespace
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Mon, 22 Mar 2021 14:36:42 +0000 (14:36 +0000)]
Bug 12362: Reverse transfer upon cancellation
This patch adds a reverse transfer if a transfer is cancelled whilst it
is in transit. This makes sure the item returns to it's original
location.
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Mon, 22 Mar 2021 14:43:42 +0000 (14:43 +0000)]
Bug 12362: Add 'TransferCancellation' as a transfer reason
This patch adds the database update to add 'TransferCancellation' as a
reason for transfer.
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Mon, 8 Mar 2021 15:30:09 +0000 (15:30 +0000)]
Bug 27896: Remove DeleteTransfer
This patch removes the last mentions of DeleteTransfer
Test plan
1/ Grep the codebase for DeleteTransfer
2/ It should no longer exist
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 27896: (QA follow-up) Fix number of unit tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Mon, 8 Mar 2021 15:24:14 +0000 (15:24 +0000)]
Bug 27896: Remove DeleteTransfer from circ/return.pl
This patch replaces the DeleteTransfer call in circ/returns.pl with a
call to Koha::Item::Transfer->cancel.
Test plan
1/ Check an item out
2/ Add a transfer request for the item to a second library
3/ Attempt to check the item in at the first library
4/ Note that you should be given a 'WrongTransfer' modal and have to
option to cancel.
5/ Cancel the transfer
6/ Check in the database that the transfer now has 'datecancelled' set.
7/ Add a transfer for the item again
8/ From the transferstoreceive page cancel the transfer
9/ Click cancel and again check that datecancelled is set in the
database for your transfer
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 27896: (follow-up) Fix Typo
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 22 Apr 2021 08:35:11 +0000 (09:35 +0100)]
Bug 27281: (QA follow-up) Restore test for holdingbranch
I inadvertantly removed the test that varified that the items
holdingbranch is unaffected by the call to LostItem. This restores such
a test and adds a few comments to clarify the test transfers.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Mon, 8 Mar 2021 14:59:06 +0000 (14:59 +0000)]
Bug 27281: (follow-up) Clean up LostItem test
The LostItem test was rather messy, and wasn't actually testing much in
reality. This patch cleans it up and adds testing for transfer queue
handling of ListItem cancellations.
Test plan
1/ Confirm t/db_dependent/Circulation.t still passes
2/ Read the tests before and after and confirm that they test what is
required.
3/ Signoff
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Mon, 8 Mar 2021 13:43:11 +0000 (13:43 +0000)]
Bug 27281: Update LostItem to use Koha::Item[::Transfer] methods
This patch updates C4::Circulation::LostItem to use the Koha::Item and
Koha::Item::Transfer methods to cancel transfers when an item is marked
as lost.
Test plan
1/ Confirm t/db_dependant/Circulation.t passes prior to applying the
patches
2/ Apply the patch and run updatedatabase.pl
3/ Confirm that t/db_dependant/Circulation.t still passes
4/ Signoff
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
As highlighted by Jonathan in comment #90, we were passing
borrowernumber to ModBasket. This was a hangover from when we explicitly
logged the borrower, which was later discovered to be unnecessary
duplication, and was removed in commit "Remove data duplication".
This commit removes this unnecessary parameter.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Andrew Isherwood [Fri, 23 Oct 2020 14:44:32 +0000 (15:44 +0100)]
Bug 23971: (follow-up) Make changes for 26582
This commit makes changes necessary to allow this bug to be dependent on
Bug 23562:
- Move basket closure logging from C4::Acquisision::CloseBasket to Koha::Acquisition::Basket::close
- Move basket closure unit test from t/db_dependent/Acquisition.t to
t/db_dependent/Koha/Acquisition/Basket.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Andrew Isherwood [Fri, 23 Oct 2020 14:14:28 +0000 (15:14 +0100)]
Bug 23971: (follow-up) Fix tests
Following a discussion with Tomás on Slack, this commit implements the
following suggestions:
- Switch from ->find to ->search in tests. ->find is only ever going to return 0
or 1 rows, which doesn't help us if there is breakage which results in
more than 1 row being returned, the test would fail due to ->find not
expecting more than 1 row, but we should be testing for it. So switching
to ->search returns all matching rows.
- Moved tests into their own subtest, they had the potential to pollute
surrounding tests
- Remove all action logs before each test, this ensures we're only
testing the result of the current test
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Andrew Isherwood [Mon, 19 Oct 2020 09:48:57 +0000 (10:48 +0100)]
Bug 23971: (follow-up) Respond to feedback
As requested by Jonathan in commit #28:
- We now no longer pass a flag to CloseBasket indicating if the closure
was due to an EDI basket approval, we log the closure and approval as
separate events.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit adds unit tests for the logging done in Acquisitions.pm
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Katrin Fischer [Sat, 22 Aug 2020 14:05:01 +0000 (14:05 +0000)]
Bug 23971: (QA follow-up) Fix punctuation, doubled up return and syspref order
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Holly <hc@interleaf.ie> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>