smalll bugfixes and code cleaning. See mail in koha-devel for remaining questions
authortipaul <tipaul>
Wed, 15 May 2002 14:32:48 +0000 (14:32 +0000)
committertipaul <tipaul>
Wed, 15 May 2002 14:32:48 +0000 (14:32 +0000)
acqui/addorder.pl
acqui/newbiblio.pl

index 1e00b8a..75e9d40 100755 (executable)
@@ -43,18 +43,24 @@ if ($quantity ne '0'){
     #if it doesnt create it
     $bibnum = &newbiblio({ title     => $title?$title:"",
                           author    => $author?$author:"",
-                          copyright => $copyright?$copyright:"" });
+                          copyright => $copyright?$copyright:"",
+                                   series => $series?$series:"",
+
+
+                                    });
     $bibitemnum = &newbiblioitem({ biblionumber => $bibnum,
                                   itemtype     => $itemtype?$itemtype:"",
-                                  isben        => $isbn?$isbn:"" });
+                                  isbn        => $isbn?$isbn:""
+                                                  });
        if ($title) {
                newsubtitle($bibnum,$title);
        }
-    modbiblio({ biblionumber  => $bibnum,
-               title         => $title?$title:"",
-               author        => $author?$author:"",
-               copyrightdate => $copyright?$copyright:"",
-               series        => $series?$series:"" });
+#unuseful (already added 4 line before
+#     modbiblio({ biblionumber  => $bibnum,
+#              title         => $title?$title:"",
+#              author        => $author?$author:"",
+#              copyrightdate => $copyright?$copyright:"",
+#              series        => $series?$series:"" });
   } else {
     $bibnum=$input->param('biblio');
     $bibitemnum=$input->param('bibitemnum');
@@ -62,7 +68,7 @@ if ($quantity ne '0'){
     if ($bibitemnum eq '' || $itemtype ne $oldtype){
       $bibitemnum= &newbiblioitem({ biblionumber => $bibnum,
                                                         itemtype => $itemtype?$itemtype:"",
-                                                        isben => $isbn?$isbn:"" });
+                                                        isbn => $isbn?$isbn:"" });
     }
     &modbiblio({
         biblionumber  => $bibnum,
index 104a1af..98212a9 100755 (executable)
@@ -21,6 +21,7 @@ my $ordnum=$input->param('ordnum');
 my $biblio=$input->param('biblio');
 my $data;
 my $new;
+
 if ($ordnum eq ''){
   $new='yes';
   $ordnum=newordernum;
@@ -35,7 +36,7 @@ if ($ordnum eq ''){
 }else {
   $data=getsingleorder($ordnum);
   $biblio=$data->{'biblionumber'};
-} 
+}
 
 print startpage;
 
@@ -61,11 +62,11 @@ function update(f){
   //  rrp=f.rrp.value
   //  ecost=f.ecost.value  //budgetted cost
   //  GST=f.GST.value
-  //  total=f.total.value  
-  //make useful constants out of the above  
-  exchangerate=f.elements[currency].value      //get exchange rate  
+  //  total=f.total.value
+  //make useful constants out of the above
+  exchangerate=f.elements[currency].value      //get exchange rate
   gst_on=(!listinc && applygst);
-  //do real stuff  
+  //do real stuff
   rrp=listprice*exchangerate;
   ecost=rrp*(100-discount)/100
   GST=0;
@@ -73,17 +74,17 @@ function update(f){
     rrp=rrp*1.125;
     GST=ecost*0.125
   }
-  
+
   total=(ecost+GST)*quantity
-  
-  
+
+
   f.rrp.value=display(rrp)
   f.ecost.value=display(ecost)
   f.GST.value=display(GST)
   f.total.value=display(total)
-  
+
 }
-                                                                     
+
 
 
 function messenger(X,Y,etc){
@@ -128,7 +129,7 @@ if ($new ne 'yes'){
   print "<input type=hidden name=orderexists value=yes>\n";
 }
 print <<printend
-<a href=basket.pl?basket=$basket><img src=/images/view-basket.gif width=187 heigth=42 border=0 align=right alt="View Basket"></a> 
+<a href=basket.pl?basket=$basket><img src=/images/view-basket.gif width=187 heigth=42 border=0 align=right alt="View Basket"></a>
 <FONT SIZE=6><em>$ordnum - Order Details </em></FONT><br>
 Shopping Basket For: $booksellers[0]->{'name'}
 <P>
@@ -162,8 +163,12 @@ my $query="Select itemtype,description from itemtypes order by description";
 my $sth=$dbh->prepare($query);
 $sth->execute;
 print "<option value=\"\">Please choose:\n";
-while (my $data=$sth->fetchrow_hashref){
-  print "<option value=\"" . $data->{'itemtype'} . "\">" . $data->{'description'} . "\n";
+while (my $data2=$sth->fetchrow_hashref){
+       if ($data2->{'itemtype'} eq $data->{'itemtype'}) {
+               print "<option value=\"" . $data2->{'itemtype'} . "\" SELECTED>" . $data2->{'description'} . "\n";
+       } else {
+               print "<option value=\"" . $data2->{'itemtype'} . "\">" . $data2->{'description'} . "\n";
+       }
 }
 $sth->finish;
 $dbh->disconnect;