Commit graph

6089 commits

Author SHA1 Message Date
9c6f634469 Bug 16912: Koha::Patrons - Move AddEnrolmentFeeIfNeeded to ->add_enrolment_fee_if_needed
This patch moves the code of the C4::Members::AddEnrolmentFeeIfNeeded
subroutine to the Koha::Patron->add_enrolment_fee_if_needed method.
The behavior should be unchanged.

Test plan:
1/ Define enrolment fee for 2 patron categories
2/ Create a patron using the first category
=> The patron should be charged
3/ Change the patron category to the other one
=> The patron should be charged again

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 15:31:43 +00:00
Blou
73d9557b13 Bug 16123 - Display budget hierarchy in the budget dropdown menu used when placing a new order
When placing a new order, the budget dropdown will display the budget hierarchy.

TEST PLAN :

1. Go to the Administration module
2. Add a new budget (ie : Budget 2016)
3. Add a fund to this budget (ie : Book)
4. Add a child fund (ie : Adult fiction)

You will have this hierarchy :

Budget 2016
 |____ Book
         |_____ Adult fiction

5. Go to the Acquisition module
6. Select a vendor and create a new basket
7. Place an order
8. Check the budget dropdown menu

BEFORE PATCH
Book
Adult fiction

AFTER PATCH
Book
   Adult fiction

Dropbown menu is hierarchical as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 15:26:00 +00:00
Julian Maurice
0fe43b3ad1 Bug 13323: Recalculate tax_value for partially received orders
Test plan:
1. Create an order with at least 2 items
2. Receive only 1 item
3. Check that the tax value of the received order line is correct on
   the parcel and invoice pages
4. Check that the tax value of the original order line is correct (on
   the basket page for example)
5. Cancel the receipt
6. Check that the tax value of the original order line is correct

Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 13:46:42 +00:00
Jonathan Druart
19398f2777 Bug 13323: Tax rate can change on receiving
This commit permits to update the tax rate on receiving.

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Francois Charbonnier <francois.charbonnier@inlibro.com>

Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 13:46:41 +00:00
Jonathan Druart
d653e02d32 Bug 13324: The fund values should be based on tax included values
Now we have a column in DB to easily retrieve the tax included values.
So the sum must be done this the _tax_included DB field and not on the
"old" field.
The old field can be tax excluded or tax included depending the supplier
configuration.

Test plan:
Verify that the values in the acqui home and budgets page are the tax
included values.

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Francois Charbonnier <francois.charbonnier@inlibro.com>

Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 13:46:21 +00:00
d8da77bd8b Bug 13321 - (QA Followup) Restore standing order functionality
Some lines deleted during rebase, restored and updated, tests repaired

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 13:46:11 +00:00
Julian Maurice
1a05ec58cd Bug 13321: Recalculate tax_value for partially received orders
Test plan:
1. Create an order with at least 2 items
2. Receive only 1 item
3. Check that the tax value of the received order line is correct on
   the parcel and invoice pages
4. Check that the tax value of the original order line is correct (on
   the basket page for example)
5. Cancel the receipt
6. Check that the tax value of the original order line is correct

Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 13:46:10 +00:00
Jonathan Druart
8f5ee4c91d Bug 13321: Fix unitprice rounding
We need to display the rounded value, but insert the exact value.
The unit price can be change on receiving, so the input value can be
modified.
But if it's not, we must insert the exact (not rounded) unit price,
which is the ecost value.

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Francois Charbonnier <francois.charbonnier@inlibro.com>

Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 13:46:08 +00:00
Jonathan Druart
1c1e6b11f7 Bug 13321: Csv export - Display rrp and ecost with and without taxes
If a basketgroup is exported as a CSV file, both prices should be displayed to
avoid confusion.

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Francois Charbonnier <francois.charbonnier@inlibro.com>

Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 13:46:08 +00:00
Jonathan Druart
7e89301ab2 Bug 13321: Fix the prices calculation method
Well, we have finally arrived here \o/

