koha.git
3 years agoBug 26265: (QA follow-up) Remove g option from regex, add few dirs master esi/master
Marcel de Rooy [Mon, 24 Aug 2020 08:03:48 +0000]
Bug 26265: (QA follow-up) Remove g option from regex, add few dirs

Adding .git. Using a regex.
If we make it a bit smarter, we do not need most dirs listed.

Test plan:
Run the test again

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26265: Add missing xt dir
Jonathan Druart [Fri, 21 Aug 2020 13:10:18 +0000]
Bug 26265: Add missing xt dir

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26265: Add test for missing directory in Makefile.PL
Jonathan Druart [Fri, 21 Aug 2020 13:09:44 +0000]
Bug 26265: Add test for missing directory in Makefile.PL

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26265: Add pos directory to the Makefile
Martin Renvoize [Fri, 21 Aug 2020 08:24:29 +0000]
Bug 26265: Add pos directory to the Makefile

This patch adds the /pos directory to the Makefile so that pos gets
properly mapped at make and install time.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 8732: DBRev 20.06.00.027
Jonathan Druart [Mon, 24 Aug 2020 10:29:50 +0000]
Bug 8732: DBRev 20.06.00.027

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 8732: (QA follow-up) Terminology - staff client to staff interface
Katrin Fischer [Thu, 20 Aug 2020 22:46:39 +0000]
Bug 8732: (QA follow-up) Terminology - staff client to staff interface

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 8732: (follow-up) Make icon show on opac details and correct pref
Nick Clemens [Tue, 18 Aug 2020 10:23:23 +0000]
Bug 8732: (follow-up) Make icon show on opac details and correct pref

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 8732: (QA follow-up) Fix capitalization and terminology on BiblioItemtypeInfo...
Katrin Fischer [Sat, 15 Aug 2020 03:05:31 +0000]
Bug 8732: (QA follow-up) Fix capitalization and terminology on BiblioItemtypeInfo description

- opac = OPAC
- add "system preference" to make context easier to understand

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 8732: undo XSLT changes
Nick Clemens [Mon, 3 Aug 2020 13:05:12 +0000]
Bug 8732: undo XSLT changes

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 8732: Update statement
Nick Clemens [Thu, 16 Jul 2020 11:47:04 +0000]
Bug 8732: Update statement

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 8732: Allowing biblio level itemtypes to display instead of MARC ones
Chris Cormack [Sun, 30 Sep 2012 21:58:06 +0000]
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones

This patchset adds a new syspref: BiblioItemtypeInfo

If you set BiblioItemtypeInfo to Koha, you will see the Koha
record level itemtype info. This info is also shown if item-level_itypes
is set to biblio

Display of icons are controlled by
noItemTypeImages/OpacnoItemTypeImages

Material type display is controlled by DisplayIconsXSLT/DisplayOPACIconsXSLT

To test:
 1 - Apply patch
 2 - Update database
 3 - Do an opac search and view results
 4 - Switch pref to 'Koha' and refresh
 5 - Note itemtypes appear
 6 - Click in to a record details
 7 - Note you see itemtype and icon
 8 - Switch the pref
 9 - Note you don't see record level itemtype and icon
10 - Repeat in staff interface

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 16112: Do not depend on SpecifyDueDate
Jonathan Druart [Fri, 21 Aug 2020 07:06:41 +0000]
Bug 16112: Do not depend on SpecifyDueDate

It's possible to specify a renewal due date in the checkouts table
even if SpecifyDueDate is off.

Also change the label from "Specify due date:" to "Renewal due date:"

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 16112: (follow-up) Form style improvements, clear date
Owen Leonard [Thu, 6 Aug 2020 12:41:23 +0000]
Bug 16112: (follow-up) Form style improvements, clear date

This follow-up makes some markup and style improvements in order to make
the renew form more consistent with similar forms like checkout and
check-in.

It also adds a "Clear" button for the datepicker field, matching similar
date inputs.

To test, apply the patch and go to Circulation -> Renew.

 - With or without the  SpecifyDueDate system preference enabled the
   form should look correct.
 - With the SpecifyDueDate preference enabled you should see the date
   form below the barcode input field.
 - Select a date and test that the "Clear" button works to clear it.
 - Compare to the check-in page to confirm that they look consistent
   with each other.

Signed-off-by: Marco Abi-Ramia <marco.abi-ramia@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 16112: Add the ability to define due date for batch renew
Jonathan Druart [Tue, 4 Aug 2020 14:55:56 +0000]
Bug 16112: Add the ability to define due date for batch renew

Same as bug 16748, for batch renew.

Test plan:
Check an item in
Renew it using the circ/renew.pl page
=> You can pick a due date!
=> The date is kept from one renew to another
Renew it until you reach the maximum number of renewals
=> You get a warning with "continue without renewing"
=> The date is still kept

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 21750: Move collection code to its own column on checkins table
Nick Clemens [Thu, 1 Nov 2018 15:11:36 +0000]
Bug 21750: Move collection code to its own column on checkins table

To test:
 1 - Set 'ShowAllCheckins' to show
 2 - Set a collcection code for an item
 3 - Check it in
 4 - Note it displays in the the 'Item type' column
 5 - Apply patch
 6 - Check it in again
 7 - Note the new 'Collection' column
 8 - Hide/show the column using column visibility on the checkins page
 9 - Go to Admin->Configure columns
10 - Test the various settings for this column and check in the item to
make sure they work as expected

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 24973: Load custom localization file
Bernardo Gonzalez Kriegel [Fri, 15 May 2020 21:11:16 +0000]
Bug 24973: Load custom localization file

It adds a new localization directory that could
host a custom SQL file for each language,
xx-YY/custom.sql

This will be the last file to be loaded at
install time, it can be used to set any difference
from default values.

It can't be deselected at install time.

Moved corresponding files for de-DE, it-IT,
nb-NO and completed es-ES

To test:
1) Apply the patch
2) Install es-ES/de-DE/it-IT/nb-NO translation (any lang)
   ( cd misc/translation; ./translate install es-ES )
