koha.git
4 years agoBug 23354: (follow-up) Make display of debit types configurable
Martin Renvoize [Thu, 17 Oct 2019 12:19:34 +0000 (13:19 +0100)]
Bug 23354: (follow-up) Make display of debit types configurable

This patch adds a the ability to define where a debit type will be
available as a option for use.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23354: Update to account for bug 23049
Martin Renvoize [Thu, 3 Oct 2019 16:13:25 +0000 (17:13 +0100)]
Bug 23354: Update to account for bug 23049

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23354: Add Icon for POS system
Martin Renvoize [Thu, 3 Oct 2019 13:39:00 +0000 (14:39 +0100)]
Bug 23354: Add Icon for POS system

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23354: (follow-up) Use 'format_price' for totals
Martin Renvoize [Mon, 23 Sep 2019 13:12:13 +0000 (14:12 +0100)]
Bug 23354: (follow-up) Use 'format_price' for totals

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23354: (follow-up) Input type on jEditable
Martin Renvoize [Mon, 23 Sep 2019 12:51:11 +0000 (13:51 +0100)]
Bug 23354: (follow-up) Input type on jEditable

Update the jEditable plugin to a maintained version and use the new
'number' type to enable increment arrows on click and remap onblur event
to submit.

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23354: Add tests for Koha::Charges::Sales
Martin Renvoize [Tue, 17 Sep 2019 11:28:56 +0000 (12:28 +0100)]
Bug 23354: Add tests for Koha::Charges::Sales

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23354: Add permissions
Martin Renvoize [Wed, 11 Sep 2019 09:44:56 +0000 (10:44 +0100)]
Bug 23354: Add permissions

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23354: (follow-up) Responses to feedback
Martin Renvoize [Thu, 5 Sep 2019 09:13:57 +0000 (10:13 +0100)]
Bug 23354: (follow-up) Responses to feedback

This patch impliments a number of refinements requested after the first
round of feedback from the sponsors.

1) Fix padding on pay page
2) Switch 'items to add' from right to left on the page
3) Fix editable columns on pay page
4) Add explanitory text to pay page

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23354: Add ability to remove items
Martin Renvoize [Tue, 13 Aug 2019 10:16:25 +0000 (11:16 +0100)]
Bug 23354: Add ability to remove items

This patch adds the ability to remove items from a transactions on the
new Point of Sale pay page.

Test plan:
1) Populate a transaction with at least one item.
2) Note the new button to 'Remove item' on the items table.
3) Click the button and confirm the item is removed
4) Signoff

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23354: Add receipting to Pay page
Martin Renvoize [Tue, 17 Sep 2019 11:28:30 +0000 (12:28 +0100)]
Bug 23354: Add receipting to Pay page

This patch adds receipt printing to the new Point of Sale pay page.

Test plan:
1) Apply patch and run database update
2) Enable automatic receipt printing via the `` system preference.
3) Make a payment for an item via the new POS pay page.
4) Note that a receipt printing dialogue is shown automatically after
   payment.
5) Note that a new notice is available under tools where you can alter
   the content of the receipt.
6) Signoff

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23354: Add a Point Of Sale 'pay' screen
Martin Renvoize [Tue, 23 Jul 2019 16:23:55 +0000 (17:23 +0100)]
Bug 23354: Add a Point Of Sale 'pay' screen

This patch adds a new Point Of Sale module to Koha's staff client front
page. The module button leads directly to a 'Pay' page giving the staff
user the ability to record anonymous payments for items that would not
normally require a patron to be registered at the library.

Test plan:
1) Enable `UseCashRegisters` via the system preferences.
2) Ensure your user has the 'manage_cash_registers' permission.
3) Add a cash register for your current branch.
4) Add at least one 'MANUAL_INV' authorized value.
5) Navigate to the new 'POS' pay page via the main menu.
6) Add an item to the 'sale' by clicking 'add' from the right side of
   the screen.
7) Note that said item was added to the table of items this sale on the
   left.
8) At this point you should be able to 'click to edit' the quantity or
   price of the item in the table on the left.
9) Enter an amount greater than the price of the item into the 'amount
   collected from patron' box.
10) Click 'Confirm'
11) Varify that the same change to give modal from the paycollect pages
    appears here.
12) Click 'Confirm'
13) Payment will have been recorded (check the database) and you will be
    back at a fresh 'Pay' page ready for the next transaction.
14) Signoff

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23790: fr-CA translation of ACCOUNT_DEBIT and ACCOUNT_CREDIT notices
Caroline Cyr La Rose [Wed, 9 Oct 2019 19:34:24 +0000 (15:34 -0400)]
Bug 23790: fr-CA translation of ACCOUNT_DEBIT and ACCOUNT_CREDIT notices

This patch provides the fr-CA translation of the ACCOUNT_DEBIT and ACCOUNT_CREDIT notices.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested deleting from letter table, then loading the file.
File loads without problem, no errors.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18355: (QA follow-up) Rearrange comments, improve code
Marcel de Rooy [Fri, 29 Nov 2019 10:57:18 +0000 (10:57 +0000)]
Bug 18355: (QA follow-up) Rearrange comments, improve code

Comments were hard to read (for me) but tastes differ..

Code should reflect that permanent_location is a code and that location
may be already an authval. See detail.pl:
$item->{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );

Obviously, this kind of logic divided over two places should be reduced.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18355: Display permanent location with cart location
Jonathan Druart [Mon, 1 Oct 2018 14:23:48 +0000 (11:23 -0300)]
Bug 18355: Display permanent location with cart location

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21466: Catch any values that should be defined in the AV but are not
Jonathan Druart [Tue, 5 Mar 2019 20:04:45 +0000 (17:04 -0300)]
Bug 21466: Catch any values that should be defined in the AV but are not

Let's expand the idea of the first patch to catch the wrong values for
any others AV.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21466: Search for items.location inconsistencies
Jonathan Druart [Wed, 17 Oct 2018 18:08:58 +0000 (15:08 -0300)]
Bug 21466: Search for items.location inconsistencies

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24408: Do not compare floats with precision in tests
Jonathan Druart [Fri, 10 Jan 2020 10:10:50 +0000 (11:10 +0100)]
Bug 24408: Do not compare floats with precision in tests

We should not compare floating precision in tests.

Test plan:
Confirm that the tests still pass after this patch

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24146: Illustrate increasing and decreasing fine
Nick Clemens [Fri, 6 Dec 2019 15:35:27 +0000 (15:35 +0000)]
Bug 24146: Illustrate increasing and decreasing fine

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24146: Corrections to UpdateFine logic concerning maxFine
Martin Renvoize [Fri, 6 Dec 2019 15:10:17 +0000 (15:10 +0000)]
Bug 24146: Corrections to UpdateFine logic concerning maxFine

The `maxFine` system preference actually refers to the amount of
outsanding debt (in fines) a patron may have at a given time. This patch
corrects the functionality of UpdateFine such that it properly respects
that counter given the payment of accruing fines scenario.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24146: Increment existing fine
Martin Renvoize [Thu, 5 Dec 2019 10:14:51 +0000 (10:14 +0000)]
Bug 24146: Increment existing fine

We should increment an existing fine even if it has been fully paid off
whilst it is still incrementing and not create a new fine.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24146: Add test cases
Martin Renvoize [Wed, 4 Dec 2019 14:23:14 +0000 (14:23 +0000)]
Bug 24146: Add test cases

This patch adds test cases for both checking amountoutstanding values
are handled correctly and also that the paid down accruing fines do not
add additional fines on increment.

Test plan:
Read the changeset and asses whether the changes/additional tests are
correct as per the expected behaviour.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24350: (follow-up) Fix pickup_location test in t/db_dependent/Template/Plugin...
Agustin Moyano [Sun, 12 Jan 2020 06:11:13 +0000 (03:11 -0300)]
Bug 24350: (follow-up) Fix pickup_location test in t/db_dependent/Template/Plugin/Branches.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24350: (follow-up) Clear Koha::Libraries->pickup_locations() and move logic to...
Agustin Moyano [Sun, 12 Jan 2020 04:11:52 +0000 (01:11 -0300)]
Bug 24350: (follow-up) Clear Koha::Libraries->pickup_locations() and move logic to Koha::Template::Plugin::Branches->pickup_locations().

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23676: (RM follow-up) Test Correction
Martin Renvoize [Mon, 13 Jan 2020 09:27:35 +0000 (09:27 +0000)]
Bug 23676: (RM follow-up) Test Correction

We altered the query form passed by the ElasticSearch Query Builder
but neglected to update the test.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15142: (RM follow-up) Fix tests
Martin Renvoize [Mon, 13 Jan 2020 09:22:20 +0000 (09:22 +0000)]
Bug 15142: (RM follow-up) Fix tests

We removed the su-ut facet from zebra config for UNIMARC as it makes no
sense for that case, but we neglected to remove it form the test that
checks the config response.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24206: (RM follow-up) Add bug number to DB revision
Martin Renvoize [Mon, 13 Jan 2020 09:11:26 +0000 (09:11 +0000)]
Bug 24206: (RM follow-up) Add bug number to DB revision

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22426: Map 'loc' to 'location' when building ES queries
Fridolin Somers [Mon, 17 Jun 2019 14:09:38 +0000 (16:09 +0200)]
Bug 22426: Map 'loc' to 'location' when building ES queries

A search made on Shelving location tab in advanced search gives 0 result.

Test plan :
Without patch:
    - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc)
    - 0 result
    - check that location exist by doing a simple search and filtering on the    location facet
    - have some results
With patch:
    - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc)
    - found results

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23676: Use 'false' for opac suppression
Nick Clemens [Wed, 25 Sep 2019 19:04:13 +0000 (19:04 +0000)]
Bug 23676: Use 'false' for opac suppression

To test:
 1 - Enable ES
 2 - Enable OpacSuppression
 3 - Suppress a bib in staff client
     Edit 942n to be 1
 4 - Search the opac for anything
 5 - Tail the plack logs and note a deprecation warning
 6 - Apply patch
 7 - Restart all the things
 8 - Repeat search on opac
 9 - No error/warn in logs
10 - Record is correctly suppressed

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17885: Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings throws...
Joonas Kylmälä [Fri, 31 Aug 2018 12:32:20 +0000 (15:32 +0300)]
Bug 17885: Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings throws DBD::mysql Duplicate entry exceptions

When executing
Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings()
against populated search engine mappings tables, one gets this
exception:

DBD::mysql::st execute failed: Duplicate entry '388-73' for key
'PRIMARY' [for Statement \"INSERT INTO `search_marc_to_field` ( `facet`,
`search_field_id`, `search_marc_map_id`, `sort`, `suggestible`) VALUES (
?, ?, ?, ?, ? )\" with ParamValues: 0='', 1='73', 2='388', 3=undef,
4=''] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line
1834.\nDBIx::Class::Storage::DBI::_dbh_execute(): Duplicate entry
'388-73' for key 'PRIMARY' at /home/koha/Koha/Koha/SearchField.pm line
38"

This patch fixes this, by first deleting all entries, then adding the
default ones.

If a subroutine says reset_elasticsearch_mappings(), I expect it to
reset the elasticsearch mappings without errors.  When writing tests it
is better to call that one subroutine reset_elasticsearch_mappings
instead of the bunch of code in
admin/searchengine/elasticsearch/mappings.pl?op=reset_confirmed
Also this promotes code reuse.

TEST PLAN:

a. perl -e 'use Koha::SearchEngine::Elasticsearch; Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings'
b. Run misc/devel/populate_db.pl on an already populated DB and you eventually
face this problem.

After this patch, step a. works.

This patch is adapted from the original patch made by Olli-Antti
Kivilahti <olli-antti.kivilahti@jns.fi>.

Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23934: Item level holds not checked for LocalHoldsPriority in Holds Queue
Kyle M Hall [Thu, 31 Oct 2019 17:52:05 +0000 (13:52 -0400)]
Bug 23934: Item level holds not checked for LocalHoldsPriority in Holds Queue

Test plan:
- Set LocalHoldsPriority to "Give priority for filling holds to patrons
whose pickup library matches the item's holding library"
- set yourself at Library A
- find at item at Library A
- place an item-level hold (Hold 1) for item for pickup at Library B
- set an item-level hold (Hold 2) for item for pickup at Library A
- Confirm Hold 1 shows priority=1
- Check in item
- confirm item would be captured for Hold 2, ignore hold
- run holds queue
- check item in
- confirm item is captured for Hold 2

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23934: Unit test
Kyle M Hall [Thu, 31 Oct 2019 17:51:33 +0000 (13:51 -0400)]
Bug 23934: Unit test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15142: (follow-up) Remove facet configuration from .xsl file
Katrin Fischer [Tue, 31 Dec 2019 09:30:32 +0000 (10:30 +0100)]
Bug 15142: (follow-up) Remove facet configuration from .xsl file

Removes last remaining bit of configuration for the Titles facet
configuration.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15142: (follow-up) remove from Zebra UNIMARC config files
Fridolin Somers [Tue, 26 Nov 2019 08:44:08 +0000 (09:44 +0100)]
Bug 15142: (follow-up) remove from Zebra UNIMARC config files

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15142: Remove titles facet for UNIMARC
Fridolin Somers [Fri, 22 Nov 2019 14:16:51 +0000 (15:16 +0100)]
Bug 15142: Remove titles facet for UNIMARC

There is a facet using 500$a, 501$a and 503$a and Subject index.
In UNIMARC 500$a, 501$a and 503$a are not indexed as Subject.
I propose to remove this facet for UNIMARC, looks like it does not make
sens.

Test plan:
1) Install UNIMARC database
2) Edit some records to have 500$a
3) Perform a search to find those records
4) Check you dont see the titles facet

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 9156: Clarify order in the syspref
Nick Clemens [Thu, 2 Jan 2020 18:06:20 +0000 (18:06 +0000)]
Bug 9156: Clarify order in the syspref

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 9156: (follow-up) Simplify code
Nick Clemens [Thu, 19 Dec 2019 19:05:36 +0000 (19:05 +0000)]
Bug 9156: (follow-up) Simplify code

The MARC::Field as_string method can join multiple subfield using a delimiter, this simplifies the code here

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 9156: itemcallnumber not pulling more than 2 subfields
Owen Leonard [Tue, 19 Nov 2019 14:56:05 +0000 (14:56 +0000)]
Bug 9156: itemcallnumber not pulling more than 2 subfields

When the itemcallnumber system preference is defined, the item add form
pulls data from the specified tag and subfield(s) to pre-populate the
call number field. This update makes it possible to build the
prepopulated callnumber from more than just the first two subfields.

To test, apply the patch and update the itemcallnumber system preference
so that it includes more than two subfields. For instance, "092abef"

 - Edit a bibliographic record and populate the specified subfields.
   e.g. subfield a -> "One", b-> "Two", e-> "Three", f-> "Four".
 - Save the record and go to the add/edit items screen.
 - The call number field should contain a string which contains each of
   the subfields you populated, concatenated with spaces: "One Two Three
   Four."
 - Test with other numbers of subfields.
 - Test with an empty itemcallnumber preference.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24206: DBRev 19.12.00.008
Martin Renvoize [Fri, 10 Jan 2020 16:11:56 +0000 (16:11 +0000)]
Bug 24206: DBRev 19.12.00.008

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24206: Update content of OpacSearchForTitleIn for existing installations
Katrin Fischer [Sun, 22 Dec 2019 13:07:46 +0000 (13:07 +0000)]
Bug 24206: Update content of OpacSearchForTitleIn for existing installations

This includes a database update for existing installations.
Using the REPLACE function it makes the same changes to the URLs
as the previous patch did for new installations:

