Commit graph

536 commits

Author SHA1 Message Date
Julian Maurice
d4cda293b4 Bug 7583: Cancel a receipt
In acqui/parcel.pl, there is now the possibility to cancel a receipt.
In "Already received" table, just click on "Cancel receipt" and the
order line will go back to pending orders.
If it was a partial receipt, order line is merged to its 'parent' line.
Attached items are modified so that they become attached to the merged
order line.
If AcqCreateItem is 'receiving', attached items are deleted.
If an order line was first partially received, and then completed. You
must cancel the 'parent' order line before cancelling the 'child'.

Signed-off-by: Marc Veron <veron@veron.ch>

The patch behaves like expected, and the feature is really helpfull.

Just a tiny remark about the following message:

-------------
Cannot cancel receipt. Possible reasons :
You are trying to cancel the receipt of an order line whose parent order line is already received. Cancel this parent order line and retry.
-------------

Maybe it would be good
- to explain a little bit more why it happend and re-word the message for non technical people (not everybody understands 'parent' the same way)

- prevent the situation to happen (e.g. forbid order lines to be deleted if they are already received) - but that would be in the scope of an other bug, I think.

I think such things could be fixed in the future during the ongoing work for Acquisitions module. Signing off.
2012-09-13 18:29:20 +02:00
christophe croullebois
b6433ee60a SIGNED-OFF] bug 8382: It is not possible to cancel an order on a filtered page in parcel.pl
Because in parcel.pl page the filter (on the left) makes a table using jscript and
a very different workflow, the "cancel" link does nothing just asking for cancelling.
Principaly due to the use of the "filter" js function that call the parcel.pl page
and does all the job in a separate block with a separate perl function
(SearchOrder) that sends all to js, that constructs html to finally append it to table.
So I have decided to rebuild entirely the filter.
I have choosen to overload the function "GetPendingOrders" to enable it to accept new arguments.
To test : when you are in "parcel.pl" ready to receive orders, simply select a filter on the left
and on the filtered page try to cancel a line.
You'll have the warning message but no more, the line will be not canceled.

Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-05 13:31:37 +02:00
Julian Maurice
04539f5cb8 Bug 7168: Add basket group search field in histsearch.pl
Allow to search orders by basket group name

Signed-off-by: Marc Veron <veron@veron.ch>

Displays search field for baketgroup as expected.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-03 17:49:21 +02:00
Jonathan Druart
a6c93961b1 Bug 7302: Export basketgroup as CSV
Adds new action export for basketgroup.
This action is available only if your basketgroup is closed.
This export generates a csv file with order informations.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested together with bug 5356.
2012-07-24 18:22:06 +02:00
Dobrica Pavlinusic
a64ed6722b Bug 8439 - Printing basketgroup does not work on plack
scope $input CGI object with our for plack

Signed-off-by: Mirko Tietgen <5p4m@gmx.de>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-24 10:55:43 +02:00
Katrin Fischer
19ac74f387 Bug 6394: purchase order has French strings hard coded in
On the purchase order it said 'publié par' - instead of 'published by'.

The layout files for PDF generation in basket groups contain lots of English
strings, this change makes the template more consistent.

Currently the files are not translatable. The only way is to add translated
files to your installation.

To test:
Print a basket group as PDF. Verify string is ok for both possible settings
of system preference OrderPdfFormat:
- pdfformat::layout3pages
- pdfformat::layout2pages

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-13 14:41:25 +02:00
Julian Maurice
203757e353 Bug 7304: More permissions for budgets
- Possibility to add users to a budget
- Restrictions changed to:
  - None
  - Owner
  - Owner and users
  - Owner, users and library
- Restricted users cannot spent on these budgets (they cannot modify them
  either)

Modified pages:
 - admin/aqbudgets.pl
 - admin/aqplan.pl
 - suggestion/suggestion.pl
 - acqui/acqui-home.pl
 - acqui/addorderiso2709.pl
 - acqui/basket.pl
 - acqui/neworderempty.pl

Unit tests in t/Budgets/CanUserUseBudget.t and t/Budgets/CanUserModifyBudget.t

Bug 7304 tmp

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-27 16:25:44 +02:00
Jonathan Druart
e31768aab1 Bug 8102: DataTables integration in acquisition module [14]
supplier.tt

http://bugs.koha-community.org/show_bug.cgi?id=8102
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Corrected bug number.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-20 19:06:02 +02:00
Dobrica Pavlinusic
47be784f96 Bug 8183 - acqui/parcels.pl plack scoping
Scope our $template for plack to prevent following error:

Can't call method "param" on an undefined value at /srv/koha_ffzg/acqui/parcels.pl line 177.

Test scenario:

1. Home > Acquisitions > Search for vendor
2. click on "Receive shipment"

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-20 18:39:13 +02:00
Aleksa Vujicic
f2ca89b30e Bug 7129: Added a sprintf to format the actual cost.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Rebased to current master, please test.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Ian Walls <koha.sekjal@gmail.com>

QA note: changed call to use $order instead of @$results[0], for consistency
with surrounding variables

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-20 10:10:01 +02:00
Matthias Meusburger
7f957077dd Bug 5337: EAN management : Adds ean for various searches
- in various acquisition pages and serials home
  - in database : biblioitems.ean
  - adds ean and its mapping in default english bibliographic framework
  - adds ean mapping in default french bibliographic framework
  - ean search is not enabled for MARC21

The required mapping between the ean marc field and the biblioitems.ean
database field will be automatically added on an existing unimarc installation.

However, if you already have records with ean, you will have to
run misc/batchRebuildBiblioTables.pl to populate biblioitems.ean

Signed-off-by: jmbroust <jean-manuel.broust@univ-lyon2.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Passed QA at second run. Removed a merge marker only.
2012-06-09 18:26:34 +02:00
Chris Cormack
0aecb2c2b3 Bug 4330 : Fixing FSF address and copyright headers for acqui/
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-28 17:54:18 +02:00
285f06e394 Bug 7112 - Having two prices in 020$c causes basket creation to fail from staged marc import
The root problem here is that the price is being pulled from the MARC record
and is then run through Number::Format::unformat_number. This routine is
really being misused, and should only be used to reverse the effects of
Number::Format on a number string. We are apparently using it to strip
out currency characters and the like.

Number::Format::unformat_number will choke if there is more than one period (.)
in the price field. MARC standards do not limit this field to a single period,
so unless there is only one period, we should skip number unformatting.
Examples of that break unformat_number include '18.95 (U.S.)', and
'$5.99 ($7.75 CAN)', both of which are perfectly valid.

This commit adds the function MungeMarcPrice that will better handle
find a real price value in a given price field. It does a very good
job at finding a price in any currency format, and attempts to find
a price in whichever currency is active before falling back to
the first valid price it can find.

The variable $price may fail to have an actual price, in which case
the price then defaults to '0.00', which would be rarely if ever the
correct price. To combat this, I have added highlighting to any
price in the Order Details table that begins with 0 ( i.e. '0.00' ).