3) Do a clean install using es-ES
4) After all files have been loaded check:
    * A new section labeled "Localization data added"
      with one file, custom.sql
    * Inspect the value of FrameworksLoaded syspref,
      last entry must be custom.sql
5) Remove/rename the file or localization dir and
   repeat 3/4, install must proceed normally

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25113: Refactor CirculationRules.t when testing scope combinations
Lari Taskula [Sat, 4 Apr 2020 15:01:02 +0000]
Bug 25113: Refactor CirculationRules.t when testing scope combinations

We used to test rule scopes by explicitly defining each combination.

When adding new scopes, it is much easier if these tests are auto-
generated for you so that you don't have to repeat similar code.

This patch removes those "duplicates" and adds a method that returns
test cases for each scope as follows:

branchcode categorycode itemtype
__________ ____________ ________
branchcode categorycode itemtype
branchcode categorycode *
branchcode *            itemtype
branchcode *            *
*          categorycode itemtype
*          categorycode *
*          *            itemtype
*          *            *

And automatically extends the test when new scopes are added.

This also obsoletes the "Get effective issuing rule in correct order"
test in t/db_dependent/Koha/IssuingRules.t

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

Sponsored-by: The National Library of Finland
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

JD amended patch: perl tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25728: Don't prefill av's code
Jonathan Druart [Sat, 22 Aug 2020 12:11:45 +0000]
Bug 25728: Don't prefill av's code

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25728: fix rebase issues
Jonathan Druart [Sat, 22 Aug 2020 09:15:28 +0000]
Bug 25728: fix rebase issues

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25728: Use a svc script instead of the REST API endpoint
Jonathan Druart [Sat, 13 Jun 2020 10:36:01 +0000]
Bug 25728: Use a svc script instead of the REST API endpoint

The try to implement correctly the REST API endpoint for authorised
values failed.
This patch uses an easy to implement svc script for the POST route.

Signed-off-by: Hugo Agud <hagud@orex.es>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25728: Don't explode if no CAN_* var defined
Jonathan Druart [Tue, 9 Jun 2020 16:02:14 +0000]
Bug 25728: Don't explode if no CAN_* var defined

Sponsored-by: Orex Digital

Signed-off-by: Hugo Agud <hagud@orex.es>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25728: Fix the clone field feature
Jonathan Druart [Tue, 9 Jun 2020 15:57:19 +0000]
Bug 25728: Fix the clone field feature

Sponsored-by: Orex Digital

Signed-off-by: Hugo Agud <hagud@orex.es>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25728: Don't explode in the advanced editor
Jonathan Druart [Tue, 9 Jun 2020 15:34:30 +0000]
Bug 25728: Don't explode in the advanced editor

Sponsored-by: Orex Digital

Signed-off-by: Hugo Agud <hagud@orex.es>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25728: Create AV when cataloguing an authority record
Jonathan Druart [Tue, 9 Jun 2020 15:34:34 +0000]
Bug 25728: Create AV when cataloguing an authority record

Test plan:
Same as the first patch but when cataloguing an authority record

Sponsored-by: Orex Digital

Signed-off-by: Hugo Agud <hagud@orex.es>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25728: Create AV when adding a new item
Jonathan Druart [Mon, 8 Jun 2020 14:00:48 +0000]
Bug 25728: Create AV when adding a new item

We do a bit of refactoring to make the code reusable.

Test plan:
Same as the first patch but when adding/editing an item

QA note: There is a warning from the QA tools
 FAIL   koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
   FAIL   js_in_body
                A <script> tag found inside head, must be moved to the body (see bug 17858)
I don't think how we could avoid it.

Sponsored-by: Orex Digital

Signed-off-by: Hugo Agud <hagud@orex.es>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25728: Create AV when cataloguing a bibliographic record
Jonathan Druart [Fri, 12 Jun 2020 13:22:54 +0000]
Bug 25728: Create AV when cataloguing a bibliographic record

This whole patch set adds the ability to create a new authorised value
directly from the cataloguing module.
It will prevent the cataloger to leave and reload the page if they need
a new one.

Test plan:
If you are logged in with a patron with the manage_authorised_values
subpermission you will be able to:
* Edit a bibliographic record
* Search for a subfield linked to an authorised values (not the "fake"
AV like itemtypes, branches, cn)
* Click the dropdown list and start searching for a value that does not
exist
* Click enter
* Fill the fields in the popup
* Save
=> Your dropdown list has the new AV :)

Note: This does not work for the advanced editor. It does not have
select2 applied to the selects. I have hardly tried but failed.

Sponsored-by: Orex Digital

Signed-off-by: Hugo Agud <hagud@orex.es>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25727: (follow-up) Some style updates, JS i18n
Owen Leonard [Fri, 21 Aug 2020 13:19:26 +0000]
Bug 25727: (follow-up) Some style updates, JS i18n

This patch makes to general changes. First, it makes some minor style
changes to the appearance of the dropdowns. Second, it moves the JS
content in select2.inc into a separate JS file. This is made possible by
Bug 21156.

To test, apply the patch and view a page which uses the Select2 library,
e.g. the add item screen. Confirm that the Select2-styled dropdowns look
good and work correctly.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/select2.js for translation,
  e.g.:

  msgid "No results found"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for
  testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client and
  test a Select2-styled dropdown. Test that translated strings appear.
  For example:
  - Use the filter form to search for a string which isn't found. You
    should see a translated version.
  - Make a selection in one of the dropdowns. Hover your mouse over the
    "X" icon which now appears. The tooltip should be a translated
    version.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25727: Default to dropdownAutoWidth
Jonathan Druart [Mon, 17 Aug 2020 14:39:43 +0000]
Bug 25727: Default to dropdownAutoWidth

This will set a correct width by default.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25727: Do not open options on clear
Jonathan Druart [Mon, 17 Aug 2020 12:58:10 +0000]
Bug 25727: Do not open options on clear