The method where the prices are calculated uses the equations listed on
the wiki page (http://wiki.koha-community.org/wiki/GST_Rewrite_RFC).

The ecost is calculated from the rrp (using the discount and the tax
rate). That's why we removed the ability to edit this value.

That's why we remove the ability to edit the ecost on ordering in a
previous commit (bug 12840).

The total is now calculated in the scripts. That's why this patch
removes lines in the test file.

In C4::Acquisition::populate_order_with_prices, the calculation on
receiving must depend on the 'invoiceincgst' supplier parameter, and not
listincgst (which is used on ordering).
It also removes the rounding errors, now we store "exact" values in DB
(10^-6).
The values will be displayed using the Price TT plugin it will round the
values for us.

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Francois Charbonnier <francois.charbonnier@inlibro.com>

Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 13:46:07 +00:00
Jonathan Druart
20d9ed618f Bug 13321: Rename variables
This patch renames the variable according to the new DB column names
 * gste => tax_excluded
 * gsti => tax_included
 * gstrate => tax_rate
 * gstvalue => tax_value

This patch also modify the ModReceiveOrder subroutine:
 * Edit vendor note on receiving is not possible, so the code should not
   permit that.
 * Update ModReceiveOrder to pass a hashref

And that's all!
git grep on gste, gsti, gstrate and gstvalue should not return any code
that can be executed.

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Francois Charbonnier <francois.charbonnier@inlibro.com>

Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 13:45:59 +00:00
c8f6794bb1 Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo
This was the "Get" subroutine for the framework, it can be easily
replaced with a call to the Koha::BiblioFrameworks->find method.
This patch also replaces some confusing wordings (framework vs frameworkcode).

Test plan:
On the circulation home page, you should see a "Fast cataloguing" link
if the FA framework exists.

Note that the admin/marctagstructure.pl has already been tested in the
previous patch.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Link pops Ok
No errors

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 12:05:00 +00:00
8f436a5075 Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks
C4::Koha::getframeworks returned a hashref of biblio frameworks.
It was mainly used to generate the dropdown list of frameworks.
The scripts modified in this patch did not necessary order the element
by description (frameworktext), the displays were not consistent from
one screen to another.
Using the same search method everywhere:
  Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
We will know always get the framework in the same order.

Test plan:
Following the different pages modified by this patch, and make sure the
frameworks are displayed correctly in the dropdown list:
1/ acqui/z3950_search.pl - Create an order from an external source.
2/ admin/fieldmapping.pl - Define some mappings keyword / MARC field
3/ admin/marctagstructure.pl - On the MARC frameworks admin page, select
another framework than the default one and click on the 'Search' button
4/ catalogue/MARCdetail.pl - On the MARC defail page, change the
framework you want to use to display the record
5/ cataloguing/addbiblio.pl - Add or edit a biblio record, change its
framework. When editing, the framework of the record should be selected
by default
6/ cataloguing/addbooks.pl - Go on the cataloguing home page and click
on the "New record" button. You should see all the frameworks
7/ cataloguing/merge.pl - Select 2 biblio records to merge. On the first
step (select the merge reference), you should be allowed to select the
framework to use.
8/ tools/inventory.pl - On the inventory page, the "Item statuses" part
should be populated as before this patch
9/ tools/manage-marc-import.pl - Stage records for import. Before
importing them into the catalog, you should see the framework dropdown
list.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works Ok.
No errors

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 12:04:59 +00:00
ddb1ecb9d8 Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::GetFrameworksLoop
The C4::Koha::GetFrameworksLoop retrieves biblio frameworks and returns
them ordered by the description (frameworktext). If a parameter is
passed, a selected flag is set. The selection of the options should be
done on the template side.
These 2 calls can be replaced with
  Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });

Test plan:
1/ Go on a Labeled MARC biblio view (catalogue/labeledMARCdetail.pl)
You should see a dropdown list with the biblio frameworks. The framework
of the record should be selected by default
2/ Create a sql report using the biblio_framework parameter, something
like:
  SELECT COUNT(*) FROM biblio WHERE frameworkcode=<<framework|biblio_framework>>
Save and execute the report.
You should get a dropdown list with the framework list.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Both dropdowns Ok
No errors

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 12:04:58 +00:00
bad06abf77 Bug 14629: [QA Follow-up] Small tidy up
Some cosmetic changes as to whitespace and one call less to Normalize.

Test plan:
Run t/Koha.t

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:58:15 +00:00
0963dc4da6 Bug 14629 - [QA Followup] Pass invalid ISSN through GetVariationsOfISSN
This is an optional follow up depending on community opinion.