- Worldcat: now https
- BookFinder: now https
- OpenLibrary: remove / before search parameters

To test:
- Verify the current content of your preference OpacSearchForTitleIn
  (without changes from first patch!)
- Run the database update
- Verify everything still works, but changes have been made

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24206: Update URLs for default options in OPACSearchForTitleIn
Katrin Fischer [Sun, 22 Dec 2019 13:05:34 +0000 (13:05 +0000)]
Bug 24206: Update URLs for default options in OPACSearchForTitleIn

- Worldcat: now https
- BookFinder: now https
- OpenLibrary: remove / before search parameters

To test:
- Verify changes to the installer files are correct
- Bonus: run the web installer for en, de-DE and nb-NO and
  verfiy the content of OPACSearchForTitleIn is correct

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24358: (bug 21232) Make the alert string translatable
Jonathan Druart [Mon, 6 Jan 2020 22:08:55 +0000 (23:08 +0100)]
Bug 24358: (bug 21232) Make the alert string translatable

"Bibliographic record does not exist!" was not translatable as it was
defined in the .js file

Test plan:
Repeat test plan from bug 21232

Bonus point: update and install a localized version and confirm that the
message is translatable

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24350: (follow-up) Unbless each library, not the array
Nick Clemens [Fri, 10 Jan 2020 15:37:46 +0000 (15:37 +0000)]
Bug 24350: (follow-up)  Unbless each library, not the array

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23377: (QA follow-up) Use OVERRIDE_SYSPREF
Marcel de Rooy [Fri, 10 Jan 2020 10:49:45 +0000 (10:49 +0000)]
Bug 23377: (QA follow-up) Use OVERRIDE_SYSPREF

SYSPREF_OVERRIDE unfortunately is not supported ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23377: use ENV syspref override instead of complete disable
Ian Walls [Wed, 31 Jul 2019 16:32:23 +0000 (16:32 +0000)]
Bug 23377: use ENV syspref override instead of complete disable

In an attempt to save time, bulkmarcimport temporarily sets CataloguingLog
and AuthoritiesLog to 0.  It does this by disabling syspref caching and saving
the changes to the database (then replacing the original values at completion).

Unfortunately, this disables other key sysprefs from being cached, and results in
a 50% increase in processing time for the script.

This patch instead utilizes the ENV variable override feature of sysprefs, which
preempts the cache in C4::Context->preference().

To test:
1. Perform a bulkmarcimport with a reasonable number of biblios (~1000 will do)
2. Note the time taken to complete
3. Apply patch
4. Revert the biblio load performed
5. Perform another bulkmarcimport with the same biblios and commandline options
6. Note the time taken to complete
7. Compare times.  The time from step 6 should be about 33% less than the time from step 2
8. Check Cataloguing and Authorities Logs to verify imported records were not logged
9. Profit!

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24200: Try to fix random failures from Borrower_PrevCheckout.t
Jonathan Druart [Fri, 10 Jan 2020 10:48:09 +0000 (11:48 +0100)]
Bug 24200: Try to fix random failures from Borrower_PrevCheckout.t

It failed inconsistently, let's try to use build_sample_item and see if
it fixes the random failures.

Test plan:
 % prove t/db_dependent/Patron/Borrower_PrevCheckout.t
must return green

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24396: Fix Suggestions.t with MySQL 8
Jonathan Druart [Fri, 10 Jan 2020 10:29:15 +0000 (11:29 +0100)]
Bug 24396: Fix Suggestions.t with MySQL 8

 #   Failed test 'DelSuggestion deletes the correct suggestion'
 #   at t/db_dependent/Suggestions.t line 413.
 #          got: 'my title 3'
 #     expected: 'my deleted title'
 t/db_dependent/Suggestions.t .. 112/113 # Looks like you failed 1 test of 113.

Suggestions were returned in the reverse order. Adding an ORDER BY clause fixes the problem.

Test plan:
 % prove t/db_dependent/Suggestions.t
must return green

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24337: Checkout note cannot be marked seen if more than 20 exist
Owen Leonard [Fri, 3 Jan 2020 20:02:26 +0000 (20:02 +0000)]
Bug 24337: Checkout note cannot be marked seen if more than 20 exist

This patch modifies the event handler on the individual "Mark seen" /
"Mark unseen" buttons in the table of checkout notes. For an event to be
successfully attached to a hidden element it must be given a context.

To test you should have multiple checkout notes to work with, both seen
and unseen. Apply the patch and go to "Checkout notes pending" from the
staff client home page.

 - Navigate to the second "page" of data in the DataTable.
 - Test the functionality of the "Mark seen" and "Mark unseen" buttons.
   They should work correctly.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24335: Cannot mark checkout notes seen/not seen in bulk
Owen Leonard [Fri, 3 Jan 2020 18:43:15 +0000 (18:43 +0000)]
Bug 24335: Cannot mark checkout notes seen/not seen in bulk

This patch changes the way checkbox events are handled on the checkout
notes page so that checking a checkbox enables the batch operation
controls.

Note: The addition of a "markseen" class is a preventative measure to
avoid future problems where using the "btn-small" class might not be
specific enough.