We want to restore the previous behaviour and keep the options closed when
clear is clicked

https://github.com/select2/select2/issues/3320#issuecomment-621662039

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25727: (follow-up) Use CSS specificity rather than !important
Owen Leonard [Wed, 17 Jun 2020 16:34:50 +0000]
Bug 25727: (follow-up) Use CSS specificity rather than !important

This patch adds specificty to the CSS which controls the "invalid"
appearance of a Select2 dropdown so that the use of "!important" can be
avoided. The patch also puts this style into our custom select2 CSS file
so that it is located with other Select2 style changes.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25727: Fix highlight of a missing field
Jonathan Druart [Sat, 13 Jun 2020 13:03:50 +0000]
Bug 25727: Fix highlight of a missing field

In the previous version of Select2 we had only 1 'a' tag that was
visible, next to the invisible select.

Now we have a 3 nested span elt, the last one (with a role=combobox
attribute) is the one we want to style.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25727: Fix default values
Jonathan Druart [Sat, 13 Jun 2020 12:08:11 +0000]
Bug 25727: Fix default values

The way we defined the default values does not longer work (?)
Using
  $.fn.select2.defaults.set
instead of
  jQuery.extend($.fn.select2.defaults, {
fixes the problem.

It restores the allowClear setting.

There is a change in the behavior here, the selection opens when the
clear button is clicked. That is coming from a change in Select2
apparently. We may want to hack something to restore the precedent
behaviour.

This patch also removes the redefinition of the width. It seems that the
issue that this code was trying to correct is now fixed.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25727: Adjust translations
Jonathan Druart [Sat, 13 Jun 2020 11:32:56 +0000]
Bug 25727: Adjust translations

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25727: Upgrade the Select2 JS lib to version 4
Jonathan Druart [Sun, 7 Jun 2020 10:23:04 +0000]
Bug 25727: Upgrade the Select2 JS lib to version 4

In order to benefit from the last feature of Select we should upgrade to the version 4.
For instance it adds the ability to dynamically create new entries

https://select2.org/tagging

Test plan:
Confirm that there is no visible regression on dropdown list with select2
Like edit a bibliographic records, and the items.

Sponsored-by: Orex Digital

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26150: Remove the use of jquery.checkboxes plugin from inventory page
Owen Leonard [Wed, 5 Aug 2020 17:00:26 +0000]
Bug 26150: Remove the use of jquery.checkboxes plugin from inventory page

This patch removes the use of the jquery.checkboxes plugin from the
inventory page and replaces it with custom JS.

To test, apply the patch and go to Tools -> Inventory.

 - Submit the form with some selections which will return results on the
   following page. I filtered by library.
 - On the page showing results, test that the "Select all" and "Clear
   all" links work correctly.

Signed-off-by: Brandon J <brandon.jimenez@inLibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26157: Hide expected DBI warnings from tests
Jonathan Druart [Thu, 6 Aug 2020 11:11:50 +0000]
Bug 26157: Hide expected DBI warnings from tests

We must redirect them to /dev/null if we know they will appear.

Test plan:
prove the different test files and confirm that the output is clean when
this patch is applied

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 21539: addorderiso2709.pl forces librarian to select a ccode and notforloan code...
Kyle M Hall [Wed, 10 Oct 2018 15:13:37 +0000]
Bug 21539: addorderiso2709.pl forces librarian to select a ccode and notforloan code when using MarcItemFieldsToOrder

There is no reason that MarcItemFieldsToOrder should force librarians
to select a ccode and notforloan value for each item.
They are both optional fields.
As with location, the first value should be an empty 'none' option.

Test Plan:
1) Set up MarcItemFieldsToOrder, do *not* set mappings for ccode and notforloan
2) Add an order record to a basket that uses MarcItemFieldsToOrder
3) Note you must choose a ccode and nfl value
4) Apply this patch
5) Reload the page
6) Note you no longer have to select values for ccode and notforloan

Signed-off-by: Daniel Gaghan <daniel.gaghan@pueblolibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26189: Compiled CSS
Jonathan Druart [Mon, 24 Aug 2020 09:06:39 +0000]
Bug 26189: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26189: Improve styling of datatables within fieldsets
Martin Renvoize [Wed, 12 Aug 2020 12:58:58 +0000]
Bug 26189: Improve styling of datatables within fieldsets

Unset label width restriction: The label width restriction within
fieldsets causes issues for the datatables header. Unsetting it
explicitly here resolves the line wrapping issues :)

Reset margins for datatables found inside fieldsets such that the
datatable properly utilises the available space and restore the
default datatable label font weights.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25791: Remove win.print()
Lucas Gass [Wed, 15 Jul 2020 22:28:07 +0000]
Bug 25791: Remove win.print()

Test plan:
1) Turn on system preference SelfCheckReceiptPrompt
2) Check out item via /cgi-bin/koha/sco/sco-main.pl
3) Click "Finish"
4) Click 'Print receipt and end session'
5) Notice two print dialog boxes right on top of each other
6) Apply patch
7) Repeat steps 1 - 4
8) Should only get a single print dialog.
9) Test in FF/Chrome and make sure behavior is consistent

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25903: Add unit tests
Kyle M Hall [Thu, 20 Aug 2020 11:56:12 +0000]
Bug 25903: Add unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25903: Sending a SIP patron information request with a summary field flag in...
Kyle M Hall [Tue, 30 Jun 2020 18:37:21 +0000]
Bug 25903: Sending a SIP patron information request with a summary field flag in indexes 6-9 will crash server

The 'summary' field in the patron information request specifies if detail information should be send for holds,
overdues, fines, etc. The field is 10 characters in length (0-9). However, the SIP2 spec only defines indexes 0
though 5, leave 6 though 9 undefined. Some ILSs specify behavior for these undefined indexes. Apparently the
7th field is often used to request 'Fees', as opposed to 'Fines' in some ILS. Some software that integrate via
SIP try both the 5th and 7th indexes to ensure they get all fines and fees.