While copying over the code form the ISBN portion I noticed that with
aggressive matching enabled invalid ISBNs (and hence ISSNs) were being
stripped from the record.

I think in the case of a library exporting records, making changes, and
reimporting they would expect to get a match on ISSN or ISBN whether or
not the number is valid.

This patch changes the subroutine to return the original ISSN in the
case of it being invalid.

To test:
With first patch only export a record with an invalid ISSN and reimport
with AggressiveMatchOnISSN enabled and match on ISSN - you should not get a match
Apply this patch
reimport the file and you should find a match.

Signed-off-by: Chad Roseburg <croseburg@ncrl.org>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:58:14 +00:00
68ced964fd Bug 14629 - Add aggressive ISSN matching feature equivalent to the aggressive ISBN matcher
This patch adds a syspref "AggressiveMatchOnISSN" allowing for a match
of ISSNs with or without hyphens. It uses Business::ISSN in order to
follow the use of Business::ISBN and allow for validation of ISSNs

To test:
1 - Find a record in your system with an ISSN (or add one)
2 - Stage a record containing the same ISSN but lacking a hyphen
3 - Matching on ISSN should find 0 matches
4 - Repeat with no hyphen ISSN in system and hyphen ISSN in import
5 - Matching should find 0
6 - Apply patch
7 - Update datbase and install Business::ISSN
8 - Leave AggressiveMatchOnISSN as don't and repeat original tests- no
change
9 - Set AggressiveMatchOnISSN as do and repeat original test
10 - You should find a match
11 - prove t/Koha.t - all tests pass

Sponsored by North Central Regional Library System (NCRL) www.ncrl.org

Signed-off-by: Chad Roseburg <croseburg@ncrl.org>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:58:14 +00:00
Katrin Fischer
1e120924c2 Bug 5260: QA follow-up: Fix error when no notice template is defined
When no notice template ACQORDER was defined, you'r receive a false
positive "email sent" message. Now it will display a specific
error message instead.

Also includes 2 unit tests to test for the warn and new error code.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:52:26 +00:00
Katrin Fischer
0ca7ac9dd5 Bug 5260: Follow-up - Reindenting POD of SendAlerts
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:52:26 +00:00
Katrin Fischer
9af64aa7d5 Bug 5260 - Add option to send an order by e-mail to the acquisition module
With this patch it will be possible to send order information
to the vendor by e-mail. For now this feature can be triggered
manually with a button before closing the basket.
The order e-mail is based on the acquisition claim feature, but
uses a new notice template.

Test plan:

1) Vendors
A new checkbox "Contact when ordering?" was added to the vendor
page.
- Add a vendor and/or edit an existing vendor
- Verify the new option is saved correctly
- Verify the new option displays on the vendor summary page
  after saving

2) Notices
The feature works with a new notice template: ACQORDER
It works with the same formatting/fields etc. as the acq claim
notice.
- Add a new notice template ACQORDER in module
  'Claim/order aquisition'
- Make sure to use fields from the various offered tables
  in your notice
- Verify it is saved correctly

3) Basket
- Turn on LetterLog system preference
- Create multiple order lines
- Click the 'Send order' button in the toolbar
- Verify error or success message
- Verify you received the e-mail
- Verify there is a new entry with about the sent
  notice in your action_logs table

4) Regression testing...
- Verify order claims still work
- Verify serial claims still work
- Verify new serial issue notices still work
...
(I can provide additional test plans if needed)

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:52:25 +00:00
kohamaster
f74e467550 Bug 17435: Gives ability to display stocknumber in search results
Adds stocknumber to data provided for xslt transformation

Test plan :
1) go to Administration module, MARC default frameworks and add, if not already done, a stocknumber subfield (a priori under the 995 tag). It will be linked to items.stocknumber in the koha.link zone of Advanced constraints section.
2) edit an item in staff interface and add a number in the stocknumber field.
3) Edit the xslt opac Results file that you are using and customize it. For a basic test, you can just replace "itemcallnumber" occurrences by "stocknumber".
4) make a search in a way to get several results including the title from which you modified an item.
5) You will see the added stocknumber displayed (between square brackets in the default xslt).

Same can be done through staff interface and staff xslt files.

