Commit graph

37450 commits

Author SHA1 Message Date
d16710382e
Bug 24082: Add refund action to relevant lines
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>
2020-03-04 16:14:41 +00:00
d4d1ffb91c
Bug 24082: Add anonymous_refund permission to cash_management
This patch adds the new `anonymous_refund` permission to the
`cash_management` flag and binds it to the visability of the register
details page.

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>
2020-03-04 16:14:37 +00:00
0359a04bf8
Bug 22529: Use new C4::Auth::haspermission from svc/members/search
The svc/members/search script can be used to retrieve patrons with a
specific permission. This feature is only used once, to link patrons to
funds.
The code in the script is duplicated from what we have in
C4::Auth::haspermission, and it makes sense to clean it.

Test plan:
Create a fund and add users to this fund.
When you search for users you must only have a list of patrons with the
acquisition.order_manage permission.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works as described. No errors
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-04 16:14:32 +00:00
c16476af44
Bug 24801: Display all the categories - Selenium fix
To make sure we are going to be able to click on the "Delete" button of
our newly created category PATRON_CAT, we are displaying them all.

Test plan:
Create several patron categories that will fill the first page:

use t::lib::TestBuilder;
my $builder = t::lib::TestBuilder->new;
for my $i ( 1..20 ) {
    $builder->build_object({ class => 'Koha::Patron::Categories', value => { description => "cat_$i" } });
}

Execute the selenium tests.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-04 14:56:19 +00:00
c0f3c9f29a
Bug 24775: Add ID to POS submit payment button
This patch simply adds an ID to the submit button to make it easier to
overide styling and functionality.

Test Plan:
0/ Inspect the element on page and note there is no id
1/ Apply patch
2/ Refresh page
3/ Inspect the element on page and note there is now an id

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-04 14:51:13 +00:00
c5c7f3efa2
Bug 24479: Use $Price filters for '0' amounts
This patch adds the use of the $Price TT filter to properly format '0'
amounts in the POS system.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-04 14:50:42 +00:00
4237fa9512
Bug 24081: DBRev 19.12.00.034
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-04 14:49:27 +00:00
ce2744e0e3
Bug 24081: (QA follow-up) Fix small typo
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-04 14:46:25 +00:00
87ff988393
Bug 24081: Add discount action to boraccount
This patch adds the ability to apply discounts to existing patron
charges from the boraccount page.

Test plan
1/ Carry out some accounting actions that end up with debts on the
patron record. (Add a manual invoice for example)
2/ Note a new 'Apply discount' action button on the unpaid debt
3/ Paid debts do not display the action button
4/ Click the button
5/ Enter an amount into the resulting modal and click confirm
6/ Confirm that the outstanding debt has been reduced by the amount you
specified.
7/ Confirm that a new 'Discount' line appears on the patrons account
8/ Confirm that in the 'details' view of the debt that the discount line
was used against the debt to create the reduction.
9/ Signoff

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>
2020-03-04 14:46:22 +00:00
a2fa0acb7d
Bug 24081: Add DISCOUNT to the allowed 'reduce' types
This patch adds the DISCOUNT type to the handled types list in the
reduce method introduced in bug 23442

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>
2020-03-04 14:46:19 +00:00
12381ead91
Bug 24081: Add credit_types, offset_types and permissions
This patch adds the credit_type, offset_type and permissions required
for the addition of a discounting workflow in the accounts system.

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>
2020-03-04 14:46:13 +00:00
7c6300c657
Bug 24540: Prevent add button being triggered on enter
This patch prevents the add button being triggered by hitting return
from inside the collected from patron form input.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-04 14:44:18 +00:00
5b78de6cef
Bug 24741: (bug 21674 follow-up) Fix destructive update DB 19.12.00.017
Previous version of the SQL query did not deal correctly with subgroup.

Test plan:
checkout the following commit to be just before 017
  commit 715da06db5
  Bug 22868: DBRev 19.12.00.016
reset_all # recreate the DB
Create a complex tree of library groups, with several groups, subgroups,
etc.
When you add a new library, refresh the page to add it several time.
When ready, git checkout master, restart all the things, execute the
updatedatabase script, then go to the library groups page.
You should see that the duplicated entries have been removed, but
subgroups have not been deleted

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested with duplicated entries on groups and subgroups,
going back to the right commit and doing clean install.
Patch works, subgroups are preserved. No errors.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-04 14:44:10 +00:00
027f72da7c
Bug 23355: (RM follow-up) Tidy Template
At Jonatans request, I have tidied the table markup

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-04 09:04:57 +00:00
2f98da053b
Bug 23355: Make "Print receipt" translatable
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-04 08:54:03 +00:00
f7630d7469
Bug 23355: (RM follow-up) Remove reintroduced relationship
As part of an accidental push of a DO NOT PUSH schema update commit
we re-introduced a formerly removed relationship accessor