Also, fixed the incomplete table footer, adding a new td with a
span of 3 to fill in the nonexistant cells.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-05-24 15:59:21 +02:00
d6c3cb2934 Bug 7757 - Edit basket vendor after it has been created
Signed-off-by: mveron <veron@veron.ch>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-24 13:35:52 +02:00
Julian Maurice
2338d02e9e Bug 7175: Allow to choose which items to receive
If AcqCreateItem=ordering, when you receive an order, you now have a
list of all created items and checkboxes that permit you to choose which
items you want to receive.
A 'Edit' link open additem.pl page in a popup to allow you edit the
items before receiving them (popup is automatically closed after
modification, and items table is automatically updated)
If quantity is set manually in the text box, the appropriate number of
checkbox are checked from top to bottom and a warning shows up if
quantity is greater than order quantity

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-21 17:46:07 +02:00
Julian Maurice
b156055ad2 Bug 7175: orderreceive.pl cosmetic changes
- use warnings
- replace @$results[0] by $order when $count == 1
2012-05-21 17:46:04 +02:00
Paul Poulain
a598b10061 Merge remote-tracking branch 'origin/new/bug_7178' 2012-05-14 16:18:46 +02:00
d83596ad1b Followup 7178: Remove warning on uninitialized value in sprintf for neworderempty
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-14 16:17:05 +02:00
Julian Maurice
7a81b89357 Bug 7178: Follow-up Improve order item creation
Move SQL code from Perl script to Perl module
Replace SHOW COLUMNS by $dbh->column_info()
Update total on neworderempty.pl when adding or deleting items

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested ok for ordering and receiving items.
Total updated correctly.

Note: There are lots of errors in the logs before and after applying
the patch. A follow up is needed.
2012-05-14 16:16:13 +02:00
Jonathan Druart
f15d3de96c Bug 5347: Followup: FIX 2 bugs in lateorders
1/ Failed to claim late orders (Can't use string as a HASH ref)
2/ Don't show the red error message after submit the form for claims

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
1/ Fixed.
2/ Also fixed.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-18 17:05:23 +02:00
Colin Campbell
b5ac4a852f Bug 7831 : Sort budgets for selection in new order
The select budget dropdown list should be presented in
an ordered fashion. To achieve this sort the budget array
by the visible text.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-12 18:24:39 +02:00
Jonathan Druart
763d69732e Bug 7756: FIX send email for late orders
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
- sending claim mails works now
- claim counter is not increased when vendor has no email address

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-12 16:50:27 +02:00
Jonathan Druart
d76dbace5e Bug 7291: Adds new field aqbooksellers.deliverytime
New field deliverytime in aqbooksellers table. It is an estimated
delivery time for orders (in days).
You can set this delay on the supplier modification page.
It is used in the late orders search.

The order estimated date is the aqbasket.closedate +
aqbooksellers.deliverytime

If you set a delay, the query check if closedate <= today - delay

If you set a "delivery time from" and a "delivery time to", the query check if
$delivery_time_from <= aqbooksellers.deliverytime is not NULL and if
closedate + deliverytime >= $delivery_time_to
if there is not a time_to then $delivery_time_to = the current date.
2012-04-03 18:19:46 +02:00
Julian Maurice
eefc774e27 Bug 7178: Acquisition item creation improvement
- Display a unique item block at once

On orderreceive.pl when AcqCreateItem is 'receiving', and on
neworderempty.pl when AcqCreateItem is 'ordering' it displays an
item block with item infos to fill, and a '+' button.
When user clicks on '+', the block is hidden and a list shows up with
the items that will be received. User can then edit or delete items in
the list and click 'Save' to receive items.

- PrepareItemrecordDisplay is now used for cloning block

Previous cloning function was duplicating ids, the side effect is that
plugins didn't work when several items were displayed.
PrepareItemrecordDisplay regenerate the form with new ids

- New system preference UniqueItemFields

Contains a space-separated list of sql column names (of items table).
This syspref is used in two ways:
 - Values corresponding to fields in syspref are not duplicated when
   adding a new item (button 'Add')
 - When saving the form, a check is made on fields in syspref for
   detecting duplicate (in DB and in the form)

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests done are noted on the bug report.

2012-03-23: Fixed conflict in updatedatabase.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-26 11:07:23 +02:00
Dobrica Pavlinusic
fb3f624f09 Bug 7767 - acqui/basketgroup.pl: our $template scoping for plack
Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-22 17:52:03 +01:00
Dobrica Pavlinusic
ccce4f0f60 Bug 7768 - acqui/z3950_search.pl: remove sub displayresults to fix plack scoping
Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-22 17:48:42 +01:00
Adrien Saurat
31175cbdab Bug 7737: applies date filters on vendor pages
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-22 17:18:03 +01:00
Adrien Saurat
58e3065af4 Bug 7748: use of TT date filter on addorderiso2709
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-21 18:23:39 +01:00
Julian Maurice
f3197e20eb Bug 7169: Follow-up: Change booksellers search results display
- List of booksellers changed to a drop-down list
- Baskets columns renamed and reordered to make them consistent with
  acqui/parcels.pl
- warning in log removed
- changed a '&' to '&amp;' to pass W3 validator

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-21 17:54:00 +01:00
Julian Maurice
d09e428a7d Bug 7169: Change booksellers search results display
- Replace vendor table by a div (avoid table in a table)
- Add two columns in basket tables: biblio count and expected (not
  received) items)
- Replace tablesorter by datatables
- Add a list of all returned bookseller names in top of the page (easier
  to find a bookseller in a large list of results)
2012-03-21 17:53:57 +01:00
Adrien Saurat
813648526d Bug 7744: use of TT date filters on basket pages
TT date filters added on basket.pl and neworderempty.pl

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-21 14:38:23 +01:00
Adrien Saurat
d266ccb81f Bug 7735: removal of C4::Dates when unused
Removes use of C4::Dates in acqui/ordered.pl and acqui/spent.pl

Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-20 18:11:04 +01:00
Jonathan Druart
692ee0e9da Bug 7166: Adds edit order notes when the basket is closed
When you are on parcel.pl or basket.pl you can now add or edit a note
 for each order.

 To test:
 Create orders with and without note.
 Edit/Add the note on basket.pl page

 Close the basket.
 Check you can add/edit the order note on parcel.pl page

+ From Owen:
Correcting markup issues with modordernotes.pl:

- Adding "rows" and "cols" attributes to <textarea> (required)
- Converting cancel button to link to stay consistent with
  other pages
- Changing page layout to fixed & centered (not sidebar needed)
- Expanding information in breadcrumbs to match information
  on basket.pl

Changing markup around note add and edit links: Moving output
of order note to the end of the table cell, putting it in its
own paragraph, and adding a "Note:" label

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-20 16:45:37 +01:00
Jonathan Druart
f3ba35c0a0 Bug 7301: 'From' field is 1 year ago by default
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-19 18:28:17 +01:00
Robin Sheat
4cbeeedbe8 Bug 6296: allow users to be authenticated by SSL client certs
This adds a new syspref: AllowPKIAuth. It can have one of three states:
* None
* Common Name
* emailAddress

If a) this is set to something that's not "None", and b) the webserver
is passing SSL client cert details on to Koha, then the relevant field
in the user's certificate will be matched up against the field in the
database and they will be automatically logged in. This is used as a
secure form of single sign-on in some organisations.

The "Common Name" field is matched up against the userid, while
"emailAddress" is matched against the primary email.

This is an example of what might go in the Apache configuration for the
virtual host:

    #SSLVerifyClient require # only allow PKI authentication
    SSLVerifyClient optional
    SSLVerifyDepth 2
    SSLCACertificateFile /etc/apache2/ssl/test/ca.crt
    SSLOptions +StdEnvVars