Olivier Crouzet

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:49:18 +00:00
73b85e9875 Bug 14598 [QA Followup] - Correct the behavior of GetItem
Currently GetItem sets itemtype to the biblio itemtype if no item level
itemtype exists. Instead, it should only do this if item_level-itypes
is not set.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:29:58 +00:00
4384e08196 Bug 14598 [QA Followup] - Only fetch bib data if needed
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:29:58 +00:00
Brendan A Gallagher
096b6c3938 Bug 14598 - QA Followup touching CanBookBeIssued subroutine
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:29:57 +00:00
34eb4c1fa9 Bug 14598: (QA followup) Don't die on bad barcode
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:29:57 +00:00
285ac7a31e Bug 14598: Make C4::Circulation::AddReturn store the right itemtype
This patch makes C4::Circulation::AddReturn correctly store the itemtype
on the 'statistics' table.

To reproduce:
- Checkout master.
- Make a checkout.
- Check the 'statistics' table and notice the itemtype is correctly set
  > SELECT * FROM statistics;
- Check the item in.
- Check the 'statistics' table and notice the itemtype is not set
  > SELECT * FROM statistics WHERE type="return";
=> FAIL: itemtype is set to NULL

To test:
- Apply the regression tests patch
- Run the tests:
  $ prove t/db_dependent/Circulation/Returns.t
=> FAIL: Tests fail
- Apply this patch
- Run the regression tests:
  $ prove t/db_dependent/Circulation/Returns.t
=> SUCCESS: Tests now pass.
- Repeat the 'To reproduce' steps
=> SUCCESS: itemtype is now correctly set (in real life)
- Happily sign off :-D

Sponsored-by: Universidad Empresarial Siglo 21

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:29:57 +00:00
87f21ae245 Bug 14874: Set default DefaultPatronSearchFields
just in case...

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-27 13:21:13 +00:00
65ed212fae Bug 14874 - Add ability to search for patrons by date of birth from checkout and patron quick searches
This patch adds a new syspef 'DefaultPatronSearchFields' which defines
the fields that should be used when searching for a patron if none are
defined.

To test:
1 - Aply patch, updatedatabase
2 - Ensure patron search has not changed
3 - Add dateofbirth to new pref
4 - Ensure things work wll
5 - Experiment with adding and removing other fields from borrowers
table
6 - prove t/db_dependent/Utils/Datatables_Members.t

Tested together with followup. Works as described.
Signed-off-by: Marc Véron <veron@veron.ch>

Bug 14874 (QA Followup)

    Fix atomicupdate file name

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-27 13:21:13 +00:00
9b34b07d62 Bug 17375: Search by dateofbirth - handle invalid dates
Prevent internal software error when searching patron with invalid birth date

To reproduce:

- Go to Home > Patron
- Expand patron search (click on + at the left of the search button)
- In drop down 'Search fields', select 'Date of birth'
- Enter a valid date (e.g. 11.02.1995 if syspref 'dateformat' is set to dmydot)
Result: Search works OK
- Enter an invalid date, e.g. 11.02 or abcd...
Result: Internal server error

- Do a patron search with many results
- Use filter on results screen, select 'Date of birth' as search field and
  enter an invalid date to search (e.g. 'a')
Result: Endless message 'Processing'

To test:
- Apply patch
- Repeat steps above
- In both cases, you should get "No results"

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Lucio Moraes <lmoraes@catalyst.net.nz>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-27 13:18:32 +00:00
bf1563e60b Bug 14610 - Add and update modules
Signed-off-by: Jennifer Schmidt <jschmidt@switchinc.org>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-26 12:15:13 +00:00
60fc63ef4d Bug 17425: Add Try::Tiny dependency
This patch just introduces Try::Tiny as a core Koha dependency.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 17:37:54 +00:00
a09f1d7546 Bug 17080: borrowers.checkprevcheckout - use the default value defined in the DBIx::Class schema
This line has been added by bug 16917 to define the default value of
borrowers.checkprevcheckout.
As this value is defined in the DBIx::Class schema, we should not have
to handle it here.

Test plan:
Confirm that this patch does not reintroduced the bug fixed by bug
16917.