This patch removes that mistake.

Tests added to the pre-push hook to prevent future mishaps.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 16:27:36 +00:00
bdefa10107
Bug 23355: (RM follow-up) Add DROP statement for cash_register_actions
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 16:09:55 +00:00
ab0f1df0c1
Bug 23355: DBRev 19.12.00.033
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 15:03:02 +00:00
3252c8d2dd
Bug 23355: (QA follow-up) Add a modal confirm to the cashup action
This patch adds a simple modal to confirm the cashup action adding a
safely measure to it.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 15:03:02 +00:00
dd44efbc84
Bug 23355: Rename staff_id for manager_id
This patch makes the parameter naming more consistent and also fixes the
tests (there was a missmatch on the parameter naming, and tests count
was incorrect).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 15:03:02 +00:00
d6684f13fc
Bug 23355: (QA follow-up) Missing koha_object(s)_class definitions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 15:03:02 +00:00
a1d89f8b88
Bug 23355: (QA follow-up) Add missing TT filters
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 15:03:02 +00:00
d3015f84e3
Bug 23355: License fixes
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 15:03:01 +00:00
4d2037914c
Bug 23355: Add cashup permissions
Add new 'cashup' sub-permissions to the 'cash_management' permission to
allow fine grained control over whome may 'cashup' a cash register.

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>
2020-03-03 15:03:01 +00:00
fcb545b4ae
Bug 23355: Add register details page
This patch adds a new page which can be accessed via the menu to the
left of the point of sale page.  This new page displays a list of
transactions since the last 'cashup' action, a summary of transaction
amounts and a button to allow the recording of a new 'cashup action.

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>
2020-03-03 15:03:01 +00:00
16b3a16374
Bug 23355: Split tests for Line vs Lines
This patch simply splits the existing tests for accountlines into two
test files, one for the singular object and one for the set.

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>
2020-03-03 15:03:01 +00:00
39ebdb4ea2
Bug 23355: Link cash_register_actions to cash_registers by foreign key
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>
2020-03-03 15:03:01 +00:00
8781527637
Bug 23355: Add accountline deletion test
This patch adds a test to ensure database relations do not cascade
deletions when a cash register is deleted.

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>
2020-03-03 15:03:00 +00:00
747531e8de
Bug 23355: Add CASHUP actions
This patch adds methods relating to cashup procedures to the cash
register object to ease adding and querying for cashup actions related
to the register.

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>
2020-03-03 15:03:00 +00:00
5cf1e85191
Bug 23355: [DO NOT PUSH] DBIC Classes
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>
2020-03-03 15:03:00 +00:00
239ac3303c
Bug 23355: Add cash_register_actions table
This patch adds the new cash_register_actions database table to allow
for storing of cash register actions which are not already stored as
accountlines.

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
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>
2020-03-03 15:03:00 +00:00
e2adf9f28c
Bug 23534: Fix selenium tests
The title of the page now contains lot of info (is it what we really
want?)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 15:03:00 +00:00
292f562605
Bug 24756: Catch two failed to load-variations in Security.t
Test 7 in Security.t failed when 'failed to load HTTP resource' was
returned by libxml2 instead of 'failed to load external entity'.

We now remove the debugging with Dumper again and adjust the regex to
include both variations.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 10:39:00 +00:00
bd9960a2d2
Bug 24757: (RM follow-up) Restore test count
Somehow we lost a '0' on the test count for
t/db_dependent/Koha/Patrons.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 10:31:12 +00:00
3c9cc044ce
Bug 23975: (QA follow-up) Add another plugin source
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 09:22:39 +00:00
21170c635c
Bug 23975: (QA follow-up) Add missing TT filters
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 09:19:37 +00:00
c46dc0fadc
Bug 23975: (QA follow-up) Search button style and functionality
This patch makes the search form button match the other buttons style,
and also adds the submit() action on click.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 09:19:20 +00:00
10cdbb9fde
Bug 23975: (QA follow-up) Fix styling of install buttons
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 09:19:12 +00:00
553627f12c
Bug 23975: (follow-up) Don't rely on save_to being present
The `save_to` shortcut method was introduced to Mojolicious in version
8.02 but we still support 7.21 as our minimum dependancy and as such we
cannot yet use it.

