Adding 2 new fields, called "sort1" and "sort2"

They can be used for sorting & statistics reasons by the library.
This commit is contained in:
tipaul 2004-07-02 15:55:06 +00:00
parent a043d6de11
commit 73de15b3ff
5 changed files with 31 additions and 14 deletions

View File

@ -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=?");

View File

@ -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');

View File

@ -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;

View File

@ -146,6 +146,15 @@ win.document.write("</font></body></html>");
<label>Notes</label>
<input type=text size=20 name=notes value="<!-- TMPL_VAR name="notes" -->">
</p>
<p>The 2 following fields are available for your own usage. They can be useful for stat purposes</p>
<p>
<label>Sort field 1</label>
<input type=text size=20 name=sort1 value="<!-- TMPL_VAR name="sort1" -->">
</p>
<p>
<label>Sort field 2</label>
<input type=text size=20 name=sort2 value="<!-- TMPL_VAR name="sort2" -->">
</p>
<p>
<input type="submit" value="OK" class="button acquisition">
</p>
@ -153,5 +162,3 @@ win.document.write("</font></body></html>");
</div>
</div>
<!-- TMPL_INCLUDE name="acquisitions-bottom.inc" -->

View File

@ -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
#