Commit graph

404 commits

Author SHA1 Message Date
Fridolyn SOMERS
6cec57901a Bug 9423: Add notforloan value to issue confirmation or blocking message
When trying to checkout an item that is not for loan (due to
items.notforloan value or because itemtype is not for loan), you get a
confirmation or blocking message (depending on AllowNotForLoanOverride
syspref).

This message tells "Item is normally not for loan".

This patch adds some informations :
if itemtype is not for loan, tells "Item type is normally not for loan".
if item is not for loan due to items.notforloan value, adds notforloan
description to message.

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

Works as advertised: Not for loan authorized value is correctly shown.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-19 22:22:23 -04:00
Jonathan Druart
37b6ac0b14 Bug 9367: Followup: Code optimization: CheckReserves is too often called
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-16 11:49:43 -04:00
Jonathan Druart
fad1f44d42 Bug 9367: Code optimization: CheckReserves is too often called
This patch rewrites the GetReserveStatus routine in order to take in
parameter the itemnumber and/or the biblionumber.

In some places, the C4::Reserves::CheckReserves routine is called when
we just want to get the status of the reserve. In these cases, the
C4::Reserves::GetReserveStatus is now called.
This routine executes 1 sql query (or 2 max).

Test plan:
Check that there is no regression on the different pages where reserves
are used. The different status will be the same than before applying
this patch.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-16 11:49:43 -04:00
Fridolyn SOMERS
755decfd89 Bug 9392: confirmation does not appear for negative notforloan items issues
When checking-out an item marked "not for loan" with a positive value,
you get a message to forbid or confirm issue (depending on
AllowNotForLoanOverride syspref).  For an item with a negative value
(usually during acquisition process), the issue is made without forbid
or confirm message.

This patch simply changes the test notforloan > 0 into notforloan != 0.

Test plan :
- Checkout an item with items.notforloan = 0
=> The item is issued without message
- Checkout an item with items.notforloan > 0
=> A message forbids or asks confirmation to override
- Checkout an item with items.notforloan < 0 (e.g., on order)
=> A message forbids or asks confirmation to override

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Checked with AllowNotForLoanOverride on and off.
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-02-08 21:38:49 -05:00
Srdjan
95077493bd Bug 7243: Rewording and renaming
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passed-QA-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-01-24 09:17:12 -05:00
Srdjan
1b4a266915 Bug 7243: Be selective when summing up charges for blocking issues
Added RentalsInNoissueCharges and ManInvlsInNoissueCharges sys prefs

Created C4::Members::cwGetMemberAccountBallance()
* A wrapper for GetMemberAccountRecords that gives info on non-issue and
  other charges
* Other charges are:
  'Res'
  'Rent' if RentalsInNoissueCharges is Mo
  authorised_values MANUAL_INV if ManInvlsInNoissueCharges is No

C4::Members::GetMemberAccountRecords() changes:
* Dropped input param $date, it is not used

Use split charges in C4::Circulation::CanBookBeIssued() and
C4::Members::patronflags(). That way only fines decide whether an item
can be issued, and not other non-fine charges

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

Rebased (updatedatabase.pl)

ManInvInNoissueCharges and RentalsInNoissueCharges ar both included by default (= behaviour as before)

All variants tested: Both included, none included, manual invoice included, rentals included.
Works fine, blocks/does not blok as appropirate, messages appear as expected.

[Oct 12, 2012 marcelr:] Amended for updatedatabase.pl
Signed-off-by: M. de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-01-24 09:12:59 -05:00
Jonathan Druart
7fc4be502d Bug 9206: Followup QA FIX
- Fix indentation
- It is useless to loop on all items. If at least 1 item is already
  issued, we want to return 1.
2012-12-27 09:48:03 -05:00
e3f6a74660 Bug 9206 - Only allow place holds in records that the patron don't have in his possession - QA Followup
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2012-12-27 09:48:03 -05:00
Vitor FERNANDES
63f2ceb603 Bug 9206 - Only allow place holds in records that the patron don't have in his possession
Added a system preference to turn on/off this feature.
By default the system allow the patron to place holds even if it is in his possession.
Script to place holds check if the system preference is off and if patron has at least one item to block holds.
Messages to say that are already in patron possession added to templates.
Method to check if patron has one issue from one record added to C4::Circulation

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-12-27 09:48:03 -05:00
Vitor FERNANDES
8048ba3201 BUG 9151 - Renewal notice according to patron alert preferences (Patch 2)
Added a system preferences (RenewalSendNotice - default no) to controll the renewal notice sending.
Added to installer languages the renewal notice template.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-12-21 07:41:25 -05:00
Vitor FERNANDES
a478c52e09 BUG 9151 - Renewal notice according to patron alert preferences
Modifications on AddRenewals and SendCirculationAlert in order to send a renewal notice to the patron according to the patron checkout alert preference.
Added a new notice template for renewals notices.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-12-21 07:41:24 -05:00
ca11d0ba29 Bug 7189 - preference to control if returning lost items gives refund
Right now when you return an item that was lost the patron's card is
credited with the lost fee, but not all libraries refund lost fees
and sometimes the fee is refunded after the patron has paid for it,
causing all kinds of financial issues.

Adds the syspref RefundLostItemFeeOnReturn to control whether
returning a lost item refunds the fee charged for losing that
item. Enabled by default to maintain Koha's current functionality.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Passed-QA-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-11-30 08:01:41 -05:00
7b18e2146c Bug 8800 - useDaysMode=Datedue wrong behaviour (revisited)
useDaysMode=Datedue wasn't used as advertised in the docs. Added
next_open_day and prev_open_day subs to Koha::Calendar and some tests for them.

- Koha::Calendar->addDate was rewritten in a more sane way (also split into
  addHours and addDays for convenience).
- Fixed a bug introduced in Bug 8966 regarding dt truncation and dtSets->contains
- Minor docs typos
- Use the passed Calendar mode or default to 'Calendar' in Koha::Calendar->_mockinit.
- Tests

I'm writing some db-dependent tests for is_holiday, and hopefully for CalcDateDue so any
rewrite/followup doesn't break things.

Regards
To+

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passed-QA-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-11-22 09:11:19 -05:00
Mark Tompsett
c66270c02f Bug 8834 - Call to C4::Context::preference fails to pass $self in Circulation.pm
Changed:
    my $circcontrol = C4::Context::preference('CircControl');
To:
    my $circcontrol = C4::Context->preference('CircControl');
This will pass $self and 'CircControl' which will then prevent
a "Use of uninitialized value" error log entry.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-10-24 18:21:23 +02:00
Colin Campbell
1c4125cd0e Bug 8841 Duedate should be set to end of expiry day
When reducing duedate to patron's expiry date
it should be set to end of that day not 00:00
take account of the fact that the borrower
expiry date will have no hours/minutes

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-10-24 18:17:06 +02:00
Paul Poulain
f58a6f4e10 Bug 3387 follow-up: fix perlcritic error 2012-10-01 17:35:45 +02:00
7a7e018ed3 Bug 3387 - WITHDRAWN items shouldn't check in
Adds a system preference BlockReturnOfWithdrawnItems to control
whether or not Koha should allow a withdrawn item to be returned
or not.

Also fixes the behavior where Koha will attempt to use a withdrawn
item to fill a hold.

Test Plan:
1) Set BlockReturnOfWithdrawnItems to "Block" ( this is the default )
2) Check an item out to a patron
3) Mark item as withdrawn
4) Attempt to return the item, you should still see the item on the
   borrower's record
5) Set BlockReturnOfWithdrawnItems to "Don't Block"
6) Attempt to return the item, you should see the item is no longer
   on the borrower's record.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
2012-10-01 17:07:53 +02:00
5da1298ac1 Bug 6679 - [SIGNED-OFF] fix 8 perlcritic violations in C4/Circulation.pm
- "return" statement with explicit "undef" at line 994, column 39.  See page 199 of PBP.  (Severity: 5)

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-20 12:01:35 +02:00
Colin Campbell
537c746dc4 Bug 7751: Decrease Loans for Items in Demand for Holds
Rebase and merge based on Mark Gavillet's patch to reduce
the loan period given to items on renewal when they are
in high demand for holds

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2012-09-18 19:01:14 +02:00
Paul Poulain
c7eadd8b62 Bug 6151 follow-up fix POD
Fixing POD, problem detected by jenkins (thanks jenkins !)
2012-09-18 15:14:00 +02:00
Ian Walls
850b4eeab9 Bug 6151: Add AllowReturnToBranch system preference
In order to solve the issue of IndependantBranches being incompatible with HomeOrHoldingBranchReturn,
this patch changes the mechanism by which the question "can I return this material here?" is answered.  Before,
the conditions were "if IndependantBranches is on, and this branch isn't HomeOrHoldingBranchReturn for the item,
then no, otherwise yes".  Now, the question is answered by consulting CanBookBeReturned (new subroutine)