The problem is that Koha's SIP server crashes if any 'summary' index beyond 5 is flagged. We should simply
ignore flags beyond 5 and act as if no flags were sent.

Test Plan:
1) Enable SIP for your instance
2) Send a patron information request with a summary flag in any index beyond 5.
   i.e.: 6300120200617    124846      Y   AOMIDAY|AA21030050054321
3) Note the SIP server just closes the connection without a response
4) Apply this patch
5) Restart the SIP server
6) Send the same request
7) Note you get back the patron information response!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jeff Gaines <jgaine@arlingtonva.us>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26076: (QA Follow up) Prevent error by using a fresh resultset
Kyle M Hall [Thu, 30 Jul 2020 13:35:38 +0000]
Bug 26076: (QA Follow up) Prevent error by using a fresh resultset

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26076: Sum the amount due in the database query instead of a loop in Perl
Kyle M Hall [Tue, 28 Jul 2020 16:49:35 +0000]
Bug 26076: Sum the amount due in the database query instead of a loop in Perl

This appears to be a bug due to inaccuracies in floating point math. I've been unable to reproduce it on demand. Sometimes when using the "Write off selected" button, Koha will give the error that the payment is more than the amount owed, even though they are the same. The solution I've implemented is to move the summation from Perl code to the database query. This video demonstrates the issue and afterward, shows the error goes away after the patch is applied: https://monosnap.com/file/pG69HC7iI9mU9kkuoCtbkVzVTffKlE

Test Plan:
1) Apply this patch
2) Restart all the things!
3) Verify that "Write off selected" functions as usual

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26270: Fix ThingISBN after a change in behaviour
Jonathan Druart [Fri, 21 Aug 2020 12:00:51 +0000]
Bug 26270: Fix ThingISBN after a change in behaviour

This is just a guess! One of our tests is failing since today and we
don't modify anything in this area.
My guess is that the service is now returning the normalized version of
the ISBN

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 24683: IsAvailableForItemLevelRequest sub description expanded
Andrew Nugged [Sun, 19 Jul 2020 21:16:51 +0000]
Bug 24683: IsAvailableForItemLevelRequest sub description expanded

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 24683: whole test formatted by 'perltidy'
Andrew Nugged [Sun, 19 Jul 2020 21:15:37 +0000]
Bug 24683: whole test formatted by 'perltidy'

This is complementary patch using styling from
bundled /xt/perltidyrc file

Almost no code change except a few long constant strings
broken to parts by concatenation.

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 24683: Fix for take smart rules into account in "if all unavailable"
Andrew Nugged [Sun, 19 Jul 2020 21:20:56 +0000]
Bug 24683: Fix for take smart rules into account in "if all unavailable"

Inside of ItemsAnyAvailableAndNotRestricted was no effect from main set
of smart rules (per record and other limits): i.e. call to
"CanItemBeReserved" was absent totally.

Because of this there was a bug: for example none of two items were
allowed to be held when first was allowed by one smart rule, BUT on loan,
and second was disallowed by another smart rule (for example,
0 "Holds per record"),

i.e. in this case both items unavailable: so on-shelf holds setting
"allow hold if all unavailable" should allow to hold first one, and not
the second one. But it was that both wasn't allowed to be held.

Solution: call to sub "CanItemBeReserved" added so it checked for
"...->{status} ne 'OK'" so now if item restricted by smart rule it also
accounted as "unavailable" and "AnyAvailavble" not counts it.

How to reproduce:

1. Add 2 smart rules (/cgi-bin/koha/admin/smart-rules.pl) with "on shelf
   holds": "if all unavailable" for all rules, no "item level holds", and
   set "holds per record" to 2 for "books" and "0" for "computer files".

2. Create only 2 items for one biblio, but different types, "book"
   and "computer file". For example in misc4dev env:
   /cgi-bin/koha/cataloguing/additem.pl?biblionumber=1#additem

3. Check out that item of type "book" to some person, for example,
   in misc4dev:
   /cgi-bin/koha/circ/circulation.pl?borrowernumber=2&barcode=3999900000001

4. Open reserve/request, for example, for item 1 and patron 1 in misc4dev
   env (/cgi-bin/koha/reserve/request.pl?biblionumber=1&borrowernumber=1)

5. It does not allow to hold, both red crossed, but computer file says
   "Exceeded max holds per record" because of "0" limit set on step 1.

6. Apply the patch.

7. Reload page on step 5 and see that "book" will be available for hold,
   but "computer file" still will be red-crossed "Exceeded max holds
   per record", now that's correct because both items unavailable:
   one because on load, another because of "0" limit for computer files.

8. Check-in book from step 3 so it will be returned to the library,

9. Reload page on step 5 and see that again no any holds available,
   but it's now also correct: "book" now returned but "on shelf holds"
   set to "if all unavailable".

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 24683: Optimize loop in ItemsAnyAvailableAndNotRestricted
Andrew Nugged [Fri, 17 Jul 2020 11:59:19 +0000]
Bug 24683: Optimize loop in ItemsAnyAvailableAndNotRestricted

Add cut-off shortcut (return from inside the loop) when first
"Any Available And Not Restricted" item found, because one is
enough for "Any".

Testing: no change visible for code behavior/results,
it is just faster because won't loop over the whole set.

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 24683: Subroutine name changed (fix), no code logic changed This is the intermedi...
Andrew Nugged [Fri, 5 Jun 2020 06:59:48 +0000]
Bug 24683: Subroutine name changed (fix), no code logic changed This is the intermediate refactor: renamed subroutine only.

Naming mistake came because this sub is used to detect if anything
available for hold, but it used in "if ANY UNAVAILABLE rule", so actually
results of this sub negated (see below "return" in the code).

In details:

when previous refactor was done, name for subroutine was chosen
wrongly in "opposite" direction from what it actually does:

it was named "ItemsAnyAvailableForHold", but this subroutine gave
truth (1) if at least one of the items available on shelf, not lost,
not on loan, not held, and not restricted by smart rules and damaged
status. So, if this sub says that item is still "available", this
actually PREVENTS item from hold in parent sub (see negated return):

    sub IsAvailableForItemLevelRequest {
        ...
        my $any_available = ItemsAnyAvailableAndNotRestricted...
        return $any_available ? 0 : 1;
             # ^^^ if any available and not restricted - we don't allow
             #     on-shelf holds
        ...

I.e. like it named now: "ItemsAnyAvailableAndNotRestricted".

Small aside fix: white space for '&&' inside brackets added to join
operation by priority visually.

Testing plan not needed: all places where sub used it just renamed.
More: all this places/code was introduced in one older commit so there
is also no overlaps or other calls/uses for this subroutine.

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26023: Properly secure the cashup and refund actions
Martin Renvoize [Tue, 4 Aug 2020 14:02:03 +0000]
Bug 26023: Properly secure the cashup and refund actions

The cash register summary page for cash management is available for users
with the 'anonymous_refund' or 'cashup' permission and the actions available
are appropriately displayed.

However, the actions are not yet correctly tested for at the server and
so a user may force submit to accomplish the action.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26023: Properly secure the cashup action for libraries
Martin Renvoize [Mon, 20 Jul 2020 08:44:05 +0000]
Bug 26023: Properly secure the cashup action for libraries

The libraries summary page for cash management is available for users
wit the 'anonymous_refund' permission to allow them to navigate to
alternate cash registers and search for the prior transaction to refund.

However, currently the cashup option appears, and is not blocked at the
server, for all user who may access the page. It should be blocked for
those users without the 'cashup' permission.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26253: (bug 22857 follow-up) Remove duplicated mana_config in etc/koha-conf.xml
Jonathan Druart [Thu, 20 Aug 2020 08:10:14 +0000]
Bug 26253: (bug 22857 follow-up) Remove duplicated mana_config in etc/koha-conf.xml

It was there already but not at the same place!

Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26031: Add diagnostic to search_utf8.t
Jonathan Druart [Fri, 21 Aug 2020 08:06:57 +0000]
Bug 26031: Add diagnostic to search_utf8.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25811: Add debug info to authentication.t
Jonathan Druart [Fri, 21 Aug 2020 08:49:42 +0000]
Bug 25811: Add debug info to authentication.t

Trying to know if the logged in patron is the one we are expecting to
(well, we are not expecting anybody to be logged in at this point!)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 19036: (follow-up) Test credits should be credits
Martin Renvoize [Thu, 20 Aug 2020 11:52:09 +0000]
Bug 19036: (follow-up) Test credits should be credits

A series of accountlines added to mock credits were being added with a
debit_type_code instead of a valid credit_type_code and so were being
mis-identified by the new credit numbering code trigger in the store
routine.

This patch updates the test to correctly identify the credits as credits

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: Don't use paidfor for DB fields not mapped with a MARC field
Jonathan Druart [Fri, 21 Aug 2020 10:02:07 +0000]
Bug 18501: Don't use paidfor for DB fields not mapped with a MARC field

On "Bug 25964: Prevent data loss when editing items from a MARC record"
we picked paidfor as an example, but it has a specific behaviour and is
now handled in Koha::Item->store.
Let's pick another one, new_status

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: (follow-up) Use t::lib::Dates::compare in tests
Martin Renvoize [Fri, 21 Aug 2020 09:21:35 +0000]
Bug 18501: (follow-up) Use t::lib::Dates::compare in tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: (follow-up) Add fallback to ItemHomeBranch
Martin Renvoize [Thu, 20 Aug 2020 13:02:35 +0000]
Bug 18501: (follow-up) Add fallback to ItemHomeBranch

When 'RefundLostOnReturnControl' is set to 'CheckinLibrary' but
return_branch is passed as undefined we should fallback to
'ItemHomeBranch' before falling back to the default rule.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: (follow-up) Do not rely on userenv->{branchcode}
Martin Renvoize [Thu, 20 Aug 2020 12:28:41 +0000]
Bug 18501: (follow-up) Do not rely on userenv->{branchcode}

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: (follow-up) Test undefined userenv behaviour
Martin Renvoize [Thu, 20 Aug 2020 13:28:46 +0000]
Bug 18501: (follow-up) Test undefined userenv behaviour

This patch adds a test to ensure that the 'Koha::Item->store' method
will function when the userenv is not set

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: (follow-up) Remove duplicate test
Martin Renvoize [Thu, 20 Aug 2020 11:38:23 +0000]
Bug 18501: (follow-up) Remove duplicate test

The ModItem test found in t/db_dependent/Items.t was a duplciate (but
slightly less functional) for the test we introduced for the *_on
trigger functionality in t/db_dependent/Koha/Items.t::store

The failure was a missing C4::Context mock, but the logical fix is to
simply remove the duplicate test.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: Fix QA issues
Jonathan Druart [Thu, 20 Aug 2020 09:49:08 +0000]
Bug 18501: Fix QA issues

 FAIL   Koha/Item.pm
   FAIL   critic
                # Variables::ProhibitConditionalDeclarations: Got 1 violation(s).
   FAIL   spelling
                 Retreive ==> Retrieve
                 appropriatly ==> appropriately
                 somehwere ==> somewhere

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: (QA follow-up) Fix regressions highlighted by unit tests
Martin Renvoize [Fri, 14 Aug 2020 16:18:12 +0000]
Bug 18501: (QA follow-up) Fix regressions highlighted by unit tests

The migration of unit tests in the preceeding patch highlighted a few
regressions which are dealt with here.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: (QA follow-up) Migrate and update unit tests
Martin Renvoize [Fri, 14 Aug 2020 16:16:04 +0000]
Bug 18501: (QA follow-up) Migrate and update unit tests

This patch moves the _FixAccountForLostAndFound tests from Circulation.t
to Koha/Items.t and updates then to call an item store as aposed to the
now removed _FixAccountForLostAndFound method.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: (QA follow-up) Remove FIXME + Track issue_id
Martin Renvoize [Fri, 14 Aug 2020 10:53:59 +0000]
Bug 18501: (QA follow-up) Remove FIXME + Track issue_id

We correct some compilation errors here by updating the transfered
_FixAccountForLostAndFound method to use $self references.  We add
issue_id tracking so that future reports can clearly see how a refund
relates to the original charge and finally we remove a FIXME as I agree
that the 'discard_changes' call is not required.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: Adjust condition for flagging an item found
Jonathan Druart [Fri, 14 Aug 2020 08:51:39 +0000]
Bug 18501: Adjust condition for flagging an item found

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: set the is_refunded flag as internal var
Jonathan Druart [Fri, 14 Aug 2020 08:48:00 +0000]
Bug 18501: set the is_refunded flag as internal var

After discussion with Martin we decided that it could be the correct way

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: wip - need to know it has been refunded
Jonathan Druart [Fri, 14 Aug 2020 07:56:41 +0000]
Bug 18501: wip - need to know it has been refunded

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: but.. what was the meaning of holdingbranch here?
Jonathan Druart [Thu, 13 Aug 2020 16:42:56 +0000]
Bug 18501: but.. what was the meaning of holdingbranch here?

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: Add _set_found_trigger
Jonathan Druart [Thu, 13 Aug 2020 16:42:01 +0000]
Bug 18501: Add _set_found_trigger

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: Auto refund if mark as found from cataloguing
Jonathan Druart [Mon, 10 Aug 2020 14:51:11 +0000]
Bug 18501: Auto refund if mark as found from cataloguing

If an item is marked as found (ie. not itemlost) we need to refund the
patron.

Test plan:
Mark an item as lost to create a fee for the patron
Mark it as found from the cataloguing module and confirm that the patron
is refunded

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: Remove the borrowernumber parameter
Jonathan Druart [Wed, 12 Aug 2020 13:45:24 +0000]
Bug 18501: Remove the borrowernumber parameter

It was not used

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: Prepare the ground
Jonathan Druart [Mon, 10 Aug 2020 14:39:08 +0000]
Bug 18501: Prepare the ground

This code was duplicated and we are going to need it.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 18501: (QA follow-up) Add test of *_on functionality
Martin Renvoize [Tue, 18 Aug 2020 12:26:29 +0000]
Bug 18501: (QA follow-up) Add test of *_on functionality

This patch adds a test for the *_on trigger functionality to ensure
matching behaviour before and after the triggers change.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 19036: DBRev 20.06.00.026
Jonathan Druart [Thu, 20 Aug 2020 10:27:33 +0000]
Bug 19036: DBRev 20.06.00.026

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 19036: (follow-up) Improve test output
Martin Renvoize [Wed, 19 Aug 2020 11:17:32 +0000]
Bug 19036: (follow-up) Improve test output

This patch adds proper detail to the test output for the newly
introduced AutoCreditNumber feature and fixes the final test by adding
the 'interface' and 'amount' parameters to the Koha::Account::Line being
created so that we reach the Exception we are trying to catch and don't
die early.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 19036: Add missing test
Jonathan Druart [Tue, 18 Aug 2020 15:37:45 +0000]
Bug 19036: Add missing test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 19036: (QA follow-up) Add credit_number handling to POS
Martin Renvoize [Thu, 6 Aug 2020 11:28:48 +0000]
Bug 19036: (QA follow-up) Add credit_number handling to POS

This patch adds the display of 'credit_number' as a replacement for the
internal 'accountlines_id' as the transaction identifier on the
register summary page when using cash registers.

Test plan
1/ Enable 'UseCashRegisters'
2/ Enable 'EnablePointOfSale'
3/ Enable at least one 'Debit type' to allow 'sale'
4/ Add at least one 'Cash register'
5/ Enable 'AutoCreditNumber'
6/ 'Enable automatic generation of credit number' for the 'Purchase'
credit type
7/ Pay for an item via the Point of Sale page
8/ Navigate to the 'register' page to display the purchase details
9/ Confirm that the 'Transaction' is listed with a number of the form
specified in the 'AutoCreditNumber' preference
10/ Refund an item from this screen
11/ Note that the 'accountlines_id' is used for this refund as we did
not specify the 'Refund' credit type to use the 'AutoCreditNumber'
system
12/ Signoff

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 19036: (QA follow-up) Fix 'out-by-one' error on table
Martin Renvoize [Thu, 6 Aug 2020 10:34:35 +0000]
Bug 19036: (QA follow-up) Fix 'out-by-one' error on table

This patch fixes the total row where the column count was out by one.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 19036: (QA follow-up) Fix test plan
Martin Renvoize [Fri, 10 Jul 2020 10:31:33 +0000]
Bug 19036: (QA follow-up) Fix test plan

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 19036: DBIC Schema Updates
Martin Renvoize [Thu, 25 Jun 2020 09:43:03 +0000]
Bug 19036: DBIC Schema Updates

Dumped schema updates + manual addition of boolean flags

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 19036: (QA follow-up) Use Koha::DateUtils
Martin Renvoize [Thu, 25 Jun 2020 09:16:45 +0000]
Bug 19036: (QA follow-up) Use Koha::DateUtils

This patch replaced raw DateTime->now calls with dt_from_string from
Koha::DateUtils

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 19036: Add ability to enable credit number for only some credit types
Julian Maurice [Tue, 24 Mar 2020 09:14:03 +0000]
Bug 19036: Add ability to enable credit number for only some credit types

This feature is disabled by default for all credit types. To enable it
you have to set the syspref AutoCreditNumber to the value of your choice
and then enable the feature for each credit type you want.
System credit types can be modified too (but only this particular field
can be modified)

Also, throw an exception when the feature is enabled and a value for
credit_number has already been set

Updated test plan:
Test plan:
0. Apply patch, run updatedatabase and update_dbix_class_files
1. Go to Admin » Column settings, and uncheck the 'hidden' box for
   column credit_number in table account-fines. It will be easier for
   testing
2. Create a manual credit for a borrower. Verify in Transactions tab
   that this credit has no number generated
3. In Admin » Credit types:
  a. edit the FORGIVEN type and enable credit number generation
  b. create a new type A, check "can be manually added" and "enable
     credit number"
  c. create a new type B, check "can be manually added". Do NOT enable
     credit number
4. Change syspref 'AutoCreditNumber' to 'incremental'
5. Create more manual credits with types CREDIT and B, and verify that
   the numbers are not generated
6. Create more manual credits with types FORGIVEN and A, and verify that
   the numbers generated are 1, 2, 3, ...
7. Change syspref 'AutoCreditNumber' to 'annual'
8. Create more manual credits with types CREDIT and B, and verify that
   the numbers are not generated
9. Create more manual credits with types FORGIVEN and A, and verify that
   the numbers generated are '2020-0001', '2020-0002', ...
10. Change syspref to 'AutoCreditNumber' to 'branchyyyymmincr'
11. Create more manual credits with types CREDIT and B, and verify that
    the numbers are not generated
12. Create more manual credits with types FORGIVEN and A, and verify
    that the numbers generated are 'BRANCHA2020020001',
    'BRANCHA2020020002', ... (assuming you are connected to library
    BRANCHA, and it's February 2020)
13. Set library to another one, say BRANCHB
14. Create more manual credits with types FORGIVEN and A, and verify
    that the numbers generated are 'BRANCHB2020020001',
    'BRANCHB2020020002', ...
15. Edit the letter ACCOUNT_CREDIT, and add [% account.credit_number %]
    somewhere. Go back to Transactions tab and click on 'Print' for one
    line that has a credit number. Make sure the number is there.
16. prove t/db_dependent/Koha/Account.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 19036: Add ability to auto generate a number for account credits
Julian Maurice [Thu, 20 Feb 2020 09:02:38 +0000]
Bug 19036: Add ability to auto generate a number for account credits

In some areas it's required to sequentially number payment slips /
receipts.

This patch adds a database column accountlines.credit_number and a
system preference AutoCreditNumber to control how this number will be
generated.  The following options are available:

- Do not automatically generate credit numbers.
  This is the current behaviour and the default syspref value.

- Automatically generate credit numbers in the form <year>-0001 (annual)

- Automatically generate credit numbers in the form
  <branchcode>yyyymm0001 (branchyyyymmincr)
  where <branchcode> is the branch where the user (staff member) is
  logged in

- Automatically generate credit numbers in the form 1, 2, 3
  (incremental)

It also adds a column (hidden by default) in the table under
Transactions tab to display this number.

Test plan:
0. Apply patch, run updatedatabase and update_dbix_class_files
1. Go to Admin » Column settings, and uncheck the 'hidden' box for
   column credit_number in table account-fines. It will be easier for
   testing
2. Create a manual credit for a borrower. Verify in Transactions tab
   that this credit has no number generated
3. Change syspref 'AutoCreditNumber' to 'incremental'
4. Create more manual credits, and verify that the numbers generated are
   1, 2, 3, ...
5. Change syspref 'AutoCreditNumber' to 'annual'
6. Create more manual credits, and verify that the numbers generated are
   '2020-0001', '2020-0002', ...
7. Change syspref to 'AutoCreditNumber' to 'branchyyyymmincr'
8. Create more manual credits, and verify that the numbers generated are
   'BRANCHA2020020001', 'BRANCHA2020020002', ... (assuming you are
   connected to library BRANCHA, and it's February 2020)
9. Set library to another one, say BRANCHB
10. Create more manual credits, and verify that the numbers generated are
    'BRANCHB2020020001', 'BRANCHB2020020002', ...
11. Edit the letter ACCOUNT_CREDIT, and add [% account.credit_number %]
    somewhere. Go back to Transactions tab and click on 'Print' for one
    line that has a credit number. Make sure the number is there.
12. prove t/db_dependent/Koha/Account.t

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25242: Compiled CSS
Jonathan Druart [Thu, 20 Aug 2020 10:27:05 +0000]
Bug 25242: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25242: (QA follow-up) Remove deprecated break-word
Martin Renvoize [Wed, 19 Aug 2020 07:36:03 +0000]
Bug 25242: (QA follow-up) Remove deprecated break-word

It appears break-word is now deprecated in Firefox and instead all
browsers now support break-all as the definitive.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25242: (QA follow-up) Colwidth on results table
Martin Renvoize [Tue, 18 Aug 2020 09:35:59 +0000]
Bug 25242: (QA follow-up) Colwidth on results table

Prior to this patch, the column width on the opac-results table were not
fixed or calculated by a datatable; As such when we introduced the
'table-layout: fixed' property all columns were given equal share of the
table, which resulted in most cases in a three way split between a
checkbox, an empty cell and the actual content.

This patch sets the width for the selectcol to '1ch' for the single
character checkbox and updates the second columns class to 'numcol' as
it is not used for selection but rather result numbering and sets a
fixed width of '4ch' allowing for results upto 3 digits (plus the
period) to display correctly without wrapping.

Test plan
1/ Apply the patches and run the yarn build process to update the .css
2/ Perform a search and varify that the results table looks reasonable
3/ Disable OPACHiddenItems and perform a search again.
4/ Confirm the table looks reasonable still
5/ Signoff

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25242: Improve column wrapping and overflow for tables
Martin Renvoize [Thu, 6 Aug 2020 12:29:54 +0000]
Bug 25242: Improve column wrapping and overflow for tables

This patch attempts to improve the column wrapping and prevent
datatabels from overlapping with other content on high zoom levels/low
width screen sizes.

Test plan
1/ Build the OPAC CSS from the updated SCSS
2/ Navigate to various tables in the OPAC (Holds table is a good one)
and 'play' with various window sizes and zoom levels.
3/ The table should not overlap with right navigation content
4/ Signoff

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25430: Use label-default for 0
Jonathan Druart [Tue, 18 Aug 2020 14:44:34 +0000]
Bug 25430: Use label-default for 0

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25430: Improve the styling of the claims returned tab
Kyle M Hall [Fri, 8 May 2020 17:15:40 +0000]
Bug 25430: Improve the styling of the claims returned tab

It has been suggested that it would be useful to add title attributes to the different numbers on the return claims tab in the checkouts and patron details pages. In addition, color coding them ( and removing the slash ) will make the numbers easier to read.

Test Plan:
1) Set up return claims for your system
2) Apply this patch
3) View the claims tab for someone with not claims, and someone with claims
4) Note the resolved claims are green and have a "tooltip" when hovered over
5) Note the unresolved claims are green if 0, and yellow if not 0, and
   also have a "tooltip"

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25626: Fix untranslatable strings on the 'OPAC problem reports' admin
Jonathan Druart [Mon, 1 Jun 2020 08:19:05 +0000]
Bug 25626: Fix untranslatable strings on the 'OPAC problem reports' admin