The last line ensures that the required details are
passed to Koha.

To test the PKI authentication, use the following curl command:
    curl -k --cert client.crt --key client.key  https://URL/
(look through the output to find the "Welcome," line to indicate that a user
has been authenticated or the "Log in to Your Account" to indicate that a
user has not been authenticated)

To create the certificates needed for the above command, the following series
of commands will work:
    # Create the CA Key and Certificate for signing Client Certs
    openssl genrsa -des3 -out ca.key 4096
    openssl req -new -x509 -days 365 -key ca.key -out ca.crt
    # This is the ca.crt file that the Apache config needs to know about,
    # so put the file at /etc/apache2/ssl/test/ca.crt

    # Create the Server Key, CSR, and Certificate
    openssl genrsa -des3 -out server.key 1024
    openssl req -new -key server.key -out server.csr

    # We're self signing our own server cert here.  This is a no-no in
    # production.
    openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key \
        -set_serial 01 -out server.crt

    # Create the Client Key and CSR
    openssl genrsa -des3 -out client.key 1024
    openssl req -new -key client.key -out client.csr

    # Sign the client certificate with our CA cert. Unlike signing our own
    # server cert, this is what we want to do.
    openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key \
        -set_serial 02 -out client.crt
    openssl pkcs12 -export -in client.crt -inkey client.key -out client.p12
    # In theory we can install this client.p12 file in Firefox or Chrome, but
    # the exact steps for doing so are unclear, and outside the scope of this
    # patch

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Tested with Common Name and E-mail authentication, as well as with PKI
authentication disabled. Regular logins continue to work in all cases when
SSL authentication is set to optional on the server.

Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
QA comment: synchronized updatedatabase.pl version of syspref with sysprefs.sql
version, to avoid divergent databases between new and upgrading users.
2012-03-19 17:02:44 +01:00
Katrin Fischer
6ce3169ebf Bug 7602: Spent and ordered pages require full acquisition permissions
Changes permissions on these pages so that one acquisition permission
will make it possible to access the pages. Currently pages are only
accessible for users with full (all checkboxes checked) acquisition
permissions.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

Tested with only one acquisitions permission (various choices) and
patron can access the ordered and spent pages.
2012-03-13 16:00:46 +01:00
Adrien Saurat
b2180b8bd4 Bug 4969: deletion of suppliers
If a vendor/bookseller has no basket/subscription link, it can now
be deleted (after a JS confirmation).

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Verified that I can only delete vendors without linked orders or
subscriptions.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-13 15:12:26 +01:00
Srdjan Jankovic
a9ded4fa00 bug_7001: Issue and Reserve slips are notices.
Branches can have their own version of notices - added branchcode to
letter table.
Support html notices - added is_html to letter table.
Support for borrower attributes in templates.
GetPreparedletter() is the interface for compiling letters (notices).
Sysprefs for notice and slips stylesheets
Added TRANSFERSLIP to the letters

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-09 10:11:20 +01:00
Jared Camins-Esakov
5207699f98 signed off Bug 7284: Authority matching improvements
Squashed patch incorporating all previous patches (there is no functional
change compared to the previous version of this patch, this patch merely
squashes the original patch and follow-up, and rebases on latest master).

=== TL;DR VERSION ===
*** Installation ***
1. Run installer/data/mysql/atomicupdate/bug_7284_authority_linking_pt1
and installer/data/mysql/atomicupdate/bug_7284_authority_linking_pt2
2. Make sure you copy the following files from kohaclone to koha-dev:
etc/zeradb/authorities/etc/bib1.att,
etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml,
etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl,
etc/zebradb/marc_defs/marc21/authorities/koha-indexdefs-to-zebra.xsl, and
etc/zebradb/marc_defs/unimarc/authorities/record.abs
3. Run misc/migration_tools/rebuild_zebra.pl -a -r

*** New sysprefs ***
* AutoCreateAuthorities
* CatalogModuleRelink
* LinkerModule
* LinkerOptions
* LinkerRelink
* LinkerKeepStale

*** Important notes ***
You must have rebuild_zebra processing the zebraqueue for bibs when testing this
patch.

=== DESCRIPTION ===

*** Cataloging module ***
* Added an additional box to the authority finder plugin for "Heading match,"
  which consults not just the main entry but also See-from and See-also-from
  headings.

* With this patch, the automatic authority linking will actually work properly
  in the cataloging module. As Owen pointed out while testing the patch,
  though, longtime users of Koha will not be expecting that. In keeping with
  the principles of least surprise and maximum configurability, a new syspref,
  CatalogModuleRelink makes it possible to disable authority relinking in the
  cataloging module only (i.e. leaving it enabled for future runs of
  link_bibs_to_authorities.pl).  Note that though the default behavior matches
  the current behavior of Koha, it does not match the intended behavior.
  Libraries that want the intended behavior rather than the current behavior
  will need to adjust the CatalogModuleRelink syspref.

*** misc/link_bibs_to_authorities.pl ***
Added the following options to the misc/link_bibs_to_authorities.pl script:
--auth-limit        Only process those headings that match the authorities
                    matching the user-specified WHERE clause.
--bib-limit         Only process those bib records that match the
                    user-specified WHERE clause.
--commit            Commit the results to the database after every N records
                    are processed.
--link-report       Display a report of all the headings that were processed.

Converted misc/link_bibs_to_authorities.pl to use POD.

Added a detailed report of headings that linked, did not link, and linked
in a "fuzzy" fashion (the exact semantics of fuzzy are up to the individual
linker modules) during the run.

*** C4::Linker ***
Implemented new C4::Linker functionality to make it possible to easily add
custom authority linker algorithms. Currently available linker options are:
* Default: retains the current behavior of only creating links when there is
  an exact match to one and only one authority record; if the 'broader_headings'
  option is enabled, it will try to link to headings to authority records for
  broader headings by removing subfields from the end of the heading (NOTE:
  test the results before enabling broader_headings in a production system
  because its usefulness is very much dependent on individual sites' authority
  files)
* First Match: based on Default, creates a link to the *first* authority
  record that matches a given heading, even if there is more than one
  authority record that matches
* Last Match: based on Default, creates a link to the *last* authority
  record that matches a given heading, even if there is more than one record
  that matches

The API for linker modules is very simple. All modules should implement the
following two functions:
<get_link ($field)> - return the authid for the authority that should be
linked to the provided MARC::Field object, and a boolean to indicate whether
the match is "fuzzy" (the semantics of "fuzzy" are up to the individual plugin).
In order to handle authority limits, get_link should always end with:
    return $self->SUPER::_handle_auth_limit($authid), $fuzzy;

<flip_heading ($field)> - return a MARC::Field object with the heading flipped
to the preferred form. At present this routine is not used, and can be a stub.

Made the linking functionality use the SearchAuthorities in C4::AuthoritiesMarc
rather than SimpleSearch in C4::Search. Once C4::Search has been refactored,
SearchAuthorities should be rewritten to simply call into C4::Search. However,
at this time C4::Search cannot handle authority searching. Also fixed numerous
performance issues in SearchAuthorities and the Linker script:
* Correctly destroy ZOOM recordsets in SearchAuthorities when finished. If left
  undestroyed, efficiency appears to approach O(log n^n)
