This patch
- refactors C4::Stats::UpdateStats (it now takes a hashref as unique parameter, instead of a list of parameters)
- add UT for it
- change the calls made to this sub in C4::Accounts and C4::Circulation
Additionnaly it also
- adds POD to C4::Stats::TotalPaid
- adds some comments to C4::Stats::TotalPaid (I think I found some errors in it)
To test :
1. run "prove t/db_dependant/Stats.t -v"
2. make some circulation operations (checkout, checkin, renew, localuse)
check the operations are rightly recorded in Statistics table (with a SQL query like "SELECT * FROM statistics WHERE datetime LIKE "2013-11-15%", if you run your test on the 15th november)
3. make some fine payments operations (writeoff, payment)
check the operations are rightly recorded in Statistics table (with a SQL query like "SELECT * FROM statistics WHERE datetime LIKE "2013-11-15%", if you run your test on the 15th november)
Note that there is probably an issue to fix in Accounts.pm : the user is saved instead of the branch. But this is not the purpose of this patch, so I kept the previous behavior for the moment.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work, test pass, isse/return/writeoff recorded on statistics
Removed a "=back" to make happy koha-qa
No other errors
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch fixes various issues that prevented the account
type from being set correctly when recording SIP2 payments:
- the fixed fields in the fee paid message were not getting
parsed correclty
- accountlines.accounttype is only five characters wide, so
SIP2 payments are now records as 'Pay00', 'Pay02', etc. rather
than 'Pay-00'.
- removed regression on bug 2546 and made the new payment types
translatable
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Adds support for recording in Koha accountlines a different accounttype
depending on how the fee was paid at the SIP2 station (cash, credit,
etc.)
Adds a new param to recordpayment(), $sip_paytype, which is appended to
the 'Pay' type if present. The payment description is also appended
with " (via SIP2)" if this is present.
In order for other scripts to keep working as expected, "eq 'Pay'"
needed to be replaced with a regex comparison "=~ /^Pay/", so that 'Pay'
and 'Pay-##' would continue to group together.
To test:
1. Make a payment over a SIP2 connection
2. Check the patron record in the staff client; you should see the
modified description
3. Attempt to print a invoice or a reciept for the borrower; the
payment should show up where expected
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
The descriptions for fines are stored in English in the DB
(accountlines.description). So they are not translatable.
This patch removes the descriptions automatically added and generates
the string in the template.
Test plan:
1/ Execute the updatedatabase entry.
2/ Verify in the following pages the description is consistent:
- members/pay.pl?borrowernumber=XXXX
- members/boraccount.pl?borrowernumber=XXXX
- opac-account.pl
3/ Launch the translate script and update the po files in order to
translate the new strings.
4/ Verify the strings are translated in the interface.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Works as advertised. Corrected few typos in the commit message.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4::Accounts::fixcredit and C4::Accounts::refund are marked as
deprecated and are not used. They can be removed.
Use:
git grep fixcredit
git grep refund
and verify these routines are not currently in used.
Bonus: The module exports reconcileaccount which is not defined. The
export is removed too.
MLT: Ran qa tool on this patch with no issues either.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch gets rid of finish.
From the man page
finish()
Indicate that no more data will be fetched from this statement handle
before it is either executed again or destroyed.
You almost certainly do not need to call this method.
Adding calls to "finish" after loop that fetches all rows is a common
mistake, don't do it, it can mask genuine problems like uncaught fetch errors.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Similar to other patches from the same author.
Run prove t/db_dependent/Accounts.t without errors
No koha-qa errors
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Code will also respect notes when using the "Writeoff All" button but WILL NOT when using either the "Pay Amount" or "Pay Selected" buttons Fixed uri encoding of arguments
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Add all fine actions to action_logs via FinesLog syspref
Test Plan:
1) Enable FinesLog
2) Apply patch
3) Try all the various fine related actions possible
4) Verify that each action creates an action_logs entry
Signed-off-by: MJ Ray <mjr@phonecoop.coop>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
The problem was introduced by the addition of accountlines_id in bug 7671
The WriteOffFee sub was called with accountlines_id as second parameter
but still dealing with the accountno column.
As a result, the UPDATE was failing (updating nothing), and the fine
note written off even if the writeoff itself was saved. In other words:
the writeoff was not "attached" to the fine.
This patch fixes the problem.
Test plan: do what katrin says in initial description of the problem:
- add some fines manually, I did 'new card' and sundry
- try writing off all of them or one of them
- the fine is correctly written off
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Passed-QA-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This patch is not related nor introduced by bug 8739, but while qa-ing it, I found those 2 perlcritic violation
this patch fixes it !
I also fixed a tiny indentation problem
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Confirmed using test plan that the display is corrected.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
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>
Currently, the subroutine writeoff lives in pay.pl, which
is a violation of the Koha coding guidelines, as it writes
to the database. This commit restructures and moves writeoff
to C4::Accounts::WriteOff(), and modifies pay.pl to use it.
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Tested all three patches together and was able to write off single
and multiple fines and the data was correct in the stats table.
The call to ReturnLostItem in C4/Accounts was not properly namespaced to
come from C4::Circulation. That prefix is added to the call.
To test:
Pay a fine, and confirm the error disappears (and the fines is still paid)
Signed-off-by: Brendan <brendan@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
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>
Allow partial payment of outstanding fines
against either individual fine entries or as a lump payment
Sponsered by East Brunswick Public Library, East Brunswick, NJ, USA
NB: Adds a version of the include circ-menu.inc as circ-menu.tt
this has the same functionality as the old include but does not
require all the borrowers attributes to be passed as global
scoped variables
Signed-off-by: Liz Rea <lrea@nekls.org>
Bug 3498 - Documentation update to explain what every button does.
Help file updated to the following:
Pay and Writeoff Fines
Each line item can be paid in full, partially paid, or written off.
Pay a fine in full
Click "Pay" next to the fine you want to pay in full
The full amount of the fine will be populated for you in the "Collect From Patron" box
Click "Confirm"
The fine will be removed from outstanding fines, and displayed as fully paid.
Pay a partial fine
Click "Pay" next to the fine you want to partially pay
Enter the amount you are collecting from the patron in the "Collect From Patron" box
Click "Confirm"
The fine will be updated to show the original Amount, and the current Amount Outstanding
Writeoff a single fine
Click "Writeoff" next to the fine you wish to writeoff.
The fine will be removed from outstanding fines, and displayed as fully paid.
Pay an amount towards all fines
Click the "Pay Amount" button
Enter the amount you are collecting from the patron in "Collect from Patron." The sum of all fines is shown in "Total Amount Outstanding"
Click "Confirm"
The fine totals will be updated with the payment applied to oldest fines first.
Writeoff All fines
Click the "Writeoff All" button
All fines will be removed from outstanding fines, and displayed as written off.
Pay Selected fines
Check the selection boxes next to the fines you wish to pay, click "Pay Selected"
Enter an amount to pay towards the fines.
Click "Confirm"
The fine totals will be updated with the payment applied to the oldest selected fines first.
Bug 3498 - adding parens to TT IF Statements for style
pay.tt
Bug 3498 - Add parens to TT IF statements for style
paycollect.tt
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I could not reproduce the calculation bug, but after
applying this patch multiple pay/reverse cycles only
are still only 2 lines in accountlines, which makes the
display a lot less confusing.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
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>
In the code available today (14-Jun-2011), in Koha git's "master" branch,
the file "Accounts.pm" (in the "C4" directory) has the variable "$sth"
declared 3 times in the "makepayment" sub. This causes the following
warnings to appear when running "make test" in Koha installation, for
several tests:
t/Heading.t ......................... "my" variable $sth masks earlier declaration
in same scope at kohaclone/blib/PERL_MODULE_DIR/C4/Accounts.pm line 172.
"my" variable $sth masks earlier declaration in same scope at
kohaclone/blib/PERL_MODULE_DIR/C4/Accounts.pm line 188.
[...]
t/ILSDI_Services.t .................. "my" variable $sth masks earlier declaration
in same scope at kohaclone/blib/PERL_MODULE_DIR/C4/Accounts.pm line 172.
"my" variable $sth masks earlier declaration in same scope
at kohaclone/blib/PERL_MODULE_DIR/C4/Accounts.pm line 188.
[...etc...]
Therefore, I'm removing the "my" keyword from the declarations of "$sth"
in lines 172 and 188 of "Accounts.pm".
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This patch creates a --quiet flag for longoverdue that will squelch
the summary at the end of the run. It also silences an unnecessary
warn in C4/Acounts.pm
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This patch fixes the SELECT so that title is available when it is used
later on, which will prevent 'Use of uninitialized value' errors.
It also uses JOIN properly, which the original query and my initial
patches for this did not.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This update the way Member is added and editing so that import and Edition
could be best automatized
GetMember evolves and allow ppl to serach on a hash of data
Adding SQLHelper A new package to deal with INSERT UPDATE and SELECT
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
I don't think this is left set intentionally.
If an item is set lost and it's on loan it's marked returned, but it
wasn't set as not on loan.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This patch deprecates the NoReturnSetLost system preference, which, as it
turns out, was not implemented anyway. New longoverdue script allows one to
specify on the commandline system-wide delays for changing items to different
lost statuses, and optionally charge for the item.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
You can test getnextacctno like:
perl -e 'use C4::Accounts; print getnextacctno(33), "\n";'
where 33 is a borrowernumber out of the accountlines table. Get that number like:
mysql> select borrowernumber,accountno from accountlines LIMIT 100;
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Qualified call to MarkIssueReturned with 'C4::Circulation'.
It looks like there is still a subtle bug with exporting
subs between modules that use each other.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
The new tables have the same structure and constraints
as the tables they archive with the following exceptions:
* borrowernumber and biblionumber in old_reserves can be
NULL
* the FK constraints (e.g., for itemnumber) on old_reserves
set the child column to NULL if the parent row is deleted
instead of deleting the child row.
* there is no FK constraint on old_issues.branchcode, allowing
a branch to be deleted without changing archived requests.
Some miscellaneous cleanup was done as part of this patch:
* GetMemberIssuesAndFines (C4::Members) now uses bind variables
* fixed POD for GetMemberIssuesAndFines
Signed-off-by: Joshua Ferraro <jmf@liblime.com>