Signed-off-by: David Nind <david@davidnind.com>
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>
2020-03-03 09:19:04 +00:00
f1dc82d70b
Bug 23975: Add 'Install' support for github results
Signed-off-by: David Nind <david@davidnind.com>
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>
2020-03-03 09:18:56 +00:00
7809a9fdd8
Bug 23975: Add ability to search and install plugins from GitHub
It would be nice to be able to search and install plugins directly from GitHub ( and GitLab if possible ). This would make it easier to verify the authenticity of plugins and make discovering new plugins easier as well as making installation of plugins simpler.

Test Plan:
1) Apply this patch
2) Add the new block for plugin_repos to your koha-conf.xml
3) Restart all the things!
4) Browse to the plugins home page
5) Try searching for 'patrons' in the new search box
6) Verify you get results!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
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>
2020-03-03 09:18:33 +00:00
Agustin Moyano
ef1d49efb5
Bug 24615: Make object.search helper also order by embedded columns
With this patch REST API request can order results by embedded columns.

Full path to the column must be given for it to work.
For example: If you are on biblio endpoint and you want to order by holding patron's card number you could

> GET /biblio/1?_order_by=item.holds.cardnumber HTTP/1.1
> x-koha-embed: item.holds

To test:
1. apply this patch
2. prove t/db_dependent/Koha/REST/Plugin/Objects.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 09:17:43 +00:00
Agustin Moyano
863f129a58
Bug 24502: (follow-up) Add all 3 query parameters in api definition
This patch adds api definition for body, query or header parameters.

To use them include:

* "$ref": "../parameters.json#/q_body" for body parameter.
* "$ref": "../parameters.json#/q_param" for query parameter.
* "$ref": "../parameters.json#/q_header" for header parameter.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 09:17:04 +00:00
Agustin Moyano
755d82015d
Bug 24502: object.search also filter by prefetched columns
This patch adds the possibility to object.search helper, to also filter by prefetched columns.

In order to dynamically add filter parameters, they must be coded as json and placed in the body of the request, coded as string in 'q' query parameter or as string in 'x-koha-query' header.

The coded json, is in fact dbix syntax.

To test:
1. apply this patch
2. prove t/Koha/REST/Plugin/Query.t t/db_dependent/Koha/REST/Plugin/Objects.t
3. Sign off

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 09:16:55 +00:00
ab94a12ee4
Bug 17532: Make koha-shell propagate the error code
Context: I am trying to make koha-misc4dev stop when something wrong happens.
Basically we do not want the process to continue of the DB has not been populated correctly.
It will make the errors easier to catch.

The issue: Say a script that will return an error (die in perl for an easy example),
koha-shell will not return the 255 error code, but 0 instead.
The caller cannot know something wrong happened

The solution is to propagate the error and make koha-shell return the same error code
as the command it executed

An example:
=== t.pl ===
die('something wrong');

% perl t.pl;echo $?
something wrong at t.pl line 1.
255

% sudo koha-shell kohadev -p -c 'perl xxx.pl' ; echo $?
something wrong at xxx.pl line 1.
0

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Tested it with
  $ sudo debian/scripts/koha-shell kohadev -c 'exit 8'
  $ echo $?
  8
The unpatched version returns 0 (forgets about the error code).

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 09:15:57 +00:00
9a9e9fb95e
Bug 24735: DBRev 19.12.00.032
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-02 11:15:33 +00:00
6321c7220e
Bug 24735: Remove more code from tests
That was use by QP tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-02 11:13:11 +00:00
52e95fff34
Bug 24735: Remove QueryParser-related code
At the last development meeting we have voted to remove the
QueryParser-related code
https://wiki.koha-community.org/wiki/Development_IRC_meeting_19_February_2020

Hea tells us that it has not been adopted, and the code/bug tracker that
it is not really usable as it. As nobody is willing to work on it, we
decided to remove it instead.

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

See commits from bug 9239 and confirm that the code is removed in this
patch.

Also play with the search on the UI and confirm that you do not see
obvious regressions

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-02 11:13:03 +00:00
Katrin Fischer
35b47f0119
Bug 15377: (QA follow-up) Fix capitalization and column heading
Checked Out -> Checked out
Circulation -> Status (matching other pages with this information)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-02 10:54:34 +00:00
Rogan Hamby
584cf35502
Bug 15377: Allow removal of 'checked out' items from course reserves
1) removes the restriction of not allowing a reserve to be removed if it is onloan
2) adds a column to the display that says with the item is checked out or available based on the onloan flag

testplan: add an item to course reserves, check the item out, check that the Ciruclation column changes to Checked Out and that you can remove it

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Hannah Olsen <holsen@duncanville.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-02 10:54:28 +00:00