* Add an optional $skipmetadata flag to SearchAuthorities that can be used to
  avoid additional calls into Zebra when all that is wanted are authority
  records and not statistics about their use

*** New sysprefs ***
* AutoCreateAuthorities - When this and BiblioAddsAuthorities are both turned
  on, automatically create authority records for headings that don't have
  any authority link when cataloging. When BiblioAddsAuthorities is on and
  AutoCreateAuthorities is turned off, do not automatically generate authority
  records, but allow the user to enter headings that don't match an existing
  authority. When BiblioAddsAuthorities is off, this has no effect.
* CatalogModuleRelink - when turned on, the automatic linker will relink
  headings when a record is saved in the cataloging module when LinkerRelink
  is turned on, even if the headings were manually linked to a different
  authority by the cataloger. When turned off (the default), the automatic
  linker will not relink any headings that have already been linked when a
  record is saved.
* LinkerModule - Chooses which linker module to use for matching headings
  (current options are as described above in the section on linker options:
  "Default," "FirstMatch," and "LastMatch")
* LinkerOptions - A pipe-separated list of options to set for the authority
  linker (at the moment, the only option available is "broader_headings," which
  is described below)
* LinkerRelink - When turned on, the linker will confirm the links for headings
  that have previously been linked to an authority record when it runs. When
  turned off, any heading with an existing link will be ignored.
* LinkerKeepStale - When turned on, the linker will never *delete* a link to an
  authority record, though, depending on the value of LinkerRelink, it may
  change the link.

*** Other changes ***
* Cleaned up authorities code by removing unused functions and adding
  unimplemented functions and added some unit tests.

* This patch also modifies the authority indexing to remove trailing punctuation
  from Match indexes.

* Replace the old BiblioAddAuthorities subroutines with calls into the new
  C4::Linker routines.

* Add a simple implementation for C4::Heading::UNIMARC. (With thanks to F.
  Demians, 2011.01.09) Correct C4::Heading::UNIMARC class loading. Create
  biblio tag to authority types data structure at initialization rather than
  querying DB.

* Ran perltidy on all changed code.

*** Linker Options ***
Enter "broader_headings" in LinkerOptions. With this option, the linker will
try to match the following heading as follows:
=600  10$aCamins-Esakov, Jared$xCoin collections$vCatalogs$vEarly works to
1800.

First: Camins-Esakov, Jared--Coin collections--Catalogs--Early works to 1800
Next: Camins-Esakov, Jared--Coin collections--Catalogs
Next: Camins-Esakov, Jared--Coin collections
Next: Camins-Esakov, Jared (matches! if a previous attempt had matched, it
would not have tried this)

This is probably relevant only to MARC21 and LCSH, but could potentially be of
great use to libraries that make heavy use of floating subdivisions.

=== TESTING PLAN ===