The 'Sent to' and 'Status' column values were not translatable.

Test plan:
Translate the interface
Report some problems at the OPAC
Go to the admin page and notice that all the columns are now translated

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26082: Call store on new items to update itemnumber
Colin Campbell [Wed, 29 Jul 2020 12:23:14 +0000]
Bug 26082: Call store on new items to update itemnumber

Need to add call to store to Koha::Item->new so that itemnumber
is returned - otherwise is not defined and causes an error
Bug is a side-effect of Bug 23463 as this was implicitly
done in AddItem

Also set biblioitemnumber explicitly for item adds this also
used to be done explicitly but can now cause an FK error

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26251: Remove unused routines from svc/split_callnumbers
Marcel de Rooy [Wed, 19 Aug 2020 11:46:16 +0000]
Bug 26251: Remove unused routines from svc/split_callnumbers

This is just a copy and paste from svc/localization

Test plan:
Read the code.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26039: Focus and Scroll to ShelfBrowser on load
Martin Renvoize [Thu, 13 Aug 2020 12:17:59 +0000]
Bug 26039: Focus and Scroll to ShelfBrowser on load

When the shelf browser link is clicked we perform a full page reload
which results in a reset in the context. We should immediately focus the
shelf browser and scroll to that region to highlight the change of
content.

