From 73de15b3ffa17caf729cc54cee9eac228f8d87b0 Mon Sep 17 00:00:00 2001 From: tipaul Date: Fri, 2 Jul 2004 15:55:06 +0000 Subject: [PATCH] Adding 2 new fields, called "sort1" and "sort2" They can be used for sorting & statistics reasons by the library. --- C4/Catalogue.pm | 15 ++++++++------- acqui/addorder.pl | 6 ++++-- acqui/newbiblio.pl | 5 +++-- .../intranet-tmpl/default/en/acqui/newbiblio.tmpl | 11 +++++++++-- updater/updatedatabase | 8 +++++++- 5 files changed, 31 insertions(+), 14 deletions(-) diff --git a/C4/Catalogue.pm b/C4/Catalogue.pm index e497da5720..d976a9f25e 100644 --- a/C4/Catalogue.pm +++ b/C4/Catalogue.pm @@ -174,7 +174,7 @@ C<$subscription> may be either "yes", or anything else for "no". =cut #' sub neworder { - my ($bibnum,$title,$ordnum,$basket,$quantity,$listprice,$supplier,$who,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst,$budget,$cost,$sub,$invoice)=@_; + my ($bibnum,$title,$ordnum,$basket,$quantity,$listprice,$supplier,$who,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst,$budget,$cost,$sub,$invoice,$sort1,$sort2)=@_; if ($budget eq 'now'){ $budget="now()"; } else { @@ -188,11 +188,11 @@ sub neworder { my $dbh = C4::Context->dbh; my $sth=$dbh->prepare("insert into aqorders (biblionumber,title,basketno, quantity,listprice,booksellerid,entrydate,requisitionedby,authorisedby,notes, - biblioitemnumber,rrp,ecost,gst,unitprice,subscription,booksellerinvoicenumber) - values (?,?,?,?,?,?,now(),?,?,?,?,?,?,?,?,?,?)"); + biblioitemnumber,rrp,ecost,gst,unitprice,subscription,booksellerinvoicenumber,sort1,sort2) + values (?,?,?,?,?,?,now(),?,?,?,?,?,?,?,?,?,?,?,?)"); $sth->execute($bibnum,$title,$basket,$quantity,$listprice,$supplier, $who,$who,$notes,$bibitemnum,$rrp,$ecost,$gst,$cost, - $sub,$invoice); + $sub,$invoice,$sort1,$sort2); $sth->finish; $sth=$dbh->prepare("select * from aqorders where biblionumber=? and basketno=? and ordernumber >=?"); @@ -252,15 +252,16 @@ table are also updated to the new book fund ID. =cut #' sub modorder { - my ($title,$ordnum,$quantity,$listprice,$bibnum,$basketno,$supplier,$who,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst,$budget,$cost,$invoice)=@_; + my ($title,$ordnum,$quantity,$listprice,$bibnum,$basketno,$supplier,$who,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst,$budget,$cost,$invoice,$sort1,$sort2)=@_; my $dbh = C4::Context->dbh; my $sth=$dbh->prepare("update aqorders set title=?, quantity=?,listprice=?,basketno=?, rrp=?,ecost=?,unitprice=?, - booksellerinvoicenumber=? + booksellerinvoicenumber=?, + sort1=?, sort2=? where ordernumber=? and biblionumber=?"); - $sth->execute($title,$quantity,$listprice,$basketno,$rrp,$ecost,$cost,$invoice,$ordnum,$bibnum); + $sth->execute($title,$quantity,$listprice,$basketno,$rrp,$ecost,$cost,$invoice,$sort1,$sort2,$ordnum,$bibnum); $sth->finish; $sth=$dbh->prepare("update aqorderbreakdown set bookfundid=? where ordernumber=?"); diff --git a/acqui/addorder.pl b/acqui/addorder.pl index 6bf696b719..40573f6e7b 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -62,6 +62,8 @@ if ($listprice eq ''){ my $supplier=$input->param('supplier'); my $notes=$input->param('notes'); my $bookfund=$input->param('bookfund'); +my $sort1=$input->param('sort1'); +my $sort2=$input->param('sort2'); my $who=$loggedinuser; my $bibnum; my $bibitemnum; @@ -116,9 +118,9 @@ if ($quantity ne '0'){ ); } if ($orderexists ne '') { - modorder($title,$ordnum,$quantity,$listprice,$bibnum,$basketno,$supplier,$who,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst,$budget,$cost,$sub,$invoice); + modorder($title,$ordnum,$quantity,$listprice,$bibnum,$basketno,$supplier,$who,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst,$budget,$cost,$sub,$invoice,$sort1,$sort2); }else { - neworder($bibnum,$title,$ordnum,$basketno,$quantity,$listprice,$supplier,$who,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst,$budget,$cost,$sub,$invoice); + neworder($bibnum,$title,$ordnum,$basketno,$quantity,$listprice,$supplier,$who,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst,$budget,$cost,$sub,$invoice,$sort1,$sort2); } } else { $bibnum=$input->param('biblio'); diff --git a/acqui/newbiblio.pl b/acqui/newbiblio.pl index 85abcc8f80..308b8c360f 100755 --- a/acqui/newbiblio.pl +++ b/acqui/newbiblio.pl @@ -148,7 +148,7 @@ $template->param( existing => $biblio, biblioitemnumber => $data->{'biblioitemnumber'}, itemtype => $data->{'itemtype'}, discount => $booksellers[0]->{'discount'}, - listincgst => $booksellers[0]->{'listincgst'}, + listincgst => $booksellers[0]->{'listincgst'}, listprice => $booksellers[0]->{'listprice'}, gstreg => $booksellers[0]->{'gstreg'}, name => $booksellers[0]->{'name'}, @@ -169,8 +169,9 @@ $template->param( existing => $biblio, rrp => $data->{'rrp'}, ecost => $data->{'ecost'}, notes => $data->{'notes'}, + sort1 => $data->{'sort1'}, + sort2 => $data->{'sort2'}, barcode => $data->{'barcode'}, publishercode => $data->{'publishercode'}); output_html_with_http_headers $input, $cookie, $template->output; - diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl index 1fca859d0b..b7fad3ac06 100644 --- a/koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl @@ -146,6 +146,15 @@ win.document.write(""); ">

+

The 2 following fields are available for your own usage. They can be useful for stat purposes

+

+ + "> +

+

+ + "> +

@@ -153,5 +162,3 @@ win.document.write(""); - - diff --git a/updater/updatedatabase b/updater/updatedatabase index 61102b324c..b3dcd0eca0 100755 --- a/updater/updatedatabase +++ b/updater/updatedatabase @@ -331,7 +331,9 @@ my %requirefields = ( 'zipcode' => 'varchar(25)', 'homezipcode' => 'varchar(25)', }, - aqorders => { 'budgetdate' => 'date' }, + aqorders => { 'budgetdate' => 'date', + 'sort1' => 'char(80)', + 'sort2' => 'char(80)', }, aqbudget => {'aqbudgetid' => 'tinyint(4) auto_increment primary key'}, items => {'paidfor' => 'text'}, @@ -1245,6 +1247,10 @@ $sth->finish; exit; # $Log$ +# Revision 1.89 2004/07/02 15:55:08 tipaul +# Adding 2 new fields, called "sort1" and "sort2" +# They can be used for sorting & statistics reasons by the library. +# # Revision 1.88 2004/06/26 23:34:26 rangi # Fixing typo # -- 2.39.5