Note: all of these tests require that you have some authority records,
preferably for headings that actually appear in your bibliographic data. At
least one authority record must contain a "see from" reference (remember which
one contains this, as you'll need it for some of the tests). The number shown
in the "Used in" column in the authority module is populated using Zebra
searches of the bibliographic database, so you *must* have
rebuild_zebra.pl -b -z [-x] running in cron, or manually run it after running
the linker.

*** Testing the Heading match in the cataloging plugin ***
1.  Create a new record, and open the cataloging plugin for an
    authority-controlled field.
2.  Search for an authority by entering the "see from" term in the Heading Match
    box
3.  Confirm that the appropriate heading shows up
4.  Search for an authority by entering the preferred heading into the Main
    entry or Main entry ($a only) box (i.e., repeat the procedure you usually
    use for cataloging, whatever that may be)
5.  Confirm that the appropriate heading shows up

*** Testing the cataloging interface ***
6.  Turn off BiblioAddsAuthorities
7.  Confirm that you cannot enter text directly in an authority-controlled field
8.  Confirm that if you search for a heading using the authority control plugin
    the heading is inserted (note, however, that this patch does not AND IS NOT
    INTENDED TO fix the bugs in the authority plugin with duplicate subfields;
    those are wholly out of scope- this check is for regressions)
9.  Turn on BiblioAddsAuthorities and AutoCreateAuthorities
10. Confirm that you can enter text directly into an authority-controlled field,
    and if you enter a heading that doesn't currently have an authority record,
    an authority record stub is automatically created, and the heading you
    entered linked
11. Confirm that if you enter a heading with only a subfield $a that fully
    *matches* an existing heading (i.e. the existing heading has only
    subfield $a populated), the authid for that heading is inserted into
    subfield $9
12. Confirm that if you enter a heading with multiple subfields that *matches*
    an existing heading, the authid for that heading is inserted into
    subfield $9
13. Turn on BiblioAddsAuthorities and turn off AutoCreateAuthorities
14. Confirm that you can enter text directly into an authority-controlled field,
    and if you enter a heading that doesn't currently have an authority record,
    an authority record stub is *not* created
15. Confirm that if you enter a heading with only a subfield $a that *matches*
    an existing heading, the authid for that heading is inserted into
    subfield $9
16. Confirm that if you enter a heading with multiple subfields that *matches*
    an existing heading, the authid for that heading is inserted into
    subfield $9
17. Create a record and link an authority record to an authorized field using
    the authority plugin.
18. Save the record. Ensure that the heading is linked to the appropriate
    authority.
19. Open the record. Change the heading manually to something else, leaving
    the link. Save the record.
20. Ensure that the heading remains linked to that same authority.
21. Change CatalogModuleRelink to "on."
22. Open the record. Use the authority plugin to link that heading to the
    same authority record you did earlier.
23. Save the record. Ensure that the heading is linked to the appropriate
    authority.
24. Open the record. Change the heading manually to something else, leaving
    the link. Save the record.
25. Ensure that the heading is no longer linked to the old authority record.

*** Testing link_bibs_to_authorities.pl ***
26. Set LinkerModule to "Default," turn on LinkerRelink and
    BiblioAddsAuthorities, and turn AutoCreateAuthorities and
    LinkerKeepStale off
27. Edit one bib record so that an authority controlled field that has already
    been linked (i.e. has data in $9) has a heading that does not match any
    authority record in your database
28. Run misc/link_bibs_to_authorities.pl --link-report --verbose --test (you may
    want to pipe the output into less or a file, as the result is quite a lot of
    information)
29. Look over the report to see if the headings that you have authority records
    for report being matched, that the heading you modified in step 2 is
    reported as "unlinked," and confirm that no changes were actually made to
    the database (to check this, look at the bib record you edited earlier, and
    check that the authid in the field you edited hasn't changed)
30. Run misc/link_bibs_to_authorities.pl --link-report --verbose (you may want
    to pipe the output into less or a file, as the result is quite a lot of
    information)
31. Check that the heading you modified has been unlinked
32. Change the modified heading back to whatever it was, but don't use the
    authority control plugin to populate $9
33. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
34. Confirm that the heading has been linked to the correct authority record
35. Turn LinkerKeepStale on
36. Change that heading to something else
37. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
38. Confirm that the $9 has not changed
39. Turn LinkerKeepStale off
40. Create two authorities with the same heading
41. Run misc/migration_tools/rebuild_zebra.pl -a -z
42. Enter that heading into the bibliographic record you are working with
43. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
44. Confirm that the heading has not been linked
45. Change LinkerModule to "FirstMatch"
46. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
47. Confirm that the heading has been linked to the first authority record it
    matches
48. Change LinkerModule to "LastMatch"
49. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
50. Confirm that the heading has been linked to the second authority record it
    matches
51. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --auth-limit="authid=${AUTH}" (replacing ${AUTH} with an authid)
52. Confirm that only that heading is displayed in the report, and only those
    bibs with that heading have been changed

If all those things worked, good news! You're ready to sign off on the patch
for bug 7284.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on latest master and squashed follow-up, 16 February 2012
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on latest master, 21 February 2012

Signed-off-by: schuster <dschust1@gmail.com>
2012-03-07 17:34:11 +01:00
Katrin Fischer
baec1daa10 Bug 7606: Editing a vendor in acq creates a new vendor
To test:

Before patch:
- editing a new vendor will create a new vendor

After patch:
- editing a vendor saves changes correctly, no new vendor is created

Also:
- after saving or cancelling an edit page redirects correctly
- adding new vendors works correctly

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

Followed test plan and all tests pass.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This is a follow-up for 7113
2012-02-27 11:14:48 +01:00
Srdjan Jankovic
39def35275 bug_7231: Call GetMarcPrice() in acqui/neworderempty.pl for staged imports
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-02-20 22:18:10 +01:00
Paul Poulain
f7a525fa09 Merge remote-tracking branch 'origin/new/bug_6875' 2012-02-20 16:45:42 +01:00
Paul Poulain
49b167e848 Bug 6875 de nesting C4::Biblio
C4::Biblio is used in many many places. The goal of this cleaning is to do from C4::Biblio a package with as many dependancies as possible.

* C4::Heading is called only in 1 place, highly rarely used (only in 1 misc/link_bibs_to_authorities.pl), moving to require
* PrepareItemrecordDisplay is a sub that is more related to Items, moving it here. It means some scripts that used this sub must be checked against use C4::Items
* C4::Items is needed in EmbedItemsInMarcBiblio, moving it only in this sub, and switching to require
* 2 subs are totally useless z3950_extended_services and set_service_options, removing them

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
No test plan included, but tested some opac and cataloging functions.
Code looks good. Marked as Passed QA.
2012-02-20 16:35:17 +01:00
7fcff602f5 Bug 7113: Standardize vendor id name in templates and scripts
New revision updates for current master and cleans up new
instances introduced by recent commits.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
2 problems found, fixing those in follo up patches:
- late orders don't allow more than 1 order to be selected
- basketgroups: 'Edit vendor' does the same as 'Manage orders'
2012-02-17 19:04:00 +01:00
Jonathan Druart
cf999c10a4 Bug 7289: Adds editionstatement field in neworderempty
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

Tested:

Database update
- existing mapping
- no pre existing mapping

Frameworks
PROBLEM: some languages are still missing, I think only untranslated
frameworks are included in this patch.

Acquisition
- created a new order with edition filled out
- checked edition was saved to the correct field in cataloguing
- modified edition and checked display in acquisition
- edition also displays on basket summary page

http://bugs.koha-community.org/show_bug.cgi?id=7280
2012-02-17 11:13:34 +01:00
Jonathan Druart
0200639b00 Bug 5346: Linking suggestions and orders.
Display suggestion info in acquisition module:
  basket.pl
  neworderempty.pl
  orderreceive.pl
  parcel.pl

To Test:
Create a suggestion and accept it.
Create a new order from this suggestion
Receive this order

For each step, check if suggestion info are visible.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test provides more unit tests, all complete successfully.
perl t/db_dependent/Suggestions.t
Note: test case should be cleaned up after running tests.

Display changes are consistent and information about the suggestion
is shown on every important screen now.

I created an order from a suggestion and one from an existing record.

No problems found.
2012-02-17 10:27:52 +01:00
0d037efd35 Bug 7018 - need all acq permissions to search
Single line fix. Changes permissions required for histsearch.pl
from requiring * for acquisitions to only requiring
group_manage, order_manage, and order_receive

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-02-16 18:44:56 +01:00
Adrien Saurat
19d6339c26 Bug 7457: log cleaning on basket.pl
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-02-10 15:35:12 +01:00
MJ Ray
d4b132136c Bug 7476 Remove executable bit from files that probably should not be executed
Signed-off-by: Aleksa Vujicic <aleksa@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended to replace some copy-and-paste comments only with consent of MJR.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-02-03 14:22:15 +01:00
952bfc6f07 Fix for Bug 7148 - Add some error handling to Acquisitions' Z39.50 search to match Cataloging's
- Copying over error handling for timeout(10007) and refused(10000)
- Copying over error handling for submission with no targets chosen
- Correcting "cancel" link in the template which was not modified
  when it was copied from cataloging's popup window template.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-02-02 14:02:53 +01:00
Alex Arnaud
37c446b7ac bug 7343 - Fix empty values in statistic 1 and 2 dropboxes in neworderempty
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested. Comments have been incorporated. Marked as Passed QA.

http://bugs.koha-community.org/show_bug.cgi?id=7342
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-01-23 18:15:09 +01:00
Paul Poulain
f961638465 Bug 5473 follow-up : removed warn & replace some tabs by 4 spaces 2012-01-20 16:30:48 +01:00
Srdjan Jankovic
92ca5a13e5 bug_5473: Update items when receiving shipments
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

Tested by recieving multiple items with the AcqCreateItem
preference set to 'placing and order' and 'receiving an item'
In both cases the pricing and vendor is brought over to the
item record so I'm signing off.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-01-20 15:43:11 +01:00
Jonathan Druart
6c2984e78a Bug 5347: Set translatable the "no email" error
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This bookseller has no email shows up correctly, when vendor has
no email address.

Small change made: Changed bookseller to vendor.
2012-01-20 14:12:28 +01:00
Katrin Fischer
3e282ff91b Bug 5347: Follow up - Fix warnings, check/uncheck all and makes error message translatable
This patch fixes some minor problems found in late order management:

 1) Silences 2 warns in Letters.p
After patch is applied no more warns should show up in the logs.

 2) Fixes check/uncheck al
When limiting on one vendor the checkbox in the last header column
was doing nothing. I changed the checkbox to 2 links 'check all' and
'uncheck all' as it's done in other templates.

 3) Email has been sent
The message was hardcoded into the lateorders.pl file and not
translatable.
I moved it to the template and changed the wording slightly.

Note: The error message 'The bookseller has no email' comes from
Letters.pm. I didn't change that, because I was not sure where it is
used. The error message as is can not be translated and should be
moved into the templates too.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-01-20 14:12:27 +01:00
Jonathan Druart
b8e9829be5 Bug 5347: Adds columns claims_count and claimed_date in aqorders
This patch adds 2 columns in the aqorders table :
- claims_count : number of claims for an orders
- claimed_date : date of the lastest claim

In the lateorders.pl table, you can not select orders from different
supplier because there is just one letter sent after clicking the "Claim
order" button. So, it's logic that you want to select only orders from
this supplier.

Modification in C4/Letters.pm:
refactoring code for claimacquisition and claimissues letter type.
Now, fields for theses letters check the table name. It's not possible
to chooce aqorders.title, this field doesn't exist !
Furthermore, you can add a <order> tag around your item fields, like
this :