New system preference:  AllowReturnToBranch
Possible values:
  - anywhere (default for new installs, and for existing systems with IndependantBranches turned off)
  - homebranch
  - holdingbranch (which is also the issuing branch in all normal circumstances)
  - homeorholdingbranch (default for existing systems with IndependantBranches turned on)

New subroutine:  CanBookBeReturned
Input:  $item hash (from GetItems), and $branchcode
Output: 0 or 1 to indicate "allowed" or not, and an optional message if not allowed.  Message is the 'correct' branchcode
to return the material to

To Test:
1.  Install patch and new syspref
2.  Check that default value of the preference:
    - if IndependantBranches was OFF at install time, should be 'anywhere'
    - if IndependantBranches was ON at install time, should be 'homeorholdingbranch'

Case:  'anywhere'
1.  Checkout a Library A book at Library A.  Return at Library A should be successful
2.  Repeat step 1, returning to Library B.  Return should be successful
3.  Checkout a Library A book at Library B.  Return to A should be successful
4.  Repeat step 3 with Library B and Library C

Case: 'homebranch'
1.  Checkout a Library A book at Library A.  Return at Library A should be successful
2.  Repeat step 1, returning to Library B.  Return should FAIL (returning message to return at A)
3.  Checkout a Library A book at Library B.  Return to Library A should be successful
4.  Repeat step 3 with Library B and Library C.  Both should FAIL (returning message to return at A)

Case: 'holdingbranch'
1.  Checkout a Library A book at Library A.  Return at Library A should be successful
2.  Repeat step 1, returning to Library B.  Return should FAIL (returning message to return at A)
3.  Checkout a Library A book at Library B.  Return to A should FAIL (returning message to return at B)
4.  Repeat step 3 with Library B. Return should be successful
5.  Repeat step 3 with Library C. Return should FAIL (returning message to return at B)

Case: 'homeorholdingbranch'
1.  Checkout a Library A book at Library A.  Return at Library A should be successful
2.  Repeat step 1, returning to Library B.  Return should FAIL (returning message to return at A)
3.  Checkout a Library A book at Library B.  Return to A should be successful
4.  Repeat step 3 with Library B. Return should be successful
5.  Repeat step 3 with Library C. Return should FAIL (returning message to return at A)

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-17 19:17:41 +02:00
Stéphane Delaune
a8b168dc63 Bug 7671 : add a real primary key accountlines_id in accountlines
Signed-off-by: Stéphane Delaune <stephane.delaune@biblibre.com>
Signed-off-by: Marc Veron <veron@veron.ch>

NOTE: After applying the patch I got following errors in members/pay.pl:
Global symbol "$writeoff_sth" requires explicit package name
Global symbol "$add_writeoff_sth" requires explicit package name

Added to lines at the begin of members/pay.pl:
our $writeoff_sth;
our $add_writeoff_sth;

Now the patch worked as expected.

However I am not quite sure if signing off is OK in this situation.

Marc

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-15 07:31:58 +02:00
Kyle M Hall
e9dc807b32 Bug 4118 - Add Collection Code to Statistics Table
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2012-09-13 18:42:46 +02:00
Colin Campbell
223bf0099f Bug 8761 Dont inadvertantly use slices
Assignment to a single element slice is better written
as a scalar - This generates a compile time warning as it
can lead to odd behaviour see perldiag for details
This corrects some cases which were added in a recent
commit

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-13 17:56:38 +02:00
Paul Poulain
374b6f4b9f Merge remote-tracking branch 'origin/new/bug_8251' 2012-09-12 16:45:05 +02:00
Colin Campbell
32e3f9eace Bug 8251 Do not try to debar patrons if returns are not overdue
If a period of suspension is configured in the issuing rules
a calculation to debar the patron was called on all returns
It should be limited to overdue returns

Renamed _FixFineDaysOnReturn subroutine to _debar_user_on_return
which is more descriptive of its purpose
Removed some unnecessary or duplicated processing
Changed visibility of $today so it didnt need
calculating twice
Removed declaration of a datedue variable that is
never used

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-12 16:43:57 +02:00
Srdjan
86c2c4626d bug_5911: Transport Cost Matrix
Create transport_cost table,  added UseTransportCostMatrix syspref.
transport_cost table contains branch to branch transfer
costs. These are used for filling inter-branch hold transfers.

Moved GetHoldsQueueItems() from .pl to HoldsQueue.pm

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-12 14:49:25 +02:00
Marc Veron
01a7188d6a BUG 7621 [ENH] Circulation: Match age restriction of title with borrower's age without using categories
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

New version implementing Paul's advice.
See Wiki http://wiki.koha-community.org/wiki/Age_restrictiotion

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

New fix updatedatabase.pl to apply to current master by Marc Veron veron@veron.ch
...and fixed missing curly bracket after merging updatedatabase.pl

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-05 14:32:53 +02:00
Paul Poulain
ce52db9e81 Revert "Bug 7241: fix for the CIRC logs -> itemnumber stored correctly"
This reverts commit a659d02dbe.
2012-09-03 17:34:03 +02:00
Adrien Saurat
a659d02dbe Bug 7241: fix for the CIRC logs -> itemnumber stored correctly
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-03 17:26:04 +02:00
D Ruth Bavousett
7d55969329 Bug 8569: Paying for lost item overwrites nonpublic notes.
This patch modifies C4::Circulation::ReturnLostItem to append the Paid-for note
to existing data, rather than overwriting it.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-03 15:49:10 +02:00
88d5a2f2a4 Bug 8640 - GetHardDueDate functions incorrectly
GetHardDueDate works just like GetIssuingRule, but it not only tests for having
found an row of results before returning, but checks for the existence of a
hard due date as well. That means that even if it finds a matching rule, unless
that rule has a hardduedate set it will toss it and keep looking!

So, for example, even though there is a matching rule for say "STAFF / VIDEO / *",
but it has no hardduedate. So it gets tossed and the subroutine keeps looking.
If the next match, "STAFF / * / *" *has* a hardduedate, it is the one returned.

This means that if a more specific rule has no hard due date,
it is overridden by a less specific rule that does have a hard due date.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-08-29 18:07:53 +02:00
Dobrica Pavlinusic
089b1151f5 Bug 6448 [1/3] EAN-13/UPC-A itemBarcodeInputFilter
This filter which check validity of EAN-13 barcode and padd it with zeros
up to full 13 digit number. This will also expand 12 digit UPC-A barcodes
to EAN-13 automatically which is useful for older barcode readers which tend
to ignore first zero in EAN-13 if they have just UPC-A support.

It should be noted that EAN-13 or UPC-A product codes printed on books are not
good choice for barcodes in Koha since each item has to have unique barcode.

Test scenario:

1. prove t/Circulation_barcodedecode.t
   this checks expansion of 12 digit UPC-A to 13 digit EAN-13 and zero padding

2. in systempreferences search for itemBarcodeInputFilter and select EAN-13

3. edit one item and assign it valid EAN-13 barcode, eg. 0000000695152, check it out

4. test checkin with just 695152 to test leading zero expansion

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2012-08-02 18:41:40 +02:00
Elliott Davis
381794ff4e [PATCH] bug_7420: Added overduefinescap to issuingrules
Replaced existing MaxFine syspref logic with overduefinescap.
Repurposed MaxFine to be the overall overdue limit for all items
overdue. Implemented new MaxFine logic in UpdateFine().

Signed-off-by: Elliott Davis <elliott@bywatersolutions.com>
Tested according to Srdjan's test plan and everything worked like he said it would.  I set fined equal to $2 and max fine equal to $1.      When I ran the fines script for overdue items fines assessed were only $1.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-25 18:33:20 +02:00
Kyle M Hall
217fef5749 BugFix - ReturnToShelvingCart
If the ReturnToShelvingCart syspref is on, and something needs to go in transit,
the shelving cart setting is overriding the transit.

What seems to be happening is this:
  * Item is checked in, and flagged as needing to go in transit from A to B.
  * Item is immediately flagged as shelving cart, though.  Current display says both shelving cart and in transit.
  * After the cart-to-shelf script runs, item comes out of transit and
    shows as being available at the destination library, although it hasn't
    arrived yet and no one has manually checked it in.