Signed-off-by: Marc Véron <veron@veron.ch>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 17:33:19 +00:00
41a19f420d Bug 17080: Make C4::Members::AddMember uses Koha::Patron->store
These calls have been added from commit e196f19 (Bug 12633: Remove SQLHelper
in C4::Members) which added a TODO:
"This patch replaced the calls to SQLHelper to use DBIX::Class.
TODO: Move them to Koha::Borrower."

This is now done by this patch: instead of calling DBIx::Class directly
we use Koha::Patron

Signed-off-by: Marc Véron <veron@veron.ch>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 17:33:18 +00:00
42cd23ceb9 Bug 15131: Add AllowItemsOnHoldCheckoutSCO to UsageStats
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 17:27:07 +00:00
c4a923bdf7 Bug 16907: Koha::Patrons - Move HandleDelBorrower to ->delete
This job should be done each time patron data are deleted. It's better
to do it just before deleting the patron than assuming the caller did
the job by itself.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 16:20:41 +00:00
26c034d1f5 Bug 16907: Koha::Patrons - Move DelMember to ->delete
This patch moves the C4::Members::DelMember subroutine to the
Koha::Patron module.
The delete method must be overwritten to permit handling of patron's
holds.

Test plan:
(With the 2 patches applied)
1/ Create a patron with holds and owner of lists
2/ Delete patrons using the web interface:
 - More > Delete on a patron page
 - Batch patron deletion tools
3/ and the cronjob script
 - perl misc/cronjobs/delete_patrons.pl -c [more options]

The patron should have been moved to the deletedborrowers table, his/her
holds and lists should have been deleted.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 16:20:41 +00:00
20c44f0051 Bug 16891: Move C4::Members::MoveMemberToDeleted to Koha::Patron->move_to_deleted
This patch removes the C4::Members::MoveMemberToDeleted subroutine in
order to replace it with the Koha::Patron->move_to_deleted method.
Next after this change, we will move C4::Members::HandleDelBorrower and
C4::Members::DelMember to the same module to simplify the code in
members/deletemem.pl and misc/cronjobs/delete_patrons.pl

Test plan:
1/ Delete a patron from the staff interface and make sure (s)he has been moved to
the deletedborrowers table.
2/ Use the "Batch patron deletion" tool (tools/cleanborrowers.pl) to
remove patron. Make sure the "Permanently delete these patrons" and "Move
these patrons to the trash" options work as before
3/ Same as previously but using the cronjob
misc/cronjobs/delete_patrons.pl.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Tested the delete_patrons.pl script and cleanborrowers.pl too.
Tests (are relevant and) pass and the qa scripts are happy too :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2016-10-21 16:20:27 +00:00
4579f1ad90 Bug 17318: Make C4::Matcher::_get_match_keys handle 'norms' param
The current implementation doesn't care about that parameter, and applies
a default normalization rule that seems counter-productive (in general) for
its aleged purpose.

This patch makes it handle the following values for 'norms':

    - upper_case
    - lower_case
    - remove_spaces
    - legacy_default
    - none

They make it call the relevant Koha::Utils::Normalize routines. 'legacy_default'
is used only for backwards compatibility, but could be removed if there's consensus.

To test:
- Run:
  $ prove t/Matcher.t
=> FAIL: most _get_match_keys tests fail
- Apply the patch
- Run:
  $ prove t/Matcher.t
=> SUCCESS: Tests pass!
- Sign off :-D

Sponsored-by: FIT

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 16:16:34 +00:00
baf78b2a33 Bug 17253: Koha::AuthorisedValues - Remove GetKohaAuthorisedValues
This patch replaces the call to C4::Koha::GetKohaAuthorisedValues with
Koha::AuthorisedValues->search_by_koha_field

Test plan:
AV descriptions should be displayed on the following pages:
- XSLT view - location and ccode
- Bibliographic detail, moredetail and OPAC pages - location, ccode, copynumber
- returns - location
- opac-basket - ccode, location
- The 3 reports: catalogue_stats.pl, issues_stats.pl and
  reserves_stats.pl - location, ccode

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 15:35:34 +00:00
cd7b84f675 Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode
The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.

Note that we may need a unique key to ->find instead of ->search.

