Bugzilla – Attachment 39073 Details for
Bug 6427
Rewrite of the accounts system
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6427 - Delete unused and unnecessary files
Bug-6427---Delete-unused-and-unnecessary-files.patch (text/plain), 146.93 KB, created by
Kyle M Hall (khall)
on 2015-05-12 12:04:40 UTC
(
hide
)
Description:
Bug 6427 - Delete unused and unnecessary files
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-05-12 12:04:40 UTC
Size:
146.93 KB
patch
obsolete
>From e63e92c2591f4962b68c8991f8b97966e295015a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 15 Jul 2014 10:41:21 -0400 >Subject: [PATCH] Bug 6427 - Delete unused and unnecessary files > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> >--- > C4/Accounts.pm | 837 -------------------- > Koha/Schema/Result/Accountline.pm | 222 ------ > Koha/Schema/Result/Accountoffset.pm | 106 --- > circ/stats.pl | 189 ----- > .../intranet-tmpl/prog/en/modules/circ/stats.tt | 55 -- > .../prog/en/modules/members/boraccount.tt | 155 ---- > .../prog/en/modules/members/mancredit.tt | 64 -- > .../prog/en/modules/members/maninvoice.tt | 88 -- > .../intranet-tmpl/prog/en/modules/members/pay.tt | 178 ----- > .../prog/en/modules/members/paycollect.tt | 234 ------ > .../prog/en/modules/members/printfeercpt.tt | 74 -- > .../prog/en/modules/members/printinvoice.tt | 76 -- > .../prog/en/modules/reports/stats_screen.tt | 131 --- > members/boraccount.pl | 126 --- > members/mancredit.pl | 108 --- > members/maninvoice.pl | 133 ---- > members/pay.pl | 269 ------- > members/paycollect.pl | 194 ----- > members/printfeercpt.pl | 142 ---- > members/printinvoice.pl | 142 ---- > misc/maintenance/fix_accountlines_date.pl | 171 ---- > reports/stats.print.pl | 178 ----- > reports/stats.screen.pl | 265 ------- > 23 files changed, 0 insertions(+), 4137 deletions(-) > delete mode 100644 C4/Accounts.pm > delete mode 100644 Koha/Schema/Result/Accountline.pm > delete mode 100644 Koha/Schema/Result/Accountoffset.pm > delete mode 100755 circ/stats.pl > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/circ/stats.tt > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/reports/stats_screen.tt > delete mode 100755 members/boraccount.pl > delete mode 100755 members/mancredit.pl > delete mode 100755 members/maninvoice.pl > delete mode 100755 members/pay.pl > delete mode 100755 members/paycollect.pl > delete mode 100755 members/printfeercpt.pl > delete mode 100755 members/printinvoice.pl > delete mode 100755 misc/maintenance/fix_accountlines_date.pl > delete mode 100755 reports/stats.print.pl > delete mode 100755 reports/stats.screen.pl > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >deleted file mode 100644 >index d0709d0..0000000 >--- a/C4/Accounts.pm >+++ /dev/null >@@ -1,837 +0,0 @@ >-package C4::Accounts; >- >-# Copyright 2000-2002 Katipo Communications >-# >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it >-# under the terms of the GNU General Public License as published by >-# the Free Software Foundation; either version 3 of the License, or >-# (at your option) any later version. >-# >-# Koha is distributed in the hope that it will be useful, but >-# WITHOUT ANY WARRANTY; without even the implied warranty of >-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >-# GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License >-# along with Koha; if not, see <http://www.gnu.org/licenses>. >- >- >-use strict; >-#use warnings; FIXME - Bug 2505 >-use C4::Context; >-use C4::Stats; >-use C4::Members; >-use C4::Circulation qw(ReturnLostItem); >-use C4::Log qw(logaction); >- >-use Data::Dumper qw(Dumper); >- >-use vars qw($VERSION @ISA @EXPORT); >- >-BEGIN { >- # set the version for version checking >- $VERSION = 3.07.00.049; >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT = qw( >- &recordpayment >- &makepayment >- &manualinvoice >- &getnextacctno >- &getcharges >- &ModNote >- &getcredits >- &getrefunds >- &chargelostitem >- &ReversePayment >- &makepartialpayment >- &recordpayment_selectaccts >- &WriteOffFee >- ); >-} >- >-=head1 NAME >- >-C4::Accounts - Functions for dealing with Koha accounts >- >-=head1 SYNOPSIS >- >-use C4::Accounts; >- >-=head1 DESCRIPTION >- >-The functions in this module deal with the monetary aspect of Koha, >-including looking up and modifying the amount of money owed by a >-patron. >- >-=head1 FUNCTIONS >- >-=head2 recordpayment >- >- &recordpayment($borrowernumber, $payment, $sip_paytype, $note); >- >-Record payment by a patron. C<$borrowernumber> is the patron's >-borrower number. C<$payment> is a floating-point number, giving the >-amount that was paid. C<$sip_paytype> is an optional flag to indicate this >-payment was made over a SIP2 interface, rather than the staff client. The >-value passed is the SIP2 payment type value (message 37, characters 21-22) >- >-Amounts owed are paid off oldest first. That is, if the patron has a >-$1 fine from Feb. 1, another $1 fine from Mar. 1, and makes a payment >-of $1.50, then the oldest fine will be paid off in full, and $0.50 >-will be credited to the next one. >- >-=cut >- >-#' >-sub recordpayment { >- >- #here we update the account lines >- my ( $borrowernumber, $data, $sip_paytype, $payment_note ) = @_; >- my $dbh = C4::Context->dbh; >- my $newamtos = 0; >- my $accdata = ""; >- my $branch = C4::Context->userenv->{'branch'}; >- my $amountleft = $data; >- my $manager_id = 0; >- $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; >- >- $payment_note //= ""; >- >- # begin transaction >- my $nextaccntno = getnextacctno($borrowernumber); >- >- # get lines with outstanding amounts to offset >- my $sth = $dbh->prepare( >- "SELECT * FROM accountlines >- WHERE (borrowernumber = ?) AND (amountoutstanding<>0) >- ORDER BY date" >- ); >- $sth->execute($borrowernumber); >- >- # offset transactions >- my @ids; >- while ( ( $accdata = $sth->fetchrow_hashref ) and ( $amountleft > 0 ) ) { >- if ( $accdata->{'amountoutstanding'} < $amountleft ) { >- $newamtos = 0; >- $amountleft -= $accdata->{'amountoutstanding'}; >- } >- else { >- $newamtos = $accdata->{'amountoutstanding'} - $amountleft; >- $amountleft = 0; >- } >- my $thisacct = $accdata->{accountlines_id}; >- my $usth = $dbh->prepare( >- "UPDATE accountlines SET amountoutstanding= ? >- WHERE (accountlines_id = ?)" >- ); >- $usth->execute( $newamtos, $thisacct ); >- >- if ( C4::Context->preference("FinesLog") ) { >- $accdata->{'amountoutstanding_new'} = $newamtos; >- logaction("FINES", 'MODIFY', $borrowernumber, Dumper({ >- action => 'fee_payment', >- borrowernumber => $accdata->{'borrowernumber'}, >- old_amountoutstanding => $accdata->{'amountoutstanding'}, >- new_amountoutstanding => $newamtos, >- amount_paid => $accdata->{'amountoutstanding'} - $newamtos, >- accountlines_id => $accdata->{'accountlines_id'}, >- accountno => $accdata->{'accountno'}, >- manager_id => $manager_id, >- note => $payment_note, >- })); >- push( @ids, $accdata->{'accountlines_id'} ); >- } >- } >- >- # create new line >- my $usth = $dbh->prepare( >- "INSERT INTO accountlines >- (borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id, note) >- VALUES (?,?,now(),?,'',?,?,?,?)" >- ); >- >- my $paytype = "Pay"; >- $paytype .= $sip_paytype if defined $sip_paytype; >- $usth->execute( $borrowernumber, $nextaccntno, 0 - $data, $paytype, 0 - $amountleft, $manager_id, $payment_note ); >- $usth->finish; >- >- UpdateStats({ >- branch => $branch, >- type =>'payment', >- amount => $data, >- borrowernumber => $borrowernumber, >- accountno => $nextaccntno } >- ); >- >- if ( C4::Context->preference("FinesLog") ) { >- $accdata->{'amountoutstanding_new'} = $newamtos; >- logaction("FINES", 'CREATE',$borrowernumber,Dumper({ >- action => 'create_payment', >- borrowernumber => $borrowernumber, >- accountno => $nextaccntno, >- amount => $data * -1, >- amountoutstanding => $amountleft * -1, >- accounttype => 'Pay', >- accountlines_paid => \@ids, >- manager_id => $manager_id, >- })); >- } >- >-} >- >-=head2 makepayment >- >- &makepayment($accountlines_id, $borrowernumber, $acctnumber, $amount, $branchcode); >- >-Records the fact that a patron has paid off the entire amount he or >-she owes. >- >-C<$borrowernumber> is the patron's borrower number. C<$acctnumber> is >-the account that was credited. C<$amount> is the amount paid (this is >-only used to record the payment. It is assumed to be equal to the >-amount owed). C<$branchcode> is the code of the branch where payment >-was made. >- >-=cut >- >-#' >-# FIXME - I'm not at all sure about the above, because I don't >-# understand what the acct* tables in the Koha database are for. >-sub makepayment { >- >- #here we update both the accountoffsets and the account lines >- #updated to check, if they are paying off a lost item, we return the item >- # from their card, and put a note on the item record >- my ( $accountlines_id, $borrowernumber, $accountno, $amount, $user, $branch, $payment_note ) = @_; >- my $dbh = C4::Context->dbh; >- my $manager_id = 0; >- $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; >- >- # begin transaction >- my $nextaccntno = getnextacctno($borrowernumber); >- my $newamtos = 0; >- my $sth = $dbh->prepare("SELECT * FROM accountlines WHERE accountlines_id=?"); >- $sth->execute( $accountlines_id ); >- my $data = $sth->fetchrow_hashref; >- >- my $payment; >- if ( $data->{'accounttype'} eq "Pay" ){ >- my $udp = >- $dbh->prepare( >- "UPDATE accountlines >- SET amountoutstanding = 0 >- WHERE accountlines_id = ? >- " >- ); >- $udp->execute($accountlines_id); >- }else{ >- my $udp = >- $dbh->prepare( >- "UPDATE accountlines >- SET amountoutstanding = 0 >- WHERE accountlines_id = ? >- " >- ); >- $udp->execute($accountlines_id); >- >- # create new line >- my $payment = 0 - $amount; >- $payment_note //= ""; >- >- my $ins = >- $dbh->prepare( >- "INSERT >- INTO accountlines (borrowernumber, accountno, date, amount, itemnumber, description, accounttype, amountoutstanding, manager_id, note) >- VALUES ( ?, ?, now(), ?, ?, '', 'Pay', 0, ?, ?)" >- ); >- $ins->execute($borrowernumber, $nextaccntno, $payment, $data->{'itemnumber'}, $manager_id, $payment_note); >- } >- >- if ( C4::Context->preference("FinesLog") ) { >- logaction("FINES", 'MODIFY', $borrowernumber, Dumper({ >- action => 'fee_payment', >- borrowernumber => $borrowernumber, >- old_amountoutstanding => $data->{'amountoutstanding'}, >- new_amountoutstanding => 0, >- amount_paid => $data->{'amountoutstanding'}, >- accountlines_id => $data->{'accountlines_id'}, >- accountno => $data->{'accountno'}, >- manager_id => $manager_id, >- })); >- >- >- logaction("FINES", 'CREATE',$borrowernumber,Dumper({ >- action => 'create_payment', >- borrowernumber => $borrowernumber, >- accountno => $nextaccntno, >- amount => $payment, >- amountoutstanding => 0,, >- accounttype => 'Pay', >- accountlines_paid => [$data->{'accountlines_id'}], >- manager_id => $manager_id, >- })); >- } >- >- UpdateStats({ >- branch => $user, >- type => 'payment', >- amount => $amount, >- borrowernumber => $borrowernumber, >- accountno => $accountno} >- ); >- >- #check to see what accounttype >- if ( $data->{'accounttype'} eq 'Rep' || $data->{'accounttype'} eq 'L' ) { >- C4::Circulation::ReturnLostItem( $borrowernumber, $data->{'itemnumber'} ); >- } >- my $sthr = $dbh->prepare("SELECT max(accountlines_id) AS lastinsertid FROM accountlines"); >- $sthr->execute(); >- my $datalastinsertid = $sthr->fetchrow_hashref; >- return $datalastinsertid->{'lastinsertid'}; >-} >- >-=head2 getnextacctno >- >- $nextacct = &getnextacctno($borrowernumber); >- >-Returns the next unused account number for the patron with the given >-borrower number. >- >-=cut >- >-#' >-# FIXME - Okay, so what does the above actually _mean_? >-sub getnextacctno { >- my ($borrowernumber) = shift or return; >- my $sth = C4::Context->dbh->prepare( >- "SELECT accountno+1 FROM accountlines >- WHERE (borrowernumber = ?) >- ORDER BY accountno DESC >- LIMIT 1" >- ); >- $sth->execute($borrowernumber); >- return ($sth->fetchrow || 1); >-} >- >-=head2 fixaccounts (removed) >- >- &fixaccounts($accountlines_id, $borrowernumber, $accountnumber, $amount); >- >-#' >-# FIXME - I don't understand what this function does. >-sub fixaccounts { >- my ( $accountlines_id, $borrowernumber, $accountno, $amount ) = @_; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare( >- "SELECT * FROM accountlines WHERE accountlines_id=?" >- ); >- $sth->execute( $accountlines_id ); >- my $data = $sth->fetchrow_hashref; >- >- # FIXME - Error-checking >- my $diff = $amount - $data->{'amount'}; >- my $outstanding = $data->{'amountoutstanding'} + $diff; >- $sth->finish; >- >- $dbh->do(<<EOT); >- UPDATE accountlines >- SET amount = '$amount', >- amountoutstanding = '$outstanding' >- WHERE accountlines_id = $accountlines_id >-EOT >- # FIXME: exceedingly bad form. Use prepare with placholders ("?") in query and execute args. >-} >- >-=cut >- >-sub chargelostitem{ >-# lost ==1 Lost, lost==2 longoverdue, lost==3 lost and paid for >-# FIXME: itemlost should be set to 3 after payment is made, should be a warning to the interface that >-# a charge has been added >-# FIXME : if no replacement price, borrower just doesn't get charged? >- my $dbh = C4::Context->dbh(); >- my ($borrowernumber, $itemnumber, $amount, $description) = @_; >- >- # first make sure the borrower hasn't already been charged for this item >- my $sth1=$dbh->prepare("SELECT * from accountlines >- WHERE borrowernumber=? AND itemnumber=? and accounttype='L'"); >- $sth1->execute($borrowernumber,$itemnumber); >- my $existing_charge_hashref=$sth1->fetchrow_hashref(); >- >- # OK, they haven't >- unless ($existing_charge_hashref) { >- my $manager_id = 0; >- $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; >- # This item is on issue ... add replacement cost to the borrower's record and mark it returned >- # Note that we add this to the account even if there's no replacement price, allowing some other >- # process (or person) to update it, since we don't handle any defaults for replacement prices. >- my $accountno = getnextacctno($borrowernumber); >- my $sth2=$dbh->prepare("INSERT INTO accountlines >- (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber,manager_id) >- VALUES (?,?,now(),?,?,'L',?,?,?)"); >- $sth2->execute($borrowernumber,$accountno,$amount, >- $description,$amount,$itemnumber,$manager_id); >- >- if ( C4::Context->preference("FinesLog") ) { >- logaction("FINES", 'CREATE', $borrowernumber, Dumper({ >- action => 'create_fee', >- borrowernumber => $borrowernumber, >- accountno => $accountno, >- amount => $amount, >- amountoutstanding => $amount, >- description => $description, >- accounttype => 'L', >- itemnumber => $itemnumber, >- manager_id => $manager_id, >- })); >- } >- >- } >-} >- >-=head2 manualinvoice >- >- &manualinvoice($borrowernumber, $itemnumber, $description, $type, >- $amount, $note); >- >-C<$borrowernumber> is the patron's borrower number. >-C<$description> is a description of the transaction. >-C<$type> may be one of C<CS>, C<CB>, C<CW>, C<CF>, C<CL>, C<N>, C<L>, >-or C<REF>. >-C<$itemnumber> is the item involved, if pertinent; otherwise, it >-should be the empty string. >- >-=cut >- >-#' >-# FIXME: In Koha 3.0 , the only account adjustment 'types' passed to this function >-# are : >-# 'C' = CREDIT >-# 'FOR' = FORGIVEN (Formerly 'F', but 'F' is taken to mean 'FINE' elsewhere) >-# 'N' = New Card fee >-# 'F' = Fine >-# 'A' = Account Management fee >-# 'M' = Sundry >-# 'L' = Lost Item >-# >- >-sub manualinvoice { >- my ( $borrowernumber, $itemnum, $desc, $type, $amount, $note ) = @_; >- my $manager_id = 0; >- $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; >- my $dbh = C4::Context->dbh; >- my $notifyid = 0; >- my $insert; >- my $accountno = getnextacctno($borrowernumber); >- my $amountleft = $amount; >- >- if ( ( $type eq 'L' ) >- or ( $type eq 'F' ) >- or ( $type eq 'A' ) >- or ( $type eq 'N' ) >- or ( $type eq 'M' ) ) >- { >- $notifyid = 1; >- } >- >- if ( $itemnum ) { >- $desc .= ' ' . $itemnum; >- my $sth = $dbh->prepare( >- 'INSERT INTO accountlines >- (borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding, itemnumber,notify_id, note, manager_id) >- VALUES (?, ?, now(), ?,?, ?,?,?,?,?,?)'); >- $sth->execute($borrowernumber, $accountno, $amount, $desc, $type, $amountleft, $itemnum,$notifyid, $note, $manager_id) || return $sth->errstr; >- } else { >- my $sth=$dbh->prepare("INSERT INTO accountlines >- (borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding,notify_id, note, manager_id) >- VALUES (?, ?, now(), ?, ?, ?, ?,?,?,?)" >- ); >- $sth->execute( $borrowernumber, $accountno, $amount, $desc, $type, >- $amountleft, $notifyid, $note, $manager_id ); >- } >- >- if ( C4::Context->preference("FinesLog") ) { >- logaction("FINES", 'CREATE',$borrowernumber,Dumper({ >- action => 'create_fee', >- borrowernumber => $borrowernumber, >- accountno => $accountno, >- amount => $amount, >- description => $desc, >- accounttype => $type, >- amountoutstanding => $amountleft, >- notify_id => $notifyid, >- note => $note, >- itemnumber => $itemnum, >- manager_id => $manager_id, >- })); >- } >- >- return 0; >-} >- >-sub getcharges { >- my ( $borrowerno, $timestamp, $accountno ) = @_; >- my $dbh = C4::Context->dbh; >- my $timestamp2 = $timestamp - 1; >- my $query = ""; >- my $sth = $dbh->prepare( >- "SELECT * FROM accountlines WHERE borrowernumber=? AND accountno = ?" >- ); >- $sth->execute( $borrowerno, $accountno ); >- >- my @results; >- while ( my $data = $sth->fetchrow_hashref ) { >- push @results,$data; >- } >- return (@results); >-} >- >-sub ModNote { >- my ( $accountlines_id, $note ) = @_; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare('UPDATE accountlines SET note = ? WHERE accountlines_id = ?'); >- $sth->execute( $note, $accountlines_id ); >-} >- >-sub getcredits { >- my ( $date, $date2 ) = @_; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare( >- "SELECT * FROM accountlines,borrowers >- WHERE amount < 0 AND accounttype not like 'Pay%' AND accountlines.borrowernumber = borrowers.borrowernumber >- AND timestamp >=TIMESTAMP(?) AND timestamp < TIMESTAMP(?)" >- ); >- >- $sth->execute( $date, $date2 ); >- my @results; >- while ( my $data = $sth->fetchrow_hashref ) { >- $data->{'date'} = $data->{'timestamp'}; >- push @results,$data; >- } >- return (@results); >-} >- >- >-sub getrefunds { >- my ( $date, $date2 ) = @_; >- my $dbh = C4::Context->dbh; >- >- my $sth = $dbh->prepare( >- "SELECT *,timestamp AS datetime >- FROM accountlines,borrowers >- WHERE (accounttype = 'REF' >- AND accountlines.borrowernumber = borrowers.borrowernumber >- AND date >=? AND date <?)" >- ); >- >- $sth->execute( $date, $date2 ); >- >- my @results; >- while ( my $data = $sth->fetchrow_hashref ) { >- push @results,$data; >- >- } >- return (@results); >-} >- >-sub ReversePayment { >- my ( $accountlines_id ) = @_; >- my $dbh = C4::Context->dbh; >- >- my $sth = $dbh->prepare('SELECT * FROM accountlines WHERE accountlines_id = ?'); >- $sth->execute( $accountlines_id ); >- my $row = $sth->fetchrow_hashref(); >- my $amount_outstanding = $row->{'amountoutstanding'}; >- >- if ( $amount_outstanding <= 0 ) { >- $sth = $dbh->prepare('UPDATE accountlines SET amountoutstanding = amount * -1, description = CONCAT( description, " Reversed -" ) WHERE accountlines_id = ?'); >- $sth->execute( $accountlines_id ); >- } else { >- $sth = $dbh->prepare('UPDATE accountlines SET amountoutstanding = 0, description = CONCAT( description, " Reversed -" ) WHERE accountlines_id = ?'); >- $sth->execute( $accountlines_id ); >- } >- >- if ( C4::Context->preference("FinesLog") ) { >- my $manager_id = 0; >- $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; >- >- if ( $amount_outstanding <= 0 ) { >- $row->{'amountoutstanding'} *= -1; >- } else { >- $row->{'amountoutstanding'} = '0'; >- } >- $row->{'description'} .= ' Reversed -'; >- logaction("FINES", 'MODIFY', $row->{'borrowernumber'}, Dumper({ >- action => 'reverse_fee_payment', >- borrowernumber => $row->{'borrowernumber'}, >- old_amountoutstanding => $row->{'amountoutstanding'}, >- new_amountoutstanding => 0 - $amount_outstanding,, >- accountlines_id => $row->{'accountlines_id'}, >- accountno => $row->{'accountno'}, >- manager_id => $manager_id, >- })); >- >- } >- >-} >- >-=head2 recordpayment_selectaccts >- >- recordpayment_selectaccts($borrowernumber, $payment,$accts); >- >-Record payment by a patron. C<$borrowernumber> is the patron's >-borrower number. C<$payment> is a floating-point number, giving the >-amount that was paid. C<$accts> is an array ref to a list of >-accountnos which the payment can be recorded against >- >-Amounts owed are paid off oldest first. That is, if the patron has a >-$1 fine from Feb. 1, another $1 fine from Mar. 1, and makes a payment >-of $1.50, then the oldest fine will be paid off in full, and $0.50 >-will be credited to the next one. >- >-=cut >- >-sub recordpayment_selectaccts { >- my ( $borrowernumber, $amount, $accts, $note ) = @_; >- >- my $dbh = C4::Context->dbh; >- my $newamtos = 0; >- my $accdata = q{}; >- my $branch = C4::Context->userenv->{branch}; >- my $amountleft = $amount; >- my $manager_id = 0; >- $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; >- my $sql = 'SELECT * FROM accountlines WHERE (borrowernumber = ?) ' . >- 'AND (amountoutstanding<>0) '; >- if (@{$accts} ) { >- $sql .= ' AND accountno IN ( ' . join ',', @{$accts}; >- $sql .= ' ) '; >- } >- $sql .= ' ORDER BY date'; >- # begin transaction >- my $nextaccntno = getnextacctno($borrowernumber); >- >- # get lines with outstanding amounts to offset >- my $rows = $dbh->selectall_arrayref($sql, { Slice => {} }, $borrowernumber); >- >- # offset transactions >- my $sth = $dbh->prepare('UPDATE accountlines SET amountoutstanding= ? ' . >- 'WHERE accountlines_id=?'); >- >- my @ids; >- for my $accdata ( @{$rows} ) { >- if ($amountleft == 0) { >- last; >- } >- if ( $accdata->{amountoutstanding} < $amountleft ) { >- $newamtos = 0; >- $amountleft -= $accdata->{amountoutstanding}; >- } >- else { >- $newamtos = $accdata->{amountoutstanding} - $amountleft; >- $amountleft = 0; >- } >- my $thisacct = $accdata->{accountlines_id}; >- $sth->execute( $newamtos, $thisacct ); >- >- if ( C4::Context->preference("FinesLog") ) { >- logaction("FINES", 'MODIFY', $borrowernumber, Dumper({ >- action => 'fee_payment', >- borrowernumber => $borrowernumber, >- old_amountoutstanding => $accdata->{'amountoutstanding'}, >- new_amountoutstanding => $newamtos, >- amount_paid => $accdata->{'amountoutstanding'} - $newamtos, >- accountlines_id => $accdata->{'accountlines_id'}, >- accountno => $accdata->{'accountno'}, >- manager_id => $manager_id, >- })); >- push( @ids, $accdata->{'accountlines_id'} ); >- } >- >- } >- >- # create new line >- $sql = 'INSERT INTO accountlines ' . >- '(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id,note) ' . >- q|VALUES (?,?,now(),?,'','Pay',?,?,?)|; >- $dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id, $note ); >- UpdateStats({ >- branch => $branch, >- type => 'payment', >- amount => $amount, >- borrowernumber => $borrowernumber, >- accountno => $nextaccntno} >- ); >- >- if ( C4::Context->preference("FinesLog") ) { >- logaction("FINES", 'CREATE',$borrowernumber,Dumper({ >- action => 'create_payment', >- borrowernumber => $borrowernumber, >- accountno => $nextaccntno, >- amount => 0 - $amount, >- amountoutstanding => 0 - $amountleft, >- accounttype => 'Pay', >- accountlines_paid => \@ids, >- manager_id => $manager_id, >- })); >- } >- >- return; >-} >- >-# makepayment needs to be fixed to handle partials till then this separate subroutine >-# fills in >-sub makepartialpayment { >- my ( $accountlines_id, $borrowernumber, $accountno, $amount, $user, $branch, $payment_note ) = @_; >- my $manager_id = 0; >- $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; >- if (!$amount || $amount < 0) { >- return; >- } >- $payment_note //= ""; >- my $dbh = C4::Context->dbh; >- >- my $nextaccntno = getnextacctno($borrowernumber); >- my $newamtos = 0; >- >- my $data = $dbh->selectrow_hashref( >- 'SELECT * FROM accountlines WHERE accountlines_id=?',undef,$accountlines_id); >- my $new_outstanding = $data->{amountoutstanding} - $amount; >- >- my $update = 'UPDATE accountlines SET amountoutstanding = ? WHERE accountlines_id = ? '; >- $dbh->do( $update, undef, $new_outstanding, $accountlines_id); >- >- if ( C4::Context->preference("FinesLog") ) { >- logaction("FINES", 'MODIFY', $borrowernumber, Dumper({ >- action => 'fee_payment', >- borrowernumber => $borrowernumber, >- old_amountoutstanding => $data->{'amountoutstanding'}, >- new_amountoutstanding => $new_outstanding, >- amount_paid => $data->{'amountoutstanding'} - $new_outstanding, >- accountlines_id => $data->{'accountlines_id'}, >- accountno => $data->{'accountno'}, >- manager_id => $manager_id, >- })); >- } >- >- # create new line >- my $insert = 'INSERT INTO accountlines (borrowernumber, accountno, date, amount, ' >- . 'description, accounttype, amountoutstanding, itemnumber, manager_id, note) ' >- . ' VALUES (?, ?, now(), ?, ?, ?, 0, ?, ?, ?)'; >- >- $dbh->do( $insert, undef, $borrowernumber, $nextaccntno, $amount, >- '', 'Pay', $data->{'itemnumber'}, $manager_id, $payment_note); >- >- UpdateStats({ >- branch => $user, >- type => 'payment', >- amount => $amount, >- borrowernumber => $borrowernumber, >- accountno => $accountno} >- ); >- >- if ( C4::Context->preference("FinesLog") ) { >- logaction("FINES", 'CREATE',$borrowernumber,Dumper({ >- action => 'create_payment', >- borrowernumber => $user, >- accountno => $nextaccntno, >- amount => 0 - $amount, >- accounttype => 'Pay', >- itemnumber => $data->{'itemnumber'}, >- accountlines_paid => [ $data->{'accountlines_id'} ], >- manager_id => $manager_id, >- })); >- } >- >- return; >-} >- >-=head2 WriteOffFee >- >- WriteOffFee( $borrowernumber, $accountline_id, $itemnum, $accounttype, $amount, $branch, $payment_note ); >- >-Write off a fine for a patron. >-C<$borrowernumber> is the patron's borrower number. >-C<$accountline_id> is the accountline_id of the fee to write off. >-C<$itemnum> is the itemnumber of of item whose fine is being written off. >-C<$accounttype> is the account type of the fine being written off. >-C<$amount> is a floating-point number, giving the amount that is being written off. >-C<$branch> is the branchcode of the library where the writeoff occurred. >-C<$payment_note> is the note to attach to this payment >- >-=cut >- >-sub WriteOffFee { >- my ( $borrowernumber, $accountlines_id, $itemnum, $accounttype, $amount, $branch, $payment_note ) = @_; >- $payment_note //= ""; >- $branch ||= C4::Context->userenv->{branch}; >- my $manager_id = 0; >- $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; >- >- # if no item is attached to fine, make sure to store it as a NULL >- $itemnum ||= undef; >- >- my ( $sth, $query ); >- my $dbh = C4::Context->dbh(); >- >- $query = " >- UPDATE accountlines SET amountoutstanding = 0 >- WHERE accountlines_id = ? AND borrowernumber = ? >- "; >- $sth = $dbh->prepare( $query ); >- $sth->execute( $accountlines_id, $borrowernumber ); >- >- if ( C4::Context->preference("FinesLog") ) { >- logaction("FINES", 'MODIFY', $borrowernumber, Dumper({ >- action => 'fee_writeoff', >- borrowernumber => $borrowernumber, >- accountlines_id => $accountlines_id, >- manager_id => $manager_id, >- })); >- } >- >- $query =" >- INSERT INTO accountlines >- ( borrowernumber, accountno, itemnumber, date, amount, description, accounttype, manager_id, note ) >- VALUES ( ?, ?, ?, NOW(), ?, 'Writeoff', 'W', ?, ? ) >- "; >- $sth = $dbh->prepare( $query ); >- my $acct = getnextacctno($borrowernumber); >- $sth->execute( $borrowernumber, $acct, $itemnum, $amount, $manager_id, $payment_note ); >- >- if ( C4::Context->preference("FinesLog") ) { >- logaction("FINES", 'CREATE',$borrowernumber,Dumper({ >- action => 'create_writeoff', >- borrowernumber => $borrowernumber, >- accountno => $acct, >- amount => 0 - $amount, >- accounttype => 'W', >- itemnumber => $itemnum, >- accountlines_paid => [ $accountlines_id ], >- manager_id => $manager_id, >- })); >- } >- >- UpdateStats({ >- branch => $branch, >- type => 'writeoff', >- amount => $amount, >- borrowernumber => $borrowernumber} >- ); >- >-} >- >-END { } # module clean-up code here (global destructor) >- >-1; >-__END__ >- >-=head1 SEE ALSO >- >-DBI(3) >- >-=cut >- >diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm >deleted file mode 100644 >index e83ef40..0000000 >--- a/Koha/Schema/Result/Accountline.pm >+++ /dev/null >@@ -1,222 +0,0 @@ >-use utf8; >-package Koha::Schema::Result::Accountline; >- >-# Created by DBIx::Class::Schema::Loader >-# DO NOT MODIFY THE FIRST PART OF THIS FILE >- >-=head1 NAME >- >-Koha::Schema::Result::Accountline >- >-=cut >- >-use strict; >-use warnings; >- >-use base 'DBIx::Class::Core'; >- >-=head1 TABLE: C<accountlines> >- >-=cut >- >-__PACKAGE__->table("accountlines"); >- >-=head1 ACCESSORS >- >-=head2 accountlines_id >- >- data_type: 'integer' >- is_auto_increment: 1 >- is_nullable: 0 >- >-=head2 borrowernumber >- >- data_type: 'integer' >- default_value: 0 >- is_foreign_key: 1 >- is_nullable: 0 >- >-=head2 accountno >- >- data_type: 'smallint' >- default_value: 0 >- is_nullable: 0 >- >-=head2 itemnumber >- >- data_type: 'integer' >- is_foreign_key: 1 >- is_nullable: 1 >- >-=head2 date >- >- data_type: 'date' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >- >-=head2 amount >- >- data_type: 'decimal' >- is_nullable: 1 >- size: [28,6] >- >-=head2 description >- >- data_type: 'mediumtext' >- is_nullable: 1 >- >-=head2 dispute >- >- data_type: 'mediumtext' >- is_nullable: 1 >- >-=head2 accounttype >- >- data_type: 'varchar' >- is_nullable: 1 >- size: 5 >- >-=head2 amountoutstanding >- >- data_type: 'decimal' >- is_nullable: 1 >- size: [28,6] >- >-=head2 lastincrement >- >- data_type: 'decimal' >- is_nullable: 1 >- size: [28,6] >- >-=head2 timestamp >- >- data_type: 'timestamp' >- datetime_undef_if_invalid: 1 >- default_value: current_timestamp >- is_nullable: 0 >- >-=head2 notify_id >- >- data_type: 'integer' >- default_value: 0 >- is_nullable: 0 >- >-=head2 notify_level >- >- data_type: 'integer' >- default_value: 0 >- is_nullable: 0 >- >-=head2 note >- >- data_type: 'text' >- is_nullable: 1 >- >-=head2 manager_id >- >- data_type: 'integer' >- is_nullable: 1 >- >-=cut >- >-__PACKAGE__->add_columns( >- "accountlines_id", >- { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, >- "borrowernumber", >- { >- data_type => "integer", >- default_value => 0, >- is_foreign_key => 1, >- is_nullable => 0, >- }, >- "accountno", >- { data_type => "smallint", default_value => 0, is_nullable => 0 }, >- "itemnumber", >- { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, >- "date", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >- "amount", >- { data_type => "decimal", is_nullable => 1, size => [28, 6] }, >- "description", >- { data_type => "mediumtext", is_nullable => 1 }, >- "dispute", >- { data_type => "mediumtext", is_nullable => 1 }, >- "accounttype", >- { data_type => "varchar", is_nullable => 1, size => 5 }, >- "amountoutstanding", >- { data_type => "decimal", is_nullable => 1, size => [28, 6] }, >- "lastincrement", >- { data_type => "decimal", is_nullable => 1, size => [28, 6] }, >- "timestamp", >- { >- data_type => "timestamp", >- datetime_undef_if_invalid => 1, >- default_value => \"current_timestamp", >- is_nullable => 0, >- }, >- "notify_id", >- { data_type => "integer", default_value => 0, is_nullable => 0 }, >- "notify_level", >- { data_type => "integer", default_value => 0, is_nullable => 0 }, >- "note", >- { data_type => "text", is_nullable => 1 }, >- "manager_id", >- { data_type => "integer", is_nullable => 1 }, >-); >- >-=head1 PRIMARY KEY >- >-=over 4 >- >-=item * L</accountlines_id> >- >-=back >- >-=cut >- >-__PACKAGE__->set_primary_key("accountlines_id"); >- >-=head1 RELATIONS >- >-=head2 borrowernumber >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Borrower> >- >-=cut >- >-__PACKAGE__->belongs_to( >- "borrowernumber", >- "Koha::Schema::Result::Borrower", >- { borrowernumber => "borrowernumber" }, >- { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >-); >- >-=head2 itemnumber >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Item> >- >-=cut >- >-__PACKAGE__->belongs_to( >- "itemnumber", >- "Koha::Schema::Result::Item", >- { itemnumber => "itemnumber" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "SET NULL", >- on_update => "SET NULL", >- }, >-); >- >- >-# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jUiCeLLPg5228rNEBW0w2g >- >- >-# You can replace this text with custom content, and it will be preserved on regeneration >-1; >diff --git a/Koha/Schema/Result/Accountoffset.pm b/Koha/Schema/Result/Accountoffset.pm >deleted file mode 100644 >index e9d8c2f..0000000 >--- a/Koha/Schema/Result/Accountoffset.pm >+++ /dev/null >@@ -1,106 +0,0 @@ >-use utf8; >-package Koha::Schema::Result::Accountoffset; >- >-# Created by DBIx::Class::Schema::Loader >-# DO NOT MODIFY THE FIRST PART OF THIS FILE >- >-=head1 NAME >- >-Koha::Schema::Result::Accountoffset >- >-=cut >- >-use strict; >-use warnings; >- >-use base 'DBIx::Class::Core'; >- >-=head1 TABLE: C<accountoffsets> >- >-=cut >- >-__PACKAGE__->table("accountoffsets"); >- >-=head1 ACCESSORS >- >-=head2 borrowernumber >- >- data_type: 'integer' >- default_value: 0 >- is_foreign_key: 1 >- is_nullable: 0 >- >-=head2 accountno >- >- data_type: 'smallint' >- default_value: 0 >- is_nullable: 0 >- >-=head2 offsetaccount >- >- data_type: 'smallint' >- default_value: 0 >- is_nullable: 0 >- >-=head2 offsetamount >- >- data_type: 'decimal' >- is_nullable: 1 >- size: [28,6] >- >-=head2 timestamp >- >- data_type: 'timestamp' >- datetime_undef_if_invalid: 1 >- default_value: current_timestamp >- is_nullable: 0 >- >-=cut >- >-__PACKAGE__->add_columns( >- "borrowernumber", >- { >- data_type => "integer", >- default_value => 0, >- is_foreign_key => 1, >- is_nullable => 0, >- }, >- "accountno", >- { data_type => "smallint", default_value => 0, is_nullable => 0 }, >- "offsetaccount", >- { data_type => "smallint", default_value => 0, is_nullable => 0 }, >- "offsetamount", >- { data_type => "decimal", is_nullable => 1, size => [28, 6] }, >- "timestamp", >- { >- data_type => "timestamp", >- datetime_undef_if_invalid => 1, >- default_value => \"current_timestamp", >- is_nullable => 0, >- }, >-); >- >-=head1 RELATIONS >- >-=head2 borrowernumber >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Borrower> >- >-=cut >- >-__PACKAGE__->belongs_to( >- "borrowernumber", >- "Koha::Schema::Result::Borrower", >- { borrowernumber => "borrowernumber" }, >- { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >-); >- >- >-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OTfcUiJCPb5aU/gjqAb/bA >- >- >-# You can replace this text with custom content, and it will be preserved on regeneration >-1; >diff --git a/circ/stats.pl b/circ/stats.pl >deleted file mode 100755 >index f41ea6e..0000000 >--- a/circ/stats.pl >+++ /dev/null >@@ -1,189 +0,0 @@ >-#!/usr/bin/perl >- >- >-#written 14/1/2000 >-#script to display reports >- >-# Copyright 2000-2002 Katipo Communications >-# >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it >-# under the terms of the GNU General Public License as published by >-# the Free Software Foundation; either version 3 of the License, or >-# (at your option) any later version. >-# >-# Koha is distributed in the hope that it will be useful, but >-# WITHOUT ANY WARRANTY; without even the implied warranty of >-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >-# GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License >-# along with Koha; if not, see <http://www.gnu.org/licenses>. >- >-use strict; >-#use warnings; FIXME - Bug 2505 >-use CGI qw ( -utf8 ); >-use C4::Context; >-use C4::Output; >-use C4::Auth; >-use Date::Manip; >-use C4::Stats; >-use C4::Debug; >- >-use vars qw($debug); >- >-my $input = new CGI; >-my $time = $input->param('time') || ''; >- >-my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >- { >- template_name => "circ/stats.tt", >- query => $input, >- type => "intranet", >- authnotrequired => 0, >- flagsrequired => { reports => 1 }, >- debug => 1, >- } >-); >- >-my $date; >-my $date2; >-if ( $time eq 'yesterday' ) { >- $date = ParseDate('yesterday'); >- $date2 = ParseDate('today'); >-} >-elsif ( $time eq 'today' ) { >- $date = ParseDate('today'); >- $date2 = ParseDate('tomorrow'); >-} >-elsif ( $time eq 'daybefore' ) { >- $date = ParseDate('2 days ago'); >- $date2 = ParseDate('yesterday'); >-} >-elsif ( $time eq 'month' ) { >- $date = ParseDate('1 month ago'); >- $date2 = ParseDate('today'); >-} >-elsif ( $time =~ /\// ) { >- $date = ParseDate($time); >- $date2 = ParseDateDelta('+ 1 day'); >- $date2 = DateCalc( $date, $date2 ); >-} else { >- $template->param(notime => '1'); # TODO: add error feedback if time sent, but unrecognized >- output_html_with_http_headers $input, $cookie, $template->output; >- exit; >-} >- >-$debug and warn "d : $date // d2 : $date2"; >-$date = UnixDate( $date, '%Y-%m-%d' ); >-$date2 = UnixDate( $date2, '%Y-%m-%d' ); >-$debug and warn "d : $date // d2 : $date2"; >-my @payments = TotalPaid( $date, $date2 ); >-my $count = @payments; >-my $total = 0; >-my $totalw = 0; >-my $oldtime; >-my @loop; >-my %row; >-my $i = 0; >- >-while ( $i < $count ) { >- $debug and warn " pay : " . $payments[$i]{'timestamp'}; >- my $time = $payments[$i]{'datetime'}; >- my $payments = $payments[$i]{'value'}; >- my $charge = 0; >- my @temp = split(/ /, $payments[$i]{'datetime'}); >- my $date = $temp[0]; >- my @charges = >- getcharges( $payments[$i]{'borrowernumber'}, $payments[$i]{'timestamp'} ); >- my $count = @charges; >- my $temptotalf = 0; >- my $temptotalr = 0; >- my $temptotalres = 0; >- my $temptotalren = 0; >- my $temptotalw = 0; >- >- # FIXME: way too much logic to live only here in a report script >- for ( my $i2 = 0 ; $i2 < $count ; $i2++ ) { >- $charge += $charges[$i2]->{'amount'}; >- %row = ( >- name => $charges[$i2]->{'description'}, >- type => $charges[$i2]->{'accounttype'}, >- time => $charges[$i2]->{'timestamp'}, >- amount => $charges[$i2]->{'amount'}, >- branch => $charges[$i2]->{'amountoutstanding'} >- ); >- push( @loop, \%row ); >- if ( $payments[$i]{'accountytpe'} ne 'W' ) { >- if ( $charges[$i2]->{'accounttype'} eq 'Rent' ) { >- $temptotalr += >- $charges[$i2]->{'amount'} - >- $charges[$i2]->{'amountoutstanding'}; >- } >- if ( $charges[$i2]->{'accounttype'} eq 'F' >- || $charges[$i2]->{'accounttype'} eq 'FU' >- || $charges[$i2]->{'accounttype'} eq 'FN' ) >- { >- $temptotalf += >- $charges[$i2]->{'amount'} - >- $charges[$i2]->{'amountoutstanding'}; >- } >- if ( $charges[$i2]->{'accounttype'} eq 'Res' ) { >- $temptotalres += >- $charges[$i2]->{'amount'} - >- $charges[$i2]->{'amountoutstanding'}; >- } >- if ( $charges[$i2]->{'accounttype'} eq 'R' ) { >- $temptotalren += >- $charges[$i2]->{'amount'} - >- $charges[$i2]->{'amountoutstanding'}; >- } >- } >- } >- my $time2 = $payments[$i]{'date'}; >- my $branch = Getpaidbranch( $time2, $payments[$i]{'borrowernumber'} ); >- my $borrowernumber = $payments[$i]{'borrowernumber'}; >- my $oldtime = $payments[$i]{'timestamp'}; >- my $oldtype = $payments[$i]{'accounttype'}; >- >- while ($borrowernumber eq $payments[$i]{'borrowernumber'} >- && $oldtype == $payments[$i]{'accounttype'} >- && $oldtime eq $payments[$i]{'timestamp'} ) >- { >- my $xtime2 = $payments[$i]{'date'}; >- my $branch = Getpaidbranch( $xtime2, $payments[$i]{'borrowernumber'} ); >- if ( $payments[$i]{'accounttype'} eq 'W' ) { >- $totalw += $payments[$i]{'amount'}; >- } >- else { >- $payments[$i]{'amount'} = $payments[$i]{'amount'} * -1; >- $total += $payments[$i]{'amount'}; >- } >- >- #FIXME: display layer HTML >- %row = ( >- name => "<b>" >- . $payments[$i]{'firstname'} >- . $payments[$i]{'surname'} . "</b>", >- type => $payments[$i]{'accounttype'}, >- time => $payments[$i]{'date'}, >- amount => $payments[$i]{'amount'}, >- branch => $branch >- ); >- push( @loop, \%row ); >- $oldtype = $payments[$i]{'accounttype'}; >- $oldtime = $payments[$i]{'timestamp'}; >- $borrowernumber = $payments[$i]{'borrowernumber'}; >- $i++; >- } >-} >- >-$template->param( >- loop1 => \@loop, >- totalw => $totalw, >- total => $total >-); >- >-output_html_with_http_headers $input, $cookie, $template->output; >- >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/stats.tt >deleted file mode 100644 >index d62c1af..0000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/stats.tt >+++ /dev/null >@@ -1,55 +0,0 @@ >-[% INCLUDE 'doc-head-open.inc' %] >-<title>Koha › Circulation › Statistics</title> >-[% INCLUDE 'doc-head-close.inc' %] >-</head> >-<body id="circ_stats" class="circ"> >-[% INCLUDE 'header.inc' %] >-[% INCLUDE 'circ-search.inc' %] >- >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> › Statistics</div> >- >-<div id="doc3" class="yui-t2"> >- >- <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >- >- [% IF ( notime ) %] >- <h1>Display statistics for:</h1> >- <ul> >- <li><a href="/cgi-bin/koha/circ/stats.pl?time=yesterday">yesterday</a></li> >- <li><a href="/cgi-bin/koha/circ/stats.pl?time=today">today</a></li> >- [% ELSE %] >- [% IF ( loop1 ) %] >- <table> >- <caption>Statistics</caption> >- <tr> >- <th>Name</th> >- <th>Type</th> >- <th>Date/time</th> >- <th>Amount</th> >- <th>Library</th> >- <tr> >- [% FOREACH loop IN loop1 %] >- <tr> >- <td>[% loop.name %]</td> >- <td>[% loop.type %]</td> >- <td>[% loop.time %]</td> >- <td>[% loop.amount %]</td> >- <td>[% loop.branch %]</td> >- </tr> >- [% END %] >- </table> >- <p>Total paid: [% total %]<br />Total written off: [% totalw %]</p> >- [% ELSE %] >- <h3>No statistics to report</h3> >- [% END %] >- >- [% END %] >-</div> >-</div> >-<div class="yui-b"> >-[% INCLUDE 'circ-menu.inc' %] >-</div> >-</div> >-[% INCLUDE 'intranet-bottom.inc' %] >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >deleted file mode 100644 >index e115c59..0000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ /dev/null >@@ -1,155 +0,0 @@ >-[% USE Koha %] >-[% USE KohaDates %] >-[% INCLUDE 'doc-head-open.inc' %] >-<title>Koha › Patrons › Account for [% INCLUDE 'patron-title.inc' %]</title> >-[% INCLUDE 'doc-head-close.inc' %] >-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >-[% INCLUDE 'datatables.inc' %] >-<script type="text/javascript"> >-$(document).ready(function() { >- var txtActivefilter = _("Filter paid transactions"); >- var txtInactivefilter = _("Show all transactions"); >- var table_account_fines = $("#table_account_fines").dataTable($.extend(true, {}, dataTablesDefaults, { >- "sPaginationType": "four_button", >- 'aaSorting': [[0, 'desc']], >- "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', >- "aoColumnDefs": [ >- { "sType": "title-string", "aTargets" : [ "title-string" ] } >- ] >- })); >- $("#filter_c").html('<p><a href="#" id="filter_transacs">'+txtActivefilter+'</a>'); >- $('#filter_transacs').click(function(e) { >- e.preventDefault(); >- if ($(this).hasClass('filtered')) { >- var filteredValue = ''; >- $(this).text(txtActivefilter); >- } else { //Not filtered. Let's do it! >- var filteredValue = '^((?!0.00).*)$'; //Filter not matching 0.00 http://stackoverflow.com/a/406408 >- $(this).text(txtInactivefilter); >- } >- table_account_fines.fnFilter(filteredValue, 4, true, false); >- $(this).toggleClass('filtered'); >- }); >-}); >-</script> >-</head> >-<body id="pat_borraccount" class="pat"> >-[% INCLUDE 'header.inc' %] >-[% INCLUDE 'patron-search.inc' %] >- >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Account for [% INCLUDE 'patron-title.inc' %]</div> >- >-<div id="doc3" class="yui-t2"> >- >- <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >-[% INCLUDE 'members-toolbar.inc' %] >-<form action="/cgi-bin/koha/members/boraccount.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /></form> >- >-<!-- The manual invoice and credit buttons --> >-<div class="statictabs"> >-<ul> >- <li class="active"><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Account</a></li> >- <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]" >Pay fines</a></li> >- <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrowernumber %]" >Create manual invoice</a></li> >- <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrowernumber %]" >Create manual credit</a></li> >-</ul> >-<div class="tabs-container"> >-<!-- The table with the account items --> >-<table id="table_account_fines"> >- <thead> >- <tr> >- <th class="title-string">Date</th> >- <th>Description of charges</th> >- <th>Note</th> >- <th>Amount</th> >- <th>Outstanding</th> >- [% IF ( reverse_col ) %] >- <th> </th> >- [% END %] >- <th>Print</th> >- </tr> >- </thead> >- >- <!-- FIXME: Shouldn't hardcode dollar signs, since Euro or Pound might be needed --> >- [% FOREACH account IN accounts %] >- >- [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %] >- <td><span title="[% account.date %]">[% account.date |$KohaDates %]</span></td> >- <td> >- [% SWITCH account.accounttype %] >- [% CASE 'Pay' %]Payment, thanks >- [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) >- [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) >- [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) >- [% CASE 'N' %]New card >- [% CASE 'F' %]Fine >- [% CASE 'A' %]Account management fee >- [% CASE 'M' %]Sundry >- [% CASE 'L' %]Lost item >- [% CASE 'W' %]Writeoff >- [% CASE 'FU' %]Accruing fine >- [% CASE 'Rent' %]Rental fee >- [% CASE 'FOR' %]Forgiven >- [% CASE 'LR' %]Lost item fee refund >- [% CASE 'PAY' %]Payment >- [% CASE 'WO' %]Writeoff >- [% CASE 'C' %]Credit >- [% CASE 'CR' %]Credit >- [% CASE %][% account.accounttype %] >- [%- END -%] >- [%- IF account.description %], [% account.description %][% END %] >- [% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&itemnumber=[% account.itemnumber %]">View item</a> [% END %][% account.title |html %]</td> >- <td>[% account.note | html_line_break %]</td> >- [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount %]</td> >- [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding %]</td> >- [% IF ( reverse_col ) %] >- <td> >- [% IF ( account.payment ) %] >- <a href="boraccount.pl?action=reverse&accountlines_id=[% account.accountlines_id %]&borrowernumber=[% account.borrowernumber %]">Reverse</a> >- [% ELSE %] >- >- [% END %] >- </td> >- [% END %] >-<td> >- [% IF ( account.payment ) %] >- <a target="_blank" href="printfeercpt.pl?action=print&accountlines_id=[% account.accountlines_id %]&borrowernumber=[% account.borrowernumber %]">Print</a> >- [% ELSE %] >- <a target="_blank" href="printinvoice.pl?action=print&accountlines_id=[% account.accountlines_id %]&borrowernumber=[% account.borrowernumber %]">Print</a> >- [% END %] >- </td> >- </tr> >- >- [% END %] >-<tfoot> >- <tr> >- <td colspan="4">Total due</td> >- [% IF ( totalcredit ) %] >- [% IF ( reverse_col ) %] >- <td colspan="3" class="credit"> >- [% ELSE %] >- <td colspan="2" class="credit"> >- [% END %] >- [% ELSE %] >- [% IF ( reverse_col ) %] >- <td colspan="3" class="debit"> >- [% ELSE %] >- <td colspan="2" class="credit"> >- [% END %] >- [% END %] >- [% total %]</td> >- </tr> >- </tfoot> >-</table> >-</div></div> >- >-</div> >-</div> >- >-<div class="yui-b"> >-[% INCLUDE 'circ-menu.inc' %] >-</div> >-</div> >-[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >deleted file mode 100644 >index 65a61a5..0000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >+++ /dev/null >@@ -1,64 +0,0 @@ >-[% USE Koha %] >-[% INCLUDE 'doc-head-open.inc' %] >-<title>Koha › Patrons › Create manual credit</title> >-[% INCLUDE 'doc-head-close.inc' %] >-<script type="text/javascript"> >-//<![CDATA[ >-$(document).ready(function(){ >- $('#mancredit').preventDoubleFormSubmit(); >- $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); >-}); >-//]]> >-</script> >-</head> >-<body id="pat_mancredit" class="pat"> >-[% INCLUDE 'header.inc' %] >-[% INCLUDE 'patron-search.inc' %] >- >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Manual credit</div> >- >-<div id="doc3" class="yui-t2"> >- >- <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >-[% INCLUDE 'members-toolbar.inc' %] >- >-<!-- The manual invoice and credit buttons --> >-<div class="statictabs"> >-<ul> >- <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Account</a></li> >- <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]" >Pay fines</a></li> >- <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrowernumber %]" >Create manual invoice</a></li> >- <li class="active"><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrowernumber %]" >Create manual credit</a></li> >-</ul> >-<div class="tabs-container"> >- >-<form action="/cgi-bin/koha/members/mancredit.pl" method="post" id="mancredit"> >-<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /> >- >-<fieldset class="rows"> >-<legend>Manual credit</legend><ol> >- <li><label for="type">Credit type: </label><select name="type" id="type"> >-<option value="C">Credit</option> >-<option value="FOR">Forgiven</option> >-</select></li> >- <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li> >- <li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li> >- <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li> >- <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li> >-</ol></fieldset> >- >-<fieldset class="action"><input type="submit" name="add" value="Add credit" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset> >-</form> >- >-</div></div> >- >-</div> >-</div> >- >-<div class="yui-b"> >-[% INCLUDE 'circ-menu.inc' %] >-</div> >-</div> >-[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >deleted file mode 100644 >index 7d35c73..0000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >+++ /dev/null >@@ -1,88 +0,0 @@ >-[% USE Koha %] >-[% INCLUDE 'doc-head-open.inc' %] >-<title>Koha › Patrons › Create manual invoice</title> >-[% INCLUDE 'doc-head-close.inc' %] >-<script type="text/javascript"> >-//<![CDATA[ >-$(document).ready(function(){ >- $('#maninvoice').preventDoubleFormSubmit(); >- $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); >-}); >-//]]> >-</script> >-</head> >-<body id="pat_maninvoice" class="pat"> >-[% INCLUDE 'header.inc' %] >-[% INCLUDE 'patron-search.inc' %] >- >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Manual invoice</div> >- >-<div id="doc3" class="yui-t2"> >- >- <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >-[% INCLUDE 'members-toolbar.inc' %] >- >-<!-- The manual invoice and credit buttons --> >-<div class="statictabs"> >-<ul> >- <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Account</a></li> >- <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]" >Pay fines</a></li> >- <li class="active"><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrowernumber %]" >Create manual invoice</a></li> >- <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrowernumber %]" >Create manual credit</a></li> >-</ul> >-<div class="tabs-container"> >- >-[% IF ( ERROR ) %] >-[% IF ( ITEMNUMBER ) %] >- ERROR an invalid itemnumber was entered, please hit back and try again >-[% END %] >-[% ELSE %] >-<form action="/cgi-bin/koha/members/maninvoice.pl" method="post" id="maninvoice"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /> >- <fieldset class="rows"> >- <legend>Manual invoice</legend> >- <ol> >- <li> >-<script type="text/javascript"> >-var type_fees = new Array(); >-type_fees['L'] = ''; >-type_fees['F'] = ''; >-type_fees['A'] = ''; >-type_fees['N'] = ''; >-type_fees['M'] = ''; >-[% FOREACH invoice_types_loo IN invoice_types_loop %] >-type_fees['[% invoice_types_loo.authorised_value %]'] = "[% invoice_types_loo.lib %]"; >-[% END %] >-</script> >- <label for="type">Type: </label> >- <select name="type" id="type" onchange="this.form.desc.value=this.options[this.selectedIndex].value; this.form.amount.value=type_fees[this.options[this.selectedIndex].value];"> >- <option value="L">Lost item</option> >- <option value="F">Fine</option> >- <option value="A">Account management fee</option> >- <option value="N">New card</option> >- <option value="M">Sundry</option> >- [% FOREACH invoice_types_loo IN invoice_types_loop %] >- <option value="[% invoice_types_loo.authorised_value %]">[% invoice_types_loo.authorised_value %]</option> >- [% END %] >- </select> >- </li> >- <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li> >- <li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li> >- <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li> >- <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li> >- </ol></fieldset> >-<fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset> >-</form> >- >-[% END %] >-</div></div> >- >-</div> >-</div> >- >-<div class="yui-b"> >-[% INCLUDE 'circ-menu.inc' %] >-</div> >-</div> >-[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >deleted file mode 100644 >index 18b857c..0000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >+++ /dev/null >@@ -1,178 +0,0 @@ >-[% USE Koha %] >-[% INCLUDE 'doc-head-open.inc' %] >-<title>Koha › Patrons › Pay Fines for [% borrower.firstname %] [% borrower.surname %]</title> >-[% INCLUDE 'doc-head-close.inc' %] >-<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> >-<script type= "text/javascript"> >-//<![CDATA[ >-function enableCheckboxActions(){ >- // Enable/disable controls if checkboxes are checked >- var checkedBoxes = $("input.cb:checked"); >- if ($(checkedBoxes).size()) { >- $("#payselected").prop("disabled",false); >- } else { >- $("#payselected").prop("disabled",true); >- } >-} >- $(document).ready(function(){ >- $('#pay-fines-form').preventDoubleFormSubmit(); >- $("#woall").click(function(event){ >- var msg = _("Are you sure you want to write off %s in outstanding fines? This cannot be undone!").format( "[% total | format('%.2f') %]" ); >- var answer = confirm(msg); >- if (!answer){ >- event.preventDefault(); >- } >- }); >- $('#CheckAll').click(function(){ >- $("#finest").checkCheckboxes(); >- enableCheckboxActions(); >- return false; >- }); >- $('#CheckNone').click(function(){ >- $("#finest").unCheckCheckboxes(); >- enableCheckboxActions(); >- return false; >- }); >- $(".cb").change(function(){ >- enableCheckboxActions(); >- }); >- enableCheckboxActions(); >- }); >-//]]> >-</script> >-</head> >-<body id="pat_pay" class="pat"> >-[% INCLUDE 'header.inc' %] >-[% INCLUDE 'patron-search.inc' %] >- >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Pay fines for [% borrower.firstname %] [% borrower.surname %]</div> >- >-<div id="doc3" class="yui-t2"> >- >- <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >-[% INCLUDE 'members-toolbar.inc' borrowernumber=borrower.borrowernumber %] >- >-<!-- The manual invoice and credit buttons --> >-<div class="statictabs"> >-<ul> >- <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Account</a></li> >- <li class="active"><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]" >Pay fines</a></li> >- <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual invoice</a></li> >- <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual credit</a></li> >-</ul> >-<div class="tabs-container"> >- >-[% IF ( accounts ) %] >- <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form"> >- <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" /> >-<p><span class="checkall"><a id="CheckAll" href="#">Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></p> >-<table id="finest"> >-<thead> >-<tr> >- <th> </th> >- <th>Fines & charges</th> >- <th>Description</th> >- <th>Payment note</th> >- <th>Account type</th> >- <th>Notify id</th> >- <th>Level</th> >- <th>Amount</th> >- <th>Amount outstanding</th> >-</tr> >-</thead> >-<tfoot> >-<tr> >- <td class="total" colspan="8">Total due:</td> >- <td>[% total | format('%.2f') %]</td> >-</tr> >-</tfoot> >-<tbody> >-[% FOREACH account_grp IN accounts %] >- [% FOREACH line IN account_grp.accountlines %] >-<tr> >- <td> >- [% IF ( line.amountoutstanding > 0 ) %] >- <input class="cb" type="checkbox" checked="checked" name="incl_par_[% line.accountno %]" /> >- [% END %] >- </td> >- <td> >- [% IF ( line.amountoutstanding > 0 ) %] >- <input type="submit" name="pay_indiv_[% line.accountno %]" value="Pay" /> >- [% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="wo_indiv_[% line.accountno %]" value="Write off" />[% END %] >- [% END %] >- <input type="hidden" name="itemnumber[% line.accountno %]" value="[% line.itemnumber %]" /> >- <input type="hidden" name="description[% line.accountno %]" value="[% line.description %]" /> >- <input type="hidden" name="accounttype[% line.accountno %]" value="[% line.accounttype %]" /> >- <input type="hidden" name="amount[% line.accountno %]" value="[% line.amount %]" /> >- <input type="hidden" name="accountlines_id[% line.accountno %]" value="[% line.accountlines_id %]" /> >- <input type="hidden" name="amountoutstanding[% line.accountno %]" value="[% line.amountoutstanding %]" /> >- <input type="hidden" name="borrowernumber[% line.accountno %]" value="[% line.borrowernumber %]" /> >- <input type="hidden" name="accountno[% line.accountno %]" value="[% line.accountno %]" /> >- <input type="hidden" name="notify_id[% line.accountno %]" value="[% line.notify_id %]" /> >- <input type="hidden" name="notify_level[% line.accountno %]" value="[% line.notify_level %]" /> >- <input type="hidden" name="totals[% line.accountno %]" value="[% line.totals %]" /> >- </td> >- <td> >- [% SWITCH line.accounttype %] >- [% CASE 'Pay' %]Payment, thanks >- [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) >- [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) >- [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) >- [% CASE 'N' %]New card >- [% CASE 'F' %]Fine >- [% CASE 'A' %]Account management fee >- [% CASE 'M' %]Sundry >- [% CASE 'L' %]Lost item >- [% CASE 'W' %]Writeoff >- [% CASE 'FU' %]Accruing fine >- [% CASE 'Rent' %]Rental fee >- [% CASE 'FOR' %]Forgiven >- [% CASE 'LR' %]Lost item fee refund >- [% CASE 'PAY' %]Payment >- [% CASE 'WO' %]Writeoff >- [% CASE 'C' %]Credit >- [% CASE 'CR' %]Credit >- [% CASE %][% line.accounttype %] >- [%- END -%] >- [%- IF line.description %], [% line.description %][% END %] >- [% IF line.title %]([% line.title %])[% END %] >- </td> >- <td><input type="text" name="payment_note_[% line.accountno %]" /></td> >- <td>[% line.accounttype %]</td> >- <td>[% line.notify_id %]</td> >- <td>[% line.notify_level %]</td> >- <td class="debit">[% line.amount | format('%.2f') %]</td> >- <td class="debit">[% line.amountoutstanding | format('%.2f') %]</td> >-</tr> >-[% END %] >-[% IF ( account_grp.total ) %] >-<tr> >- >- <td class="total" colspan="8">Sub total:</td> >- <td>[% account_grp.total | format('%.2f') %]</td> >-</tr> >-[% END %] >-[% END %] >-</tbody> >-</table> >-<fieldset class="action"> >-<input type="submit" id="paycollect" name="paycollect" value="Pay amount" class="submit" /> >-[% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="woall" id="woall" value="Write off all" class="submit" />[% END %] >-<input type="submit" id="payselected" name="payselected" value="Pay selected" class="submit" /> >-<a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a> >-</fieldset> >-</form> >-[% ELSE %] >- <p>[% borrower.firstname %] [% borrower.surname %] has no outstanding fines.</p> >-[% END %] >-</div></div> >- >-</div> >-</div> >-<div class="yui-b"> >-[% INCLUDE 'circ-menu.inc' %] >-</div> >-</div> >-[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >deleted file mode 100644 >index cb6902c..0000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >+++ /dev/null >@@ -1,234 +0,0 @@ >-[% USE Koha %] >-[% INCLUDE 'doc-head-open.inc' %] >-<title>Koha › Patrons › Collect fine payment for [% borrower.firstname %] [% borrower.surname %]</title> >-[% INCLUDE 'doc-head-close.inc' %] >-<script type= "text/javascript"> >-//<![CDATA[ >-$(document).ready(function() { >- $('#payindivfine, #woindivfine, #payfine').preventDoubleFormSubmit(); >-}); >-//]]> >-</script> >-<script type= "text/javascript"> >-//<![CDATA[ >-function moneyFormat(textObj) { >- var newValue = textObj.value; >- var decAmount = ""; >- var dolAmount = ""; >- var decFlag = false; >- var aChar = ""; >- >- for(i=0; i < newValue.length; i++) { >- aChar = newValue.substring(i, i+1); >- if (aChar >= "0" && aChar <= "9") { >- if(decFlag) { >- decAmount = "" + decAmount + aChar; >- } >- else { >- dolAmount = "" + dolAmount + aChar; >- } >- } >- if (aChar == ".") { >- if (decFlag) { >- dolAmount = ""; >- break; >- } >- decFlag = true; >- } >- } >- >- if (dolAmount == "") { >- dolAmount = "0"; >- } >-// Strip leading 0s >- if (dolAmount.length > 1) { >- while(dolAmount.length > 1 && dolAmount.substring(0,1) == "0") { >- dolAmount = dolAmount.substring(1,dolAmount.length); >- } >- } >- if (decAmount.length > 2) { >- decAmount = decAmount.substring(0,2); >- } >-// Pad right side >- if (decAmount.length == 1) { >- decAmount = decAmount + "0"; >- } >- if (decAmount.length == 0) { >- decAmount = decAmount + "00"; >- } >- >- textObj.value = dolAmount + "." + decAmount; >-} >-//]]> >-</script> >-</head> >-<body id="pat_paycollect" class="pat"> >-[% INCLUDE 'header.inc' %] >-[% INCLUDE 'patron-search.inc' %] >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Pay fines for [% borrower.firstname %] [% borrower.surname %]</a> › [% IF ( pay_individual ) %]Pay an individual fine[% ELSIF ( writeoff_individual ) %]Write off an individual fine[% ELSE %][% IF ( selected_accts ) %]Pay an amount toward selected fines[% ELSE %]Pay an amount toward all fines[% END %][% END %]</div> >- >-<div id="doc3" class="yui-t2"> >- >-<div id="bd"> >-<div id="yui-main"> >-<div class="yui-b"> >-[% INCLUDE 'members-toolbar.inc' borrowernumber=borrower.borrowernumber %] >- >- >-<!-- The manual invoice and credit buttons --> >-<div class="statictabs"> >-<ul> >- <li> >- <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Account</a> >- </li> >- <li class="active"> >- <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]" >Pay fines</a> >- </li> >- <li> >- <a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual invoice</a> >- </li> >- <li> >- <a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual credit</a> >- </li> >-</ul> >-<div class="tabs-container"> >-[% IF ( error_over ) %] >- <div id="error_message" class="dialog alert"> >- You must pay a value less than or equal to [% total_due | format('%.2f') %]. >- </div> >-[% END %] >- >-[% IF ( pay_individual ) %] >- <form name="payindivfine" id="payindivfine" onsubmit="return validatePayment(this);" method="post" action="/cgi-bin/koha/members/paycollect.pl"> >- <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" /> >- <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual %]" /> >- <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" /> >- <input type="hidden" name="description" id="description" value="[% description %]" /> >- <input type="hidden" name="accounttype" id="accounttype" value="[% accounttype %]" /> >- <input type="hidden" name="notify_id" id="notify_id" value="[% notify_id %]" /> >- <input type="hidden" name="notify_level" id="notify_level" value="[% notify_level %]" /> >- <input type="hidden" name="amount" id="amount" value="[% amount %]" /> >- <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" /> >- <input type="hidden" name="accountno" id="accountno" value="[% accountno %]" /> >- <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" /> >- <input type="hidden" name="title" id="title" value="[% title %]" /> >- >-<fieldset class="rows"> >- <legend>Pay an individual fine</legend> >- <input type="hidden" name="payment_note" id="payment_note" value="[% payment_note %]" /> >- <table> >- <thead><tr> >- <th>Description</th> >- <th>Account type</th> >- <th>Notify id</th> >- <th>Level</th> >- <th>Amount</th> >- <th>Amount outstanding</th> >- </tr></thead> >- <tfoot> >- <td colspan="5">Total amount payable:</td><td>[% amountoutstanding | format('%.2f') %]</td> >- </tfoot> >- <tbody><tr> >- <td> >- [% description %] [% title %] >- </td> >- <td>[% accounttype %]</td> >- <td>[% notify_id %]</td> >- <td>[% notify_level %]</td> >- <td class="debit">[% amount | format('%.2f') %]</td> >- <td class="debit">[% amountoutstanding | format('%.2f') %]</td> >- </tr></tbody> >-</table> >- >-<ol> >- >- <li> >- <label for="paid">Collect from patron: </label> >- <!-- default to paying all --> >- <input name="paid" id="paid" value="[% amountoutstanding | format('%.2f') %]" onchange="moneyFormat(document.payindivfine.paid)"/> >- </li> >-</ol> >-</fieldset> >- >- <div class="action"><input type="submit" name="submitbutton" value="Confirm" /> >- <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a></div> >- </form> >-[% ELSIF ( writeoff_individual ) %] >- <form name="woindivfine" id="woindivfine" action="/cgi-bin/koha/members/pay.pl" method="post" > >- <fieldset class="rows"> >- <legend>Write off an individual fine</legend> >- <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" /> >- <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual %]" /> >- <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" /> >- <input type="hidden" name="description" id="description" value="[% description %]" /> >- <input type="hidden" name="accounttype" id="accounttype" value="[% accounttype %]" /> >- <input type="hidden" name="notify_id" id="notify_id" value="[% notify_id %]" /> >- <input type="hidden" name="notify_level" id="notify_level" value="[% notify_level %]" /> >- <input type="hidden" name="amount" id="amount" value="[% amount %]" /> >- <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" /> >- <input type="hidden" name="accountno" id="accountno" value="[% accountno %]" /> >- <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" /> >- <input type="hidden" name="title" id="title" value="[% title %]" /> >- <input type="hidden" name="payment_note" id="payment_note" value="[% payment_note %]" /> >- <table> >- <thead><tr> >- <th>Description</th> >- <th>Account type</th> >- <th>Notify id</th> >- <th>Level</th> >- <th>Amount</th> >- <th>Amount outstanding</th> >- </tr></thead> >- <tfoot><td colspan="5">Total amount to be written off:</td><td>[% amountoutstanding | format('%.2f') %]</td></tfoot> >- <tbody><tr> >- <td>[% description %] [% title %]</td> >- <td>[% accounttype %]</td> >- <td>[% notify_id %]</td> >- <td>[% notify_level %]</td> >- <td class="debit">[% amount | format('%.2f') %]</td> >- <td class="debit">[% amountoutstanding | format('%.2f') %]</td> >- </tr></tbody> >- </table> >- </fieldset> >- <div class="action"><input type="submit" name="confirm_writeoff" id="confirm_writeoff" value="Write off this charge" /> >- <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a></div> >- </form> >-[% ELSE %] >- >- <form name="payfine" id="payfine" onsubmit="return validatePayment(this);" method="post" action="/cgi-bin/koha/members/paycollect.pl"> >- <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" /> >- <input type="hidden" name="selected_accts" id="selected_accts" value="[% selected_accts %]" /> >- <input type="hidden" name="total" id="total" value="[% total %]" /> >- >- <fieldset class="rows"> >- [% IF ( selected_accts ) %]<legend>Pay an amount toward selected fines</legend>[% ELSE %]<legend>Pay an amount toward all fines</legend>[% END %] >- <ol> >- <li> >- <span class="label">Total amount outstanding: </span> >- <span class="debit">[% total | format('%.2f') %]</span> >- </li> >- <li> >- <label for="paid">Collect from patron: </label> >- <!-- default to paying all --> >- <input name="paid" id="paid" value="[% total | format('%.2f') %]" onchange="moneyFormat(document.payfine.paid)"/> >- </li> >- <li> >- <label for="selected_accts_notes">Note: </label> >- <textarea name="selected_accts_notes" id="selected_accts_notes">[% selected_accts_notes %]</textarea> >- </li> >- </ol> >- </fieldset> >- <div class="action"><input type="submit" name="submitbutton" value="Confirm" /> >- <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a></div> >- </form> >-[% END %] >-</div></div> >-</div> >-</div> >- >-<div class="yui-b"> >-[% INCLUDE 'circ-menu.inc' %] >-</div> >-</div> >-[% INCLUDE 'intranet-bottom.inc' %] >- >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt >deleted file mode 100644 >index 13a02e8..0000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt >+++ /dev/null >@@ -1,74 +0,0 @@ >-[% USE Koha %] >-[% INCLUDE 'doc-head-open.inc' %] >-<title>Print Receipt for [% cardnumber %]</title> >-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> >-<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" /> >-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/printreceiptinvoice.css" /> >-[% INCLUDE 'slip-print.inc' #printThenClose %] >-</head> >-<body id="pat_printfeercpt" class="pat" onload="printThenClose();"> >- >-<div id="receipt"> >-<!-- The table with the account items --> >-<table> >-[% IF ( LibraryName ) %] >- <tr> >- <th colspan=3 class="centerednames"> >- <h3>[% LibraryName %]</h3> >- </th> >- </tr> >-[% END %] >- <tr> >- <th colspan=3 class="centerednames"> >- <h2><u>Fee receipt</u></h2> >- </th> >- </tr> >- <tr> >- <th colspan=3 class="centerednames"> >- [% IF ( branchname ) %]<h2>[% branchname %]</h2>[% END %] >- </th> >- </tr> >- <tr> >- <th colspan=3 > >- Received with thanks from [% firstname %] [% surname %] <br /> >- Card number : [% cardnumber %]<br /> >- </th> >- </tr> >- <tr> >- <th>Date</th> >- <th>Description of charges</th> >- <th>Amount</th> >- </tr> >- >- [% FOREACH account IN accounts %] >-<tr class="highlight"> >- <td>[% account.date %]</td> >- <td> >- [% SWITCH account.accounttype %] >- [% CASE 'Pay' %]Payment, thanks >- [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) >- [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) >- [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) >- [% CASE 'N' %]New Card >- [% CASE 'F' %]Fine >- [% CASE 'A' %]Account management fee >- [% CASE 'M' %]Sundry >- [% CASE 'L' %]Lost Item >- [% CASE 'W' %]Writeoff >- [% CASE %][% account.accounttype %] >- [%- END -%] >- [%- IF account.description %], [% account.description %][% END %] >- </td> >- [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount %]</td> >- </tr> >- >- [% END %] >-<tfoot> >- <tr> >- <td colspan="2">Total outstanding dues as on date : </td> >- [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total %]</td> >- </tr> >- </tfoot> >-</table> >-</div> >-[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt >deleted file mode 100644 >index d5899d1..0000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt >+++ /dev/null >@@ -1,76 +0,0 @@ >-[% USE Koha %] >-[% INCLUDE 'doc-head-open.inc' %] >-<title>Print Receipt for [% cardnumber %]</title> >-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> >-<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" /> >-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/printreceiptinvoice.css" /> >-[% INCLUDE 'slip-print.inc' #printThenClose %] >-</head> >-<body id="printinvoice" class="pat" onload="printThenClose();"> >- >-<div id="receipt"> >-<!-- The table with the account items --> >-<table> >-[% IF ( LibraryName ) %] >- <tr> >- <th colspan="4" class="centerednames"> >- <h3>[% LibraryName %]</h3> >- </th> >- </tr> >-[% END %] >- <tr> >- <th colspan="4" class="centerednames"> >- <h2><u>INVOICE</u></h2> >- </th> >- </tr> >- <tr> >- <th colspan="4" class="centerednames"> >- [% IF ( branchname ) %]<h2>[% branchname %]</h2>[% END %] >- </th> >- </tr> >- <tr> >- <th colspan="4" > >- Bill to: [% firstname %] [% surname %] <br /> >- Card number: [% cardnumber %]<br /> >- </th> >- </tr> >- <tr> >- <th>Date</th> >- <th>Description of charges</th> >- <th style="text-align:right;">Amount</th> >- <th style="text-align:right;">Amount outstanding</th> >- </tr> >- >- [% FOREACH account IN accounts %] >-<tr class="highlight"> >- <td>[% account.date %]</td> >- <td> >- [% SWITCH account.accounttype %] >- [% CASE 'Pay' %]Payment, thanks >- [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) >- [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) >- [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) >- [% CASE 'N' %]New Card >- [% CASE 'F' %]Fine >- [% CASE 'A' %]Account management fee >- [% CASE 'M' %]Sundry >- [% CASE 'L' %]Lost Item >- [% CASE 'W' %]Writeoff >- [% CASE %][% account.accounttype %] >- [%- END -%] >- [%- IF account.description %], [% account.description %][% END %] >- </td> >- [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount %]</td> >- [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding %]</td> >- </tr> >- >- [% END %] >-<tfoot> >- <tr> >- <td colspan="3">Total outstanding dues as on date: </td> >- [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total %]</td> >- </tr> >- </tfoot> >-</table> >-</div> >-[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/stats_screen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/stats_screen.tt >deleted file mode 100644 >index df53367..0000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/stats_screen.tt >+++ /dev/null >@@ -1,131 +0,0 @@ >-[% INCLUDE 'doc-head-open.inc' %] >-<title>Koha › Reports › Till reconciliation</title> >-[% INCLUDE 'doc-head-close.inc' %] >-[% INCLUDE 'calendar.inc' %] >-</head> >-<body id="rep_stats_screen" class="rep"> >-[% INCLUDE 'header.inc' %] >-[% INCLUDE 'circ-search.inc' %] >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> › Till reconciliation >-</div> >- >-<div id="doc3" class="yui-t2"> >- >- <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >- >-<h1>Till reconciliation</h1> >- >-<fieldset><legend>Search between two dates</legend> >-<form action="stats.screen.pl" method="post"> >- <label for="from">Start Date: </label> >- <input type="text" name="time" size="10" value="[% IF ( date ) %][% date %][% ELSE %]today[% END %]" id="from" class="datepickerfrom" /> >- <label for="to">End Date: </label> >- <input type="text" name="time2" size="10" value="[% IF ( date2 ) %][% date2 %][% ELSE %]tomorrow[% END %]" class="datepickerto" id="to" /> >- <input type="submit" value="To screen" name="submit" class="submit" /> >-<!-- <input type="submit" value="To Excel" name="submit" class="button"> --></fieldset> >-</form> >- >-<h2>Payments</h2> >- >- <table> >- <tr> >- <th>Library</th> >- <th>Date/time</th> >- <th>Surname</th> >- <th>First name</th> >- <th>Description</th> >- <th>Charge type</th> >- <th>Invoice amount</th> >- <th>Payment type</th> >- <th>Payment amount</th> >- </tr> >- >- [% FOREACH loop IN loop1 %] >- <tr> >- <td>[% loop.branch %]</td> >- <td>[% loop.datetime %]</td> >- <td>[% loop.surname %]</td> >- <td>[% loop.firstname %]</td> >- <td>[% loop.description %]</td> >- <td>[% loop.accounttype %]</td> >- <td>[% loop.amount %]</td> >- <td>[% loop.type %]</td> >- <td>[% loop.value %]</td> >- </tr> >- [% END %] >- </table> >- >-<p> >- <b>Total amount paid: [% totalpaid %]</b> >-</p> >- >- >-<h2>Credits</h2> >- >- <table> >- <tr> >- <th>Library</th> >- <th>Date/time</th> >- <th>Surname</th> >- <th>First name</th> >- <th>Description</th> >- <th>Charge type</th> >- <th>Invoice amount</th> >- </tr> >- >- [% FOREACH loop IN loop2 %] >- <tr> >- <td>[% loop.creditbranch %]</td> >- <td>[% loop.creditdate %]</td> >- <td>[% loop.creditsurname %]</td> >- <td>[% loop.creditfirstname %]</td> >- <td>[% loop.creditdescription %]</td> >- <td>[% loop.creditaccounttype %]</td> >- <td>[% loop.creditamount %]</td> >- </tr> >- [% END %] >- </table> >-<p> >- <ul><li> <b>Total amount credits: [% totalcredits %]</b></li> >- <li><b>Total number written off: [% totalwritten %] charges</b></li></ul> >-</p> >- >- >-<h2>Refunds</h2> >- >- <table> >- <tr> >- <th>Library</th> >- <th>Date/time</th> >- <th>Surname</th> >- <th>First name</th> >- <th>Description</th> >- <th>Charge type</th> >- <th>Invoice amount</th> >- </tr> >- >- [% FOREACH loop IN loop3 %] >- <tr> >- <td>[% loop.refundbranch %]</td> >- <td>[% loop.refunddate %]</td> >- <td>[% loop.refundsurname %]</td> >- <td>[% loop.refundfirstname %]</td> >- <td>[% loop.refunddescription %]</td> >- <td>[% loop.refundaccounttype %]</td> >- <td>[% loop.refundamount %]</td> >- </tr> >- [% END %] >- </table> >-<p> >- <ul><li><b>Total amount refunds: [% totalrefund %]</b></li> >- <li><b>Total amount of cash collected: [% totalcash %] </b></li></ul> >-</p> >-</div> >-</div> >-<div class="yui-b"> >-[% INCLUDE 'reports-menu.inc' %] >-</div> >-</div> >-[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/members/boraccount.pl b/members/boraccount.pl >deleted file mode 100755 >index 8b1b7bd..0000000 >--- a/members/boraccount.pl >+++ /dev/null >@@ -1,126 +0,0 @@ >-#!/usr/bin/perl >- >- >-#writen 11/1/2000 by chris@katipo.oc.nz >-#script to display borrowers account details >- >- >-# Copyright 2000-2002 Katipo Communications >-# >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it >-# under the terms of the GNU General Public License as published by >-# the Free Software Foundation; either version 3 of the License, or >-# (at your option) any later version. >-# >-# Koha is distributed in the hope that it will be useful, but >-# WITHOUT ANY WARRANTY; without even the implied warranty of >-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >-# GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License >-# along with Koha; if not, see <http://www.gnu.org/licenses>. >- >-use strict; >-use warnings; >- >-use C4::Auth; >-use C4::Output; >-use CGI qw ( -utf8 ); >-use C4::Members; >-use C4::Branch; >-use C4::Accounts; >-use C4::Members::Attributes qw(GetBorrowerAttributes); >- >-my $input=new CGI; >- >- >-my ($template, $loggedinuser, $cookie) = get_template_and_user( >- { >- template_name => "members/boraccount.tt", >- query => $input, >- type => "intranet", >- authnotrequired => 0, >- flagsrequired => { borrowers => 1, >- updatecharges => 'remaining_permissions'}, >- debug => 1, >- } >-); >- >-my $borrowernumber=$input->param('borrowernumber'); >-my $action = $input->param('action') || ''; >- >-#get borrower details >-my $data=GetMember('borrowernumber' => $borrowernumber); >- >-if ( $action eq 'reverse' ) { >- ReversePayment( $input->param('accountlines_id') ); >-} >- >-if ( $data->{'category_type'} eq 'C') { >- my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); >- my $cnt = scalar(@$catcodes); >- $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1; >- $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1; >-} >- >-#get account details >-my ($total,$accts,undef)=GetMemberAccountRecords($borrowernumber); >-my $totalcredit; >-if($total <= 0){ >- $totalcredit = 1; >-} >- >-my $reverse_col = 0; # Flag whether we need to show the reverse column >-foreach my $accountline ( @{$accts}) { >- $accountline->{amount} += 0.00; >- if ($accountline->{amount} <= 0 ) { >- $accountline->{amountcredit} = 1; >- } >- $accountline->{amountoutstanding} += 0.00; >- if ( $accountline->{amountoutstanding} <= 0 ) { >- $accountline->{amountoutstandingcredit} = 1; >- } >- >- $accountline->{amount} = sprintf '%.2f', $accountline->{amount}; >- $accountline->{amountoutstanding} = sprintf '%.2f', $accountline->{amountoutstanding}; >- if ($accountline->{accounttype} =~ /^Pay/) { >- $accountline->{payment} = 1; >- $reverse_col = 1; >- } >-} >- >-$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); >- >-my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'}); >-$template->param( picture => 1 ) if $picture; >- >-if (C4::Context->preference('ExtendedPatronAttributes')) { >- my $attributes = GetBorrowerAttributes($borrowernumber); >- $template->param( >- ExtendedPatronAttributes => 1, >- extendedattributes => $attributes >- ); >-} >- >-my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ); >- >-#workaround for Bug 4041 to get rid of duplicated code in circ-menu.tt, use circ-menu.inc instad >-$template->param(%$data); >- >-$template->param( >- finesview => 1, >- borrowernumber => $borrowernumber, >- roadtype => $roadtype, >- branchname => GetBranchName($data->{'branchcode'}), >- total => sprintf("%.2f",$total), >- totalcredit => $totalcredit, >- is_child => ($data->{'category_type'} eq 'C'), >- reverse_col => $reverse_col, >- accounts => $accts, >- activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), >- RoutingSerials => C4::Context->preference('RoutingSerials'), >-); >- >-output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/members/mancredit.pl b/members/mancredit.pl >deleted file mode 100755 >index 9fc3891..0000000 >--- a/members/mancredit.pl >+++ /dev/null >@@ -1,108 +0,0 @@ >-#!/usr/bin/perl >- >-#written 11/1/2000 by chris@katipo.oc.nz >-#script to display borrowers account details >- >- >-# Copyright 2000-2002 Katipo Communications >-# Copyright 2010 BibLibre >-# >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it >-# under the terms of the GNU General Public License as published by >-# the Free Software Foundation; either version 3 of the License, or >-# (at your option) any later version. >-# >-# Koha is distributed in the hope that it will be useful, but >-# WITHOUT ANY WARRANTY; without even the implied warranty of >-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >-# GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License >-# along with Koha; if not, see <http://www.gnu.org/licenses>. >- >-use strict; >-use warnings; >- >-use C4::Auth; >-use C4::Output; >-use CGI qw ( -utf8 ); >- >-use C4::Members; >-use C4::Branch; >-use C4::Accounts; >-use C4::Items; >-use C4::Members::Attributes qw(GetBorrowerAttributes); >- >-my $input=new CGI; >-my $flagsrequired = { borrowers => 1, updatecharges => 1 }; >- >-my $borrowernumber=$input->param('borrowernumber'); >- >-#get borrower details >-my $data=GetMember('borrowernumber' => $borrowernumber); >-my $add=$input->param('add'); >- >-if ($add){ >- if ( checkauth( $input, 0, $flagsrequired, 'intranet' ) ) { >- my $barcode = $input->param('barcode'); >- my $itemnum; >- if ($barcode) { >- $itemnum = GetItemnumberFromBarcode($barcode); >- } >- my $desc = $input->param('desc'); >- my $note = $input->param('note'); >- my $amount = $input->param('amount') || 0; >- $amount = -$amount; >- my $type = $input->param('type'); >- manualinvoice( $borrowernumber, $itemnum, $desc, $type, $amount, $note ); >- print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber"); >- } >-} else { >- my ($template, $loggedinuser, $cookie) = get_template_and_user( >- { >- template_name => "members/mancredit.tt", >- query => $input, >- type => "intranet", >- authnotrequired => 0, >- flagsrequired => { borrowers => 1, >- updatecharges => 'remaining_permissions' }, >- debug => 1, >- } >- ); >- >- if ( $data->{'category_type'} eq 'C') { >- my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); >- my $cnt = scalar(@$catcodes); >- $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1; >- $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1; >- } >- >- $template->param( adultborrower => 1 ) if ( $data->{category_type} eq 'A' ); >- my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'}); >- $template->param( picture => 1 ) if $picture; >- >- if (C4::Context->preference('ExtendedPatronAttributes')) { >- my $attributes = GetBorrowerAttributes($borrowernumber); >- $template->param( >- ExtendedPatronAttributes => 1, >- extendedattributes => $attributes >- ); >- } >- >- my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ); >- $template->param(%$data); >- >- $template->param( >- finesview => 1, >- borrowernumber => $borrowernumber, >- categoryname => $data->{'description'}, >- roadtype => $roadtype, >- branchname => GetBranchName($data->{'branchcode'}), >- is_child => ($data->{'category_type'} eq 'C'), >- activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), >- RoutingSerials => C4::Context->preference('RoutingSerials'), >- ); >- output_html_with_http_headers $input, $cookie, $template->output; >-} >diff --git a/members/maninvoice.pl b/members/maninvoice.pl >deleted file mode 100755 >index 164b833..0000000 >--- a/members/maninvoice.pl >+++ /dev/null >@@ -1,133 +0,0 @@ >-#!/usr/bin/perl >- >-#written 11/1/2000 by chris@katipo.oc.nz >-#script to display borrowers account details >- >- >-# Copyright 2000-2002 Katipo Communications >-# Copyright 2010 BibLibre >-# >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it >-# under the terms of the GNU General Public License as published by >-# the Free Software Foundation; either version 3 of the License, or >-# (at your option) any later version. >-# >-# Koha is distributed in the hope that it will be useful, but >-# WITHOUT ANY WARRANTY; without even the implied warranty of >-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >-# GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License >-# along with Koha; if not, see <http://www.gnu.org/licenses>. >- >-use strict; >-use warnings; >- >-use C4::Auth; >-use C4::Output; >-use CGI qw ( -utf8 ); >-use C4::Members; >-use C4::Accounts; >-use C4::Items; >-use C4::Branch; >-use C4::Members::Attributes qw(GetBorrowerAttributes); >- >-my $input=new CGI; >-my $flagsrequired = { borrowers => 1 }; >- >-my $borrowernumber=$input->param('borrowernumber'); >- >- >-# get borrower details >-my $data=GetMember('borrowernumber'=>$borrowernumber); >-my $add=$input->param('add'); >-if ($add){ >- if ( checkauth( $input, 0, $flagsrequired, 'intranet' ) ) { >- # print $input->header; >- my $barcode=$input->param('barcode'); >- my $itemnum; >- if ($barcode) { >- $itemnum = GetItemnumberFromBarcode($barcode); >- } >- my $desc=$input->param('desc'); >- my $amount=$input->param('amount'); >- my $type=$input->param('type'); >- my $note = $input->param('note'); >- my $error = manualinvoice( $borrowernumber, $itemnum, $desc, $type, $amount, $note ); >- if ($error) { >- my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >- { template_name => "members/maninvoice.tt", >- query => $input, >- type => "intranet", >- authnotrequired => 0, >- flagsrequired => $flagsrequired, >- debug => 1, >- } >- ); >- if ( $error =~ /FOREIGN KEY/ && $error =~ /itemnumber/ ) { >- $template->param( 'ITEMNUMBER' => 1 ); >- } >- $template->param( 'ERROR' => $error ); >- output_html_with_http_headers $input, $cookie, $template->output; >- } else { >- print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber"); >- exit; >- } >- } >-} else { >- >- my ($template, $loggedinuser, $cookie) = get_template_and_user({ >- template_name => "members/maninvoice.tt", >- query => $input, >- type => "intranet", >- authnotrequired => 0, >- flagsrequired => { borrowers => 1, >- updatecharges => 'remaining_permissions' }, >- debug => 1, >- }); >- >- # get authorised values with type of MANUAL_INV >- my @invoice_types; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare('SELECT * FROM authorised_values WHERE category = "MANUAL_INV"'); >- $sth->execute(); >- while ( my $row = $sth->fetchrow_hashref() ) { >- push @invoice_types, $row; >- } >- $template->param( invoice_types_loop => \@invoice_types ); >- >- if ( $data->{'category_type'} eq 'C') { >- my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); >- my $cnt = scalar(@$catcodes); >- $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1; >- $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1; >- } >- >- $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); >- my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'}); >- $template->param( picture => 1 ) if $picture; >- >- if (C4::Context->preference('ExtendedPatronAttributes')) { >- my $attributes = GetBorrowerAttributes($borrowernumber); >- $template->param( >- ExtendedPatronAttributes => 1, >- extendedattributes => $attributes >- ); >- } >- >- my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ); >- $template->param(%$data); >- $template->param( >- finesview => 1, >- borrowernumber => $borrowernumber, >- categoryname => $data->{'description'}, >- branchname => GetBranchName($data->{'branchcode'}), >- roadtype => $roadtype, >- is_child => ($data->{'category_type'} eq 'C'), >- activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), >- RoutingSerials => C4::Context->preference('RoutingSerials'), >- ); >- output_html_with_http_headers $input, $cookie, $template->output; >-} >diff --git a/members/pay.pl b/members/pay.pl >deleted file mode 100755 >index 1ac140d..0000000 >--- a/members/pay.pl >+++ /dev/null >@@ -1,269 +0,0 @@ >-#!/usr/bin/perl >- >-# Copyright 2000-2002 Katipo Communications >-# Copyright 2010 BibLibre >-# Copyright 2010,2011 PTFS-Europe Ltd >-# >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it >-# under the terms of the GNU General Public License as published by >-# the Free Software Foundation; either version 3 of the License, or >-# (at your option) any later version. >-# >-# Koha is distributed in the hope that it will be useful, but >-# WITHOUT ANY WARRANTY; without even the implied warranty of >-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >-# GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License >-# along with Koha; if not, see <http://www.gnu.org/licenses>. >- >-=head1 pay.pl >- >- written 11/1/2000 by chris@katipo.oc.nz >- part of the koha library system, script to facilitate paying off fines >- >-=cut >- >-use strict; >-use warnings; >- >-use URI::Escape; >-use C4::Context; >-use C4::Auth; >-use C4::Output; >-use CGI qw ( -utf8 ); >-use C4::Members; >-use C4::Accounts; >-use C4::Stats; >-use C4::Koha; >-use C4::Overdues; >-use C4::Branch; >-use C4::Members::Attributes qw(GetBorrowerAttributes); >- >-our $input = CGI->new; >- >-my $updatecharges_permissions = $input->param('woall') ? 'writeoff' : 'remaining_permissions'; >-our ( $template, $loggedinuser, $cookie ) = get_template_and_user( >- { template_name => 'members/pay.tt', >- query => $input, >- type => 'intranet', >- authnotrequired => 0, >- flagsrequired => { borrowers => 1, updatecharges => $updatecharges_permissions }, >- debug => 1, >- } >-); >- >-my @names = $input->param; >- >-our $borrowernumber = $input->param('borrowernumber'); >-if ( !$borrowernumber ) { >- $borrowernumber = $input->param('borrowernumber0'); >-} >- >-# get borrower details >-our $borrower = GetMember( borrowernumber => $borrowernumber ); >-our $user = $input->remote_user; >-$user ||= q{}; >- >-my $branches = GetBranches(); >-our $branch = GetBranch( $input, $branches ); >- >-my $writeoff_item = $input->param('confirm_writeoff'); >-my $paycollect = $input->param('paycollect'); >-if ($paycollect) { >- print $input->redirect( >- "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber"); >-} >-my $payselected = $input->param('payselected'); >-if ($payselected) { >- payselected(@names); >-} >- >-my $writeoff_all = $input->param('woall'); # writeoff all fines >-if ($writeoff_all) { >- writeoff_all(@names); >-} elsif ($writeoff_item) { >- my $accountlines_id = $input->param('accountlines_id'); >- my $itemno = $input->param('itemnumber'); >- my $account_type = $input->param('accounttype'); >- my $amount = $input->param('amountoutstanding'); >- my $payment_note = $input->param("payment_note"); >- WriteOffFee( $borrowernumber, $accountlines_id, $itemno, $account_type, $amount, $branch, $payment_note ); >-} >- >-for (@names) { >- if (/^pay_indiv_(\d+)$/) { >- my $line_no = $1; >- redirect_to_paycollect( 'pay_individual', $line_no ); >- } elsif (/^wo_indiv_(\d+)$/) { >- my $line_no = $1; >- redirect_to_paycollect( 'writeoff_individual', $line_no ); >- } >-} >- >-$template->param( >- finesview => 1, >- activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), >- RoutingSerials => C4::Context->preference('RoutingSerials'), >-); >- >-add_accounts_to_template(); >- >-output_html_with_http_headers $input, $cookie, $template->output; >- >-sub add_accounts_to_template { >- >- my ( $total, undef, undef ) = GetMemberAccountRecords($borrowernumber); >- my $accounts = []; >- my @notify = NumberNotifyId($borrowernumber); >- >- my $notify_groups = []; >- for my $notify_id (@notify) { >- my ( $acct_total, $accountlines, undef ) = >- GetBorNotifyAcctRecord( $borrowernumber, $notify_id ); >- if ( @{$accountlines} ) { >- my $totalnotify = AmountNotify( $notify_id, $borrowernumber ); >- push @{$accounts}, >- { accountlines => $accountlines, >- notify => $notify_id, >- total => $totalnotify, >- }; >- } >- } >- borrower_add_additional_fields($borrower); >- >- #workaround for Bug 4041 to get rid of duplicated code in circ-menu.tt, use circ-menu.inc instad >- $template->param(%$borrower); >- >- $template->param( >- accounts => $accounts, >- borrower => $borrower, >- total => $total, >- ); >- return; >- >-} >- >-sub get_for_redirect { >- my ( $name, $name_in, $money ) = @_; >- my $s = q{&} . $name . q{=}; >- my $value = $input->param($name_in); >- if ( !defined $value ) { >- $value = ( $money == 1 ) ? 0 : q{}; >- } >- if ($money) { >- $s .= sprintf '%.2f', $value; >- } else { >- $s .= $value; >- } >- return $s; >-} >- >-sub redirect_to_paycollect { >- my ( $action, $line_no ) = @_; >- my $redirect = >- "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber"; >- $redirect .= q{&}; >- $redirect .= "$action=1"; >- $redirect .= get_for_redirect( 'accounttype', "accounttype$line_no", 0 ); >- $redirect .= get_for_redirect( 'amount', "amount$line_no", 1 ); >- $redirect .= >- get_for_redirect( 'amountoutstanding', "amountoutstanding$line_no", 1 ); >- $redirect .= get_for_redirect( 'accountno', "accountno$line_no", 0 ); >- $redirect .= get_for_redirect( 'title', "title$line_no", 0 ); >- $redirect .= get_for_redirect( 'itemnumber', "itemnumber$line_no", 0 ); >- $redirect .= get_for_redirect( 'notify_id', "notify_id$line_no", 0 ); >- $redirect .= get_for_redirect( 'notify_level', "notify_level$line_no", 0 ); >- $redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 ); >- $redirect .= q{&} . 'payment_note' . q{=} . uri_escape_utf8( $input->param("payment_note_$line_no") ); >- $redirect .= '&remote_user='; >- $redirect .= $user; >- return print $input->redirect($redirect); >-} >- >-sub writeoff_all { >- my @params = @_; >- my @wo_lines = grep { /^accountno\d+$/ } @params; >- for (@wo_lines) { >- if (/(\d+)/) { >- my $value = $1; >- my $accounttype = $input->param("accounttype$value"); >- >- # my $borrowernum = $input->param("borrowernumber$value"); >- my $itemno = $input->param("itemnumber$value"); >- my $amount = $input->param("amountoutstanding$value"); >- my $accountno = $input->param("accountno$value"); >- my $accountlines_id = $input->param("accountlines_id$value"); >- my $payment_note = $input->param("payment_note_$value"); >- WriteOffFee( $borrowernumber, $accountlines_id, $itemno, $accounttype, $amount, $branch, $payment_note ); >- } >- } >- >- $borrowernumber = $input->param('borrowernumber'); >- print $input->redirect( >- "/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber"); >- return; >-} >- >-sub borrower_add_additional_fields { >- my $b_ref = shift; >- >-# some borrower info is not returned in the standard call despite being assumed >-# in a number of templates. It should not be the business of this script but in lieu of >-# a revised api here it is ... >- if ( $b_ref->{category_type} eq 'C' ) { >- my ( $catcodes, $labels ) = >- GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); >- if ( @{$catcodes} ) { >- if ( @{$catcodes} > 1 ) { >- $b_ref->{CATCODE_MULTI} = 1; >- } elsif ( @{$catcodes} == 1 ) { >- $b_ref->{catcode} = $catcodes->[0]; >- } >- } >- } elsif ( $b_ref->{category_type} eq 'A' ) { >- $b_ref->{adultborrower} = 1; >- } >- my ( $picture, $dberror ) = GetPatronImage( $b_ref->{borrowernumber} ); >- if ($picture) { >- $b_ref->{has_picture} = 1; >- } >- my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{streettype} ); >- $b_ref->{roadtype} = $roadtype; >- >- if (C4::Context->preference('ExtendedPatronAttributes')) { >- $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber); >- $template->param( >- ExtendedPatronAttributes => 1, >- ); >- } >- >- $b_ref->{branchname} = GetBranchName( $b_ref->{branchcode} ); >- return; >-} >- >-sub payselected { >- my @params = @_; >- my $amt = 0; >- my @lines_to_pay; >- foreach (@params) { >- if (/^incl_par_(\d+)$/) { >- my $index = $1; >- push @lines_to_pay, $input->param("accountno$index"); >- $amt += $input->param("amountoutstanding$index"); >- } >- } >- $amt = '&amt=' . $amt; >- my $sel = '&selected=' . join ',', @lines_to_pay; >- my $notes = '¬es=' . join("%0A", map { $input->param("payment_note_$_") } @lines_to_pay ); >- my $redirect = >- "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber" >- . $amt >- . $sel >- . $notes; >- >- print $input->redirect($redirect); >- return; >-} >diff --git a/members/paycollect.pl b/members/paycollect.pl >deleted file mode 100755 >index ad0026f..0000000 >--- a/members/paycollect.pl >+++ /dev/null >@@ -1,194 +0,0 @@ >-#!/usr/bin/perl >-# Copyright 2009,2010 PTFS Inc. >-# Copyright 2011 PTFS-Europe Ltd >-# >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it >-# under the terms of the GNU General Public License as published by >-# the Free Software Foundation; either version 3 of the License, or >-# (at your option) any later version. >-# >-# Koha is distributed in the hope that it will be useful, but >-# WITHOUT ANY WARRANTY; without even the implied warranty of >-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >-# GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License >-# along with Koha; if not, see <http://www.gnu.org/licenses>. >- >-use strict; >-use warnings; >-use URI::Escape; >-use C4::Context; >-use C4::Auth; >-use C4::Output; >-use CGI qw ( -utf8 ); >-use C4::Members; >-use C4::Members::Attributes qw(GetBorrowerAttributes); >-use C4::Accounts; >-use C4::Koha; >-use C4::Branch; >- >-my $input = CGI->new(); >- >-my $updatecharges_permissions = $input->param('writeoff_individual') ? 'writeoff' : 'remaining_permissions'; >-my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >- { template_name => 'members/paycollect.tt', >- query => $input, >- type => 'intranet', >- authnotrequired => 0, >- flagsrequired => { borrowers => 1, updatecharges => $updatecharges_permissions }, >- debug => 1, >- } >-); >- >-# get borrower details >-my $borrowernumber = $input->param('borrowernumber'); >-my $borrower = GetMember( borrowernumber => $borrowernumber ); >-my $user = $input->remote_user; >- >-# get account details >-my $branch = GetBranch( $input, GetBranches() ); >- >-my ( $total_due, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber); >-my $total_paid = $input->param('paid'); >- >-my $individual = $input->param('pay_individual'); >-my $writeoff = $input->param('writeoff_individual'); >-my $select_lines = $input->param('selected'); >-my $select = $input->param('selected_accts'); >-my $payment_note = uri_unescape $input->param('payment_note'); >-my $accountno; >-my $accountlines_id; >-if ( $individual || $writeoff ) { >- if ($individual) { >- $template->param( pay_individual => 1 ); >- } elsif ($writeoff) { >- $template->param( writeoff_individual => 1 ); >- } >- my $accounttype = $input->param('accounttype'); >- $accountlines_id = $input->param('accountlines_id'); >- my $amount = $input->param('amount'); >- my $amountoutstanding = $input->param('amountoutstanding'); >- $accountno = $input->param('accountno'); >- my $itemnumber = $input->param('itemnumber'); >- my $description = $input->param('description'); >- my $title = $input->param('title'); >- my $notify_id = $input->param('notify_id'); >- my $notify_level = $input->param('notify_level'); >- $total_due = $amountoutstanding; >- $template->param( >- accounttype => $accounttype, >- accountlines_id => $accountlines_id, >- accountno => $accountno, >- amount => $amount, >- amountoutstanding => $amountoutstanding, >- title => $title, >- itemnumber => $itemnumber, >- description => $description, >- notify_id => $notify_id, >- notify_level => $notify_level, >- payment_note => $payment_note, >- ); >-} elsif ($select_lines) { >- $total_due = $input->param('amt'); >- $template->param( >- selected_accts => $select_lines, >- amt => $total_due, >- selected_accts_notes => $input->param('notes'), >- ); >-} >- >-if ( $total_paid and $total_paid ne '0.00' ) { >- if ( $total_paid < 0 or $total_paid > $total_due ) { >- $template->param( >- error_over => 1, >- total_due => $total_due >- ); >- } else { >- if ($individual) { >- if ( $total_paid == $total_due ) { >- makepayment( $accountlines_id, $borrowernumber, $accountno, $total_paid, $user, >- $branch, $payment_note ); >- } else { >- makepartialpayment( $accountlines_id, $borrowernumber, $accountno, $total_paid, >- $user, $branch, $payment_note ); >- } >- print $input->redirect( >- "/cgi-bin/koha/members/pay.pl?borrowernumber=$borrowernumber"); >- } else { >- if ($select) { >- if ( $select =~ /^([\d,]*).*/ ) { >- $select = $1; # ensure passing no junk >- } >- my @acc = split /,/, $select; >- my $note = $input->param('selected_accts_notes'); >- recordpayment_selectaccts( $borrowernumber, $total_paid, \@acc, $note ); >- } else { >- my $note = $input->param('selected_accts_notes'); >- recordpayment( $borrowernumber, $total_paid, '', $note ); >- } >- >-# recordpayment does not return success or failure so lets redisplay the boraccount >- >- print $input->redirect( >-"/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber" >- ); >- } >- } >-} else { >- $total_paid = '0.00'; #TODO not right with pay_individual >-} >- >-borrower_add_additional_fields($borrower); >- >-#workaround for Bug 4041 to get rid of duplicated code in circ-menu.tt, use circ-menu.inc instad >-$template->param(%$borrower); >- >- >-$template->param( >- borrowernumber => $borrowernumber, # some templates require global >- borrower => $borrower, >- total => $total_due, >- activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), >- RoutingSerials => C4::Context->preference('RoutingSerials'), >- ExtendedPatronAttributes => C4::Context->preference('ExtendedPatronAttributes'), >-); >- >-output_html_with_http_headers $input, $cookie, $template->output; >- >-sub borrower_add_additional_fields { >- my $b_ref = shift; >- >-# some borrower info is not returned in the standard call despite being assumed >-# in a number of templates. It should not be the business of this script but in lieu of >-# a revised api here it is ... >- if ( $b_ref->{category_type} eq 'C' ) { >- my ( $catcodes, $labels ) = >- GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); >- if ( @{$catcodes} ) { >- if ( @{$catcodes} > 1 ) { >- $b_ref->{CATCODE_MULTI} = 1; >- } elsif ( @{$catcodes} == 1 ) { >- $b_ref->{catcode} = $catcodes->[0]; >- } >- } >- } elsif ( $b_ref->{category_type} eq 'A' ) { >- $b_ref->{adultborrower} = 1; >- } >- my ( $picture, $dberror ) = GetPatronImage( $b_ref->{borrowernumber} ); >- if ($picture) { >- $b_ref->{has_picture} = 1; >- } >- >- if (C4::Context->preference('ExtendedPatronAttributes')) { >- $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber); >- } >- >- my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{streettype} ); >- $b_ref->{roadtype} = $roadtype; >- >- $b_ref->{branchname} = GetBranchName( $b_ref->{branchcode} ); >- return; >-} >diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl >deleted file mode 100755 >index 8ffc49f..0000000 >--- a/members/printfeercpt.pl >+++ /dev/null >@@ -1,142 +0,0 @@ >-#!/usr/bin/perl >- >- >-#writen 3rd May 2010 by kmkale@anantcorp.com adapted from boraccount.pl by chris@katipo.oc.nz >-#script to print fee receipts >- >- >-# Copyright Koustubha Kale >-# >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it >-# under the terms of the GNU General Public License as published by >-# the Free Software Foundation; either version 3 of the License, or >-# (at your option) any later version. >-# >-# Koha is distributed in the hope that it will be useful, but >-# WITHOUT ANY WARRANTY; without even the implied warranty of >-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >-# GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License >-# along with Koha; if not, see <http://www.gnu.org/licenses>. >- >-use strict; >-use warnings; >- >-use C4::Auth; >-use C4::Output; >-use C4::Dates qw/format_date/; >-use CGI qw ( -utf8 ); >-use C4::Members; >-use C4::Branch; >-use C4::Accounts; >- >-my $input=new CGI; >- >- >-my ($template, $loggedinuser, $cookie) >- = get_template_and_user({template_name => "members/printfeercpt.tt", >- query => $input, >- type => "intranet", >- authnotrequired => 0, >- flagsrequired => {borrowers => 1, updatecharges => 'remaining_permissions'}, >- debug => 1, >- }); >- >-my $borrowernumber=$input->param('borrowernumber'); >-my $action = $input->param('action') || ''; >-my $accountlines_id = $input->param('accountlines_id'); >- >-#get borrower details >-my $data=GetMember('borrowernumber' => $borrowernumber); >- >-if ( $action eq 'print' ) { >-# ReversePayment( $borrowernumber, $input->param('accountno') ); >-} >- >-if ( $data->{'category_type'} eq 'C') { >- my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); >- my $cnt = scalar(@$catcodes); >- $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1; >- $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1; >-} >- >-#get account details >-my ($total,$accts,$numaccts)=GetMemberAccountRecords($borrowernumber); >-my $totalcredit; >-if($total <= 0){ >- $totalcredit = 1; >-} >-my @accountrows; # this is for the tmpl-loop >- >-my $toggle; >-for (my $i=0;$i<$numaccts;$i++){ >- next if ( $accts->[$i]{'accountlines_id'} ne $accountlines_id ); >- if($i%2){ >- $toggle = 0; >- } else { >- $toggle = 1; >- } >- $accts->[$i]{'toggle'} = $toggle; >- $accts->[$i]{'amount'}+=0.00; >- if($accts->[$i]{'amount'} <= 0){ >- $accts->[$i]{'amountcredit'} = 1; >- $accts->[$i]{'amount'}*=-1.00; >- } >- $accts->[$i]{'amountoutstanding'}+=0.00; >- if($accts->[$i]{'amountoutstanding'} <= 0){ >- $accts->[$i]{'amountoutstandingcredit'} = 1; >- } >- my %row = ( 'date' => format_date($accts->[$i]{'date'}), >- 'amountcredit' => $accts->[$i]{'amountcredit'}, >- 'amountoutstandingcredit' => $accts->[$i]{'amountoutstandingcredit'}, >- 'toggle' => $accts->[$i]{'toggle'}, >- 'description' => $accts->[$i]{'description'}, >- 'itemnumber' => $accts->[$i]{'itemnumber'}, >- 'biblionumber' => $accts->[$i]{'biblionumber'}, >- 'amount' => sprintf("%.2f",$accts->[$i]{'amount'}), >- 'amountoutstanding' => sprintf("%.2f",$accts->[$i]{'amountoutstanding'}), >- 'accountno' => $accts->[$i]{'accountno'}, >- accounttype => $accts->[$i]{accounttype}, >- ); >- >- if ($accts->[$i]{'accounttype'} ne 'F' && $accts->[$i]{'accounttype'} ne 'FU'){ >- $row{'printtitle'}=1; >- $row{'title'} = $accts->[$i]{'title'}; >- } >- >- push(@accountrows, \%row); >-} >- >-$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); >- >-my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'}); >-$template->param( picture => 1 ) if $picture; >- >-$template->param( >- finesview => 1, >- firstname => $data->{'firstname'}, >- surname => $data->{'surname'}, >- borrowernumber => $borrowernumber, >- cardnumber => $data->{'cardnumber'}, >- categorycode => $data->{'categorycode'}, >- category_type => $data->{'category_type'}, >- # category_description => $data->{'description'}, >- categoryname => $data->{'description'}, >- address => $data->{'address'}, >- address2 => $data->{'address2'}, >- city => $data->{'city'}, >- zipcode => $data->{'zipcode'}, >- country => $data->{'country'}, >- phone => $data->{'phone'}, >- email => $data->{'email'}, >- branchcode => $data->{'branchcode'}, >- branchname => GetBranchName($data->{'branchcode'}), >- total => sprintf("%.2f",$total), >- totalcredit => $totalcredit, >- is_child => ($data->{'category_type'} eq 'C'), >- accounts => \@accountrows ); >- >-output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/members/printinvoice.pl b/members/printinvoice.pl >deleted file mode 100755 >index d9b1307..0000000 >--- a/members/printinvoice.pl >+++ /dev/null >@@ -1,142 +0,0 @@ >-#!/usr/bin/perl >- >-#writen 3rd May 2010 by kmkale@anantcorp.com adapted from boraccount.pl by chris@katipo.oc.nz >-#script to print fee receipts >- >-# Copyright Koustubha Kale >-# >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it >-# under the terms of the GNU General Public License as published by >-# the Free Software Foundation; either version 3 of the License, or >-# (at your option) any later version. >-# >-# Koha is distributed in the hope that it will be useful, but >-# WITHOUT ANY WARRANTY; without even the implied warranty of >-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >-# GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License >-# along with Koha; if not, see <http://www.gnu.org/licenses>. >- >-use strict; >-use warnings; >- >-use C4::Auth; >-use C4::Output; >-use C4::Dates qw/format_date/; >-use CGI qw ( -utf8 ); >-use C4::Members; >-use C4::Branch; >-use C4::Accounts; >- >-my $input = new CGI; >- >-my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >- { template_name => "members/printinvoice.tt", >- query => $input, >- type => "intranet", >- authnotrequired => 0, >- flagsrequired => { borrowers => 1, updatecharges => 'remaining_permissions' }, >- debug => 1, >- } >-); >- >-my $borrowernumber = $input->param('borrowernumber'); >-my $action = $input->param('action') || ''; >-my $accountlines_id = $input->param('accountlines_id'); >- >-#get borrower details >-my $data = GetMember( 'borrowernumber' => $borrowernumber ); >- >-if ( $data->{'category_type'} eq 'C' ) { >- my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); >- my $cnt = scalar(@$catcodes); >- $template->param( 'CATCODE_MULTI' => 1 ) if $cnt > 1; >- $template->param( 'catcode' => $catcodes->[0] ) if $cnt == 1; >-} >- >-#get account details >-my ( $total, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber); >-my $totalcredit; >-if ( $total <= 0 ) { >- $totalcredit = 1; >-} >- >-my @accountrows; # this is for the tmpl-loop >- >-my $toggle; >-for ( my $i = 0 ; $i < $numaccts ; $i++ ) { >- next if ( $accts->[$i]{'accountlines_id'} ne $accountlines_id ); >- >- if ( $i % 2 ) { >- $toggle = 0; >- } else { >- $toggle = 1; >- } >- >- $accts->[$i]{'toggle'} = $toggle; >- $accts->[$i]{'amount'} += 0.00; >- >- if ( $accts->[$i]{'amount'} <= 0 ) { >- $accts->[$i]{'amountcredit'} = 1; >- } >- >- $accts->[$i]{'amountoutstanding'} += 0.00; >- if ( $accts->[$i]{'amountoutstanding'} <= 0 ) { >- $accts->[$i]{'amountoutstandingcredit'} = 1; >- } >- >- my %row = ( >- 'date' => format_date( $accts->[$i]{'date'} ), >- 'amountcredit' => $accts->[$i]{'amountcredit'}, >- 'amountoutstandingcredit' => $accts->[$i]{'amountoutstandingcredit'}, >- 'toggle' => $accts->[$i]{'toggle'}, >- 'description' => $accts->[$i]{'description'}, >- 'itemnumber' => $accts->[$i]{'itemnumber'}, >- 'biblionumber' => $accts->[$i]{'biblionumber'}, >- 'amount' => sprintf( "%.2f", $accts->[$i]{'amount'} ), >- 'amountoutstanding' => sprintf( "%.2f", $accts->[$i]{'amountoutstanding'} ), >- 'accountno' => $accts->[$i]{'accountno'}, >- accounttype => $accts->[$i]{accounttype}, >- ); >- >- if ( $accts->[$i]{'accounttype'} ne 'F' && $accts->[$i]{'accounttype'} ne 'FU' ) { >- $row{'printtitle'} = 1; >- $row{'title'} = $accts->[$i]{'title'}; >- } >- >- push( @accountrows, \%row ); >-} >- >-$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); >- >-my ( $picture, $dberror ) = GetPatronImage( $data->{'borrowernumber'} ); >-$template->param( picture => 1 ) if $picture; >- >-$template->param( >- finesview => 1, >- firstname => $data->{'firstname'}, >- surname => $data->{'surname'}, >- borrowernumber => $borrowernumber, >- cardnumber => $data->{'cardnumber'}, >- categorycode => $data->{'categorycode'}, >- category_type => $data->{'category_type'}, >- categoryname => $data->{'description'}, >- address => $data->{'address'}, >- address2 => $data->{'address2'}, >- city => $data->{'city'}, >- zipcode => $data->{'zipcode'}, >- country => $data->{'country'}, >- phone => $data->{'phone'}, >- email => $data->{'email'}, >- branchcode => $data->{'branchcode'}, >- branchname => GetBranchName( $data->{'branchcode'} ), >- total => sprintf( "%.2f", $total ), >- totalcredit => $totalcredit, >- is_child => ( $data->{'category_type'} eq 'C' ), >- accounts => \@accountrows >-); >- >-output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/misc/maintenance/fix_accountlines_date.pl b/misc/maintenance/fix_accountlines_date.pl >deleted file mode 100755 >index 896edfa..0000000 >--- a/misc/maintenance/fix_accountlines_date.pl >+++ /dev/null >@@ -1,171 +0,0 @@ >-#!/usr/bin/perl >-# >-# Copyright (C) 2008 LibLime >-# >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it >-# under the terms of the GNU General Public License as published by >-# the Free Software Foundation; either version 3 of the License, or >-# (at your option) any later version. >-# >-# Koha is distributed in the hope that it will be useful, but >-# WITHOUT ANY WARRANTY; without even the implied warranty of >-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >-# GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License >-# along with Koha; if not, see <http://www.gnu.org/licenses>. >- >-use strict; >-use warnings; >-BEGIN { >- # find Koha's Perl modules >- # test carefully before changing this >- use FindBin; >- eval { require "$FindBin::Bin/../kohalib.pl" }; >-} >- >-use C4::Context; >-use C4::Dates; >-use Getopt::Long; >-use Pod::Usage; >- >-=head1 NAME >- >-fix_accountlines_date.pl - Fix date code in the description of fines >- >-=head1 SYNOPSIS >- >-fix_accountlines_date.pl -m date_format [ -n fines_to_process ] [ -d ] [ --help or -h ] >- >- Options: >- --help or -h Brief usage message >- --man Full documentation >- -n fines_to_process How many fines to process; if left off will >- process all >- -m date_format What format the dates are currently in; 'us' >- or 'metric' (REQUIRED) >- -d Run in debugging mode >- >-=head1 DESCRIPTION >- >-This script fixes the date code in the description of fines. Previously, the >-format of this was determined by which script you were using to update fines (see the -m option) >- >-=over 8 >- >-=item B<--help> >- >-Prints a brief usage message and exits. >- >-=item B<--man> >- >-Prints a full manual page and exits. >- >-=item B<-n> >- >-Process only a certain amount of fines. If this option is left off, this script >-will process everything. >- >-=item B<-m> >- >-This required option tells the script what format your dates are currently in. >-If you were previously using the fines2.pl or fines-sanop.pl script to update >-your fines, they will be in 'metric' format. If you were using the fines-ll.pl >-script, they will be in 'us' format. After this script is finished, they will >-be in whatever format your 'dateformat' system preference specifies. >- >-=item B<-d> >- >-Run in debugging mode; this prints out a lot of information and should be used >-only if there is a problem and with the '-n' option. >- >-=back >- >-=cut >- >-my $mode = ''; >-my $want_help = 0; >-my $limit = -1; >-my $done = 0; >-my $DEBUG = 0; >- >-# Regexes for the two date formats >-our $US_DATE = '((0\d|1[0-2])\/([0-2]\d|3[01])\/(\d{4}))'; >-our $METRIC_DATE = '(([0-2]\d|3[01])\/(0\d|1[0-2])\/(\d{4}))'; >- >-sub print_usage { >- print <<_USAGE_ >-$0: Fix the date code in the description of fines >- >-Due to the multiple scripts used to update fines in earlier versions of Koha, >-this script should be used to change the format of the date codes in the >-accountlines table before you start using Koha 3.0. >- >-Parameters: >- --mode or -m This should be 'us' or 'metric', and tells the script >- what format your old dates are in. >- --debug or -d Run this script in debug mode. >- --limit or -n How many accountlines rows to fix; useful for testing. >- --help or -h Print out this help message. >-_USAGE_ >-} >- >-my $result = GetOptions( >- 'm=s' => \$mode, >- 'd' => \$DEBUG, >- 'n=i' => \$limit, >- 'help|h' => \$want_help, >-); >- >-if (not $result or $want_help or ($mode ne 'us' and $mode ne 'metric')) { >- print_usage(); >- exit 0; >-} >- >-our $dbh = C4::Context->dbh; >-$dbh->{AutoCommit} = 0; >-my $sth = $dbh->prepare(" >-SELECT borrowernumber, itemnumber, accountno, description >- FROM accountlines >- WHERE accounttype in ('FU', 'F', 'O', 'M') >-;"); >-$sth->execute(); >- >-my $update_sth = $dbh->prepare(' >-UPDATE accountlines >- SET description = ? >- WHERE borrowernumber = ? AND itemnumber = ? AND accountno = ? >-;'); >- >- >-while (my $accountline = $sth->fetchrow_hashref) { >- my $description = $accountline->{'description'}; >- my $updated = 0; >- >- if ($mode eq 'us') { >- if ($description =~ /$US_DATE/) { # mm/dd/yyyy >- my $date = C4::Dates->new($1, 'us'); >- print "Converting $1 (us) to " . $date->output() . "\n" if $DEBUG; >- $description =~ s/$US_DATE/$date->output()/; >- $updated = 1; >- } >- } elsif ($mode eq 'metric') { >- if ($description =~ /$METRIC_DATE/) { # dd/mm/yyyy >- my $date = C4::Dates->new($1, 'metric'); >- print "Converting $1 (metric) to " . $date->output() . "\n" if $DEBUG; >- $description =~ s/$METRIC_DATE/$date->output()/; >- $updated = 2; >- } >- } >- >- print "Changing description from '" . $accountline->{'description'} . "' to '" . $description . "'\n" if $DEBUG; >- $update_sth->execute($description, $accountline->{'borrowernumber'}, $accountline->{'itemnumber'}, $accountline->{'accountno'}); >- >- $done++; >- >- last if ($done == $limit); # $done can't be -1, so this works >-} >- >-$dbh->commit(); >diff --git a/reports/stats.print.pl b/reports/stats.print.pl >deleted file mode 100755 >index 9495360..0000000 >--- a/reports/stats.print.pl >+++ /dev/null >@@ -1,178 +0,0 @@ >-#!/usr/bin/perl >- >-use strict; >-#use warnings; FIXME - Bug 2505 >-use CGI qw ( -utf8 ); >-use C4::Output; >- >-use C4::Auth; >-use C4::Context; >-use Date::Manip; >-use C4::Stats; >-use Text::CSV_XS; >-&Date_Init("DateFormat=non-US"); # set non-USA date, eg:19/08/2005 >- >-my $csv = Text::CSV_XS->new( >- { >- 'quote_char' => '"', >- 'escape_char' => '"', >- 'sep_char' => ',', >- 'binary' => 1 >- } >-); >- >-my $input=new CGI; >-my $time=$input->param('time'); >-my $time2=$input->param('time2'); >- >-my @loop1; >-my @loop2; >-my $date; >-my $date2; >-if ($time eq 'yesterday'){ >- $date=ParseDate('yesterday'); >- $date2=ParseDate('today'); >-} >-if ($time eq 'today'){ >- $date=ParseDate('today'); >- $date2=ParseDate('tomorrow'); >-} >-if ($time eq 'daybefore'){ >- $date=ParseDate('2 days ago'); >- $date2=ParseDate('yesterday'); >-} >-if ($time eq 'month') { >- $date = ParseDate('1 month ago'); >- $date2 = ParseDate('today'); >- >-} >-if ($time=~ /\//){ >- $date=ParseDate($time); >- $date2=ParseDateDelta('+ 1 day'); >- $date2=DateCalc($date,$date2); >-} >- >-if ($time eq ''){ >- $date=ParseDate('today'); >- $date2=ParseDate('tomorrow'); >-} >- >-if ($time2 ne ''){ >- $date=ParseDate($time); >- $date2=ParseDate($time2); >-} >- >-my $date=UnixDate($date,'%Y-%m-%d'); >-my $date2=UnixDate($date2,'%Y-%m-%d'); >- >-#warn "MASON: DATE: $date, $date2"; >- >-#get a list of every payment >-my @payments=TotalPaid($date,$date2); >- >-my $count=@payments; >-# print "MASON: number of payments=$count\n"; >- >-my $i=0; >-my $totalcharges=0; >-my $totalcredits=0; >-my $totalpaid=0; >-my $totalwritten=0; >- >-# lets get a a list of all individual item charges paid for by that payment >-while ($i<$count ){ >- >- my $count; >- my @charges; >- >- if ($payments[$i]{'type'} ne 'writeoff'){ # lets ignore writeoff payments!. >- @charges=getcharges($payments[$i]{'borrowernumber'}, $payments[$i]{'timestamp'}, $payments[$i]{'proccode'}); >- $totalcharges++; >- $count=@charges; >- >- # getting each of the charges and putting them into a array to be printed out >- #this loops per charge per person >- for (my $i2=0;$i2<$count;$i2++){ >- >- my $hour=substr($payments[$i]{'timestamp'},8,2); >- my $min=substr($payments[$i]{'timestamp'},10,2); >- my $sec=substr($payments[$i]{'timestamp'},12,2); >- my $time="$hour:$min:$sec"; >- my $time2="$payments[$i]{'date'}"; >-# my $branch=Getpaidbranch($time2,$payments[$i]{'borrowernumber'}); >- my $branch=$payments[$i]{'branch'}; >- >- my @rows1 = ($branch, # lets build up a row >- $payments[$i]->{'datetime'}, >- $payments[$i]->{'surname'}, >- $payments[$i]->{'firstname'}, >- $charges[$i2]->{'description'}, >- $charges[$i2]->{'accounttype'}, >- # rounding amounts to 2dp and adding dollar sign to make excel read it as currency format >- "\$".sprintf("%.2f", $charges[$i2]->{'amount'}), >- $payments[$i]->{'type'}, >- "\$".$payments[$i]->{'value'}); >- >- push (@loop1, \@rows1); >- $totalpaid = $totalpaid + $payments[$i]->{'value'}; >- } >- } else { >- ++$totalwritten; >- } >- >- $i++; #increment the while loop >-} >- >-#get credits and append to the bottom of payments >-my @credits=getcredits($date,$date2); >- >-my $count=@credits; >-my $i=0; >- >-while ($i<$count ){ >- >- my @rows2 = ($credits[$i]->{'branchcode'}, >- $credits[$i]->{'date'}, >- $credits[$i]->{'surname'}, >- $credits[$i]->{'firstname'}, >- $credits[$i]->{'description'}, >- $credits[$i]->{'accounttype'}, >- "\$".$credits[$i]->{'amount'}); >- >- push (@loop2, \@rows2); >- $totalcredits = $totalcredits + $credits[$i]->{'amount'}; >- $i++; >-} >- >-#takes off first char minus sign "-100.00" >-$totalcredits = substr($totalcredits, 1); >- >-print $input->header( >- -type => 'application/vnd.ms-excel', >- -attachment => "stats.csv", >-); >-print "Branch, Datetime, Surname, Firstnames, Description, Type, Invoice amount, Payment type, Payment Amount\n"; >- >- >-for my $row ( @loop1 ) { >- >- $csv->combine(@$row); >- my $string = $csv->string; >- print $string, "\n"; >-} >- >-print ",,,,,,,\n"; >- >-for my $row ( @loop2 ) { >- >- $csv->combine(@$row); >- my $string = $csv->string; >- print $string, "\n"; >-} >- >-print ",,,,,,,\n"; >-print ",,,,,,,\n"; >-print ",,Total Amount Paid, $totalpaid\n"; >-print ",,Total Number Written, $totalwritten\n"; >-print ",,Total Amount Credits, $totalcredits\n"; >- >diff --git a/reports/stats.screen.pl b/reports/stats.screen.pl >deleted file mode 100755 >index 9ce4fe8..0000000 >--- a/reports/stats.screen.pl >+++ /dev/null >@@ -1,265 +0,0 @@ >-#!/usr/bin/perl >- >-# Copyright Katipo Communications 2006 >-# >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it >-# under the terms of the GNU General Public License as published by >-# the Free Software Foundation; either version 3 of the License, or >-# (at your option) any later version. >-# >-# Koha is distributed in the hope that it will be useful, but >-# WITHOUT ANY WARRANTY; without even the implied warranty of >-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >-# GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License >-# along with Koha; if not, see <http://www.gnu.org/licenses>. >- >- >-use strict; >-#use warnings; FIXME - Bug 2505 >-use CGI qw ( -utf8 ); >-use C4::Output; >-use C4::Auth; >-use C4::Context; >-use C4::Stats; >-use C4::Accounts; >-use C4::Debug; >-use Date::Manip; >- >-my $input = new CGI; >-my $time = $input->param('time'); >-my $time2 = $input->param('time2'); >-my $op = $input->param('submit'); >- >-my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >- { >- template_name => "reports/stats_screen.tt", >- query => $input, >- type => "intranet", >- flagsrequired => { reports => '*' }, >- } >-); >- >-( $time = "today" ) if !$time; >-( $time2 = "tomorrow" ) if !$time2; >- >-my $date = ParseDate($time); >-my $date2 = ParseDate($time2); >-$date = UnixDate( $date, '%Y-%m-%d' ); >-$date2 = UnixDate( $date2, '%Y-%m-%d' ); >-$debug and warn "MASON: TIME: $time, $time2"; >-$debug and warn "MASON: DATE: $date, $date2"; >- >-# get a list of every payment >-my @payments = TotalPaid( $date, $date2 ); >- >-my $count = @payments; >- >-$debug and warn "MASON: number of payments=$count\n"; >- >-my $i = 0; >-my $totalcharges = 0; >-my $totalcredits = 0; >-my $totalpaid = 0; >-my $totalwritten = 0; >-my @loop1; >-my @loop2; >- >-# lets get a a list of all individual item charges paid for by that payment >- >-foreach my $payment (@payments) { >- >- my @charges; >- if ( $payment->{'type'} ne 'writeoff' ) { >- >- @charges = getcharges( >- $payment->{'borrowernumber'}, >- $payment->{'timestamp'}, >- $payment->{'proccode'} >- ); >- $totalcharges++; >- my $count = @charges; >- >- # getting each of the charges and putting them into a array to be printed out >- #this loops per charge per person >- for ( my $i2 = 0 ; $i2 < $count ; $i2++ ) { >- my $hour = substr( $payment->{'timestamp'}, 8, 2 ); >- my $min = substr( $payment->{'timestamp'}, 10, 2 ); >- my $sec = substr( $payment->{'timestamp'}, 12, 2 ); >- my $time = "$hour:$min:$sec"; >- my $time2 = "$payment->{'date'}"; >- >- # my $branch=Getpaidbranch($time2,$payment->{'borrowernumber'}); >- my $branch = $payment->{'branch'}; >- >- # lets build up a row >- my %rows1 = ( >- branch => $branch, >- datetime => $payment->{'datetime'}, >- surname => $payment->{'surname'}, >- firstname => $payment->{'firstname'}, >- description => $charges[$i2]->{'description'}, >- accounttype => $charges[$i2]->{'accounttype'}, >- amount => sprintf( "%.2f", $charges[$i2]->{'amount'} ) >- , # rounding amounts to 2dp >- type => $payment->{'type'}, >- value => sprintf( "%.2f", $payment->{'value'} ) >- ); # rounding amounts to 2dp >- >- push( @loop1, \%rows1 ); >- >- } >- $totalpaid = $totalpaid + $payment->{'value'}; >- $debug and warn "totalpaid = $totalpaid"; >- } >- else { >- ++$totalwritten; >- } >- >-} >- >-#get credits and append to the bottom of payments >-my @credits = getcredits( $date, $date2 ); >- >-my $count = @credits; >-my $i = 0; >- >-while ( $i < $count ) { >- >- my %rows2 = ( >- creditbranch => $credits[$i]->{'branchcode'}, >- creditdate => $credits[$i]->{'date'}, >- creditsurname => $credits[$i]->{'surname'}, >- creditfirstname => $credits[$i]->{'firstname'}, >- creditdescription => $credits[$i]->{'description'}, >- creditaccounttype => $credits[$i]->{'accounttype'}, >- creditamount => sprintf( "%.2f", $credits[$i]->{'amount'} ) >- ); >- >- push( @loop2, \%rows2 ); >- $totalcredits = $totalcredits + $credits[$i]->{'amount'}; >- $i++; #increment the while loop >-} >- >-#takes off first char minus sign "-100.00" >-$totalcredits = substr( $totalcredits, 1 ); >- >-my $totalrefunds = 0; >-my @loop3; >-my @refunds = getrefunds( $date, $date2 ); >-$count = @refunds; >-$i = 0; >- >-while ( $i < $count ) { >- >- my %rows3 = ( >- refundbranch => $refunds[$i]->{'branchcode'}, >- refunddate => $refunds[$i]->{'datetime'}, >- refundsurname => $refunds[$i]->{'surname'}, >- refundfirstname => $refunds[$i]->{'firstname'}, >- refunddescription => $refunds[$i]->{'description'}, >- refundaccounttype => $refunds[$i]->{'accounttype'}, >- refundamount => sprintf( "%.2f", $refunds[$i]->{'amount'} ) >- ); >- >- push( @loop3, \%rows3 ); >- $totalrefunds = $totalrefunds + $refunds[$i]->{'amount'}; >- $i++; #increment the while loop >-} >- >-my $totalcash = $totalpaid - $totalrefunds; >- >-if ( $op eq 'To Excel' ) { >- >- my $csv = Text::CSV_XS->new( >- { >- 'quote_char' => '"', >- 'escape_char' => '"', >- 'sep_char' => ',', >- 'binary' => 1 >- } >- ); >- >- print $input->header( >- -type => 'application/vnd.ms-excel', >- -attachment => "stats.csv", >- ); >- print >-"Branch, Datetime, Surname, Firstnames, Description, Type, Invoice amount, Payment type, Payment Amount\n"; >- >- $DB::single = 1; >- >- for my $row (@loop1) { >- my @array = ( >- $row->{'branch'}, $row->{'datetime'}, >- $row->{'surname'}, $row->{'firstname'}, >- $row->{'description'}, $row->{'accounttype'}, >- $row->{'amount'}, $row->{'type'}, >- $row->{'value'} >- ); >- >- $csv->combine(@array); >- my $string = $csv->string(@array); >- print $string, "\n"; >- } >- print ",,,,,,,\n"; >- print >-"Branch, Date/time, Surname, Firstname, Description, Charge Type, Invoice Amount\n"; >- >- for my $row (@loop2) { >- >- my @array = ( >- $row->{'creditbranch'}, $row->{'creditdate'}, >- $row->{'creditsurname'}, $row->{'creditfirstname'}, >- $row->{'creditdescription'}, $row->{'creditaccounttype'}, >- $row->{'creditamount'} >- ); >- >- $csv->combine(@array); >- my $string = $csv->string(@array); >- print $string, "\n"; >- } >- print ",,,,,,,\n"; >- print >-"Branch, Date/time, Surname, Firstname, Description, Charge Type, Invoice Amount\n"; >- >- for my $row (@loop3) { >- my @array = ( >- $row->{'refundbranch'}, $row->{'refunddate'}, >- $row->{'refundsurname'}, $row->{'refundfirstname'}, >- $row->{'refunddescription'}, $row->{'refundaccounttype'}, >- $row->{'refundamount'} >- ); >- >- $csv->combine(@array); >- my $string = $csv->string(@array); >- print $string, "\n"; >- >- } >- >- print ",,,,,,,\n"; >- print ",,,,,,,\n"; >- print ",,Total Amount Paid, $totalpaid\n"; >- print ",,Total Number Written, $totalwritten\n"; >- print ",,Total Amount Credits, $totalcredits\n"; >- print ",,Total Amount Refunds, $totalrefunds\n"; >-} >-else { >- $template->param( >- date => $time, >- date2 => $time2, >- loop1 => \@loop1, >- loop2 => \@loop2, >- loop3 => \@loop3, >- totalpaid => $totalpaid, >- totalcredits => $totalcredits, >- totalwritten => $totalwritten, >- totalrefund => $totalrefunds, >- totalcash => $totalcash, >- ); >- output_html_with_http_headers $input, $cookie, $template->output; >-} >- >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6427
:
21922
|
22704
|
22705
|
22708
|
22709
|
22710
|
22741
|
22870
|
22871
|
22872
|
22873
|
22874
|
22875
|
22876
|
22881
|
22889
|
22940
|
22948
|
22949
|
22995
|
23000
|
23137
|
23158
|
23161
|
23171
|
23186
|
23269
|
23275
|
23276
|
23391
|
23392
|
23400
|
23401
|
23402
|
23403
|
23404
|
23405
|
23406
|
23407
|
23408
|
23409
|
23410
|
23411
|
23412
|
23413
|
23420
|
23421
|
23422
|
23423
|
23424
|
23425
|
23426
|
23427
|
23428
|
23429
|
23430
|
23431
|
23432
|
23433
|
23440
|
23441
|
23442
|
23443
|
23444
|
23445
|
23446
|
23447
|
23448
|
23449
|
23450
|
23451
|
23452
|
23453
|
23454
|
23458
|
23459
|
23460
|
23461
|
23462
|
23463
|
23464
|
23465
|
23466
|
23467
|
23468
|
23469
|
23470
|
23471
|
23603
|
23643
|
23644
|
23645
|
23646
|
23647
|
23648
|
23649
|
23650
|
23651
|
23652
|
23653
|
23654
|
23655
|
23656
|
23657
|
23937
|
23938
|
23939
|
23940
|
23941
|
23942
|
23943
|
23944
|
23945
|
23946
|
23947
|
23948
|
23949
|
23950
|
23951
|
24612
|
24613
|
24614
|
24615
|
24616
|
24617
|
24618
|
24619
|
24620
|
24621
|
24622
|
24623
|
24624
|
24625
|
24626
|
24627
|
24628
|
24757
|
24758
|
24759
|
24760
|
24761
|
24762
|
24763
|
24764
|
24765
|
24766
|
24767
|
24768
|
24769
|
24770
|
24771
|
24772
|
24777
|
24792
|
24793
|
24794
|
24795
|
24796
|
24797
|
24798
|
24799
|
24800
|
24801
|
24802
|
24803
|
24804
|
24805
|
24806
|
24807
|
24808
|
24809
|
24810
|
24811
|
24812
|
24813
|
24814
|
24815
|
24816
|
24817
|
24818
|
24819
|
24820
|
24821
|
24822
|
24823
|
24824
|
24825
|
24826
|
24827
|
24828
|
24829
|
24830
|
24831
|
24832
|
24833
|
24834
|
24835
|
24836
|
24837
|
24838
|
24839
|
24840
|
24841
|
24842
|
24843
|
24844
|
25777
|
25778
|
25779
|
25780
|
25781
|
25782
|
25783
|
25784
|
25785
|
25786
|
25787
|
25788
|
25789
|
25790
|
25791
|
25792
|
25793
|
25794
|
25795
|
25796
|
25797
|
25798
|
25799
|
25800
|
25801
|
25802
|
25803
|
25804
|
25805
|
25806
|
25807
|
25808
|
25809
|
25810
|
25811
|
25812
|
25813
|
25814
|
25815
|
25816
|
25930
|
25932
|
25933
|
25934
|
26033
|
26034
|
26035
|
26036
|
26107
|
27167
|
27168
|
27169
|
27170
|
27171
|
27172
|
27173
|
27174
|
27175
|
27176
|
27177
|
27178
|
27179
|
27180
|
27181
|
27182
|
27183
|
27184
|
27185
|
27186
|
27187
|
27189
|
27190
|
27197
|
28067
|
28068
|
28069
|
28070
|
28071
|
28072
|
28073
|
28074
|
28075
|
28076
|
28077
|
28078
|
28079
|
28080
|
28081
|
28082
|
28083
|
28084
|
28085
|
28086
|
28087
|
28088
|
28089
|
28090
|
28091
|
28527
|
28528
|
28529
|
28530
|
28531
|
28532
|
28533
|
28534
|
28535
|
28536
|
28537
|
28538
|
28539
|
28540
|
28541
|
28542
|
28543
|
28544
|
28545
|
28546
|
28547
|
28548
|
28549
|
28550
|
28551
|
28552
|
28553
|
28555
|
28556
|
28561
|
28563
|
28564
|
28795
|
28796
|
28797
|
28798
|
28799
|
28800
|
28801
|
28802
|
28803
|
28804
|
28805
|
28806
|
28807
|
28808
|
28809
|
28810
|
28811
|
28812
|
28813
|
28814
|
28815
|
28816
|
28817
|
28818
|
28819
|
28820
|
28821
|
28822
|
28887
|
28888
|
28889
|
28890
|
28909
|
29176
|
29230
|
29231
|
29232
|
29233
|
29234
|
29235
|
29236
|
29237
|
29238
|
29239
|
29240
|
29241
|
29242
|
29243
|
29244
|
29245
|
29246
|
29247
|
29248
|
29249
|
29250
|
29251
|
29252
|
29253
|
29254
|
29255
|
29256
|
29257
|
29258
|
29259
|
29260
|
29261
|
29262
|
29263
|
29264
|
29265
|
29706
|
29707
|
29708
|
29709
|
29710
|
29711
|
29712
|
29713
|
29714
|
29715
|
29716
|
29717
|
29719
|
29720
|
29721
|
29722
|
29723
|
29724
|
29725
|
29726
|
29727
|
29728
|
29729
|
29730
|
30271
|
30272
|
30273
|
30274
|
30275
|
30276
|
30277
|
30278
|
30279
|
30280
|
30281
|
30282
|
30320
|
30321
|
30322
|
30323
|
30324
|
30325
|
30326
|
30327
|
30328
|
30329
|
30330
|
30331
|
30416
|
30417
|
30418
|
30419
|
30420
|
30421
|
30422
|
30423
|
30424
|
30425
|
30426
|
30427
|
31477
|
31478
|
31479
|
31480
|
31481
|
31482
|
31483
|
31484
|
31485
|
31486
|
31487
|
31488
|
31754
|
31755
|
31756
|
31757
|
31758
|
31759
|
31760
|
31761
|
31762
|
31763
|
31764
|
31765
|
31766
|
31767
|
31768
|
31769
|
31770
|
31771
|
31772
|
31773
|
31774
|
31775
|
31776
|
31777
|
32478
|
32479
|
32480
|
32481
|
32482
|
32483
|
32484
|
32485
|
32486
|
32487
|
32488
|
32489
|
32591
|
32592
|
32593
|
32594
|
32595
|
32596
|
32597
|
32598
|
32599
|
32600
|
32601
|
32602
|
32827
|
32828
|
32829
|
32830
|
32831
|
32832
|
32833
|
32834
|
32835
|
32836
|
32837
|
32838
|
33251
|
33252
|
33253
|
33254
|
33255
|
33256
|
33257
|
33258
|
33259
|
33260
|
33261
|
33262
|
34096
|
34097
|
34098
|
34099
|
34100
|
34101
|
34102
|
34103
|
34104
|
34105
|
34106
|
34107
|
34204
|
34205
|
34206
|
34207
|
34208
|
34209
|
34210
|
34211
|
34212
|
34213
|
34214
|
34215
|
35196
|
35197
|
35198
|
35199
|
35200
|
35201
|
35202
|
35203
|
35204
|
35205
|
35206
|
35207
|
35208
|
35302
|
36324
|
36326
|
36327
|
36328
|
36329
|
36330
|
36331
|
36332
|
36333
|
36334
|
36335
|
36337
|
36338
|
36340
|
36380
|
36391
|
36393
|
37127
|
37128
|
37129
|
37130
|
37131
|
37133
|
37134
|
37135
|
37136
|
37137
|
37138
|
37139
|
37140
|
37141
|
37142
|
37143
|
37147
|
37148
|
37149
|
37150
|
37151
|
37152
|
37153
|
37154
|
37155
|
37156
|
37157
|
37158
|
37159
|
37160
|
37161
|
37162
|
37229
|
37230
|
37231
|
37232
|
37233
|
37234
|
37235
|
37236
|
37237
|
37238
|
37239
|
37240
|
37241
|
37242
|
37243
|
37244
|
38247
|
38248
|
38249
|
38250
|
38251
|
38252
|
38253
|
38254
|
38255
|
38256
|
38257
|
38258
|
38259
|
38260
|
38261
|
38262
|
39063
|
39064
|
39065
|
39066
|
39067
|
39069
|
39070
|
39071
|
39072
|
39073
|
39074
|
39075
|
39076
|
39077
|
39078
|
39079
|
39671
|
39672
|
39673
|
39674
|
39675
|
39676
|
39677
|
39678
|
39679
|
39680
|
39681
|
39682
|
39683
|
39684
|
39685
|
39686