http://bugs.koha-community.org/show_bug.cgi?id=3701

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-24 15:05:23 +02:00
Paul Poulain
612b12f41b Merge remote-tracking branch 'origin/new/bug_8251' 2012-07-16 13:46:31 +02:00
9d4e241ada Bug 8251 - Follow up, use 'day' instead of 'days' for Datetime::truncate
As noted in comment #4 by Jonathan Druart, this should be fixed in every call
to DateTie::truncate function. This patch does exactly that.

julian_m tested that truncate( to => 'days' ) didn't actually do anything, so
it is understandable that this 'fix' might introduce new bugs as we might have
'fixed' at a higher libs level this issue.

'minutes' is used in truncate function too, so fixing.

Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-16 13:45:45 +02:00
f380a6c804 Bug 7848 - Issues data missing from circulation notices
For the CHECKIN and CHECKOUT notices, any data that is issue specific
does not show. For example, date due.

For CHECKOUT, this is caused not passing in the issues table as part
of the 'table' hash used by C4::Letters::GetPreparedLetter.

For CHECKIN notices, we need the old_issues table instead, as the item
has already been returned.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
passes tests, correct information shows in notices.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-10 13:50:10 +02:00
Jared Camins-Esakov
c0714a99f2 Bug 6557: Record bib popularity in totalissues
Because updating the total issues count associated with a bibliographic
record on issue could cause a significant load on the server, this
commit adds the syspref UpdateTotalIssuesOnCirc (which defaults to OFF
to match existing behavior). The syspref has the following description:

  Do/Do not update a bibliographic record's total issues count whenever
  an item is issued (WARNING! This increases server load significantly;
  if performance is a concern, use the update_totalissues.pl cron job
  to update the total issues count).

Bug 6557: automatically increment totalissues

Adds the ability to automatically increment biblioitems.totalissues
whenever an item is issued.

To test:
1) Choose a record with at least one item that can circulate
2) Check the value of 942$0 (you may need to look at the plain MARC view
   on the OPAC). Most likely there won't be any 942$0 at all
3) Enable UpdateTotalIssuesOnCirc
4) Check out the item you selected
5) Check the value of 942$0 (you may need to look at the plain MARC view
   on the OPAC). That value should now be one greater than before
6) Discharge the item
7) Disable UpdateTotalIssuesOnCirc
8) Check out the item you selected again
9) Check the value of 942$0 (you may need to look at the plain MARC view
   on the OPAC). That value should not have changed

Bug 6557: add script to update totalissues from stats

NAME
       update_totalissues.pl

SYNOPSIS
         update_totalissues.pl --use-stats
         update_totalissues.pl --use-items
         update_totalissues.pl --commit=1000
         update_totalissues.pl --since='2012-01-01'
         update_totalissues.pl --interval=30d

DESCRIPTION
       This batch job populates bibliographic records' total issues count
       based on historical issue statistics.

       --help  Prints this help

       -v|--verbose
               Provide verbose log information (list every bib modified).

       --use-stats
               Use the data in the statistics table for populating total
               issues.

       --use-items
               Use items.issues data for populating total issues. Note that
               issues data from the items table does not respect the --since
               or --interval options, by definition. Also note that if both
               --use-stats and --use-items are specified, the count of biblios
               processed will be misleading.

       -s|--since=DATE
               Only process issues recorded in the statistics table since
               DATE.

       -i|--interval=S
               Only process issues recorded in the statistics table in the
               last N units of time. The interval should consist of a number
               with a one-letter unit suffix. The valid suffixes are h
               (hours), d (days), w (weeks), m (months), and y (years). The
               default unit is days.

       --incremental
               Add the number of issues found in the statistics table to the
               existing total issues count. Intended so that this script can
               be used as a cron job to update popularity information during
               low-usage periods. If neither --since or --interval are
               specified, incremental mode will default to processing the
               last twenty-four hours.

       --commit=N
               Commit the results to the database after every N records are
               processed.

       --test  Only test the popularity population script.

WARNING

If the time on your database server does not match the time on your Koha
server you will need to take that into account, and probably use the
--since argument instead of the --interval argument for incremental
updating.

=== TESTING PLAN ===

NOTE: in order to test this script, you will need to have some sort of
circulation data already existing in your Koha installation.

1) Disable UpdateTotalIssuesOnCirc
2) Run: misc/cronjobs/update_totalissues.pl --use-items -t -v
3) If you have total checkout data in your item records (i.e. anything
   in 952$l), you should see messages like "Processing bib 43 (1 issues)"
4) Choose one of the lines that shows more than 0 issues, and view the
   record with that biblionumber in the staff client, choosing the "Items"
   tab (moredetail.pl). Add up the "Total checkouts" listed for each item,
   and confirm it matches what the script reported
5) Run: misc/cronjobs/update_totalissues.pl --use-stats -t -v
6) If you have any circulation statistics in your database (i.e. any
   'issue' entries in your statistics table), you should see messages
   like "Processing bib 43 (1 issues)";
7) Choose one of the lines and view the record with that biblionumber in
   the staff client, choosing the "Items" tab (moredetail.pl). If you
   count the number of checkouts listed in each item's checkout history,
   the total should match what the script reported.
8) Check out an item
9) Run: misc/cronjobs/update_totalissues.pl --use-stats
   --incremental --interval=1h -t -v
10) You should see one line reporting a single circ for the bib record
    associated with the item you just checked out (there may be more if
    you checked out any books in the hour prior to running these tests
11) If the results in steps 4, 7, and 10 match the predictions, the
    script worked

This patch to Koha was sponsored by the Arcadia Public Library and the
Arcadia Public Library Foundation in honor of Jackie Faust-Moreno, late
director of the Arcadia Public Library.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Tested this with my test data - numbers are correct and updated appropriately.

More importantly - if I do a popularity search, the most popular items *come up first*. Amazing.
2012-06-29 14:29:22 +02:00
Chris Cormack
509d673f10 Bug 7941 : Fix version numbers in modules
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-11 17:29:38 +02:00
47e4f3ed84 Talking Tech Support - Phase I - Followup - Fix Messaging Preferences
There is a flaw in C4::Members::Messaging::GetMessagingPreferences where
the system assumes that every transport will use the same letter. This
is not necessarily true. Even with the default preferences of just
'email' and 'sms', we should be able to have different letters
for each, as one has a maximum character length ( sms ) and one
does not. GetMessagingPreferences currently uses the letter code
of the last result of its query as the letter code for every transport type.

The returned data is a hashref with a key 'transport_types' that is
an array of transport_types this borrower has selected for the given
alert.

This commit modifies GetMessagingPreferences such that the the
'transport_types' array is now a hash where the name of the transport
type is now a key to the value of the letter code set for that transport
type.

It also modifies code calling GetMessagingPreferences where necessary,
and as a side benefit will correctly get the letter codes for email
and sms correctly, if they are defined differently.

http://bugs.koha-community.org/show_bug.cgi?id=4246
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

In use in production by two libraries: Middletown and Washoe
who give their sign off but don't have git to do so.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-10 17:46:58 +02:00
9f7186afd3 Bug 8005 - Lost item is not anonymized when checked in
This bug is caused by the subroutine C4::Circulation::LostItem
not passing the privacy parameter when calling
C4::Circulation::MarkIssueReturned.

This issue is actually anonymized when the item is marked as lost,
not when the item is checked in.

Note, even if the issue is anonymized, the fine charged for lost
items still contains a description of the lost item, which is
required for the ability to forgive fees for lost items that
are later found.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-10 12:34:08 +02:00
2aff4b467b Bug 8167 - Add syspref allow a choice of blocking, non-blocking, or do nothing when issuing lost items.
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Works as advertised.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-09 16:21:05 +02:00
Meenakshi.R
804b073a82 Bug 7704 -Fix bug that prevent items to be returned to home branch, when independentbranches and canreservefromotherbranch sysprefs are both turned on.
Before this fix, when attempt to checkin the item at the other branch is made, system disallows checkin. Now (with this fix) the item is checked in and an automatic transfer to the home branch is setup.

How to test:
Case 1
Set independentbranches to "Prevent" and canreservefromotherbranch to "allow". Set up an item in branch A and a member in branch A and another member in branch B.

Checkout the item to member in branch A.
Place a reserve on the item on behalf of member in branch B.
Return the item in branch A. Check if a transfer is setup to branch B.
Checkout the item to the member in branch B and check it back in. Checkin should be allowed and at this point an automatic return to branch A (the home library) should be setup.