To test you should have multiple checkout notes to work with, both seen
and unseen. Apply the patch and go to "Checkout notes pending" from the
staff client home page.

 - Check any checkbox. The "Mark seen" and "Mark not seen" should go
   from disabled to enabled.
   - Test that the buttons work correctly.
 - Click the "Select all" and "Clear all" controls and confirm that the
   buttons are enabled and disabled correctly.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23274: Mock simple_search_compat to cover both search engines
Nick Clemens [Tue, 26 Nov 2019 12:57:17 +0000 (12:57 +0000)]
Bug 23274: Mock simple_search_compat to cover both search engines

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24323: Advanced editor - Display an error message if the record did not save
Cori Lynn Arnold [Tue, 31 Dec 2019 17:10:14 +0000 (17:10 +0000)]
Bug 24323: Advanced editor - Display an error message if the record did not save

Invalid 008 with helper silently fails to save.

This patch adds a "else if" to fall through if the error message isn't
one of the previously defined ones ("syntax" and "invalid") and presents
the human with a generic message that "Something went wrong, cannot
save."

Prior to testing:
a/Verify that Advanced Editor is enabled
b/Download the errorrecord.mrc from bug

To test:
1/Apply patch
2/Go to Cataloging->Advanced Editor
3/Click "Import Record" button and navigate to the record saved from
step b/
4/Add an 003 field (as required by the default cataloging config)
5/Hit "Save to catalog"
6/Verify that a message is passed to the user that the file was unable
to be saved

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24371: Fix "Show all items" avaibility link (use $raw filter) - intra
Jonathan Druart [Fri, 10 Jan 2020 08:56:12 +0000 (09:56 +0100)]
Bug 24371: Fix "Show all items" avaibility link (use $raw filter) - intra

Same fix for the intranet side

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24371: Fix "Show all items" avaibility link (use $raw filter) - opac
Lucas Gass [Tue, 7 Jan 2020 18:54:49 +0000 (18:54 +0000)]
Bug 24371: Fix "Show all items" avaibility link (use $raw filter) - opac

TO TEST:
1. Make an OPAC search with plenty of results.
2. Use the search facets to limit the search in some way, item type, author, etc.
3. Click on 'Limit to currently available items', everything is still fine.
4. Attempt to return to 'Show all items', there will be no search results.
5. Apply patch
6. Ateempt steps 1-4 again.
7. Should work this time.

Signed-off-by: Rhonda Kuiper <rkuiper@roundrocktexas.gov>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24373: Correct basic cataloging editor CSS
Owen Leonard [Tue, 7 Jan 2020 19:52:25 +0000 (19:52 +0000)]
Bug 24373: Correct basic cataloging editor CSS

This patch makes minor corrections to the basic MARC editor CSS, fixing
an error caused by Bug 23259.

To test, apply the patch and clear your browser cache if necessary.

Open the basic MARC editor and check the numbered tabs. There should be
no stripe of green background showing below the tabs.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Guillaume Paquet <guillaume@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14759: Add test
Jonathan Druart [Thu, 9 Jan 2020 15:17:12 +0000 (16:17 +0100)]
Bug 14759: Add test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14759: Replace Text::Unaccent with Unicode::Normalize
Martin Renvoize [Wed, 8 Jan 2020 09:13:18 +0000 (09:13 +0000)]
Bug 14759: Replace Text::Unaccent with Unicode::Normalize

As shown in the comments on the bug, it appears that Unicode::Normalize
is the most reliable way to strip accents from strings for this use
case.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24394: Typo when adding a new cash register
Caroline Cyr La Rose [Thu, 9 Jan 2020 19:52:24 +0000 (14:52 -0500)]
Bug 24394: Typo when adding a new cash register

This patch corrects a typo in the cash register template.

To test:
1) Go to Administration > Global system preferences
2) Search for UseCashRegisters
3) Enable UseCashRegisters and save
4) Go to Administration > Cash registers
5) Click on 'New cash register'
6) Notice the title says 'Add new cash_register'
7) Apply patch
8) Refresh and notice it now says 'Add new cash register'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23442: DBRev 19.12.00.007
Martin Renvoize [Fri, 10 Jan 2020 08:43:30 +0000 (08:43 +0000)]
Bug 23442: DBRev 19.12.00.007

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23442: Prevent payouts from being reduced
Martin Renvoize [Thu, 9 Jan 2020 11:59:43 +0000 (11:59 +0000)]
Bug 23442: Prevent payouts from being reduced

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23442: Add html filter to a couple lines in template
John Doe [Wed, 8 Jan 2020 15:51:45 +0000 (15:51 +0000)]
Bug 23442: Add html filter to a couple lines in template

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23442: Add refund option to patron account page
Martin Renvoize [Thu, 21 Nov 2019 13:09:47 +0000 (13:09 +0000)]
Bug 23442: Add refund option to patron account page

This enhancement adds a refined workflow to allow librarians
to refund payments to patrons and record these refunds on the
patrons account.

The use case is that a patron has paid for something before
then performing an action that may require some level of refund
to be actioned.  Perhaps they are returning a lost and paid for
book.

Test plan:
1) Undertake a series of transactions that result in a debit
   accountline being partially or fully paid off.
2) Note that a new 'Issue refund' button appears next to a
   debit (but only if your user has the refund permission or
   is a superlibrarian)
3) Click the 'Issue refund' button and a modal should appear
   pre-populated with the amount - amountoutstanding.
4) You should be able to edit the amount you wish to refund,
   record the refund or cancel.
5) Signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23442: Add refund permission
Martin Renvoize [Thu, 21 Nov 2019 15:04:56 +0000 (15:04 +0000)]
Bug 23442: Add refund permission

Add a new subpermission called 'refund' to the 'updatecharges'
permission group which will allow/prevent refund actions to be
performed by staff.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23442: Add 'reduce' method to Koha::Account::Line
Martin Renvoize [Thu, 21 Nov 2019 12:10:41 +0000 (12:10 +0000)]
Bug 23442: Add 'reduce' method to Koha::Account::Line

This enhancement adds a 'reduce' method to Koha::Account::Line which can
be used to reduce a charge/debit by adding a credit to offset against
the amount outstanding.

It may be used to apply a discount whilst retaining the original debit
amounts or to apply a full or partial refund for example when a lost
item is found and returned.

The created credit will be immediately applied against the debit unless
the debit has already been paid, in which case a 'zero' offset will be
added to maintain a link to the debit but the outstanding credit will be
left so it may be applied to other debts.

Test Plan:
1) Run the included tests and verify they pass.
2) Signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23442: Add account credit types
Martin Renvoize [Thu, 21 Nov 2019 15:20:45 +0000 (15:20 +0000)]
Bug 23442: Add account credit types

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 10352: Get add operations too
Nick Clemens [Fri, 13 Dec 2019 17:08:58 +0000 (17:08 +0000)]
Bug 10352: Get add operations too

When an add for biblio or item is recorded there is no space in the info field

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 10352: (follow-up) Show the biblionumber for items in modification logs
Nick Clemens [Mon, 25 Nov 2019 12:09:45 +0000 (12:09 +0000)]
Bug 10352: (follow-up) Show the biblionumber for items in modification logs

This patch adds a link to the the biblio that shows the biblionumber of the item. It makes things a little more obvious

To test:
1 - Find a biblio with an item where an itemnumber on another biblio is equal to that biblionumber
   i.e. In the sample data:
        biblionumber 59 with item with itemnumber 127
        item with itemnumber  59 on biblionumber 23
2 - Edit both items however you wish
3 - On biblionumber 59 click the modification log
4 - You should see "Item 127"
5 - Click "Submit" on the form - this searches as itemnumber
6 - You should see "Item 59"
7 - Apply patch
8 - On biblionumber 59 click the modification log
9 - You should see "Item 127 from Biblio 59"
10 - Click "Submit" on the form - this searches as itemnumber
11 - You should see "Item 59 from Biblio 23"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 10352: Use a new object_type parameter instead of the module's name
Jonathan Druart [Mon, 25 Nov 2019 10:28:40 +0000 (11:28 +0100)]
Bug 10352: Use a new object_type parameter instead of the module's name

To dissociate a search on biblio and item, we pass a new "object_type"
parameter to viewlog.pl. If equals 'biblio' we will assume that "object"
contains a biblionumber

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 10352: Display the correct modification logs for bibliographic records
Jonathan Druart [Mon, 13 May 2019 15:36:14 +0000 (10:36 -0500)]
Bug 10352: Display the correct modification logs for bibliographic records

The 'Modification log" link in the cataloguing module returns confusing
results. The 'object' parameter is the biblionumber, but the all log
from itemnumber=biblionumber will be displayed as well.
Since bug 11473 we have the action_logs.info column that is prefixed by
'item ' or 'biblio ' to disociated an item modification from a biblio
modif.
This patch suggests a quick and dirty approach, use this column to make
sure we are searching for the correct logs.
/!\ As bug 11473 did not update the existing rows, we will no longer display
the logs created prior to this change.

Test plan:
Make sure you have at least 2 bibliographic records with some items
Make sure you have the biblionumbers of those records that match
existing itemnumbers
Edit them (no matter what you change)
Go to the bibliographic detail page (staff) and click "Modification log"
You should see the correct changes.

Signed-off-by: hc <hc@interleaf.ie>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24313: Always display XSLT errors in logs
Jonathan Druart [Fri, 27 Dec 2019 13:55:36 +0000 (14:55 +0100)]
Bug 24313: Always display XSLT errors in logs

From
  commit 295ae33800a322facfdf56795f4c02b2fd53432b
  Bug 20272: Replace error numbers by codes in XSLT_Handler

"""
    Make XSLT_Handler a little bit less noisy by defaulting print_warns to
    false unless $ENV{DEBUG} is set. (See also bug 19018).
"""

I think we should warn the errors in the logs. They are not debug messages here, we should not rely on DEBUG.
If too noisy we should fix the original issues, not hide all the errors (which make the XSLT debugging super hard)