-- Begin example
<<LibrarianFirstname>>
<<LibrarianSurname>>

<<aqbooksellers.contact>>
<<aqbooksellers.address1>>
<<aqbooksellers.phone>>
<<aqbasket.basketno>>
<<aqbooksellers.phone>>
<order>Library : <<items.homebranch>>
In your possesssion : <<biblio.author>>. <<biblio.title>>.
<<biblioitems.publishercode>>, <<biblioitems.publicationyear>>.
Callnumber : <<items.itemcallnumber>>. doc type : <<items.itype>>
Barcode : <<items.barcode>>
Date for the return : <<items.onloan>>.</order>

<<LibrarianSurname>>
-- End example

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
2012-01-20 14:12:27 +01:00
Paul Poulain
79b0b76481 Merge remote-tracking branch 'origin/new/bug_929' 2012-01-13 17:47:30 +01:00
Paul Poulain
5dcc27d14c Bug 929 small follow-up (mistake in POD) 2012-01-13 17:47:16 +01:00
Julian Maurice
7a3f77de8c Bug 5358: Show cancelled orders in basket page
Signed-off-by: Christophe Croullebois <christophe.croullebois@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-01-13 10:52:50 +01:00
Katrin Fischer
71d2d81e34 Bug 929: Follow up - showing fund code instead of internal number
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-01-06 13:52:10 +01:00
Chris Cormack
01875b565d Bug 929 : Followup fixing date formatting
This patch introduces a Filter (KohaDates) for use in templates
[% USE KohaDates %]
[% somevariable | $KohaDates %]

This will format the date in the format specified by the systempreference

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
2012-01-06 13:52:08 +01:00
Chris Cormack
ddb6883b57 Bug 929 : Last follow up, implementing the last of Katrins suggestions
Date formatting
Links
Nomenclature changes

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
2012-01-06 13:52:06 +01:00
Chris Cormack
c64322e48d Bug 929 : Follow up, making some improvements to the spent page More to come
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
2012-01-06 13:52:05 +01:00
Chris Cormack
9638053a25 Bug 929 : Reinstating the breakdown of budgets
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
2012-01-06 13:52:01 +01:00
Katrin Fischer
37e1f05e8f Bug 3184: Show creator and budget on order receive page
Reimplementing 3.0.x patch from
Nahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>

To test:
1) Create basket
2) Order something, note your fund
3) Receive title
> Verify your name and selected fund display correctly

Additional tests:
1) Set borrowernumber in aqbasket.authorisedby to a nonexistant borrowernumber (like something really big)
> Created by should show "No name"
2) Set borrowernumber to NULL / empty
> Created by should show "No name"

Signed-off-by: Duncan Tyler <duncan@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-01-06 12:35:34 +01:00
Adrien Saurat
28ef6c199b Bug 6893 : Updates suggestions list when adding orders
A suggestion added through addorder.pl now changes
to the ORDERED status as initially intended (but so
far it stayed as ACCEPTED).

This fixes the list of potential suggestions to order,
the ORDERED ones don't appear anymore.

Bug 6893 : Follow-up: Disabled WHERE clause excluding ORDERED status

In SearchSuggestions, a WHERE clause was excluding the ORDERED
suggestions from the results. Now replaced with 1=1.

(before 6893 correction, the WHERE clause was excluding the
STATUS='CLAIMED' suggestions, but this status cannot be found anywhere
else in the code... so I changed to STATUS='ORDERED' which
seemed more accurate, but it had impacts on OPAC and some Admin tabs)

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Both patches applied cleanly, sqashed them together after testing.

Tested:
1) Creating new suggestions
- from OPAC, shows up in patron account as 'requested', pending in staff
- from staff, shows up in list of pending suggestions
Status in database is ASKED

Note: suggestions made from staff for the same patron have suggestedby = 0
in the database, so are not showing up in the patron account. Is this by
intention? (if not, I think this is a separate bug)

2) Accepting suggestions
- from list
- from edit page
Status in database is ACCEPTED
Patron account shows 'Accepted by the library (Bestseller)'

Note: after changing the status from the list, bug 4068 kicks in and
some tabs and even suggestions are hidden. Going back to the acq start
page and going back to the suggestions page from there helps.

3) Rejecting suggestions
- from list
- from edit page
Status in database is REJECTED
Patron account in OPAC shows 'Suggestion declined'

Note: bug 4068 again.

4) Ordering from suggestions
- new basket
- ordered 2 accepted suggestions
SUCCESS! Great improvement:
- Status in database is now ORDERED
- Already ordered suggestions no longer show up on list of
  suggestions to order from.
- Patron account shows 'Ordered by the library (Bestseller)'
- Suggestion management page shows a new tab 'Ordered'
- For the suggestion with a valid 'suggestedby' borrowernumber,
  a mail was generated. (bug 7094)

5) Receive ordered suggestions
- received my ordered suggestions
This is is not in the scope of this bug, but for documentation:
- No message was generated to inform the patron
- Status stays ORDERED
- Patron account still shows item as ordered, no change to 4)

Looking at the suggestion.tt I think there should be another status
AVAILABLE.
216     [% ELSIF (suggestion.suggestiontypelabel == "Available") %]Available

Signing off, fixes bug reported. Danke!

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-06 20:30:04 +01:00
Katrin Fischer
573b9275a6 Bug 3388: Restore account number on vendor page
This patch makes it possible to add the account number to the
vendor information. The used field aqbookseller.accountnumber was
already existent in the database.

To test:
1) Add a new vendor with accountnumber
> Verify form has a field for accountnumber
> Verify accountnumber does show up on vendor summary page
2) Edit this vendor, change accountnumber
> Verify change was correctly saved and new number is displayed on
vendor summary page
3) Delete accountnumber

Signed-off-by: Liz Rea <lrea@nekls.org>
Tested 1-3, no troubles found.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-25 11:07:11 +01:00
Katrin Fischer
5d5a047984 Bug 4161: Preselect active currency for new vendors
Currently when creating a new vendor in acquisitions the alphabetical first
currency will be preselected. For better usability and less mistakes the
active curency should be preselected.

To test:
Check your currency settings in administration.
Your active currency should not be the first in the list.

1) Create a new vendor
Verify the active currency is selected for list and invoice prices.

2) Check vendor summary page
Verify the correct currencies from the vendor record are shown here.

3) Edit vendor
Verify the correct currencies from the vendor record  are shown here.

Signed-off-by: Liz Rea <lrea@nekls.org>
Verified with tests 1, 2, and 3.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-16 17:46:08 +01:00
Katrin Fischer
7a3dc5102e Bug 7138: Can't print basket group order pdf
PDF print of basket groups is broken.

To test:

1) Make sure OrderPdfFormat is set to pdfformat::layout2pages or pdfformat::layout3pages
2) Create a basket with orders
3) Close the basket and create a basket group checking the checkbox
4) Print the basket group as PDF

Before patch the file is broken and when opened in an editor contains an error message.
After the patch the PDF should be generated correctly again.

Thx to Chris for helping me to fix the problem.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-09 17:07:26 +01:00
Paul Poulain
bfc3ea8cc4 Merge remote-tracking branch 'origin/new/bug_6390' 2011-11-06 17:56:36 +01:00
Ian Walls
58bdfdb088 Bug 6390 Followup: Basket's authorisedby might not be a borrowernumber
aqbasket.authorisedby is not foreign key constrainted to borrowers.borrowernumber,
so if it's anything other than that, vendor search breaks by using an undefined value
(GetMember() on an invalid borrowernumber) as a HASH ref.

