From d22e1e8a469886c0edcace1a8b081658c3a8140f Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Tue, 28 Apr 2009 22:05:56 +0200 Subject: [PATCH] removing useless code * bookfund.pl (replaced by budgets.pl) * spent.pl (useless now) --- acqui/bookfund.pl | 101 --------------- acqui/spent.pl | 85 ------------- .../en/includes/bookfund-admin-search.inc | 115 ------------------ .../prog/en/modules/acqui/bookfund.tmpl | 63 ---------- .../prog/en/modules/acqui/spent.tmpl | 75 ------------ 5 files changed, 439 deletions(-) delete mode 100755 acqui/bookfund.pl delete mode 100755 acqui/spent.pl delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/bookfund-admin-search.inc delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/bookfund.tmpl delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tmpl diff --git a/acqui/bookfund.pl b/acqui/bookfund.pl deleted file mode 100755 index 4769b9b323..0000000000 --- a/acqui/bookfund.pl +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/perl - -# Copyright 2006 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA - -use C4::Context; -use strict; -use CGI; -use C4::Auth; -use C4::Output; - -my $dbh = C4::Context->dbh; -my $input = new CGI; -my $bookfund = $input->param('bookfund'); -my $start = $input->param('start'); -my $end = $input->param('end'); - -my ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { - template_name => "acqui/bookfund.tmpl", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => { acquisition => 1 }, - debug => 1, - } -); - -my $query = ' -SELECT quantity, - datereceived, - freight, - unitprice, - listprice, - ecost, - quantityreceived AS qrev, - subscription, - title, - itemtype, - aqorders.biblionumber, - aqorders.booksellerinvoicenumber, - quantity-quantityreceived AS tleft, - aqorders.ordernumber AS ordnum, - entrydate, - budgetdate, - booksellerid, - aqbasket.basketno - FROM aqorders - INNER JOIN aqorderbreakdown - ON aqorderbreakdown.ordernumber = aqorders.ordernumber - INNER JOIN aqbasket - ON aqbasket.basketno = aqorders.basketno - LEFT JOIN biblioitems - ON biblioitems.biblioitemnumber = aqorders.biblioitemnumber - WHERE bookfundid = ? - AND budgetdate >= ? - AND budgetdate < ? - AND (datecancellationprinted IS NULL - OR datecancellationprinted = \'0000-00-00\') -'; -my $sth = $dbh->prepare($query); -$sth->execute( $bookfund, $start, $end ); -my @commited_loop; - -my $total = 0; -while ( my $data = $sth->fetchrow_hashref ) { - my $left = $data->{'tleft'}; - if ( !$left || $left eq '' ) { - $left = $data->{'quantity'}; - } - if ( $left && $left > 0 ) { - my $subtotal = $left * $data->{'ecost'}; - $data->{subtotal} = sprintf("%.2f",$subtotal); - $data->{'left'} = $left; - push @commited_loop, $data; - $total += $subtotal; - } -} - -$template->param( - COMMITTEDLOOP => \@commited_loop, - total => sprintf("%.2f",$total), -); -$sth->finish; -$dbh->disconnect; - -output_html_with_http_headers $input, $cookie, $template->output; diff --git a/acqui/spent.pl b/acqui/spent.pl deleted file mode 100755 index c9c13ea3a6..0000000000 --- a/acqui/spent.pl +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/perl - -# script to show a breakdown of committed and spent budgets - -# needs to be templated at some point - -use C4::Context; -use C4::Auth; -use C4::Output; -use strict; -use CGI; - -my $dbh = C4::Context->dbh; -my $input = new CGI; -my $bookfund = $input->param('bookfund'); -my $start = $input->param('start'); -my $end = $input->param('end'); - -my ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { - template_name => "acqui/spent.tmpl", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => { acquisition => 1 }, - debug => 1, - } -); - -#James Winter 3/4/2009: Original query does not select spent rows -# correctly due to missing joins between tables - -my $query = -"Select distinct quantity,datereceived,freight,unitprice,listprice,ecost,quantityreceived - as qrev,subscription,title,itype as itemtype,aqorders.biblionumber,aqorders.booksellerinvoicenumber, - quantity-quantityreceived as tleft, - aqorders.ordernumber - as ordnum,entrydate,budgetdate,aqbasket.booksellerid,aqbasket.basketno - from aqorders - inner join aqorderbreakdown on aqorderbreakdown.ordernumber = aqorders.ordernumber - inner join aqbasket on aqbasket.basketno = aqorders.basketno - left join items on items.biblionumber=aqorders.biblionumber - where bookfundid=? and - aqorders.ordernumber=aqorderbreakdown.ordernumber and - aqorders.basketno=aqbasket.basketno - and ( - (datereceived >= ? and datereceived < ?)) - and (datecancellationprinted is NULL or - datecancellationprinted='0000-00-00') - - - "; -my $sth = $dbh->prepare($query); -$sth->execute( $bookfund, $start, $end ); - -my $total = 0; -my $toggle; -my @spent_loop; -while ( my $data = $sth->fetchrow_hashref ) { - my $recv = $data->{'qrev'}; - if ( $recv > 0 ) { - my $subtotal = $recv * $data->{'unitprice'}; - $data->{'subtotal'} = $subtotal; - $data->{'unitprice'} += 0; - $total += $subtotal; - if ($toggle) { - $toggle = 0; - } - else { - $toggle = 1; - } - $data->{'toggle'} = $toggle; - push @spent_loop, $data; - } - -} - -$template->param( - SPENTLOOP => \@spent_loop, - total => $total -); -$sth->finish; - -$dbh->disconnect; -output_html_with_http_headers $input, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/bookfund-admin-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/bookfund-admin-search.inc deleted file mode 100644 index aa405d271a..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/bookfund-admin-search.inc +++ /dev/null @@ -1,115 +0,0 @@ - -

- - - diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/bookfund.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/bookfund.tmpl deleted file mode 100644 index 3dba4b2e8a..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/bookfund.tmpl +++ /dev/null @@ -1,63 +0,0 @@ - -Koha › Acquisitions › Funds - - - - - - - - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TitleOrderItemtypeLeft on OrderEstimated cost per unitBudget DateSubtotal
&booksellerid=&basketno=">
Total     
- -
-
-
- -
-
- diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tmpl deleted file mode 100644 index 50b8455aea..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tmpl +++ /dev/null @@ -1,75 +0,0 @@ - -Koha › Acquisitions › Budgets and Funds: Spent - - - - - - - - -
-
-
-
- -

Budgets and funds

-

Spent

- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TitleOrderVendorInvoiceItemtypeReceievedUnit PriceDate ReceivedSubtotal
- &biblio=&invoice=&supplierid=&catview=yes"> &supplierid=>
Total       
- -
-
-
- -
-
- -- 2.39.5