From: tipaul Date: Mon, 3 Mar 2003 17:35:29 +0000 (+0000) Subject: bugfixes. seems to work better. X-Git-Tag: R_1-9-1~96 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=8dd5bb69de0b3cd1c9c2de77c13a2b2046c7997c;p=koha-ffzg.git bugfixes. seems to work better. NOTES to 1.2 managers : the 1.2 seems to have problems too : * when finishrecieve is called, the booksellerid is lost, and you arrive to the "recieve.pl" again, it's with the 1st bookseller from the DB. * under certain circunstances, the invoice # is lost, and ALL lines from the bookseller are shown. this strange behaviour is fixed too in this commit --- diff --git a/acqui/acquire.pl b/acqui/acquire.pl index 4d6780ced4..4ca58aa5a4 100755 --- a/acqui/acquire.pl +++ b/acqui/acquire.pl @@ -46,7 +46,7 @@ my $freight=$input->param('freight'); my $biblio=$input->param('biblio'); my $catview=$input->param('catview'); my $gst=$input->param('gst'); -my ($count,@results)=ordersearch($search,$biblio,$catview); +my ($count,@results)=ordersearch($search,$id,$biblio,$catview); my ($count2,@booksellers)=bookseller($results[0]->{'booksellerid'}); my @date=split('-',$results[0]->{'entrydate'}); my $date="$date[2]/$date[1]/$date[0]"; @@ -165,6 +165,9 @@ if ($count == 1){ for (my $i=0;$i<$count;$i++){ my %line; $line{isbn} = $results[$i]->{'isbn'}; + $line{basketno} = $results[$i]->{'basketno'}; + $line{quantity} = $results[$i]->{'quantity'}; + $line{quantityrecieved} = $results[$i]->{'quantityreceived'}; $line{ordernumber} = $results[$i]->{'ordernumber'}; $line{biblionumber} = $results[$i]->{'biblionumber'}; $line{invoice} = $invoice; @@ -172,9 +175,16 @@ if ($count == 1){ $line{gst} = $gst; $line{title} = $results[$i]->{'title'}; $line{author} = $results[$i]->{'author'}; + $line{id} = $id; push @loop,\%line; } - $template->param( loop => \@loop); + $template->param( loop => \@loop, + user => $loggedinuser, + date => $date, + name => $booksellers[0]->{'name'}, + id => $id, + invoice => $invoice, +); } output_html_with_http_headers $input, $cookie, $template->output; diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index 5a387f4e41..41b28bce2f 100755 --- a/acqui/finishreceive.pl +++ b/acqui/finishreceive.pl @@ -53,8 +53,6 @@ my $branch=$input->param('branch'); my $bookfund=$input->param('bookfund'); my $itemtype=$input->param('format'); my $isbn=$input->param('ISBN'); -my $bookseller = $input->param('bookseller'); -my $id = $bookseller; my $biblio = { biblionumber => $biblionumber, title => $input->param('title')?$input->param('title'):"", @@ -70,6 +68,7 @@ if ($quantrec != 0){ my $gst=$input->param('gst'); my $freight=$input->param('freight'); my $volinf=$input->param('volinf'); +my $id = $input->param('id'); my $loan=0; if ($itemtype =~ /REF/){ $loan=1; @@ -84,8 +83,8 @@ if ($itemtype =~ /PER/){ volumeddesc => $volinf?$volinf:"", classification => $class?$class:"" }); } -warn "qty : $quantity"; if ($quantity != 0){ + warn "receive : $biblionumber,$ordnum,$quantrec,$user,$cost,$invoiceno,$bibitemno,$freight,$bookfund"; receiveorder($biblionumber,$ordnum,$quantrec,$user,$cost,$invoiceno,$bibitemno,$freight,$bookfund); modbiblio($biblio); &modbibitem({ @@ -116,16 +115,16 @@ if ($quantity != 0){ biblionumber => $biblionumber, replacementprice => $replacement, price => $cost, - booksellerid => $bookseller, + booksellerid => $id, homebranch => $branch, loan => $loan }, @barcodes); if ($error eq ''){ - if ($itemtype ne 'PER'){ - print $input->redirect("/cgi-bin/koha/acqui/receive.pl?invoice=$invoiceno&id=$id&freight=$freight&gst=$gst"); - } else { - print $input->redirect("/acquisitions/"); - } + if ($itemtype ne 'PER'){ + print $input->redirect("/cgi-bin/koha/acqui/receive.pl?invoice=$invoiceno&id=$id&freight=$freight&gst=$gst"); + } else { + print $input->redirect("/acquisitions/"); + } } else { print $input->header; print $error; diff --git a/acqui/receive.pl b/acqui/receive.pl index cf3c3ec11f..87f4fb9e03 100755 --- a/acqui/receive.pl +++ b/acqui/receive.pl @@ -40,7 +40,6 @@ my ($count,@booksellers)=bookseller($id); my $invoice=$input->param('invoice'); my $freight=$input->param('freight'); my $gst=$input->param('gst'); -my $user=$input->remote_user; my $date=localtime(time); my ($template, $loggedinuser, $cookie) @@ -65,7 +64,6 @@ my $tototal; my $toggle; my @loop_orders = (); for (my$i=0;$i<$count;$i++){ - warn "nb : ".$results[$i]->{'ordernumber'}; $total=($results[$i]->{'unitprice'} + $results[$i]->{'freight'}) * $results[$i]->{'quantityreceived'}; $results[$i]->{'unitprice'}+=0; my %line; @@ -98,9 +96,10 @@ $totalfreight=$freight; $tototal=$tototal+$freight; $template->param(invoice => $invoice, - user => $user, + user => $loggedinuser, date => $date, name => $booksellers[0]->{'name'}, + id => $id, gst => $gst, freight => $freight, invoice => $invoice,