This patch sets the branchcode (the desired value from GetMember) to a blank value, then only
changes it if GetMember is defined.  In the case where the authorisedby librarian has been deleted,
or the value is otherwise invalid, and AcqViewBaskets is set to 'branch', the basket will not appear
except to superlibrarians

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Invalid borrowernumber in aqbasket.authorisedby no longer breaks search.
2011-11-06 17:55:37 +01:00
Katrin Fischer
488f4be865 Bug 6994: Wrong 'no budget defined' alert
When ordering from an existing record the 'no budgets and funds defined' error
message was shown below the result list.

To test:
A) No budgets defined for this user and library
Basket summary page shows a warning instead of the link for creation
of orders.

B) Budgets and funds are properly defined for this user and library
Basket summary page shows links for order creation.
Before patch: A search for an existing record had the alert at the bottom
of the search result list.
After patch: The links for creation of orders are shown instead.

Signed-off-by: Liz Rea <lrea@nekls.org>
Verified A and B.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-06 11:43:30 +01:00
Frédérick Capovilla
61e1eeee84 Follow-up patch : use the subfield associated with items.barcode
Instead of using the 'p' subfield directly, use the subfield letter
associated with the items.barcode column.

http://bugs.koha-community.org/show_bug.cgi?id=6963
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

Test cases tested:
- 1 item, barcode empty
- 2 items, barcodes both empty
- 1 item, existing barcode
- 1 item, new barcode
- 2 items, one barcode empty, one existing

All test cases worked nicely and gave correct error messages.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-04 10:22:52 +01:00
Frédérick Capovilla
327be442bd Bug 6963: Corrects a problem when a new order is created with a duplicate barcode.
If the AcqCreateItem preference is set to "ordering" and the barcode for
the new item is already in use, no error is returned, but an invalid
itemnumber is saved in the aqorders_items table and the item is never
created.

This patch adds a duplicate barcode verification in neworderempty.pl
_koha_add_item is also modified so it won't return an invalid ID when
an item can't be added.

http://bugs.koha-community.org/show_bug.cgi?id=6963
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test plan on second patch.
2011-11-04 10:22:28 +01:00
Maxime Pelletier
0faf91c591 Use unitprice in neworder so that the value is saved in the database and so it will be the same field used as to receive shipments
http://bugs.koha-community.org/show_bug.cgi?id=6414
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

Signed off with a note: this doesn't fix everything mentioned in the bug.
It also might clash with bug 4831 and should be tested with that patch.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-04 08:02:54 +01:00
Christophe Croullebois
dcfb5e63c9 Bug 5680: Follow Up for Order cancelling improvement : the same for parcel.pl
The same scope than in basket.pl

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Detailed information about possible deletion of orders on parcel page.

1) Delete order for record with 1 other item and item level hold
OK. Record, item and hold remain, only on order item is deleted.

2) Delete order for ordered record with 1 item and title level hold
OK. Deletion is not possible, before hold is cancelled.

3) Delete order for new record with only items connected to this order
OK. Cancelling the order deletes record and item or only order,
depending on link used.

4) Delete order for record with subscription.
OK. Subscription remains untouched, item is deleted.

Also checked:
AcqCreateItem = on receive / in cataloging
Links show and it's possible to delete the order or only the record
using different links.

Comments:
There is a table sorter option for the last column with the delete links.
I am not sure it is useful here, but it does work.

Before patch is applied, the links use 'cancel' instead of 'delete'.
I am not sure which is better and if it should be different on
basket summary and order receive or the same on both.

QA Comment:
Made a small change to template language; blocking deletion because of items referred to
holds instead.  Changed text to refer to items.
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-19 16:59:12 +13:00
Christophe Croullebois
4d67e69107 Bug 5680: Order cancelling improvement : delete attached items & biblio if avalaible
- all items attached to the order are deleted
- if there is no more items, and if the biblio is not in other orders and no subscriptions and no holds then the biblio is proposed to deletion
Now whe have 2 links : "delete order" and "delete order and catalog record", the second one appears only if the deletion is possible.
Note that if an hold is related to the item or if the item is unique for the biblio the link "Delete order" is canceled due to hold remaining.
On mouse over explanations are shown with count.
More lines of warnings with count are shown depending of the case.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Configuration:
AcqCreateItem = on order

Test cases and results:

1) Order new record with 2 items
a) From basket
- delete order: only deletes items, OK!
- delete order and catalog record: deletes record and items, OK
b) From shipment/receive
- delete order: only deletes items, OK!

2) Order 1 additional item for existing record with 1 item
a) From basket:
- delete order: works, existing item and record remain, OK
- Can't delete order and catalog record, 1 item left, OK!

3) Order new record with 1 item, title level hold on record
a) From basket:
- delete order: not possible, OK!
- delete orer and catalog record: not possible, OK!
b) From shipment/receive page
- Cancel: Deletes order, record and hold silently.
NO WARNING. NOT OK. See note below.

4) Order 1 additional item for existing record with 1 item,
item level hold on existing item
a) From basket:
- delete order: works, hold and existing item remain, OK!
- delete order and catalog record: not possible, OK!
b) From shipment/receive page
- Cancel: on order item is deleted, other item and hold remain.

5) Order new serial record, create subscription
a) From basket:
- delete order: works, record and subscription remain, OK!
- delete order and catalog record: not possible, OK!
b) From shipment/receive page:
- Cancel: Subscription and record are silently deleted. NOT OK.

6) Order additional item for existing record with other on order items
a) From basket:
- delete order: works, existing on order items remain, OK!
- delete order and catalog record: not possible, OK!
b) From shipment:
- Cancel: deletes order and ordered item. OK.

Changes made:
I changed the wording of the error messages a bit in the template.
I changed the message 'Can't delete order and catalog record' to not be
shown as a link, as the link does nothing. Tooltip still appears.
I attached a screenshot to the bug showing some of my changes.

Hope that's ok.

Necessary  enhancements:
Cancelling orders when receiving items should work the same as from the
basket summary page. We need the same checks and messages there before
deleting records and items automatically.
I am signing off on this, but to go into Koha it  needs a follow-up for the
order receive page.
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-19 16:58:46 +13:00
Jonathan Druart
8f75c19afd Bug 6390: Implement 'see mine/my branches/all baskets'-syspref
Code written by Edgar Fuß <ef@math.uni-bonn.de>,
Mathematisches Institut der Uniersität Bonn

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
- rebased on current master, fixed a conflict in booksellers.pl
- reworked permission checks to account for general acq permissions and
  superlibrarian permission
- rephrased text of system preference (Thx to Jared Camins-Esakov)

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-18 09:39:45 +13:00
Jonathan Druart
0fe43ac28b Bug 6390: Implement 'see mine/my branches/all baskets'-syspref
Code written by Edgar Fuß <ef@math.uni-bonn.de>,
Mathematisches Institut der Uniersität Bonn

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
- rebased on current master, fixed a conflict in booksellers.pl
- reworked permission checks to account for general acq permissions and
  superlibrarian permission