Case 2
Set independentbranches to "Prevent" and canreservefromotherbranch to "not allow". In this case item checkin should not be allowed in branch B.

Other cases
Set independentbranches to "Not Prevent". Here items should be returned automatically to home branch, the value in canreservefromotherbranch has no impact.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-21 18:43:13 +02:00
Ian Walls
f61a961718 Bug 5549 followup: fix suspension in days further
Grace periods are now measured in the same unit as the loan.

Suspension in days works explicitly in days, independent of unit.  Since
the 'deltadays' duration is actually the duration, possibly in hours, between
when the material was due and when it's returned, we need to take the finedays
factor (how many days per unit overdue) and multiple it by 24 if the unit is
hourly.

Example: a 1 hour loan material with 1 hour grace period and finedays = 2,
returned 2 hours late would give 4 days suspension

To test:
1.  create some circ rules:
  A) an hourly loan rule with suspension in days
  B) an hourly loan rule with suspension in days and a grace period
  C) a daily loan rule with suspension in days
  D) a daily loan rule with suspension in days and a grace period
2.  Check out 2 materials under each rule.  We'll call these A1-D1
and A2-D2 (to associate with the rule)
3.  Return A1-D1 late, but within the grace period for B1 and D1 as appropriate
4.  Return A2-D2 late, after the grace periods

You should get:

A1: suspended for (#hours late) * (#suspensionindays) days
B1: not suspended
C1: suspended for (#days late) * (#suspensionindays) days
D1: not suspended

A2: suspended for (#hours late) * (#suspensionindays) days
B2: suspended for (#hours late) * (#suspensionindays) days
C2: suspended for (#days late) * (#suspensionindays) days
D2: suspended for (#days late) * (#suspensionindays) days

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-14 18:15:54 +02:00
Colin Campbell
49ba0df9e7 Fix typo in patch for bug 7849
$type declared twice effectively throwing away the returned value

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-30 14:12:43 +02:00
Elliott Davis
d06c231982 bug 7849 Instant Fine Calculation\n Adds functionality of calculate fines instantly. This is very important for Hourly loans becuase of a loophole from the cron.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-19 17:52:18 +02:00
08cee791a7 Bug 7758 - Koha allowing LOST items to check out without alert
Adds a confirmation alert when issuing an item that has
been marked as lost.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
passes tests, works as advertiesd

Tested:
- checking out an item that is marked lost performs all usual lost operations
- checking out an item that is marked lost prompts for confirmation

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-06 18:08:17 +02:00
Chris Cormack
0c40ff9f98 Merge remote-tracking branch 'kc/master' into merged_5549
Fixed conflicts

Conflicts:
	catalogue/moredetail.pl
	installer/data/mysql/updatedatabase.pl
	koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
2012-03-22 09:36:55 +13:00
Ian Walls
28309bc61e Bug 5549 Followup: fix suspension in days
ISO dates were being compared with DateTime objects, and DateTime::Durations
with integers.  This patch reimplements the _FixFineDaysOnReturn subroutine
to use the new hourly loans functionality.

Also moves date formatting of patron debar date out of circ/returns.pl and into
KohaDates on the template

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-03-22 09:31:11 +13:00
Ian Walls
d92c595dc4 Enhancement 7144: Floating Collections (per branch/itemtype)
Adds support for Floating Collections (i.e. items that don't automatically return
home when checked in at another branch) on a per branchcode/itemtype basis.

This patch adds a new column (returnbranch) to the default_circ_rules, default_branch_item_rules,
default_branch_circ_rules and branch_item_rules tables, after the 'holdsallowed' column.  While
this is coded as a varchar(15), the only currently supported values are 'homebranch', 'holdingbranch',
'noreturn' and NULL.

On upgrade, the value of HomeOrHoldingBranchReturn is used to populate the global default (which is
stored in default_circ_rules.returnbranch).

To access this value, use C4::Circulation::GetBranchItemRule.  This subroutine is altered to supply
an additional key, "returnbranch", containing this value (or 'homebranch' as a default).  No existing
usage of GetBranchItemRule should need to be modified.

The use of HomeOrHoldingBranchReturn is removed in AddReturn to instead use this subroutine.  This will
determine, on a more granular level, where the item should be transferred, after all is said and done.  If
'noreturn' is specified, then the material will remain at the branch doing the checking in.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Passes prove t xt t/db_dependent

I was able to make this feature work as advertised.
As noted above, if you want a floating rule applied across all branches, adding a single default rule won't suffice, you'll need to add the rule to all branches. That issue is not related to the functioning of *this* patch however.
2012-03-21 10:28:26 +01:00
Chris Cormack
62621825e5 Bug 5549 : _FixFineDaysOnReturn was using C4::Dates in calling
days_between, fixed to use DateTime objects
2012-03-21 11:09:51 +13:00
Chris Cormack
4076e43d22 Bug 5549 : Fixing typo in C4/Circulation.pm
days_between not daysBetween
2012-03-21 08:33:26 +13:00
Elliott Davis
da14b2f4ba Bug 5549 : fixed non-cloned date object in Add date for calendar, also removed erounous dumper in moremember.pl that dumped entire issue 2012-03-20 13:41:49 +13:00
Chris Cormack
0c15a1ded4 Bug 5549 : Fixing link to calendar 2012-03-20 13:31:56 +13:00
Chris Cormack
9c1a43d91a Bug 5549 - Another typo fix 2012-03-20 13:29:39 +13:00
Chris Cormack
03eea72de3 Bug 5549 - Hourly Loans - Fixing a typo 2012-03-20 13:29:14 +13:00
Colin Campbell
7a8bed5576 Bug 5549 : Daily loans should be due at 23:59
This was failing in one patch through CalcDueDate
2012-03-20 13:25:41 +13:00
Colin Campbell
1e255e93eb Bug 5549 Fix a couple of comparisons in C4::Circulation
Changed a string comparison called on an integer
Deal with case where value is not set without runtime warnings
2012-03-20 13:25:05 +13:00
Colin Campbell
aa114f5349 Bug 5549 : Only use DateTime for issues table
Tidied up the module list
Removed an used subroutine
Replaced some old C4::Dates code with DateTime calls
2012-03-20 12:32:56 +13:00
Colin Campbell
99eccc18ed Bug 5549 : Handle datetimes on return 2012-03-20 12:32:13 +13:00
Colin Campbell
0ce31bfba9 Bug 5549 : Pass time_zone correctly 2012-03-20 12:12:51 +13:00
Colin Campbell
b7b6a8e388 Bug 5549 : Due Date calculation in issue needs to be HH:MM aware 2012-03-20 12:12:09 +13: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
Paul Poulain
2cff5e7642 Bug 5877 QA follow-up
* removing tabs as indenter
* adding fieldnames in INSERT clause
* updating FSF address
* removing ` in SQL table creation (mysql-ism)
* use strict & use warning added & no error in logs checked

Note that process_koc.pl and updatedatabase are not related to this bug, but the FSF address was wrong, I fixed it as well
2012-03-02 17:53:00 +01:00
a947ef57f8 Bug 5877 Follow-up for Offline circulation improvements
Internationalization fix: Offline circulation operations in
Circulation.pm return English strings for display in the
template. These strings can't be translated, so we must check
their values in the JavaScript and return a translatable
string based on their values.

Interface change: Switching to text links for checking/unchecking
checkboxes since that is more consistent with other areas in
Koha.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-02 17:51:49 +01:00
Paul Poulain
e07b36dd90 Bug 5877 : Offline circulation improvements : upload all files, apply at once
Offline circ : You now can upload all offline files from the Firefox extension.
Once all circ desks have uploaded the file, the librarian can apply all of them, sorted by date.
This avoid the problem of someone issuing an item on desk A, returning it on desk B.
Before this improvement, if desk B uploaded the file before A, the return was applied before the issue,
resulting in the items reamining issued.

Signed-off-by: Sophie Meynieux <sophie.meynieux@biblibre.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
2012-03-02 17:49:35 +01:00
biblibre
f4a5206ae0 Bug 6137: fix a Circulation bug. userenv null
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-02-17 18:38:42 +01:00
Srdjan Jankovic
2041f2c973 bug_7090: AllowItemsOnHandCheckout syspref
Observe AllowItemsOnHandCheckout syspref when using SIP self checkout

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
To test:
* place an item on hold for patron A
* attempt to circulate that item to patron B (via SIP/selfcheck)
	syspref off: item should not circulate to patron B
	Syspref On: item should circulate to patron B

Both conditions passed in our testing.
Also verified that normal staff client behavior regarding this situation was preserved. It was.
2012-02-10 19:28:25 +01:00
Paul Poulain
098ac93315 Merge remote-tracking branch 'origin/new/bug_6842' 2012-02-10 15:19:20 +01:00
Kyle M Hall
58c62f69c1 Bug 6490 - Lost and paid not updated when book is checked out.
Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Tested:

item checked out and marked lost - item is removed from borrower's checkouts and charged to patron
Checking out the item (without checking it in first) removed the fines and issued the item normally.

Passed prove t xt t/db_dependent (results congruent with current master failures)

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-02-03 17:37:52 +01:00
Srdjan Jankovic
6b092f0e27 bug_7190: Do not reverse writeoffs when item is returned
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-02-02 14:21:08 +01:00
Henri-Damien LAURENT
54e6b44da9 Bug 6842 FU : library transfer limits edits not stored
Followup :
Changes the DeleteBranchTransferLimits signature :
one now needs to delete only the limits for ONE branch
2012-02-01 22:47:56 +01:00
Paul Poulain
9c06057f21 Merge remote-tracking branch 'origin/new/bug_6328' 2012-01-19 16:50:49 +01:00
Lyon3 Team
0e9edb1102 Bug 6328 follow-up, fixes Undefined subroutine &C4::Circulation::Delta_Days
The Delta_Days sub is called only when a patron that is already debarred must be debarred for a longer period.
This (rare) case probably hasn't be tested during QA, because the sub is not loaded.
Loading it fixes the problem

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-01-19 16:49:25 +01:00
Srdjan Jankovic
6e07fd7b00 bug_2830: Remove reserve when checking out if the borrower is not the first one in the reserve queue
To test:
Create 4 holds on a bib, for patrons A, B, C, and D,

Check in the item to mark hold as waiting for patron A
Check out the item to patron B -> reserve for patron B should be removed
Check in the item to mark hold as waiting for patron A
Check out the item to Patron A, hold should complete normally
Check in the item to mark hold as waiting for patron C
Check out the item to patron D -> reserve for patron D should be removed.
Check in the item to mark hold as waiting for patron C
Check out the item to patron C, hold should complete normally
Check in the item -> there should be no more reserves.

We also tested:
Created 4 holds on a bib with two items, for patrons A, B, C, and D

All worked as expected.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-16 16:21:38 +01:00
Srdjan Jankovic
1713133fdd bug_5211: LostItem() - added charge_fee param to control fee charging
Pass charge_fee = yes wherever is LostItem() called, which effectively
means tha there's no change.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-06 11:36:34 +01:00
Paul Poulain
1fe3514c3c Bug 6328 fine in days does not work
Some code coming from BibLibre has been lost in the process of inclusion in
3.4. The result is that fine in days does not work at all (you can setup rules,
but it does nothing)

Step to reproduce:

- Koha > Admin > circ rules > set 1 day fine every day of overdue for default
  rule
- Issue a book return date last week
- check-in the book => no debarment is set

The following patch will fix all of those problems by :

* updating borrowers.debarred to a date field (instead of tinyint). It contains
  the limit of the debarment
* changing API of DebarMember and UpdateBorrowerDebarred to pass a date
* display debarrdate where applicable. Note that a debarrdate of 31/12/9999 is
  considered as unlimited and not displayed
* added a debarrcomment, usefull to explain why a patron is debarred (this is
  independant from debarrdate changes and can be used when placing an unlimited
  debarment too)

[2011-05-12] F. Demians. It works as described. And I can confirm this
functionality is impatiently awaited by French libraries since one year. Thanks
BibLibre for the good work and for contributing this code.

Bug 6328 Followup--update DB structure

Thanks Katrin.

Bug 6328: make comment a textbox / fix debar by notice trigger

Debarring by notice triggers was broken, because the new function
expects a date as second parameter.

The comment field in patron account details was a very long text field.
Patch changes it to be a textbox instead.

Bug 6328: Lift debarment leaves patron account

'Lift debarment' redirects to an empty circulation page.

BZ6328 follow-up 3

Fixes comment 23 from Fernando L. Canizo : when the patron was debarred and debar removed
he still could not check-out.

The changes in the IsMemberBlocked (that were on biblibre/master) were lost somewhere
The sub was still checking for old_issues instead of calling CheckBorrowerDebarred
to get a debardate if applicable

Note : this bug was appearing only is you had issuing rules defined for itemtype/categorycode/branch.
Seemed to work if you had only default rules. That's probably why it hadn't been spotted before

BZ6328 follow-up 4
Comments fron Zeno Tajoli: The patch is OK and I sign-off it. Two little changes done on
installer/data/mysql/kohastructure.sql and installer/data/mysql/updatedatabase.pl

Signed-off-by: koha <koha@kohabase.localdomain>
2011-11-25 14:00:47 +01:00
Colin Campbell
862b6ee90d Bug 7191 Remove GetBorrowerIssues from @EXPORT
No subroutine GetBorrowerIssues exists in C4::Circulation
So don't export it into users' namespace

Signed-off-by: Albert Oller <ago@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-24 13:45:13 +01:00
Ian Walls
c5bc35b694 Bug 7060 Followup: AddReturn needs GetMemberDetails
In my haste, I overlooked circ/returns.pl's need for borrower flags.  This patch
changes back the call in AddReturn from GetMember to GetMemberDetails

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-22 04:07:37 +13:00
Ian Walls
769acee41a Bug 7060: GetMemberDetails unnecessary in C4::Circulation
Replaces all instances of GetMemberDetails with the more efficient GetMember.  Since
no hash values other than the borrowers table's fields are used in this module, the
transition is safe.

To test:

1.  Checkout a material; the page should load without error
2.  Renew a material: the page should load without error
3.  Return a material: the page should load without error

The above test plan invokes all the subroutines affected by this patch; any call to an undefined
value in a hashref should give a warning

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-20 14:09:58 +13:00
Paul Poulain
56b9412562 Bug 7036 de-nesting C4::Circulation
Just removing use C4::Koha, as other packages are widely used.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-19 03:47:31 +13:00
Srdjan Jankovic
4770555855 bug_5533: Slightly improved marking items as lost
Call LostItem() whenever item is lost.
LostItem() new arg - mark returned.
Disabled Lost Status on catalogue item edit.

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

For follow up we need to explain how to hide the 952$1 (lost) from
the framework by putting it in the 'ignore' tab.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-18 09:01:39 +13:00
Ian Walls
e05d53d50d Enh 6403: Record local use stats when checking in unissued materials
Adds a new system preference, RecordLocalUseOnReturn, which when active will change the statistical
entry type from "return" to "localuse" in AddReturn() if the material was not on loan when returned.
The intended use-case here is for libraries with 'open' book drops, in which patrons can put locally
used (but unissued) materials.

Adds a small message to the user interface to confirm that Local Use was recorded.

This change opens up the possibility to record more types of statistics on return; one would just need
to update the $stat_type variable accordingly.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-09 19:50:41 +13:00
Meenakshi.R
073f4fa7c3 Bug id:6783 - Circulation restrictions dont work when other withdrawn reasons are used
Circulation restrictions work only when withdrawn reason (value 1) is selected.
If ones sets up other withdrawn reasons using authorized values, and selects
one of them (e.g. value 2), circulation restrictions don't work. This changes
fixes this problem.

Signed-off-by: Amit Gupta <amit.gupta@osslabs.biz>
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-11 21:40:09 +12:00
Ian Walls
18c491542b Bugs 6634: manager_id not recorded for payments and rental charges
Manager_id, the borrowernumber of the staff person doing the action, was not recorded
for payments, rental charges, or rental charges on renewals.  This patch implements that.

This patch also adds the recording of itemnumber in a payment, by taking the itemnumber of
the account that it's paying off.  This addresses bug 2696, though it does not make any
change to the display logic of the Payments line in the staff client.

To test:
1.  Check out an item with an issuing charge
2.  Renew the item
3.  Pay one of the rental charges on the item
4.  Verify in koha.accountlines that each of the three above operations recorded your borrowernumber
in accountlines.manager_id

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-15 15:28:29 +12:00
Magnus Enger
610457ea41 Bug 6450 - No check in/check out messages in message_queue
Huge thanks to Katrin Fischer for spotting what was the trouble here!

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
2011-07-03 08:55:49 +12:00
Ian Walls
5ae3a3aa4f Bug 5929: use branch admin email for advance_notice.pl emails
This squash commit takes the two patches from Srdjan and adds a minor fix to work with
template toolkit variable renames.

Squashed commit of the following:

commit 2cab669d1fd072600942e1e6fbf3378944255a68
Author: Ian Walls <ian.walls@bywatersolutions.com>
Date:   Thu Jun 2 14:08:40 2011 -0400

    Bug 5929: Fix advanced_notices to use new template-toolkit compatible message names

    Uses 'item_due' and 'advance_notice' for advance notices names; letters do not send otherwise

commit caded04702d5eebd0f63a3b93cdddce28257f092
Author: Srdjan Jankovic <srdjan@catalyst.net.nz>
Date:   Tue Mar 29 12:38:49 2011 +1300

    wr77490 (bug 5929): removed debugging leftover

commit 1944de0de40f937b1d8748500f24a119390db3f0
Author: Srdjan Jankovic <srdjan@catalyst.net.nz>
Date:   Tue Mar 22 19:05:23 2011 +1300

    wr77490 (bug 5929): use branch email in preference for due notices

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-06-04 19:41:26 +12:00
Chris Cormack
67e3b86181 Fix for Reserves.t allow the tests to run without a logged in user 2011-04-14 15:03:37 +12:00
Chris Cormack
56d7ab5a19 Merge remote branch 'kc/new/enh/bug_5548' into kcmaster 2011-04-02 19:58:17 +13:00
Colin Campbell
78dfaa1831 Bug 5548: Correct punctuation in patch
Punctuation should be a semi-colon not a comma
It works but is a trap for the unwary in the future

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-02 19:57:13 +13:00
Chris Cormack
937f27e619 Merge remote branch 'kc/new/enh/bug_5548' into kcmaster 2011-04-02 06:44:40 +13:00
Ian Walls
1b402c7422 Bug 5548 Follow up: Confirm Checkout message where it shouldn't be
Fixes the main Hard Due Dates conditional to first check for the existence
of $hardduedate, then the existences of its ISO export, then finally that that
value is not '0000-00-00'

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-02 06:42:07 +13:00
Chris Cormack
4990b0d2ee Bug 5578 : Follow up patch fixing FSF addresses 2011-04-01 15:48:19 +13:00
Ian Walls
b2a233f480 Bug 5578: Self checkout by Login enhancement
Enables the library to choose whether to have patrons scan their barcodes for self checkout, or login
with username and password.  Uses 'checkpw' for compatibility with LDAP authentication.

Also introduces a few new system preferences to make Self Checkout more secure and manageable:

  SelfCheckTimeOut:      the number of seconds before the self-checkout login times out for a patron
  AllowSelfCheckReturns: indicate whether or not patrons can return materials via self-checkout
  SelfCheckHelpMessage:  user-configurable HTML to show specific text on the Help page.

Thank you to Marlboro College in Marlboro, VT for sponsoring and testing this development!

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-01 15:18:40 +13:00
Chris Cormack
849342e3f5 Merge remote branch 'kc/new/enh/bug_5548' into kcmaster 2011-04-01 09:12:58 +13:00
Ian Walls
1d6fa48d19 Bug 5578 Followup: Hard Due Dates break hard-coded default circ rule
If you do not have an applicable circulation rule for a combination of branch,
item type and patron category defined in your Circulation and Fines rules,
the Hard Due Dates development prevents circulation by introducing an error:

Can't call method "output" on an undefined value at /home/magnus/kohahead/C4/Circulation.pm line 2713

This is because the $hardduedate variable is not defined.  Changing the conditional
to check it, rather that it's output, fixes the issue.  That's what this patch does.

Is this the longest commit message for a single line fix?  Maybe.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-01 09:10:45 +13:00
ruth@bywatersolutions.com
0a64cfba5e Bug 6004/3270: Sending things "home"
This patch addresses two problems:

Bug 6004:

If an item is returned at other than its' home library, and there is a hold for
it--at any library other than the return library--two prompts come up: one
telling the user to send the item home, and the other, to confirm and transfer
for the hold.  Only the latter should be displayed.

Bug 3270:

Cancelling a hold request after transfer initiated orphans item.

Signed-off-by: Liz Rea <lrea@nekls.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-31 21:20:12 +13:00
Ian Walls
e57dadf762 Bug 5548: Hard Due Dates Circ Rule
Implements the RFC found at http://wiki.koha-community.org/wiki/Hard_Due_Dates_Circ_Rule_RFC.  See squashed commits
messages below for details of implementation.

Squashed commit of the following:

commit 871b91af00871146eb1216ebf5ce673dda2c5925
Author: Ian Walls <ian.walls@bywatersolutions.com>
Date:   Tue Dec 28 15:09:49 2010 -0500

    Hard Due Dates dev part 3: implementing the due dates in circ

    CalcDateDue now calls GetLoanLength, rather than each invocation running separately one after another.  Therefore, instead of
    the 'loanlength' param, CalcDateDue now takes 'itype', and uses the info to get both the issuelength and the hardduedate info (if it exists)

    Global Due Date no longer populates in the sticky due date field in Circ, since it can't be determined before the item is scanned.  Any specified
    due date still overrides the circulation rules, if allowed.

    Hard Due Dates in the past will return an error message, but can be manually specified if truly desired.

    Also, a small fix to updatedatabase.pl to allow the old data to populate if possible.

commit 14d5505f3c01287a2464a759f0076c1d4b665c49
Author: Ian Walls <ian.walls@bywatersolutions.com>
Date:   Mon Dec 27 18:28:11 2010 -0500

    HardDueDates dev part 2:  adding admin interface

    Adds columns to Smart Rules page, including calendar for easy date selection.

    Removes globalDueDate and ceilingDueDates from system preferences editors

commit 76e3e3d86a7a54c6ce4253e7f68278b4dc75a0bb
Author: Ian Walls <ian.walls@bywatersolutions.com>
Date:   Mon Dec 27 15:58:05 2010 -0500

    HardDueDates dev part 1: database changes

    Adds two new columns to issuingrules, a hardduedate and a hardduedatecompare.  If globalduedate is set, use that as the universal value
    for all circ rules.  Else, if ceilingduedate is set, use that as the universal value.  Adjust the comparison accordingly (-1 before, 0
    exact, 1 after).  the old system preferences globalDueDate and ceilingDueDate are then removed.

    Rebased onto 3.03.00.032

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-30 20:35:45 +13:00
Colin Campbell
88cb47339a Bug 5708 : Get Correct Discount when levying rentalcharge
Branch can be a parameter so it should be included in the rule retrieval
Need to select the most appropriate rule from those returned
(was defaulting to first returned!)
Try to make what's happening a bit less opaque
null fields are returned as undefined not 'NULL' by DBI

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-30 20:01:37 +13:00
Paul Poulain
ddbedbfc2f Bug 4330 : Adding some copyright BibLibre statements 2011-03-21 10:57:20 +13:00
Jared Camins-Esakov
83ab549724 Bug 5811: Add sysprefs to control overriding fines
This patch adds two sysprefs to allow libraries more fine-grained control over
when fines can and can't be overridden. The two sysprefs are:
* AllFinesNeedOverride - when this syspref is set to "Require" (default) any
    fine will require a staffmember to override the fine in order to check out a
    book.  When set to "Don't require," fines below noissuescharge will not need
    any override.
* AllowFineOverride - when this syspref is set to "Allow," staff will be able to
    override fines that are above noissuescharge. When set to "Don't allow"
    (default), staff will not be able to check out items to patrons with fines
    greater than noissuescharge.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-04 09:33:18 +13:00
Ian Walls
a0dc124a95 Bug 3881: OPAC Privacy reimplementation
Reimplements Paul Poulain's original OPAC Privacy patch, with some minor improvements and changes to wording

If the library enables the OPACPrivacy system preference along with the opacreadinghistory preference, and sets
an AnonymousPatron (must be a valid patron number in the database), the user will see a new tab upon login to
the OPAC, My Privacy.  From there, the user can:

- Set their OPAC Privacy to one of three values
  0 - Forever.  This keeps their reading history unless they explicitly delete it; the bulk anonymiser won't touch it
  1 - Default.  Keep reading history until either they delete it or the library does
  2 - Never.    Instantly anonymises reading history upon item return

- Instantly delete their reading history
  There is a warning and a popup to confirm.  I've removed Paul's extra confirm checkbox, which seemed redundant

A note of which preference the patron has selected is added to the Patorn Details page in the staff client.  This is read-only.

This patch also consolidates Privacy system preferences into the Privacy section of the OPAC tab.

Thank you to BibLibre for the original implmentation of this patch, and Los Gatos Public Library for funding and
testing the reimplementation.

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-31 22:23:50 +13:00
324991fefd Fix for Bug 4946 - hold warning needs rewording
This patch improves the phrasing of several messages by
breaking the message variable into distinct parts for more
natural-sounding warnings when:

- Checking out an item on hold for another patron
- Checking out an item which is waiting for another patron
- Checking out an item which is checked out to another patron
- Checking out an item which is checked out to this patron
- Checking out to a patron who has too many checked out

I would appreciate special attention to my changes to the
TooMany function in Circulation.pm to make sure I handled
it correctly.

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-12-17 09:45:03 +13:00
Srdjan Jankovic
4d1762f5ec Bug 2965: Allow due date in the past
Raise warning rather than disallowing
Remove due date js validation when checking out

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed small error in circulation.tmpl
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-12-14 13:49:15 +13:00
Koustubha Kale
e4cbc4f421 Bug 5418: Rev-5 patch new itemBarcodeInputFilter for libsuite8 style barcodes
In India a ILS product called Libsuite8 prints barcodes like b0007432. The barcode is not stored anywhere in libsuite8's database. Neither is barcode available in any of the reports generated by the software.

The barcode 'b0007432' when scanned into the libsuite8 software is de-constructed like 'b' which is the itemtype i.e. Book in this instance, and '7432' which is the 'Accession Number'. The software then takes the logged in staff's branchcode and does a join on three tables 'Location', 'Media_Type', and 'Books' to retrieve the particular record from the database.

There is no possibility of recreating the barcodes for insertion in Koha while doing a retrospective conversion, because of arbitrary length of the barcode string AND arbitrary number of zeros in the numeric part of the printed barcode AND the fact that there are no reports available from the software which contain barcodes AND the fact that the barcode is not stored in the database.
But most importantly due to the simple fact that printed barcodes are duplicated among branches.

Therefore this patch emulates the functionality of Libsuite8 software of converting the scanned barcode into one stored in Koha using the itemBarcodeInputFilter system preference.

To use this new itemBarcodeInputFilter systempreference choice called 'libsuite8', the barcodes stored in Koha must match the pattern of <branchcode>-<itemtype_code>-<accession_number>. This is easy to achieve while doing retrospective conversion from Libsuite8 to Koha.

As expected the itemBarcodeInputFilter will return unmodified barcode if presented with a barcode of pattern <branchcode>-<itemtype_code>-<accession_number>

This revision corrects the way updatedatabase.pl is changed in order to correctly update version and insert the libsuite8 option in the database. Also kohaversion.pl is changed in the recommended format of 3.0X.0X.XXX to reflect database has changed.

This revision also changes the erronorous itemBarcodeInputFilter description in koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref from 'scanned patron barcodes' to 'scanned item barcodes' there by eliminating need for a separate patch for bug 5417.

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

1) applied patch to HEAD
2) set next database number in kohaversion.pl and updatedatabase.pl
3) webinstaller kicked in, update ok
4) typed the barcodes from test cases into check-in

Barcodes used my local branch code, everything seemed ok to me.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-12-12 20:39:20 +13:00
Henri-Damien LAURENT
45604b8d17 (bug 3536) fix homeorholdingbranch on return
this patch create a new systempreference "homeorholdingbranch"-like used only for returns.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>

An additional edit was made to circ/returns.pl by Ian Walls of ByWater Solutions to force the dialog message for the return to
use the branch specified by the new HomeOrHoldingBranchReturn system preference, rather than always Homebranch.
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-21 20:04:30 -04:00
Nahuel ANGELINETTI
d990e2cd32 (bug #4084) fix offline circ
this add the function C4::Circulation::GetOpenIssue and delete \r chars when processing koc files.

Cherry picked from 3.0.x commit 5af80ab

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-09-29 18:17:36 -04:00
7c0e441d50 replace references to defunct info email address
Now links to Koha project website.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-25 05:18:44 -04:00
Andrew Elwell
aa9b4d92cd POD Cleanups
Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-09 08:38:59 -04:00
64daee5495 fix a common "developement" typo
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-25 14:38:38 -04:00
Chris Cormack
891a0248f7 wr-70205 Rental discount not being respected
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-11 08:15:32 -04:00
7c826bc816 Fix for Bug 3666, Overriding renewal limit means negative count in OPAC
Setting "renewalsleft" variable to zero if it comes out negative.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-11 06:01:36 -04:00
Nahuel ANGELINETTI
6626e8fcca (MT #2966) fix opac-user.pl function problem
This uncomment a uselessly commented function that is needed by opac-user. And fix this function that doesn't work properly.

Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-07 13:10:59 -04:00
Michael Hafen
ea0c76af7f on checkout ask for confirmation if borrower from different branch
With IndependantBranches on check that the borrower is from the same branch as
the librarian.  If not then ask for confirmation.  This check is skipped for
SuperLibrarians.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-03 09:17:19 -04:00
Ian Walls
2d3722b5a3 Fixes bug 4369: Local use does not update datelastseen
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-03 09:04:23 -04:00
d575278cba bug 4036, 4405: overdue and fine day block improvements
* Adopted wording suggested by Kyle Hall for the
  USERBLOCKEDREMAINING and USERBLOCKEDOVERDUE circulation blocks
* Updated IsMemberBlocked so that if a patron has accrued
  fine days, that will be tested for first before testing
  to see if the patron has current overdue items; this solves
  a problem introduced in the patch series for bug 4505 where
  accrued fine days would be ignored if (a) the patron has
  current overdue items but (b) the library has chosen to
  set the OverduesBlockCirc syspref to noblock.
* Now correctly assigns the USERBLOCKEDREMAINING and USERBLOCKEDOVERDUE
  blocks; prior to this patch, they had been swapped.

FIXME: IsMemberBlock ought to be split into two functions

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-03 07:46:26 -04:00
50dc9e5cf8 bug 4405 followup - fix typo
As much as circ staff may want to block circulation to
over-rude patrons, Koha probably shouldn't be trying to make
that determination on its own. :)

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-01 10:39:11 -04:00
Chris Cormack
86fbe2ec21 Bug 4405 - Overdues block check out
[Documentation note by RM:

This patch adds a new system preference, OverduesBlockCirc,
that can take one of three values:

  - noblock:      checkouts permitted even if patrons
                  have overdue items (default)
  - confirmation: circ operator asked to confirm checkout
  - block:        checkouts to patrons who have overdue
                  items are forbidden

]

Squashed commit of the following:

commit 6a1f66e0686a14d8a89abfc3fe5978dabd0b7af7
Author: Chris Cormack <chrisc@catalyst.net.nz>
Date:   Mon Apr 26 10:27:39 2010 +1200

    Tidy up ready to send patch

commit 4d1398df18dcce4fd888cf17a0e2955fdf6ee1e4
Author: Chris Cormack <chrisc@catalyst.net.nz>
Date:   Mon Apr 26 10:26:15 2010 +1200

    Bug 4405 - tidy up

commit 3daeb71bc6b690e18dda96aa3c767c2bb0521038
Author: Chris Cormack <chrisc@catalyst.net.nz>
Date:   Mon Apr 26 10:02:04 2010 +1200

    Bug 4405 - Overdues block checkout

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-01 10:39:11 -04:00
Kyle M Hall
a1336175fd Bugfix 4123 - CanBookBeRenewed fixed.
In Circulation::CanBookBeRenewed categorycode and itemtype were not being checked for * wildcard
if a specific code was not given.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-04-30 08:08:41 -04:00
Ian Walls
2f4f4bdff6 Fixes bug 4326: Items marked as returned yesterday
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-04-29 23:16:31 -04:00
Chris Cormack
8478586cf1 Bug 4372 - Fix for bookcount.pl not counting started transfers as seeing an item
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-04-29 22:03:42 -04:00
Donovan Jones
593a7d8e6a Bug 2505 - Add commented use warnings where missing in *.pm 2010-04-21 20:28:51 +12:00
91990d783a additional improvement to POD for CanBookBeIssued()
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-03-16 21:03:45 -04:00
Lars Wirzenius
ea06cc504b Fix pod documentation for CanBookBeIssued method to refer to the right variable.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-03-16 21:02:20 -04:00
Lars Wirzenius
7279f55b60 Fix FSF address in directory C4/
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-03-16 20:17:56 -04:00
Henri-Damien LAURENT
780cda46a2 UpdateDataBase for smart-rules modification
Members.pm :
Adding IsMemberBlocked
Circulation.pm :
Using IsMemberBlocked in order to implement finedays

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-09-30 11:22:21 +02:00
Henri-Damien LAURENT
3c741d2376 Smart Rules enhancements
Adding finedays and reservesallowed and renewalsallowed management in smart rules
Adding Clone Rules
Adding CanBookBeReserved and CanItemBeReserved in C4::Reserves
Manage Reservesallowed in opac and staff interface
Manage renewalsallowed in C4/Circulation.pm
Update Database follow

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-09-30 11:22:20 +02:00
dafb3e20da bug 3481 followup - improve CartToShelf
* added POD
* removed optional $barcode argument - in all cases,
  itemnumber is known, and we should stick with
  itemnumber when retrieving an existing item
* use ModItem to do the update so that indexer
  will know to reindex bib - otherwise, can't
  do an accurate search of items that are on
  the shelving cart.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-23 13:07:33 -04:00
Colin Campbell
e40e11ab0c bug 3481: Allow Item Temporary Locations for Processing and Shelving.
Allows temporary locations corresponding to 'in processing' and 'shelving'
so that newly-created items, and newly-returned items do not show
immediately as a available. Three new system preferences govern the usage
of these features.

NewItemsDefaultLocation. If system pref NewItemsDefaultLocation is set to a location code,
 all newly catalogued items will be set to the location set in this preference.
 Location code must be a valid LOC authorized value type.

InProcessingToShelvingCart. if the system pref InProcessingToShelvingCart is turned on,
any items run through returns.pl with a location code for 'PROC', will be modified to
have a new location code of 'CART'.

ReturnToShelvingCart.  If the syspref ReturnToShelvingCart is turned on,
all items returned other than confirmed holds will have a new location code of 'CART'.
Any item issued is automatically taken of the shelving cart.

Adds a cron script shelf_to_cart.pl which should be run hourly.
Updates all items with a location of CART to the item's permanent location.

The original location code is stored in the new items column 'permanent_location'.

Original Author: PTFS Contractor <dbavousett@ptfs.com>

This work co-sponsored by
  Middletown Township Public Library, Middletown, NJ USA  and
  East Brunswick Public Library, East Brunswick, NJ USA

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-23 11:54:46 -04:00
5593a28164 implement bailing out of AddReturn if IndependantBranches is on
If IndependantBranches is ON and user attempts to return an
item at a library other than the item's home library, bail out.
This action, which was previously just a suggestion in the code,
is now required to ensure that the item doesn't get its
holdingbranch set to the library at which the attempt to return
the item was made.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-23 10:05:09 -04:00
15fbaea348 bug 3409 followup - fix use of $hbr
$hbr in this context is a branch code, not an
item field.

Also added use of C4::Debug;

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-23 10:05:09 -04:00
b59e016612 AddReturn now always updates holdingbranch
Prior to this patch, this was done only when returning
an item after it had been out on loan.  Even if the
item had not been on loan, the fact that it was checked
in means that it is now in fact at the new holding library.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-23 10:05:09 -04:00
223d1fa6e8 bug 3409 follow: fix crash if holdingbranch is undef
Make _GetCircControlBranch() default to the item's home library
in the case where it otherwise would have returned the item's
holding library but that field is null.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-23 10:05:09 -04:00
80820af3f6 bug 3409 followup: renamed _GetCirculationBranch
New name is  _GetCircControlBranch so as not to confuse
the library that a circulation transaction is taking
place at with the library that is supposed to control
circulation policy lookup.

Also fixed formatting errors in _GetCircControlBranch.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-23 10:05:09 -04:00
9dec888d78 bug 3409 followup: always set holdinglibrary to library last seen at
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-23 10:05:09 -04:00
Henri-Damien LAURENT
b00efc7295 Bug fix 3409 : Adding an internal function to C4::Circulation
This patch add the use of CircControl and HomeOrHoldingBranch for return and transfert rules.
* ItemHomeLibrary goes to item{HomeOrHoldingBranch}
* PatronLibrary goes to the borrower library
* PickupLibrary depends where the items was checked out, and the actual library.

This add a little improvment that does not re-request each time the circcontrol syspref.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-23 08:24:52 -04:00
Michael Hafen
2ace8cb33d bugfix invalid comparison to ceilingDueDate in CalcDateDue()
The comparison to check the ceilingDueDate is done in the syspref format,
which isn't a good comparison.  This changes to code so the comparison is done
using iso format.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-15 09:39:04 -04:00
Galen Charlton
99afd35871 bug 3435: added missing _ in _FixAccountForLostAndReturned
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-07-30 14:36:30 -04:00
Galen Charlton
d903e7531f bug 3435 followup: tweak AddReturn cleanup
We're returning issue information when available,
not just item information.  Fixes problem where
circ/returns.pl wasn't displaying the due date
and patron when returning a loan.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-07-30 11:29:45 -04:00
Joe Atzberger
51e8fc2cb6 bug 3435: AddReturn overhaul.
Required for SIP checkin implementation, but also for internal correctness.
AddReturn had too many things going on, with no guarantee of data being
available for the later calls.  At some point we started tacking on all the
branch transfer logic without testing edge cases.  In particular, $borrower
is not checked to be sure it is defined, considering the item may not have been
checked out so no borrower would be associated.  That means that CircControl
of "PatronLibrary" would be inaccurate, Circ Alerts will be totally confused
(untargeted), and the Fix... subs would fail.

Note that *many* errors are still present in _FixAccountForLostAndReturned, including
those where comments are added, such that it might behave strangely even with $borrower.

Renamed the internal subs with leading underscore, per convention.  Changed
the arguments to be scalars when only scalars are needed, not entire objects.
Added depth to WrongBranch message that includes Rightbranch.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-07-30 11:06:50 -04:00
Joe Atzberger
d313335cc3 Correct GetItemIssue to actually return undef if item not checked out.
Updated POD for correctness.
Replaced strftime + regexp w/ C4::Dates->today.
Also removed some sth->finish statements.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-07-22 11:15:04 -04:00
Galen Charlton
ea62d6e72f followup to AddReturn patch - fix test
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-07-22 10:15:32 -04:00
Ryan Higgins
e492747a6f Bug 2770 follwup : force AddRenewal obey circControl system preference [revised]
Also prevents infinite-length renewals by returning undef
if passed an invalid date instead of renewing with no due date.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-07-14 22:32:46 -04:00
Joe Atzberger
e8908c2f97 Returns reworking to handle empty GetItemIssue
Code cannot rely on issueinformation being populated.

Note there is room for better efficiency to have AddReturn also provide the
itemnumber (where existing) so that GetItemnumberFromBarcode is not called
at both levels.  Unfortunately there is discrepancy between this idea (for
efficiency) and the stated purpose of the $iteminformation object returned,
since $iteminformation is specifically the info from the issues table and
MUST be empty when the item was not in fact issued.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-24 09:44:39 -05:00
Galen Charlton
09279e2334 bug 2893: extend conditions handled by AllowNotForLoanOverride
Prior to this patch, turning AllowNotForLoanOverride on
allowed the circ operator to permit the loan of an
item who's individual not-for-loan flag was set, but did
not allow the loan of an item whose item type's not-for-loan
flag was set.  This patch extends the definition of the
system preference so that both cases are covered.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-19 06:01:27 -05:00
Galen Charlton
ea42477090 bug 3299: fix setting renewal due date explicitly
When renewing a loan from the patron details page, setting
the renewal due date now works again.  Broken by patch
for bug 2770.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-07 13:17:08 -05:00
Paul Poulain
6924e7d6b4 fix for 2997 : superlibrarian's ability to edit item/patron home branch affected if all other privileges are selected
Before this patch, we used to test for flags == 1, which was wrong when patron had all privileges.
This patch just adds a %2 to check that patron has superlibrarian privilege, and maybe something else we don't care.

I think I fixed it everywhere except in acquisition, that will be addressed by BibLibre new acquisition module.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-28 17:06:46 -05:00
Galen Charlton
6085209dd3 excised hard-coded reference to HLT
Note to Chris Cormack: I suspect the current ability
to override most circulation conditions is sufficient,
but if HLT still needs to establish a patron category
that can ignore issuingimpossible limitations, needs
to be done in a more flexible way.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-11 16:23:42 -05:00
Galen Charlton
5899badc3e fix to CanBookBeIssued()
Bail out if item does not exist - otherwise
subsequent checks can fail for lack of an
item branchcode.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-11 16:11:36 -05:00