bugfixes. seems to work better.
authortipaul <tipaul>
Mon, 3 Mar 2003 17:35:29 +0000 (17:35 +0000)
committertipaul <tipaul>
Mon, 3 Mar 2003 17:35:29 +0000 (17:35 +0000)
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

acqui/acquire.pl
acqui/finishreceive.pl
acqui/receive.pl

index 4d6780c..4ca58aa 100755 (executable)
@@ -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;
index 5a387f4..41b28bc 100755 (executable)
@@ -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;
index cf3c3ec..87f4fb9 100755 (executable)
@@ -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,