- rephrased text of system preference (Thx to Jared Camins-Esakov)

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
2011-10-18 09:23:40 +13:00
Amit Gupta
6c9ab3678a Bug 6807 - Add ISBN filter to advanced order search.
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-14 10:57:30 +13:00
Paul Poulain
0d0b3ef9c2 Bug 6268: (MT #6408) Bad Total in basket.pl
The total_est_gste or gsti is computed on the total_rrp_gste or gsti.
But in the budget this amount is the summ of discounts computed for each line.
Due to the rounding to 2 decimal places this produces a difference in Funds view with Total sublevels spent.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-07 10:59:06 +13:00
Jonathan Druart
1f0e3d7a4b Bug 6076: acqui pdf error when marcxml wrong
when marcxml is wrong the PDF is not generated. There is a Perl error
because
the biblio can't be retrieved.
This can be workarounded with a eval when decoding the marc

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-07 10:20:13 +13:00
Paul Poulain
b5a3f485ab BZ6074: setting import flag when staged file imported in aqbasket
Lines issued from a staged file have a flag that can be set when the order has
been added in a basket. It's set when a staged file is imported into the
catalogue, it should be set also when a record is inserted through aquisition.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
- Add order from staged file to a new basket
- Add single order from one item
- Import rest using the bulk feature
- Staged file will no longer be shown after all titles
  have been ordered and import_status in import_batches
  is correctly  set to 'imported'

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-07 10:08:41 +13:00
Robin Sheat
9966d218ae Bug 6824 - correctly check basket viewing permissions
Previously you couldn't view baskets that you hadn't created, unless you
were superlibrarian due to a bug. Now people with the right permissions
can see the baskets.

Applies to both 3.04.04 and master.

Signed-off-by: Brendan <info@bywatersolutions.com>
Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-23 11:47:25 +12:00
fae07abcc6 Bug 6679 Followup for acqui/histsearch.pl
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-21 14:58:55 +12:00
Chris Cormack
7cdea5de35 Bug 6679 Fix scripts in admin & acqui to pass Perl::Critic
Scripts in admin & acqui subdirectores weren't passing t/00-testcritic.t. This
patch add admin & acqui scripts to test case and fix various errors related to
Perl::Critic compliancy.

- Fixing a style error to pass Perl::Critic, plus silencing a warn
- More style errors, plus fixing a security issue
- Explicitly using Carp

Contrary to common belief, subroutine prototypes do not enable
compile-time checks for proper arguments. Don't use them.

Defining a named sub within another sub, does not prevent that
subroutine being global

Signed-off-by: Frédéric Demians <frederic@tamil.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-21 14:56:29 +12:00
Henri-Damien LAURENT
1ce78a0c22 bug 6834 followup removing param_map
param_map was still to be found in two files.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-03 06:39:24 +12:00
Srdjan Jankovic
54d38461f0 Bug 6721 - improve searching in the acquisitions system
This allows a basket to be searched for by name or invoice number from
anywhere in the acquisitions system. It is accessible by clicking on
"orders search", clicking the '[+]' and filling in the basket or invoice
no. fields.

Author:    Srdjan Jankovic <srdjan@catalyst.net.nz>
Author:    Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-26 11:34:27 +12:00
Colin Campbell
1a03a8a38e Bug 6181: Remove CGI Scolling lists from C4::Budgets
As noted on bug 766 more cases of usage of
CGI::scrolling_list were imported into C4::Budgets
Even if we were not trying to remove usage of this
the C4 modules are not the place to generate markup
Most of these routines are noise as they are not used in
any current code but cause confusion and increase
maintenance overhead. They are removed

The sort dropboxes on order create are the only
references in current templates to these routines
they have been replaced by a select list generated
by the markup.
They can probably be removed too but their existence
although the option that causes them to be displayed
seems unlikely to be set. I've left them pending
resolution of some of the inconsistencies and
confusions surrounding Budgts

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-14 20:24:31 +12:00
Frédérick Capovilla
552cde08db Bug 6369 Correct a formatting problem in the pdf generation of basketgroup.pl
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-12 13:40:52 +12:00
Robin Sheat
4833fd8399 Bug 5072 - prevent creating new orders if there are no valid budgets
On the basket editing screen, the links to add orders to a basket are
hidden unless a valid fund is available.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-04 13:53:59 +12:00
f53dcce0ad Bug 4959 (Language inconsistencies on basket groups; skip confirmation when closing basket)
This patch adds a new pref BasketConfirmations. This adds the option to skip
confirmations on closing and reopening a basket. If you skip the confirmation,
you do not create a new basket group.
The confusing line Create a purchase order (when closing a basket) is replaced
by Attach basket to a new basket group with the same name.
A warning for a null value on basketgroupid is fixed.

Rebased April 11.

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-04 09:47:58 +12:00
Colin Campbell
827b8c4c46 Bug 5453 Do not declare variables in conditionals
Removed occurences in acqui/*.pl

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-07-15 15:50:19 +12:00
Paul Poulain
b6a28b1bee BZ6066 let's the librarian choose the itemtype when ordering
For libraries with item-level_itype, the itemtype is in the item.
For others, it's in the biblio and should be added with the title/author when it's ordered

This patch adds the list when applicable,and build the biblio record accordingly
(BibLibre MT5189)

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
2011-07-10 20:28:37 +12:00
Frédérick Capovilla
f6486e6390 Bug 5684 : Remove all items fields from a Z39.50 record imported for acquisition.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-06-13 11:21:13 +12:00
Katrin Fischer
883bc625b2 Bug 5445: Nicer breadcrumbs when ordering from different sources
Replaces previous patch. Also fixes ordering from existing records.

While it was possible to go back to vendor and basket page when ordering
from a new suggestion the other odering options missed those 'crumbs'.

This patch makes the breadcrumbs for all orderings options consistent and
makes it possible to navigate back to the vendor or basket from all
pages.

- from existing record
- from staged record
- from external source
- from empty record

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-27 16:10:46 +12:00
Paul Poulain
7e1077b51b Bug 5961: Filling a basket from the reservoir
creating a form order to import all records from a staged file at once.
All lines of the choosen staged file will be created with the same budget
and item (if applicable depending on AcqCreateItem syspref)

BibLibre bug #4007

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

Bug 5961: follow-up : use matchingrules selected in manage-stage-import instead of FindDuplicate

Now, bulk importing the iso2709 result in adding biblio or connecting to an existing one

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

BZ5961: follow-up, save currency

Cait noticed that currency was not saved properly in the aqorders table.

note a surprise, as the 3.2 had no currency feature and 5961 had been written against 3.2
anyway, this patch fixes the problem

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-09 21:45:50 +12:00
Alex Arnaud
7cc7fb8c99 bug #6054 - Add a filter by active budget on acqui-home
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-09 11:24:08 +12:00
Colin Campbell
d8b362e0f9 Bug 5415 Let calls of SimpleSearch utilize considtent interface
Remove some unnecessary checks when check of error is
sufficient. Make the order in some cases more logical
Should remove some possibilities of runtime warning noise.
Although some calls belong to the 'Nothing could
ever go wrong' school have added some warnings

Signed-off-by: Christophe Croullebois <christophe.croullebois@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-08 13:52:57 +12:00
Paul Poulain
65c21fa52f Bug 6088: remove Perl warning
caused by use warnings;

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-08 13:17:22 +12:00