Test plan
1/ Enable shelf browser
2/ Search for an item in the open and navigate to the detail page
3/ Click the 'Browse shelf' link
4/ Note that upon page reload the screen scrolls to the 'Browsing...'
location of the screen.
5/ Note that the 'Browsing...' title is  'focused'
6/ Signoff.

Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

JD amended patch: correctly align JS code

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 25605: Replace NULL values with '' when downloading a report as a tab separated...
Didier Gautheron [Tue, 26 May 2020 11:31:31 +0000]
Bug 25605: Replace NULL values with '' when downloading a report as a tab separated text

Test plan :
    1- Create a new report : select * from items;
    2- Run it
    3- Download the report as a tab separated text
    4- There's a lot of 'use of uninitialized value in join or string at ...koha/reports/guided_reports.pl line xxx.'
    in plack-error.log
    5- Apply patch
    6- Restart all
    7- Redo 2 and 3
    8- No more warning.
    9- diff both downloaded files, they must be the same.

Signed-off-by: Marco Abi-Ramia <marco.abi-ramia@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26134: (bug 23463 follow-up) Fix add to basket from staged file
Jonathan Druart [Thu, 6 Aug 2020 10:50:36 +0000]
Bug 26134: (bug 23463 follow-up) Fix add to basket from staged file