Test plan:
Break a XSLT, reload the page and confirm that there are useful errors in the Koha log file

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24123: Fix import of UTF-8 encoded MARC21 MARCXML using bulkmarcimport (elastic...
Jonathan Druart [Tue, 10 Dec 2019 14:24:36 +0000 (15:24 +0100)]
Bug 24123: Fix import of UTF-8 encoded MARC21 MARCXML using bulkmarcimport (elastic only)

If elastic is used as search engine, the bulkmarcimport.pl will not
handle correctly UTF-8 encoded MARCXML

Koha::SearchEngine::Search->new uses a require statement to load the correct Search module.
This is done l.257 of bulkmarcimport.pl:
  257 my $searcher = Koha::SearchEngine::Search->new

Koha::SearchEngine::Elasticsearch::Search will `use MARC::File::XML`, and so resets the arguments set before:
  216     $MARC::File::XML::_load_args{BinaryEncoding} = 'utf-8';

  220     $MARC::File::XML::_load_args{RecordFormat} = $recordformat;

An easy (but dirty) fix could be to move the declaration of my $searcher before in the script.
The tricky (but correct) fix would be to remove the long standing "ugly hack follows" comment.

This patch is the easy, and dirty, fix

Test plan:
Use the command line tool to import MARXCML records that contains unicode characters into Koha

Something like `misc/migration_tools/bulkmarcimport.pl -biblios -file record.marcxml -m=MARCXML`

Without this patch you will notice that unicode characters will not be displayed correctly

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23974: Add test descriptions
Martin Renvoize [Mon, 2 Dec 2019 09:22:31 +0000 (09:22 +0000)]
Bug 23974: Add test descriptions

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23974: Add tests for issue on closed day
Martin Renvoize [Mon, 2 Dec 2019 09:00:18 +0000 (09:00 +0000)]
Bug 23974: Add tests for issue on closed day

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23974: Test Notes
Martin Renvoize [Fri, 29 Nov 2019 17:09:06 +0000 (17:09 +0000)]
Bug 23974: Test Notes

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23974: Add POD for hours_between
Martin Renvoize [Fri, 29 Nov 2019 16:44:45 +0000 (16:44 +0000)]
Bug 23974: Add POD for hours_between

Add a bit of missing POD whilst we're working in here

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23974: (follow-up) Add same day loan tests
Martin Renvoize [Fri, 8 Nov 2019 13:37:17 +0000 (13:37 +0000)]
Bug 23974: (follow-up) Add same day loan tests

Hourly loans can be short enough to not cross a day boundary and as such
we should test for that scenario in the hour_between tests too.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23974: Both methods should have the same logic/construction
Jonathan Druart [Tue, 5 Nov 2019 16:44:36 +0000 (17:44 +0100)]
Bug 23974: Both methods should have the same logic/construction

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23974: Add tests for days_between
Jonathan Druart [Tue, 5 Nov 2019 16:13:53 +0000 (17:13 +0100)]
Bug 23974: Add tests for days_between

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23974: Add new tests for hours_between
Jonathan Druart [Tue, 5 Nov 2019 15:23:00 +0000 (16:23 +0100)]
Bug 23974: Add new tests for hours_between

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23974: Improve readability
Jonathan Druart [Tue, 5 Nov 2019 14:18:38 +0000 (15:18 +0100)]
Bug 23974: Improve readability

This patch does not change anything, just a bit of cleaning

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21959: Add sponsor details
Martin Renvoize [Thu, 9 Jan 2020 16:52:23 +0000 (16:52 +0000)]
Bug 21959: Add sponsor details

Sponsored-by: City of Nîmes
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24255: Add summation methods to Koha::Account::Lines
Martin Renvoize [Tue, 17 Dec 2019 15:58:21 +0000 (15:58 +0000)]
Bug 24255: Add summation methods to Koha::Account::Lines

This patch adds a number of summation methods to Koha::Account::Lines
giving quick access to overall total, total credits and total debits.

Test plan
1) Run the included tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24257: Fix close of modal on 'Yes, print slip'
Jonathan Druart [Wed, 18 Dec 2019 09:37:00 +0000 (10:37 +0100)]
Bug 24257: Fix close of modal on 'Yes, print slip'

When a item-transfer-modal is prompted by returns.tt and the option
"Yes, print slip" is selected the transfer is not initiated and the
modal does not disappear.

The print_slip hidden input must be in the same form as the
submit/button .print, otherwise the browser logs
  this.form.print_slip is undefined

Test plan:
1. set AutomaticItemReturn to "don't"
2. Check out an item and attempt to check it in at a branch it doesn't
belong to.
3. When the popup modal appears select 'Yes, print slip'.
=> Observe that the transfer does initiate and the modal closes

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18731: (QA follow-up) Spelling and POD corrections
Martin Renvoize [Thu, 9 Jan 2020 16:24:13 +0000 (16:24 +0000)]
Bug 18731: (QA follow-up) Spelling and POD corrections

Just a coulpe of very minor tweaks to keep the QA scripts happy

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18731: OpenAPI definitions
Tomas Cohen Arazi [Wed, 4 Oct 2017 18:43:03 +0000 (15:43 -0300)]
Bug 18731: OpenAPI definitions

This patch introduces the OpenAPI definitions required for the orders
endpoint. It matches the voted RFC.

Sponsored-by: Camden County
Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18731: Use the stashed koha.embed in objects.search
Tomas Cohen Arazi [Mon, 6 Jan 2020 16:00:26 +0000 (13:00 -0300)]
Bug 18731: Use the stashed koha.embed in objects.search

This patch makes the objects.search helper use the koha.embed structure
that is embedded in the authenticate_api_request step.

This way, any controller using it will benefit from automatic embed
handling.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18731: Add API mappings to K::A::{Basket,Invoice}
Tomas Cohen Arazi [Mon, 30 Dec 2019 18:36:57 +0000 (15:36 -0300)]
Bug 18731: Add API mappings to K::A::{Basket,Invoice}

This patch adds to_api_mapping definitions to the following classes:

- Koha::Acquisition::Basket
- Koha::Acquisition::Invoice

They are implemented following the proposed RFCs:
https://wiki.koha-community.org/wiki/Acquisitions_baskets_endpoint_RFC
https://wiki.koha-community.org/wiki/Acquisitions_invoices_endpoint_RFC

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18731: /acquisitions/orders endpoint
Tomas Cohen Arazi [Tue, 5 Sep 2017 19:44:43 +0000 (16:44 -0300)]
Bug 18731: /acquisitions/orders endpoint

This patches implement the /acquisitions/orders endpoint.

The attribute names are consistent with the voted RFC

To test:
1. Apply this patchset
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_orders.t
=> SUCCESS: Tests pass!
3. Test the API with your favourite tool (Postman?)
=> SUCCESS: It works as expected!
4 Sign off :-D

Sponsored-by: Camden County
Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18731: Unit tests
Tomas Cohen Arazi [Tue, 5 Nov 2019 14:37:57 +0000 (11:37 -0300)]
Bug 18731: Unit tests

This patch implements unit tests for the orders endpoint.

Sponsored-by: Camden County
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18731: Make authenticate_api_request stash the embed structure
Tomas Cohen Arazi [Mon, 30 Dec 2019 18:34:43 +0000 (15:34 -0300)]
Bug 18731: Make authenticate_api_request stash the embed structure

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24302: Add a way to specify nested objects to embed in OpenAPI
Tomas Cohen Arazi [Mon, 23 Dec 2019 13:26:04 +0000 (10:26 -0300)]
Bug 24302: Add a way to specify nested objects to embed in OpenAPI

This patch introduces a helper for handling x-koha-embed headers on API
requests. It reads the embed definitions and adds them to the stash for
later use (either manually on the controllers, or in the objects.search
helper.

x-koha-embed needs to be defined as a list on the OpenAPI spec.

It throws an exception when invalid combinations are found.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24228: Make ->to_api params a hashref
Tomas Cohen Arazi [Mon, 23 Dec 2019 15:03:12 +0000 (12:03 -0300)]
Bug 24228: Make ->to_api params a hashref

This patch makes the parameters for Koha::Object(s)->to_api a hashref
preparing the ground for new parameters. The proposed syntax is:

$object->to_api(
    {
        embed => {
            'items' => {
                'children' => {
                    'homebranch' => {}
                }
            }
        }
    }
);

Tests are added for the Koha::Objects implementation and tests for
Koha::Object are adjusted to the new syntax, and a test for the single
result accessor is added as well.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24228: Add parameters to Koha::Object(s)->to_api to automatically embed objects
Agustin Moyano [Thu, 19 Dec 2019 18:50:49 +0000 (15:50 -0300)]
Bug 24228: Add parameters to Koha::Object(s)->to_api to automatically embed objects

This patch makes Koha::Object(s)->to_api have an 'embeds' parameter that
using dot notation (e.g. resource.related_resource.another_one) allows
embedding objects recursively.

To test:
1. Apply this patch
2. prove t/db_dependent/Koha/Object.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24252: Add relations to Koha::Account::Line
Martin Renvoize [Fri, 13 Sep 2019 13:03:11 +0000 (14:03 +0100)]
Bug 24252: Add relations to Koha::Account::Line

This patch adds two new relationships to the Koha::Account::Line object.

* credit_offsets - returns all credit type Koha::Account::Offsets
  related to this Koha::Account::Line.
* debit_offsets - returns all debit type Koha::Account::Offsets related
  to this Koha::Account::Line.
* credits - returns all credits related to this Koha::Account::Line.
* debits - returns all debits related to this Koha::Account::Line.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24321: (follow-up) Fix number of tests in t/db_dependent/Koha/Objects.t
Josef Moravec [Tue, 7 Jan 2020 11:30:53 +0000 (11:30 +0000)]
Bug 24321: (follow-up) Fix number of tests in t/db_dependent/Koha/Objects.t

Test plan:
prove t/db_dependent/Koha/Objects.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24321: Clean /patrons
Tomas Cohen Arazi [Thu, 2 Jan 2020 14:04:10 +0000 (11:04 -0300)]
Bug 24321: Clean /patrons

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24321: Clean /holds
Tomas Cohen Arazi [Tue, 31 Dec 2019 15:53:26 +0000 (12:53 -0300)]
Bug 24321: Clean /holds

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24321: Clean /patrons/{patron_id}/account
Tomas Cohen Arazi [Tue, 31 Dec 2019 15:35:43 +0000 (12:35 -0300)]
Bug 24321: Clean /patrons/{patron_id}/account

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24321: Clean /items
Tomas Cohen Arazi [Tue, 31 Dec 2019 15:31:24 +0000 (12:31 -0300)]
Bug 24321: Clean /items

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24321: Clean /biblios
Tomas Cohen Arazi [Tue, 31 Dec 2019 15:26:46 +0000 (12:26 -0300)]
Bug 24321: Clean /biblios

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24321: Clean /checkouts
Tomas Cohen Arazi [Tue, 31 Dec 2019 14:50:36 +0000 (11:50 -0300)]
Bug 24321: Clean /checkouts

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24321: Clean /libraries
Tomas Cohen Arazi [Tue, 31 Dec 2019 14:07:37 +0000 (11:07 -0300)]
Bug 24321: Clean /libraries

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>