Test plan:
- Checkin an item that cannot be checked in because it's lost, the
  message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
  description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
  displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
  behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
  DAMAGED

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 15:35:21 +00:00
8323db303d Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping
This subroutine was only used once in GetItemsForInventory.
It can be replaced with a quite simple search on AV join on
authorised_value_categories and marc_subfield_structures tables.

Note that the "interface" parameter was always set to "staff" and was
useless.

Test plan:
Play with the inventory and confirm that the AV descriptions are
correctly displayed.

The tests in t/db_dependent/Items/GetItemsForInventory.t cover this
change and should still pass.

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 15:23:06 +00:00
0b6f129ac3 Bug 17250: Do not retrieve marc subfield structure when the authorised value is not defined
GetAuthValCode did not return anything if the authorised_value column
was not defined. Our new calls to Koha::MarcSubfieldStructures->search
should behave the same

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 15:21:27 +00:00
d019f86f67 Bug 17250 - Koha::AuthorisedValues - Remove GetAuthValCode
The subroutine C4::Koha::GetAuthValCode returned the authorised value
category for a given kohafield.
This can be acchieve easily using a new Koha::AuthorisedValues->search_by_koha_field
method which will mimic search_by_marc_field.

Test plan:
Confirm that the description is correctly displayed on the following
pages:
- detail and moredetail of a bibliographic page (itemlost, damaged, materials)
- Set AcqCreateItem=ordering and receiving items.
The description for notforloan, restricted, location, ccode, etc.
field should be displayed.
- Items search form
- On the checkout list from the circulation.pl and returns.pl
pages, the description for "materials" should be displayed

Note that GetKohaAuthorisedValuesMapping is going to be removed on bug
17251.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 15:21:27 +00:00
15506a7569 Bug 17249: GetKohaAuthorisedValuesFromField - rm GetAuthValCodeFromField
The subroutine GetAuthValCodeFromField was only used from
GetKohaAuthorisedValuesFromField.

Test plan:
  git grep GetAuthValCodeFromField
should not return any occurrences.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 15:13:58 +00:00
c913a3482b Bug 17249: Remove GetKohaAuthorisedValuesFromField
Remove the subroutine, it's no longer in used.

Test plan:
  git grep GetKohaAuthorisedValuesFromField
should not return any occurrences.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 15:13:57 +00:00
1626087562 Bug 17249: Remove GetKohaAuthorisedValuesFromField - Add search_by_marc_field
This patch adds a new Koha::AuthorisedValues->search_by_marc_field
method.
It will permit to replace several subroutine from C4::Koha dealing with
authorised values.
It also uses this new methods to replace an occurrence of
GetKohaAuthorisedValuesFromField in C4::Record::marcrecord2csv

Test plan:
  prove t/db_dependent/AuthorisedValues.t
should return green

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 15:13:56 +00:00
f1a8ca1302 Bug 17411: Remove 3 other occurrences of exit 1
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 15:08:54 +00:00
556a4870d6 Bug 16245: [QA Follow-up] Replace typeofrecord2 by biblevel
Position 7 of the leader is better referred to as biblevel.
(Pos 6 is record type.)
At the same time replacing some regex's by simple eq's.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
It seems that bib level in the UNIMARC leader only allows a subset of
the possible combinations for MARC21. This does not have bad side-effects
however in the new code that tests bib level to determine the type tag.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 14:51:55 +00:00
Hector Castro
a74329af02 Bug 16245: RIS export file type incorrect
When exporting lists to a RIS file, the TY field of the RIS file is always
'book' even if the item being exported is a journal or serial.
Since unimarc and marc21 is coded in Koha, just a few references types are
included. This needs a much better code.

This bug changes only TY BOOK result. Other resources needs a case by case
basis.

To test:
-In advanced search limit by itemtype (books, music, continue resources, etc).
-Search and save result in Cart
-Export to RIS Format and notice about the new TY change with all materials
-Export record in bib record details page in OPAC and Intranet.
-Confirm that works as expected.
-Bonus test:
-Try to import the  RIS file in  http://www.myendnoteweb.com if you
have account or create one.
NOTE: According with previous comment, some values has changed.

Sponsored-by: Universidad de El Salvador
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 14:51:54 +00:00
6a31228172 Bug 10455: (follow-up 2) Remove biblioitems.marc
Signed-off-by: Mason James <mtj@kohaaloha.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 14:35:00 +00:00