There is a ->store call missing when we attempt to create a new item.

Test plan:
- set at least one value in MARCItemFieldsToOrder
- add to a basket via staged file with at least one value matching your MARCItemFields mappings
- set required fields for your order and click Save
=> Without this patch you got:
receive error: "DBIx::Class::Storage::DBI::_dbh_execute(): Column 'itemnumber' cannot be null at /kohadevbox/koha/Koha/Acquisition/Order.pm line 113
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77"
=> With this patch applied the order has been created successfully

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26153: Remove the use of jquery.checkboxes plugin from items lost report
Owen Leonard [Wed, 5 Aug 2020 18:24:08 +0000]
Bug 26153: Remove the use of jquery.checkboxes plugin from items lost report

This patch removes the use of the jquery.checkboxes plugin from the
lost items report page and replaces it with custom JS.

To test, apply the patch and go to Reports -> Lost items.

- Run the report with parameters which will return multiple results.
- On the results page Create a CSV export profile if there's none.
- On the results page test the "Select all" and "Clear all"
  links at the top of the results. The controls should work correctly.

Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26234: Teach our KohaTable constructor the specific th classes
Jonathan Druart [Tue, 18 Aug 2020 09:59:24 +0000]
Bug 26234: Teach our KohaTable constructor the specific th classes

We have different classes we can use to set specific behaviours on
table columns: title-string, string-sort, anti-the and NoSort.
We should not need to pass them to the DataTable constructor, we could
teach it that we always want to apply them.

It will avoid bug like bug 26233

The goal is to define them in a centralised place
(columns_settings.inc) then only use the class on the th

Test plan:
Different behaviour and tables must be tested to confirm it works
correctly. Focus must be put on table when aoColumnsDefs is passed from
the template and confirm that this will add more info to aoColumnsDefs
and not remove the existing ones.

Note that this only work when KohaTable is used.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

3 years agoBug 26239: Do not format large negative numbers
Nick Clemens [Tue, 18 Aug 2020 16:41:09 +0000]
Bug 26239: Do not format large negative numbers

At several places we got the following error if we use numbers too big
for Number::Format
Template process failed: undef error - round() overflow. Try smaller
precision or use Math::BigFloat at /home/koha/src/Koha/Number/Price.pm line 44

It make the app explodes.
The goal here is to handle these errors gracefully and easily.

We fixed it for positive numbers in bug 15770, but we neglected the case of negative numbers

Test plan:
- Add a manual credit to a patron of 100000000000000
- ISE!
- Apply patch
- Restart all the things

Works perfectly.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>