Commit graph

6114 commits

Author SHA1 Message Date
30dd8f9920 Bug 15906: [QA Follow-up] Correct a partial payment
The amount in accountlines should be saved as a negative amount, but
amount outstanding is correct.

Note: This routine is actually used only once (in paycollect.pl). And is
only cosmetically tested in Accounts.t.

Test plan:
[1] Create a manual invoice, Fine, say 20.
[2] Click on the Pay button next to this fine, and pay 1.
[3] Pay again, using 'Pay amount' button, and pay 2.
[4] Pay again, using 'Pay' on the same line, the full remaining amount.
[5] Verify that you see -1, -2 and -17 on the Accounts tab.
[6] Run t/db_dependent/Accounts.t

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-12-09 17:51:36 +00:00
167c74bfd3 Bug 15822: Fix 500 error when searching if items.onloan=0000-00-00
The calls
  output_pref({ dt => dt_from_string( $date ) })
are wrong and should be replaced with
  output_pref({ str => $date })
For better error handling.

Here we fix the problem of items.onloan when searching

Test plan:
- Set items.onloan=0000-00-00 (UPDATE items SET onloan='0000-00-00')
This can come from old data or bad migration
- Execute a search
=> Without this patch you get
Can't locate object method "ymd" via package "dateonly" (perhaps you forgot to load "dateonly"?) at /home/vagrant/kohaclone/Koha/DateUtils.pm line 225.
=> With this patch you won't get the error

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-12-09 16:22:10 +00:00
Petter Goksøyr Åsen
4716c495e0 Bug 17671: Remove unused variables in C4::Reserves
I was reading through Reserves.pm trying to figure out a bug - found some
unused variables instead.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-12-02 10:18:19 +00:00
b19bd97556 Bug 17278: Fix "show all items" link
Then we need to remove the "available" part from the query.
They are really awkward patches...

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-22 17:44:43 +00:00
5cc7c17c64 Bug 17278: Use available limit when requesting zebra when ccl query is used
When a ccl query is used, the buildQuery subroutine does not handle
the available limit (not an index).
This available limit is handle later in the subroutine.
This affect the author links on the detail page for instance (an=xx).
A much better solution would be to keep an 'available' zebra index up-to-date.

Test plan:
(OPAC or staff interface, it does not matter)
- Launch a search, click on a result and then on an author link to
  launch another query (an:xx)
- Limit to available items without the 'facet'
=> Without this patch you won't get any results
=> With this patch applied you should get relevant result (regarding the
known bugs 16970, 13715, 13658, 5463, etc.)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-22 17:44:36 +00:00
a16a750180 Bug 17642: Add and use get_descriptions_by_koha_field
Ok I am silly, we needed to replace to use the cache mechanism for
search_by_koha_field, not find_by_koha_field...
Let's create another subroutine

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 15:52:00 +00:00
6585bfc284 Bug 17642: use get_description_by_koha_field when needed
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 15:52:00 +00:00
c45b26aea2 Bug 17642: use find_by_koha_field when needed
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 15:52:00 +00:00
665c5c62fa Bug 14736 - AllowRenewalIfOtherItemsAvailable slows circulation down in case of a record with many items and many holds
If the AllowRenewalIfOtherItemsAvailable sys pref is set to allow, and a
borrower has an item checked out that has many items {30+} AND many
holds {70+) on it, loading the checkouts table for this borrower takes
FOREVER to load. The load time takes forever, because of the
factoring that happens to determine if an item is truly
available for renewal.

This patch swaps the use of GetMemberDetails for GetMember
and reorders the subroutine calls to check each items' renewability
from fastest to slowest.

In a test case, the results of pre patch were:
Start of loop: 2016-08-24T11:05:14
End of loop:   2016-08-24T11:05:29
Resulting in 15 seconds being spent in the loop

Post patch results were:
Start of loop: 2016-08-24T11:08:43
End of loop:   2016-08-24T11:08:48
Resulting in only 5 seconds being spent in the loop!

Test Plan:
1) Apply this patch
2) Note there are no changes in functionality for the renewals column of
   the patron checkouts table.

If you wish to go further and test the performance benefit:
1) Create a record with 50 items and 100 holds ( 50 waiting, 50 unfilled )
2) Check out one of the waiting holds to a patron
3) Time the amount of time it takes for the checkouts table to load
4) Apply this patch
5) Repeat step 3, you should see an improvement in load time

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 13:57:01 +00:00
6d5b056a14 Bug 17323: Column search_history.time cannot be null
When doing a search, with SearchHistory pref switched on:

DBD::mysql::st execute failed: Column 'time' cannot be null [for Statement "
        INSERT INTO search_history(
            userid, sessionid, query_desc, query_cgi, type, total, time
        ) VALUES(
            ?, ?, ?, ?, ?, ?, ?
        )
    " with ParamValues: 0="7874", 1='12338a0bd8da63e32c79ee84f8493a07', 2="kw,wrdl: d", 3='q=d', 4='biblio', 5=6104, 6=undef] at C4/Search/History.pm line 34.

Since MySLQ 5.7, undef does not mean "the default value".
To let the DBMS set the default value (CURRENT_TIMESTAMP), the parameter should not be passed

Test plan:
OPAC+Intranet, swith the 2 SearchHistory syspref on
Do a search
=> Without this patch, you will get an error in the log and the row will not be inserted in the table.
=> With this patch, everything must go fine

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Not verified with MySQL 5.7. But this looks good to me.
Works under Jessie.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 13:51:37 +00:00
72fea80a33 Bug 17599: (QA followup) Perltidy really long lines
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-15 15:41:44 +00:00
6edbd47a44 Bug 17599: Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule
This is a POC, I have not tested it yet.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-15 15:41:43 +00:00
3a6d38cbcb Bug 16520 - (Follow up) Restore retrieval of syspref_cache
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-15 14:09:33 +00:00
Mark Tompsett
a618c62ae6 Bug 15690: Hardcoded 16 is uncool
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Followed test plan in comment #7, works as expectd.
Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-14 11:28:43 +00:00
87380d8b46 Bug 15690: CardnumberLength should not be bigger than 16
borrowers.cardnumber is a varchar(16), so CardnumberLength should not
have a max > 16

Test plan:
Test different value in CardnumberLength ("20", "20,30", "40,")
Edit a patron a make sure the text display under the cardnumber input is
correct

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-14 11:28:42 +00:00
47bae5b365 Bug 17563: (followup) Silence undef warnings
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-10 13:36:48 +00:00
ed848e167a Bug 17563: Fix Acquisition/CancelReceipt.t
Test plan:
  prove t/db_dependent/Acquisition/CancelReceipt.t
should return green

Confirm that the changes made by
  commit 20d9ed618f
    Bug 13321: Rename variables
was wrong for the budget_id var and that this patch reverts it

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-10 13:36:48 +00:00
3f8a4cd2a1 Bug 17535: Fix search for reports by keywords
The commit cf90317112
    Bug 14435: Add the ability to store result's report
introduced a regression when searching for reports by keywords.
It also breaks tests in t/db_dependent/Reports/Guided.t

It's caused by the missing join on saved_reports.
The error says DBD::mysql::db selectall_arrayref failed: Unknown column
'report' in 'where clause'

Test plan:
Confirm that the tests are fixed and that you are able to search for
reports using the "keyword" input

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-07 16:38:25 +00:00
Matthias Meusburger
7e0f372b6c Bug 17481: Fix incorrect merge of bug 11048 (logout redirection for CAS authentication)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-07 16:34:57 +00:00
b2c59c7ff2 Bug 16908: Remove non-desired export line
GetTitles has been removed by bug 16847 and reintroduced it by bug
16908, caused by a bad merge conflict.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-07 16:18:11 +00:00
2277016620 Bug 12633: Remove export line
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-07 16:17:46 +00:00
d6de78624e Bug 16852: Remove GetBorrowerCategorycode
And use Koha::Patron->categorycode instead

Test plan:
- Restrict a patron attribute to a patron category
- Use the batch patron modification tool to update a patron of this
  category
You should not see the the patron attribute

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-02 10:56:39 +00:00
15b1f6c7fe Bug 15581: Display the latest auto renew date possible when renewing manually
If an issue marked as auto_renew is renewed manually, we want to display
the latest auto renew date possible.

Test plan:
1/ Define circ rules as in the previous patch.
2/ Check a item out, mark it as an auto renewal
3/ Back date the issuedate and make sure it will be too late to renew it
4/ Use the Circulation > renew page (circ/renew.pl) to manually renew
this issue.
You should get a warning "You barcode has been scheduled for automatic renewal
and cannot be renewed anymore since DATE."
If the pref AllowRenewalLimitOverride is set, you will be allowed to
renew it anyway.

Sponsored-by: University of the Arts London
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-02 10:28:57 +00:00
53dfa99727 Bug 15581: Add a circ rule to limit the auto renewals given a delay
This patch adds a new circulation rule (no_auto_renewal_after) to block/allow
auto renewals after a given delay.
For instance, if the issue date is 10 days before today, and
no_auto_renewal_after is set to 10, tomorrow the issue won't be auto
renewed.

Test plan:
0/ Execute the update DB entry
Note: You will have to manually change data in your DB, make sure you
have access to the sql cli.
1/ Define a rule with no_auto_renewal_after (10 for instance) and
norenewalbefore (5 for instance).
(This new rule will behave the same as norenewalbefore: the unit depends
on the lengthunit value).
The automatic renewals will be done from 5 to 10 days ahead.
2/ Modify the issues.issuedate, to simulate a checkout in the past:
    UPDATE issues
    SET issuedate = "yyyy-mm-dd hh:mm:ss"
    WHERE itemnumber = YOUR_ITEMNUMBER;
with issuedate = 2 days before for instance
3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl)
Confirm that the issue has not been renewed (too soon)
4/ Repeat step 2 with a due date set as 11 days before
5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl)
Confirm that the issue has not been renewed (too late)
6/ Repeat step 2 with a due date set as 7 days before
7/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl)
Confirm that the issue has been renewed (issues.renewals has been
incremented and date_due has been updated according your circ rules).

Sponsored-by: University of the Arts London
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-02 10:28:57 +00:00
e6e09c540f Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories
The subroutine C4::Koha::GetAuthorisedValueCategories just retrieves all
the authorised value categories.
We already have a method in the Koha::AuthorisedValues module to do this
job, let's use it!

Technical explanations:
The new subroutine of the AuthorisedValues TT plugin will allow to get
the authorised value categories from the templates.
The new html_helpers include file will get rid of the if selected else
end statements. Bug 15758 already uses this file, see the commit
description for more informations.

Test plan:
1/ Create or edit a new fund (aqbudgets.pl), the fields "statistic 1"
and "statistic 2" should be correctly filled with the list of authorised
value categories
2/ Edit subfields for a biblio and authority framework.
The "Authorized value" dropdown list should be correctly filled on both
pages
3/ Create new items search fields (from the administration area), same
as previously, the authorised value category dropdown list should be
correctly filled
4/ Add and edit patron attribute types, check the authorised value
category list.

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 16:35:52 +00:00
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