Road to 1.9.1
authortipaul <tipaul>
Thu, 13 Feb 2003 17:27:47 +0000 (17:27 +0000)
committertipaul <tipaul>
Thu, 13 Feb 2003 17:27:47 +0000 (17:27 +0000)
* templating of normal acquisitions
* some graphic changes (use of yellow color as "acquisition/cataloguin" symbol, header consistency...)
* minor reordering of screens (newbasket.pl now unused)
* few bugfixes

When templating finished, the recieving of a book will be ended by a "calatoguing" screen.
Cataloguing will be MARC cataloguing or non-MARC cataloguing, depending on "acquisitions" system parameter.

16 files changed:
acqui/addorder.pl
acqui/basket.pl
acqui/modorders.pl
acqui/newbasket.pl [deleted file]
acqui/newbasket2.pl
acqui/newbiblio.pl
acqui/order.pl
acqui/receive.pl
acqui/recieveorder.pl
koha-tmpl/intranet-tmpl/default/en/acqui/newbasket.tmpl [new file with mode: 0644]
koha-tmpl/intranet-tmpl/default/en/acqui/newbasket2.tmpl
koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl [new file with mode: 0644]
koha-tmpl/intranet-tmpl/default/en/acqui/order.tmpl
koha-tmpl/intranet-tmpl/default/en/acqui/recieve.tmpl [new file with mode: 0644]
koha-tmpl/intranet-tmpl/default/en/acqui/recieveorder.tmpl [new file with mode: 0644]
koha-tmpl/intranet-tmpl/default/en/acqui/supplier.tmpl

index a2f7dab..d0aabf1 100755 (executable)
@@ -98,4 +98,4 @@ if ($quantity ne '0'){
        delorder($bibnum,$ordnum);
 }
 
-print $input->redirect("newbasket.pl?id=$supplier&basket=$basketno");
+print $input->redirect("basket.pl?basket=$basketno");
index d5502f7..8625f2c 100755 (executable)
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
+use C4::Auth;
 use C4::Catalogue;
 use C4::Biblio;
 use C4::Output;
 use CGI;
+use C4::Interface::CGI::Output;
+use C4::Database;
+use HTML::Template;
+use C4::Catalogue;
 use strict;
 
-my $input=new CGI;
-print $input->header();
-my $basket=$input->param('basket');
-my ($count,@results)=basket($basket);
-print startpage;
-
-my @inp=startmenu('acquisitions');
+my $query =new CGI;
+my $basket=$query ->param('basket');
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "acqui/basket.tmpl",
+                            query => $query,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {acquisition => 1},
+                            debug => 1,
+                            });
+
+my ($count,@results);
+if ($basket eq ''){
+       $basket=newbasket();
+       $results[0]->{'booksellerid'}=$query->param('id');
+       $results[0]->{'authorisedby'} = $loggedinuser;
+} else {
+       ($count,@results)=basket($basket);
+}
 
-my $count3=@inp;
-for (my $i=0;$i<$count3;$i++){
-      $inp[$i]=~ s/leftmargin=0 topmargin=0\>/leftmargin=0 topmargin=0 onload='update(orderform)'\>/;
-    }
-print @inp;
-# print $count;
 my ($count2,@booksellers)=bookseller($results[0]->{'booksellerid'});
 
-print <<printend
-<div align=right>
-Our Reference: $basket<br>
-Authorised By: $results[0]->{'authorisedby'}<br>
-$results[0]->{'entrydate'};
-</div>
-<FONT SIZE=6><em>Shopping Basket For: <a href=supplier.pl?id=$results[0]->{'booksellerid'}></a> $booksellers[0]->{'name'}</em></FONT>
-<a href=newbasket.pl?id=$results[0]->{'booksellerid'}&basket=$basket>Add more orders</a>
-<CENTER>
-<FORM ACTION="/cgi-bin/koha/search.pl" method=post>
- <b>Search ISBN, Title or Author:</b> <INPUT TYPE="text"  SIZE="25"   NAME="recieve">
-</form>
-<p>
-<FORM ACTION="/cgi-bin/koha/acqui/modorders.pl" method=post name=orderform>
-<table border=0 cellspacing=0 cellpadding=5>
-<tr valign=top bgcolor=#99cc33>
-  <td background="/images/background-mem.gif"><b>ORDER</b></td>
-  <td background="/images/background-mem.gif"><b>ISBN</b></td>
-  <td background="/images/background-mem.gif"><b>TITLE</b></td>
-  <td background="/images/background-mem.gif"><b>AUTHOR</b></td>
-  <td background="/images/background-mem.gif"><b>RRP</b></td>
-  <td background="/images/background-mem.gif"><b>\$EST</b></td>
-  <td background="/images/background-mem.gif"><b>QUANTITY</b></td>
-  <td background="/images/background-mem.gif"><b>TOTAL</b></td></tr>
-printend
-;
-
-
 my $line_total; # total of each line
 my $sub_total; # total of line totals
 my $gist;      # GST
 my $grand_total; # $subttotal + $gist
+my $toggle=0;
 
+my @books_loop;
 for (my $i=0;$i<$count;$i++){
-my $rrp=$results[$i]->{'listprice'};
-if ($results[$i]->{'currency'} ne 'NZD'){
-$rrp=curconvert($results[$i]->{'currency'},$rrp);
+       my $rrp=$results[$i]->{'listprice'};
+       $rrp=curconvert($results[$i]->{'currency'},$rrp);
+
+       $line_total=$results[$i]->{'quantity'}*$results[$i]->{'ecost'};
+       $sub_total+=$line_total;
+       $gist=sprintf("%.2f",$sub_total*0.125);
+       $grand_total=$sub_total+$gist;
+       my %line;
+       if ($toggle==0){
+               $line{color}='#ffffcc';
+               $toggle=1;
+       } else {
+               $line{color}='white';
+               $toggle=0;
+       }
+       $line{ordernumber} = $results[$i]->{'ordernumber'};
+       $line{isbn} = $results[$i]->{'isbn'};
+       $line{booksellerid} = $results[$i]->{'booksellerid'};
+       $line{basket}=$basket;
+       $line{title} = $results[$i]->{'title'};
+       $line{author} = $results[$i]->{'author'};
+       $line{i} = $i;
+       $line{rrp} = $results[$i]->{'rrp'};
+       $line{ecost} = $results[$i]->{'ecost'};
+       $line{quantity} = $results[$i]->{'quantity'};
+       $line{line_total} = $line_total;
+       $line{biblionumber} = $results[$i]->{'biblionumber'};
+       push @books_loop, \%line;
 }
-
-$line_total=$results[$i]->{'quantity'}*$results[$i]->{'ecost'};
-$sub_total+=$line_total;
-$gist=sprintf("%.2f",$sub_total*0.125);
-$grand_total=$sub_total+$gist;
-
-print <<EOP
-<tr valign=top bgcolor=#ffffcc>
-  <td>$results[$i]->{'ordernumber'}</td>
-  <td>$results[$i]->{'isbn'}</td>
-  <td><a href="newbiblio.pl?ordnum=$results[$i]->{'ordernumber'}&id=$results[$i]->{'booksellerid'}&basket=$basket">$results[$i]->{'title'}</a></td>
-  <td>$results[$i]->{'author'}</td>
-  <td>\$<input type=text name=rrp$i size=6 value="$results[$i]->{'rrp'}"></td>
-  <td>\$<input type=text name=eup$i size=6 value="$results[$i]->{'ecost'}"></td>
-  <td><input type=text name=quantity$i size=6 value=$results[$i]->{'quantity'} onchange='update(this.form)'></td>
-  <td>\$<input type=text name=total$i size=10 value=$line_total></td>
-  <input type=hidden name=ordnum$i value=$results[$i]->{'ordernumber'}>
-  <input type=hidden name=bibnum$i value=$results[$i]->{'biblionumber'}>
-</tr>
-EOP
-;
-}
-#
-print "<input type=hidden name=number value=$count>
-<input type=hidden name=basketno value=\"$basket\">";
-print <<EOP
-<tr valign=top bgcolor=white><td colspan=6 rowspan=3  bgcolor=#cccc99  background="/images/background-mem.gif">
-  <b>HELP</b><br>
-  To cancel an order, just change the quantity to 0 and click "save changes".<br>
-  To change any of the catalogue or accounting information attached to an order,  click on the title.<br>
-  To add new orders to this supplier, start with a search. </td>
-  <td><b>SubTotal</b></td>
-  <td>\$<input type=text name=subtotal size=10 value=$sub_total></td></tr>
-<tr valign=top bgcolor=white>
-  <td><b>GST</b></td>
-  <td>\$<input type=text name=gst size=10 value=$gist></td></tr>
-<tr valign=top bgcolor=white><td><b>TOTAL</b></td>
-  <td>\$<input type=text name=grandtotal size=10 value=$grand_total></td></tr>
-<tr valign=top bgcolor=white>
-  <td></td>
-  <td></td>
-  <td></td>
-  <td></td>
-  <td></td>
-  <td></td>
-  <td colspan=3><input type=image  name=submit src=/images/save-changes.gif border=0 width=187 height=42 align=right></td></tr>
-</table>
-</CENTER>
-EOP
-  ;
-
-print endmenu('acquisitions');
-
-print endpage;
+$template->param(basket => $basket,
+                                               authorisedby => $results[0]->{'authorisedby'},
+                                               entrydate =>$results[0]->{'entrydate'},
+                                               id=> $results[0]->{'booksellerid'},
+                                               name => $booksellers[0]->{'name'},
+                                               books_loop => \@books_loop,
+                                               count =>$count,
+                                               subtotal => $sub_total,
+                                               gist => $gist,
+                                               grand_total =>$grand_total,
+                                               );
+output_html_with_http_headers $query, $cookie, $template->output;
index c65d58a..925ba2a 100755 (executable)
@@ -26,24 +26,16 @@ use CGI;
 use C4::Output;
 use C4::Catalogue;
 use C4::Biblio;
-#use Date::Manip;
 
 my $input = new CGI;
-#print $input->header;
-#print startpage();
-#print startmenu('acquisitions');
-#print $input->Dump;
 my $basketno=$input->param('basketno');
 my $count=$input->param('number');
 for (my $i=0;$i<$count;$i++){
-  my  $bibnum=$input->param("bibnum$i");
-  my $ordnum=$input->param("ordnum$i");
-  my $quantity=$input->param("quantity$i");
-  if ($quantity == 0){
-    delorder($bibnum,$ordnum);
-  }
+       my  $bibnum=$input->param("bibnum$i");
+       my $ordnum=$input->param("ordnum$i");
+       my $quantity=$input->param("quantity$i");
+       if ($quantity == 0){
+               delorder($bibnum,$ordnum);
+       }
 }
 print $input->redirect("basket.pl?basket=$basketno");
-#print $input->dump;
-#print endmenu('acquisitions');
-#print endpage();
diff --git a/acqui/newbasket.pl b/acqui/newbasket.pl
deleted file mode 100755 (executable)
index f4ccdda..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/usr/bin/perl
-
-# $Id$
-
-#script to show display basket of orders
-#written by chris@katipo.co.nz 24/2/2000
-
-
-# Copyright 2000-2002 Katipo Communications
-#
-# This file is part of Koha.
-#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
-#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
-
-use C4::Catalogue;
-use C4::Biblio;
-use C4::Output;
-use CGI;
-use strict;
-
-my $input=new CGI;
-print $input->header();
-my $user=$input->remote_user;
-my $id=$input->param('id');
-my ($count,@booksellers)=bookseller($id);
-print startpage;
-
-print startmenu('acquisitions');
-
-my $basket=$input->param('basket');
-if ($basket eq ''){
-  $basket=newbasket();
-}
-my $date=localtime(time);
-print <<printend
-
-
-<div align=right>
-Our Reference: HLT-$basket<br>
-Authorised By: $user<br>
-$date
-</div>
-<FONT SIZE=6><em>Shopping Basket For: <a href=/cgi-bin/koha/acqui/supplier.pl?id=$booksellers[0]->{'id'}>
-$booksellers[0]->{'name'}</a></em></FONT><br>
-Ph: $booksellers[0]->{'phone'}, Fax: $booksellers[0]->{'fax'},
-$booksellers[0]->{'address1'}, $booksellers[0]->{'address2'},
-$booksellers[0]->{'address3'}, $booksellers[0]->{'address4'}
-
-
-<p>
-<FORM ACTION="/cgi-bin/koha/acqui/newbasket2.pl" method=post>
-<input type=hidden name=id value="$id">
-<input type=hidden name=basket value="$basket">
-<b> Search Keyword or Title: </b><INPUT TYPE="text"  SIZE="25"   NAME="search">
-
-</form>
-
-
-
-<br clear=all>
-<DL>
-<dt><b>DELIVERY ADDRESS: </b></dt>
-<dd><b>Horowhenua Library Trust</b><br>
-10 Bath St<br>
-Levin<br>
-New Zealand<p>
-
-Ph: +64-6-368 1953<br>
-Email: <a href="mailto:orders\@library.org.nz">orders\@library.org.nz</a>
-
-</dl>
-
-
-printend
-;
-
-print endmenu('acquisitions');
-
-print endpage;
index 741b5f4..f3fcd75 100755 (executable)
@@ -40,12 +40,6 @@ my $type=$input->param('type');
 if ($type eq ''){
   $type = 'intra';
 }
-#setup colours
-my $main;
-my $secondary;
-  $main='#cccc99';
-  $secondary='#ffffcc';
-
 
 #print $input->dump;
 my $blah;
@@ -131,7 +125,7 @@ my @loopresult;
 
 while ($i < $count2){
                my %lineres;
-               my $coltab;
+               my $toggle;
 
        my $result=$results[$i];
        $result->{'title'}=~ s/\`/\\\'/g;
@@ -145,70 +139,70 @@ while ($i < $count2){
                my $itemcount;
        my $location='';
        my $word=$result->{'author'};
-               $word=~ s/([a-z]) +([a-z])/$1%20$2/ig;
-               $word=~ s/  //g;
-               $word=~ s/ /%20/g;
-               $word=~ s/\,/\,%20/g;
-               $word=~ s/\n//g;
-               $lineres{word}=$word;
-               $lineres{type}=$type;
-
-               my ($count,$lcount,$nacount,$fcount,$scount,$lostcount,$mending,$transit)=C4::Search::itemcount($env,$result->{'biblionumber'},$type);
-               if ($nacount > 0){
-                       $location .= "On Loan";
-                       if ($nacount >1 ){
-                               $location .= " ($nacount)";
-                       }
-                       $location.=" ";
+       $word=~ s/([a-z]) +([a-z])/$1%20$2/ig;
+       $word=~ s/  //g;
+       $word=~ s/ /%20/g;
+       $word=~ s/\,/\,%20/g;
+       $word=~ s/\n//g;
+       $lineres{word}=$word;
+       $lineres{type}=$type;
+
+       my ($count,$lcount,$nacount,$fcount,$scount,$lostcount,$mending,$transit)=C4::Search::itemcount($env,$result->{'biblionumber'},$type);
+       if ($nacount > 0){
+               $location .= "On Loan";
+               if ($nacount >1 ){
+                       $location .= " ($nacount)";
                }
-               if ($lcount > 0){
-                       $location .= "Levin";
-                       if ($lcount >1 ){
-                               $location .= " ($lcount)";
-                       }
-                       $location.=" ";
+               $location.=" ";
+       }
+       if ($lcount > 0){
+               $location .= "Levin";
+               if ($lcount >1 ){
+                       $location .= " ($lcount)";
                }
-               if ($fcount > 0){
-                       $location .= "Foxton";
-                       if ($fcount >1 ){
-                               $location .= " ($fcount)";
-                       }
-                       $location.=" ";
+               $location.=" ";
+       }
+       if ($fcount > 0){
+               $location .= "Foxton";
+               if ($fcount >1 ){
+                       $location .= " ($fcount)";
                }
-               if ($scount > 0){
-                       $location .= "Shannon";
-                       if ($scount >1 ){
-                               $location .= " ($scount)";
-                       }
-                       $location.=" ";
+               $location.=" ";
+       }
+       if ($scount > 0){
+               $location .= "Shannon";
+               if ($scount >1 ){
+                       $location .= " ($scount)";
                }
-               if ($lostcount > 0){
-                       $location .= "Lost";
-                       if ($lostcount >1 ){
-                               $location .= " ($lostcount)";
-                       }
-                       $location.=" ";
+               $location.=" ";
+       }
+       if ($lostcount > 0){
+               $location .= "Lost";
+               if ($lostcount >1 ){
+                       $location .= " ($lostcount)";
                }
-               if ($mending > 0){
-                       $location .= "Mending";
-                       if ($mending >1 ){
-                               $location .= " ($mending)";
-                       }
-                       $location.=" ";
+               $location.=" ";
+       }
+       if ($mending > 0){
+               $location .= "Mending";
+               if ($mending >1 ){
+                       $location .= " ($mending)";
                }
-               if ($transit > 0){
-                       $location .= "In Transit";
-                       if ($transit >1 ){
-                               $location .= " ($transit)";
-                       }
-                       $location.=" ";
+               $location.=" ";
+       }
+       if ($transit > 0){
+               $location .= "In Transit";
+               if ($transit >1 ){
+                       $location .= " ($transit)";
                }
-               if ($colour == 1){
-                       $coltab=$secondary;
-                       $colour=0;
+               $location.=" ";
+       }
+       if ($colour == 1){
+               $toggle='#ffffcc';
+               $colour = 0;
        } else{
-                       $coltab=$main;
-                       $colour=1;
+               $colour = 1;
+               $toggle='white';
        }
        $lineres{author2}=$author2;
        $lineres{title2}=$title2;
@@ -219,7 +213,7 @@ while ($i < $count2){
        $lineres{biblionumber}=$result->{biblionumber};
        $lineres{title}=$result->{title};
        $lineres{author}=$result->{author};
-       $lineres{coltab}=$coltab;
+       $lineres{toggle}=$toggle;
        $lineres{itemcount}=$count;
        $lineres{location}=$location;
        push(@loopresult,\%lineres);
index b5f6dbd..82402cf 100755 (executable)
@@ -28,9 +28,15 @@ use C4::Catalogue;
 use C4::Biblio;
 use C4::Output;
 use C4::Search;
+use C4::Auth;
+use C4::Biblio;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use C4::Database;
+use HTML::Template;
 
 my $input=new CGI;
-print $input->header();
+#print $input->header();
 my $id=$input->param('id');
 my $title=$input->param('title');
 my $author=$input->param('author');
@@ -38,306 +44,136 @@ my $copyright=$input->param('copyright');
 my ($count,@booksellers)=bookseller($id);
 my $ordnum=$input->param('ordnum');
 my $biblio=$input->param('biblio');
+my $basket=$input->param('basket');
 my $data;
 my $new;
+my $dbh = C4::Context->dbh;
 if ($ordnum eq ''){
-  $new='yes';
-  $ordnum=newordernum;
-  if ($biblio) {
-               $data=bibdata($biblio);
+       $new='yes';
+       warn "NEW : YES";
+       $ordnum=newordernum;
+       if ($biblio) {
+                       $data=bibdata($biblio);
+       }
+       if ($data->{'title'} eq ''){
+               $data->{'title'}=$title;
+               $data->{'author'}=$author;
+               $data->{'copyrightdate'}=$copyright;
        }
-  if ($data->{'title'} eq ''){
-    $data->{'title'}=$title;
-    $data->{'author'}=$author;
-    $data->{'copyrightdate'}=$copyright;
-  }
 }else {
-  $data=getsingleorder($ordnum);
-  $biblio=$data->{'biblionumber'};
+       $data=getsingleorder($ordnum);
+       $biblio=$data->{'biblionumber'};
 }
-
-print startpage;
-
-print startmenu('acquisitions');
-
-
-my $basket=$input->param('basket');
-print <<printend
-
-
-<script language="javascript" type="text/javascript">
-
-<!--
-
-function update(f){
-  //collect values
-  quantity=f.quantity.value
-  discount=f.discount.value
-  listinc=parseInt(f.listinc.value)
-  currency=f.currency.value
-  applygst=parseInt(f.applygst.value)
-  listprice=f.list_price.value
-  //  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
-  gst_on=(!listinc && applygst);
-  //do real stuff
-  rrp=listprice*exchangerate;
-  ecost=rrp*(100-discount)/100
-  GST=0;
-  if (gst_on){
-    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)
-
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "acqui/newbiblio.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {acquisition => 1},
+                            debug => 1,
+                            });
+
+#my ($count2,$currencies)=getcurrencies;
+my ($count,$rates)=getcurrencies();
+my @loop_currency = ();
+for (my $i=0;$i<$count;$i++){
+       my %line;
+       $line{currency} = $rates->[$i]->{'currency'};
+       $line{rate} = $rates->[$i]->{'rate'};
+       push @loop_currency, \%line;
 }
 
-
-
-function messenger(X,Y,etc){
-win=window.open("","mess","height="+X+",width="+Y+",screenX=150,screenY=0");
-win.focus();
-win.document.close();
-win.document.write("<body link='#333333' bgcolor='#ffffff' text='#000000'><font size=2><p><br>");
-win.document.write(etc);
-win.document.write("<center><form><input type=button onclick='self.close()' value=Close></form></center>");
-win.document.write("</font></body></html>");
-}
-//-->
-
-</script>
-<form action=/cgi-bin/koha/acqui/addorder.pl method=post name=frusin>
-printend
-;
-
-if ($biblio eq ''){
-  print "<input type=hidden name=existing value=no>";
-}
-
-print <<printend
-<!--$title-->
-<input type=hidden name=ordnum value=$ordnum>
-<input type=hidden name=basket value=$basket>
-<input type=hidden name=supplier value=$id>
-<input type=hidden name=biblio value=$biblio>
-<input type=hidden name=bibitemnum value=$data->{'biblioitemnumber'}>
-<input type=hidden name=oldtype value=$data->{'itemtype'}>
-<input type=hidden name=discount value=$booksellers[0]->{'discount'}>
-<input type=hidden name=listinc value=$booksellers[0]->{'listincgst'}>
-<input type=hidden name=currency value=$booksellers[0]->{'listprice'}>
-<input type=hidden name=applygst value=$booksellers[0]->{'gstreg'}>
-printend
-;
-my ($count2,$currencies)=getcurrencies;
-for (my $i=0;$i<$count2;$i++){
-  print "<input type=hidden name=\"$currencies->[$i]->{'currency'}\" value=$currencies->[0]->{'rate'}>\n";
-}
-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>
-<FONT SIZE=6><em>$ordnum - Order Details </em></FONT><br>
-Shopping Basket For: $booksellers[0]->{'name'}
-<P>
-<CENTER>
-<TABLE  CELLSPACING=0  CELLPADDING=5 border=1 align=left width="40%">
-<tr valign=top bgcolor=#99cc33><td background="/images/background-mem.gif" colspan=2><B>CATALOGUE DETAILS</B></td></tr>
-<TR VALIGN=TOP>
-<TD><b>Title *</b></td>
-<td><input type=text size=20 name=title value="$data->{'title'}">
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Author</td>
-<td><input type=text size=20 name=author value="$data->{'author'}" >
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Copyright Date</td>
-<td><input type=text size=20 name=copyright value="$data->{'copyrightdate'}">
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Format</td>
-<td>
-<select name=format size=1>
-printend
-;
-
-my $dbh = C4::Context->dbh;
 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 $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";
-       }
+my  @itemtype;
+my %itemtypes;
+push @itemtype, "";
+$itemtypes{''} = "Please choose";
+while (my ($value,$lib) = $sth->fetchrow_array) {
+       push @itemtype, $value;
+       $itemtypes{$value}=$lib;
 }
-$sth->finish;
-
-print <<printend
-</select>
 
-
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>ISBN</td>
-<td><input type=text size=20 name=ISBN value=$data->{'isbn'}>
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Series</td>
-<td><input type=text size=20 name=Series value="$data->{'seriestitle'}">
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Branch</td>
-<td><select name=branch size=1>
-printend
-;
+my $CGIitemtype=CGI::scrolling_list( -name     => 'format',
+                       -values   => \@itemtype,
+                       -default  => $data->{'itemtype'},
+                       -labels   => \%itemtypes,
+                       -size     => 1,
+                       -multiple => 0 );
+$sth->finish;
+# TODO
 my @branches;
-($count2,@branches)=branches();
+my @select_branch;
+my %select_branches;
+my ($count2,@branches)=branches();
 for (my $i=0;$i<$count2;$i++){
-  print "<option value=$branches[$i]->{'branchcode'}";
-  if ($data->{'branchcode'} == $branches[$i]->{'branchcode'}){
-    print " Selected";
-  }
-  print ">$branches[$i]->{'branchname'}";
+       push @select_branch, $branches[$i]->{'branchcode'};#
+       $select_branches{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'};
 }
-
-print <<printend
-</select>
-</td>
-</tr>
-<TR VALIGN=TOP  bgcolor=#ffffcc>
-<TD >Item Barcode</td>
-<td><input type=text size=20 name=barcode value=
-printend
-;
+my $CGIbranch=CGI::scrolling_list( -name     => 'branch',
+                       -values   => \@select_branch,
+                       -default  => $data->{'branchcode'},
+                       -labels   => \%select_branches,
+                       -size     => 1,
+                       -multiple => 0 );
 
 my $auto_barcode = C4::Context->boolean_preference("autoBarcode") || 0;
        # See whether barcodes should be automatically allocated.
        # Defaults to 0, meaning "no".
+my $barcode;
 if ($auto_barcode eq '1') {
-  my $dbh = C4::Context->dbh;
-  my $query="Select barcode from items order by barcode desc";
-  my $sth=$dbh->prepare($query);
-  $sth->execute;
-  my $data=$sth->fetchrow_hashref;
-  print $data->{'barcode'}+1;
-  $sth->finish;
+       $sth=$dbh->prepare("Select max(barcode) from items");
+       $sth->execute;
+       my $data=$sth->fetchrow_hashref;
+       $barcode = $data->{'barcode'}+1;
+       $sth->finish;
 }
 
-print <<printend
->
-</td>
-</tr>
-</table>
-<img src="/images/holder.gif" width=32 height=250 align=left>
-<table border=1 cellspacing=0 cellpadding=5 width="40%">
-<tr valign=top bgcolor=#99cc33><td background="/images/background-mem.gif" colspan=2><B>ACCOUNTING DETAILS</B></td></tr>
-<TR VALIGN=TOP>
-<TD>Quantity</td>
-<td><input type=text size=20 name=quantity value="$data->{'quantity'}" onchange='update(this.form)' >
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Bookfund</td>
-<td><select name=bookfund size=1>
-printend
-;
-
 my @bookfund;
+my @select_bookfund;
+my %select_bookfunds;
 ($count2,@bookfund)=bookfunds();
 for (my $i=0;$i<$count2;$i++){
-  print "<option value=$bookfund[$i]->{'bookfundid'}";
-  if ($data->{'bookfundid'} == $bookfund[$i]->{'bookfundid'}){
-    print " Selected";
-  }
-  print ">$bookfund[$i]->{'bookfundname'}";
+       push @select_bookfund, $bookfund[$i]->{'bookfundid'};
+       $select_bookfunds{$bookfund[$i]->{'bookfundid'}} = $bookfund[$i]->{'bookfundname'}
 }
+my $CGIbookfund=CGI::scrolling_list( -name     => 'bookfund',
+                       -values   => \@select_bookfund,
+                       -default  => $data->{'bookfundid'},
+                       -labels   => \%select_bookfunds,
+                       -size     => 1,
+                       -multiple => 0 );
+
+$template->param( existing => $biblio,
+                                               title => $title,
+                                               ordnum => $ordnum,
+                                               basket => $basket,
+                                               id => $id,
+                                               biblio => $biblio,
+                                               biblioitemnumber => $data->{'biblioitemnumber'},
+                                               itemtype => $data->{'itemtype'},
+                                               discount => $booksellers[0]->{'discount'},
+                                       listingcst => $booksellers[0]->{'listincgst'},
+                                               listprice => $booksellers[0]->{'listprice'},
+                                               gstreg => $booksellers[0]->{'gstreg'},
+                                               name => $booksellers[0]->{'name'},
+                                               loop_currencies => \@loop_currency,
+                                               orderexists => ($new eq 'yes')?0:1,
+                                               title => $data->{'title'},
+                                               author => $data->{'author'},
+                                               copyrightdate => $data->{'copyrightdate'},
+                                               CGIitemtype => $CGIitemtype,
+                                               CGIbranch => $CGIbranch,
+                                               CGIbookfund => $CGIbookfund,
+                                               isbn => $data->{'isbn'},
+                                               seriestitle => $data->{'seriestitle'},
+                                               quantity => $data->{'quantity'},
+                                               listprice => $data->{'listprice'},
+                                               rrp => $data->{'rrp'},
+                                               ecost => $data->{'ecost'},
+                                               notes => $data->{'notes'},
+                                               barcode => $data->{'barcode'},);
+
+output_html_with_http_headers $input, $cookie, $template->output;
 
-print <<printend
-</select>
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Suppliers List Price</td>
-<td><input type=text size=20 name=list_price value="$data->{'listprice'}" onchange='update(this.form)'>
-</tr>
-<TR VALIGN=TOP>
-<TD>Replacement Cost <br>
-<FONT SIZE=2>(NZ\$ inc GST)</td>
-<td><input type=text size=20 name=rrp value="$data->{'rrp'}" onchange='update(this.form)'>
-</tr>
-<TR VALIGN=TOP>
-<TD>
-Budgeted Cost<BR>
-<FONT SIZE=2>(NZ\$ ex GST, inc discount)</FONT> </td>
-<td><input type=text size=20 name=ecost value="$data->{'ecost'}" onchange='update(this.form)'>
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>
-Budgeted GST</td>
-<td><input type=text size=20 name=GST value="" onchange='update(this.form)'>
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD><B>
-BUDGETED TOTAL</B></td>
-<td><input type=text size=20 name=total value="" onchange='update(this.form)'>
-</td>
-</tr>
-<TR VALIGN=TOP  bgcolor=#ffffcc>
-<TD>Actual Cost</td>
-<td><input type=text size=20 name=cost>
-</td>
-</tr>
-<TR VALIGN=TOP  bgcolor=#ffffcc>
-<TD>Invoice Number *</td>
-<td><input type=text size=20 name=invoice >
-<TR VALIGN=TOP>
-<TD>Notes</td>
-<td><input type=text size=20 name=notes value="$data->{'notes'}">
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD colspan=2>
-<input type=image  name=submit src=/images/add-order.gif border=0 width=187 height=42 align=right>
-</td>
-</tr>
-</table>
-</form>
-</center>
-<table>
-<tr><td bgcolor=#cccc99  background="/images/background-mem.gif"><B>HELP</B><br>
-<UL>
-<LI>If ordering more than one copy of an item you will be prompted to  choose additional bookfunds, and put in additional barcodes at the next screen<P>
-<LI><B>Bold</B> fields must be filled in to create a new bibilo and item.<p>
-<LI>Shaded fields can be used to do a "quick" receive, when items have been purchased locally or gifted. In this case the quantity "ordered" will also  be entered into the database as the quantity received.
-</UL>
-</td></tr></table>
-<p> &nbsp; </p>
-printend
-;
-
-print endmenu('acquisitions');
-
-print endpage;
index f077ced..4c55a43 100755 (executable)
@@ -68,12 +68,11 @@ for (my $i=0; $i<$count; $i++) {
        my @loop_basket;
        for (my $i2=0;$i2<$ordcount;$i2++){
                my %inner_line;
-       warn "bask : ".$orders->[$i2]->{'basketno'};
-                       $inner_line{basketno} =$orders->[$i2]->{'basketno'};
-                       $inner_line{total} =$orders->[$i2]->{'count(*)'};
-                       $inner_line{authorisedby} = $orders->[$i2]->{'authorisedby'};
-                       $inner_line{entrydate} = $orders->[$i2]->{'entrydate'};
-                       push @loop_basket, \%inner_line;
+               $inner_line{basketno} =$orders->[$i2]->{'basketno'};
+               $inner_line{total} =$orders->[$i2]->{'count(*)'};
+               $inner_line{authorisedby} = $orders->[$i2]->{'authorisedby'};
+               $inner_line{entrydate} = $orders->[$i2]->{'entrydate'};
+               push @loop_basket, \%inner_line;
        }
        $line{loop_basket} = \@loop_basket;
        push @loop_suppliers, \%line;
index 3b33909..cf3c3ec 100755 (executable)
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
+use C4::Auth;
 use C4::Catalogue;
 use C4::Biblio;
 use C4::Output;
 use CGI;
+use C4::Interface::CGI::Output;
+use C4::Database;
+use HTML::Template;
+use C4::Catalogue;
 use strict;
 
 my $input=new CGI;
-print $input->header();
 my $id=$input->param('id');
 my ($count,@booksellers)=bookseller($id);
 my $invoice=$input->param('invoice');
@@ -38,125 +42,75 @@ my $freight=$input->param('freight');
 my $gst=$input->param('gst');
 my $user=$input->remote_user;
 my $date=localtime(time);
-print startpage;
-
-print startmenu('acquisitions');
-
-print <<EOP
-
-<div align=right>
-Invoice: $invoice<br>
-Received By: $user<br>
-$date
-</div>
-<FONT SIZE=6><em>Receipt Summary For : <a href=whitcoulls.html>$booksellers[0]->{'name'}</a> </em></FONT>
-<CENTER>
 
-<FORM ACTION="/cgi-bin/koha/acqui/acquire.pl">
-<input type=hidden name=gst value=$gst>
-<input type=hidden name=freight value=$freight>
-<input type=hidden name=invoice value=$invoice>
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "acqui/recieve.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {acquisition => 1},
+                            debug => 1,
+                            });
 
-<b>Search ISBN or Title:</b> <INPUT TYPE="text"  SIZE="25"   NAME="recieve">
-</form>
-<p>
-<FORM ACTION="" method=post name=orderform>
-
-<table border=0 cellspacing=0 cellpadding=5>
-<tr valign=top bgcolor=#99cc33>
-<td background="/images/background-mem.gif"><b>BASKET</b></td>
-<td background="/images/background-mem.gif"><b>ISBN</b></td>
-<td background="/images/background-mem.gif"><b>TITLE</b></td>
-<td background="/images/background-mem.gif"><b>AUTHOR</b></td>
-<td background="/images/background-mem.gif"><b>ACTUAL</b></td>
-<td background="/images/background-mem.gif"><b>P&P</b></td>
-<td background="/images/background-mem.gif"><b>QTY</b></td>
-<td background="/images/background-mem.gif"><b>TOTAL</b></td></tr>
-
-EOP
-;
 my @results;
 ($count,@results)=invoice($invoice);
 if ($invoice eq ''){
-  ($count,@results)=getallorders($id);
+       ($count,@results)=getallorders($id);
 }
-print $count;
 my $totalprice=0;
 my $totalfreight=0;
 my $totalquantity=0;
 my $total;
 my $tototal;
+my $toggle;
+my @loop_orders = ();
 for (my$i=0;$i<$count;$i++){
- $total=($results[$i]->{'unitprice'} + $results[$i]->{'freight'}) * $results[$i]->{'quantityreceived'};
-$results[$i]->{'unitprice'}+=0;
-print <<EOP
-<tr valign=top bgcolor=#ffffcc>
-<td>$results[$i]->{'basketno'}</td>
-<td>$results[$i]->{'isbn'}</td>
-<td><a href="acquire.pl?recieve=$results[$i]->{'ordernumber'}&biblio=$results[$i]->{'biblionumber'}&invoice=$invoice&gst=$gst&freight=$freight">$results[$i]->{'title'}</a></td>
-<td>$results[$i]->{'author'}</td>
-<td>\$$results[$i]->{'unitprice'}</td>
-<td></td>
-<td>$results[$i]->{'quantityreceived'}</td>
-<td>\$ $total</td>
-</tr>
-EOP
-;
-$totalprice+=$results[$i]->{'unitprice'};
-$totalfreight+=$results[$i]->{'freight'};
-$totalquantity+=$results[$i]->{'quantityreceived'};
-$tototal+=$total;
+       warn "nb : ".$results[$i]->{'ordernumber'};
+       $total=($results[$i]->{'unitprice'} + $results[$i]->{'freight'}) * $results[$i]->{'quantityreceived'};
+       $results[$i]->{'unitprice'}+=0;
+       my %line;
+       if ($toggle==0){
+               $line{color}='#ffffcc';
+               $toggle=1;
+       } else {
+               $line{color}='white';
+               $toggle=0;
+       }
+       $line{basketno} = $results[$i]->{'basketno'};
+       $line{isbn} = $results[$i]->{'isbn'};
+       $line{ordernumber} = $results[$i]->{'ordernumber'};
+       $line{biblionumber} = $results[$i]->{'biblionumber'};
+       $line{invoice} = $invoice;
+       $line{gst} = $gst;
+       $line{title} = $results[$i]->{'title'};
+       $line{author} = $results[$i]->{'author'};
+       $line{unitprice} = $results[$i]->{'unitprice'};
+       $line{quantityrecieved} = $results[$i]->{'quantityreceived'};
+       $line{total} = $total;
+       push @loop_orders, \%line;
+       $totalprice+=$results[$i]->{'unitprice'};
+       $totalfreight+=$results[$i]->{'freight'};
+       $totalquantity+=$results[$i]->{'quantityreceived'};
+       $tototal+=$total;
 }
+
 $totalfreight=$freight;
 $tototal=$tototal+$freight;
 
-my $grandtot=$tototal+$gst;
-print <<EOP
-<tr valign=top bgcolor=white>
-<td colspan=8><hr>
-</td></tr>
-
-
-
-<tr valign=top bgcolor=white>
-<td></td>
-<td></td>
-<td></td>
-<td><b>SUBTOTALS</b></td>
-<td>\$$totalprice</td>
-<td>$totalfreight</td>
-<td>$totalquantity</td>
-<td>\$$tototal</td>
-</tr>
-<tr valign=top bgcolor=white>
-<td colspan=5 rowspan=2  bgcolor=#99cc33 background="/images/background-mem.gif">
-<b>HELP</b>
-<br>
-The total at the bottom of the page should be within a few cents of the total for the invoice.<p>
-When you have finished this invoice save the changes.
-</td>
-<td colspan=2 align=right><b>GST</b></td>
-<td>\$$gst</td>
-</tr>
-<tr valign=top bgcolor=white>
-<td colspan=2 align=right ><b>TOTAL</b></td>
-<td>\$$grandtot</td>
-</tr>
-<tr valign=top bgcolor=white>
-<td></td>
-<td></td>
-<td></td>
-<td></td>
-<td></td>
-<td></td>
-<td colspan=3><input type=image  name=submit src=/images/save-changes.gif border=0 width=187 height=42 align=right></td>
-</tr>
-</table>
-</CENTER>
-EOP
-;
-
-
-print endmenu('acquisitions');
-
-print endpage;
+$template->param(invoice => $invoice,
+                                               user => $user,
+                                               date => $date,
+                                               name => $booksellers[0]->{'name'},
+                                               gst => $gst,
+                                               freight => $freight,
+                                               invoice => $invoice,
+                                               count => $count,
+                                               loop_orders => \@loop_orders,
+                                               totalprice => $totalprice,
+                                               totalfreight => $totalfreight,
+                                               totalquantity => $totalquantity,
+                                               tototal => $tototal,
+                                               gst => $gst,
+                                               grandtot => $tototal+$gst,
+                                               );
+output_html_with_http_headers $input, $cookie, $template->output;
index 1351ecb..02083b3 100755 (executable)
 # You should have received a copy of the GNU General Public License along with
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
-
-use C4::Catalogue;
-use C4::Biblio;
-use C4::Output;
-use CGI;
 use strict;
+use CGI;
+use C4::Auth;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use C4::Database;
+use HTML::Template;
+use C4::Catalogue;
 
 my $input=new CGI;
-print $input->header();
 my $id=$input->param('id');
 my ($count,@booksellers)=bookseller($id);
-print startpage;
-
-print startmenu('acquisitions');
-
-print <<EOP
-
-<FONT SIZE=6><em>Receive Orders From Supplier <a href=whitcoulls.html>$booksellers[0]->{'name'}</a></em></FONT>
-<p>
-<CENTER>
-<form method=post action="receive.pl">
-<input type=hidden name=id value=$id>
-<p>
-<table border=1 cellspacing=0 cellpadding=5>
-<tr valign=top bgcolor=#99cc33><td background="/images/background-mem.gif" colspan=2><B>SUPPLIER INVOICE INFORMATION</B></td></tr>
-<TR VALIGN=TOP >
-<TD>Supplier Invoice Number</td>
-<td><input type=text size=20 name=invoice>
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>GST</td>
-<td><input type=text size=20 name=gst>
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Freight</td>
-<td><input type=text size=20 name=freight>
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD></td>
-<td><input type=image  name=submit src=/images/continue.gif border=0 width=120 height=42>
-</td>
-</tr>
-</table>
-</CENTER>
-
-EOP
-;
-
-
-print endmenu('acquisitions');
 
-print endpage;
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "acqui/recieveorder.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {acquisition => 1},
+                            debug => 1,
+                            });
+$template->param(name => $booksellers[0]->{'name'},id => $id,);
+
+output_html_with_http_headers $input, $cookie, $template->output;
diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui/newbasket.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui/newbasket.tmpl
new file mode 100644 (file)
index 0000000..4832d33
--- /dev/null
@@ -0,0 +1,36 @@
+<TMPL_INCLUDE name="acquisitions-top.inc">
+
+<FONT SIZE=6><em>Shopping Basket <TMPL_VAR name="basket"> for <TMPL_VAR name="name"></em></FONT><br />
+(Our Reference: <TMPL_VAR name="entrydate">, #<TMPL_VAR name="basket">, authorised by: <TMPL_VAR name="user">)<br />
+Ph: <TMPL_VAR name="phone">, Fax: <TMPL_VAR name="fax"><br />
+<TMPL_VAR name="address1">, <TMPL_VAR name="address2"><br />
+<TMPL_VAR name="address3">, <TMPL_VAR name="address4"><br />
+<p>
+<FORM ACTION="/cgi-bin/koha/acqui/newbasket2.pl" method=post>
+<input type=hidden name=id value="<TMPL_VAR name="id">">
+<input type=hidden name=basket value="<TMPL_VAR name="basket">">
+<b> Search Keyword or Title: </b><INPUT TYPE="text"  SIZE="25"   NAME="search">
+
+</form>
+
+<table border=0 cellspacing=0 cellpadding=5>
+       <tr valign=top bgcolor="#ffdf61">
+               <td width="5%"><b>Order</b></td>
+               <td width="10%"><b>Isbn</b></td>
+               <td width="30%"><b>Title</b></td>
+               <td width="20%"><b>Author</b></td>
+               <td width="8%"><b>Qty</b></td>
+       </tr>
+       <TMPL_LOOP name="books_loop">
+               <tr valign=top bgcolor=<TMPL_VAR name="color">>
+                       <td><TMPL_VAR name="ordernumber"></td>
+                       <td><TMPL_VAR name="isbn"></td>
+                       <td><TMPL_VAR name="title"></td>
+                       <td><TMPL_VAR name="author"></td>
+                       <td><TMPL_VAR name="quantity"></td>
+               </tr>
+       </TMPL_LOOP>
+</table>
+<TMPL_INCLUDE name="acquisitions-bottom.inc">
+
+
index 065f384..cdf814a 100755 (executable)
@@ -31,8 +31,8 @@ You searched on
 
 <br> Results <TMPL_VAR name="dispnum"> to <TMPL_VAR name="offset2"> displayed.
 
-<TABLE  CELLSPACING=0  CELLPADDING=6 border=0 background="/images/background-mem.gif" Color="<TMPL_VAR name="main">">
-       <TR  VALIGN=TOP>
+<TABLE  CELLSPACING=0  CELLPADDING=6 border=0>
+       <TR  VALIGN=TOP bgcolor="#ffdf61">
                <TD><b>TITLE</b></TD>
                <TD><b>AUTHOR</b></TD>
                <TD><b>&copy;</b></TD>
@@ -41,7 +41,7 @@ You searched on
        </TR>
 
 <TMPL_LOOP name="loopresult">
-       <TR VALIGN=TOP bgcolor="<TMPL_VAR name="coltab">">
+       <TR VALIGN=TOP bgcolor="<TMPL_VAR name="toggle">">
                <TD>
                        <TMPL_IF name="testdonation">
                                <A HREF="/cgi-bin/koha/acqui/newbiblio.pl?sub=<TMPL_VAR name="sub">&author=<TMPL_VAR name="author2">&copyright=<TMPL_VAR name="copyright">&id=<TMPL_VAR name="id">&basket=<TMPL_VAR name="basket">&biblio=<TMPL_VAR name="biblionumber">&title=<TMPL_VAR name="title2">">
@@ -71,7 +71,7 @@ You searched on
 
 </TMPL_LOOP>
 
-       <TR VALIGN=TOP>
+       <TR VALIGN=TOP bgcolor="#ffdf61">
                <TD>
                        &nbsp;
                </TD>
diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl
new file mode 100644 (file)
index 0000000..d94aa46
--- /dev/null
@@ -0,0 +1,172 @@
+<TMPL_INCLUDE name="acquisitions-top.inc">
+<script language="javascript" type="text/javascript">
+
+<!--
+function update(f){
+  //collect values
+  quantity=f.quantity.value
+  discount=f.discount.value
+  listinc=parseInt(f.listinc.value)
+  currency=f.currency.value
+  applygst=parseInt(f.applygst.value)
+  listprice=f.list_price.value
+  //  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
+  gst_on=(!listinc && applygst);
+  //do real stuff
+  rrp=listprice*exchangerate;
+  ecost=rrp*(100-discount)/100
+  GST=0;
+  if (gst_on){
+    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){
+win=window.open("","mess","height="+X+",width="+Y+",screenX=150,screenY=0");
+win.focus();
+win.document.close();
+win.document.write("<body link='#333333' bgcolor='#ffffff' text='#000000'><font size=2><p><br>");
+win.document.write(etc);
+win.document.write("<center><form><input type=button onclick='self.close()' value=Close></form></center>");
+win.document.write("</font></body></html>");
+}
+//-->
+
+</script>
+<form action=/cgi-bin/koha/acqui/addorder.pl method=post name=frusin>
+<TMPL_UNLESS name="existing"><input type=hidden name=existing value=no></TMPL_UNLESS>
+<!-- <TMPL_VAR name="title"> -->
+<input type=hidden name=ordnum value="<TMPL_VAR name="ordnum">">
+<input type=hidden name=basket value="<TMPL_VAR name="basket">">
+<input type=hidden name=supplier value="<TMPL_VAR name="id">">
+<input type=hidden name=biblio value="<TMPL_VAR name="biblio">">
+<input type=hidden name=bibitemnum value="<TMPL_VAR name="biblioitemnumber">">
+<input type=hidden name=oldtype value="<TMPL_VAR name="itemtype">">
+<input type=hidden name=discount value="<TMPL_VAR name="discount">">
+<input type=hidden name=listinc value="<TMPL_VAR name="listincgst">">
+<input type=hidden name=currency value="<TMPL_VAR name="listprice">">
+<input type=hidden name=applygst value="<TMPL_VAR name"gstreg">">
+<TMPL_LOOP name="loop_currencies">
+       <input type=hidden name="<TMPL_VAR name="currency">" value="<TMPL_VAR name="rate">">
+</TMPL_LOOP>
+<TMPL_IF name="orderexists"><input type=hidden name=orderexists value=yes></TMPL_IF>
+<a href=basket.pl?basket=<TMPL_VAR name="basket">><img src=/images/view-basket.gif width=187 heigth=42 border=0 align=right alt="View Basket"></a>
+<FONT SIZE=6><em><TMPL_VAR name="ordnum"> - Order Details </em></FONT><br>
+Shopping Basket For: <TMPL_VAR name="name">
+<P>
+<CENTER>
+<TABLE  CELLSPACING=0  CELLPADDING=5 border=1 align=left width="40%">
+       <tr valign=top bgcolor=#99cc33>
+               <td background="/images/background-mem.gif" colspan=2><B>CATALOGUE DETAILS</B></td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD><b>Title *</b></td>
+               <td><input type=text size=20 name=title value="<TMPL_VAR name="title">"></td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Author</td>
+               <td><input type=text size=20 name=author value="<TMPL_VAR name="author">" ></td>
+       </tr>
+       <TR VALIGN=TOP>
+       <TD>Copyright Date</td>
+       <td><input type=text size=20 name=copyright value="<TMPL_VAR name="copyrightdate">">
+       </td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Format</td>
+               <td><TMPL_VAR name="CGIitemtype"></td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>ISBN</td>
+               <td><input type=text size=20 name=ISBN value="<TMPL_VAR name="isbn">"></td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Series</td>
+               <td><input type=text size=20 name=Series value="<TMPL_VAR name="seriestitle">"></td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Branch</td>
+               <td><TMPL_VAR name="CGIbranch"></td>
+       </tr>
+       <TR VALIGN=TOP  bgcolor=#ffffcc>
+               <TD >Item Barcode</td>
+               <td><input type=text size=20 name=barcode value="<TMPL_VAR name="barcode">"></td>
+       </tr>
+</table>
+<img src="/images/holder.gif" width=32 height=250 align=left>
+<table border=1 cellspacing=0 cellpadding=5 width="40%">
+       <tr valign=top bgcolor=#99cc33><td background="/images/background-mem.gif" colspan=2><B>ACCOUNTING DETAILS</B></td></tr>
+       <TR VALIGN=TOP>
+               <TD>Quantity</td>
+               <td><input type=text size=20 name=quantity value="<TMPL_VAR name="quantity">" onchange='update(this.form)' ></td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Bookfund</td>
+               <td><TMPL_VAR name="CGIbookfund"></td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Suppliers List Price</td>
+               <td><input type=text size=20 name=list_price value="<TMPL_VAR name="listprice">" onchange='update(this.form)'></td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Replacement Cost <br><FONT SIZE=2></td>
+               <td><input type=text size=20 name=rrp value="<TMPL_VAR name="rrp">" onchange='update(this.form)'>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Budgeted Cost<BR><FONT SIZE=2>(NZ\$ ex GST, inc discount)</FONT> </td>
+               <td><input type=text size=20 name=ecost value="<TMPL_VAR name="ecost">" onchange='update(this.form)'></td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Budgeted GST</td>
+               <td><input type=text size=20 name=GST value="" onchange='update(this.form)'></td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD><B>BUDGETED TOTAL</B></td>
+               <td><input type=text size=20 name=total value="" onchange='update(this.form)'></td>
+       </tr>
+       <TR VALIGN=TOP  bgcolor=#ffffcc>
+               <TD>Actual Cost</td>
+               <td><input type=text size=20 name=cost></td>
+       </tr>
+       <TR VALIGN=TOP  bgcolor=#ffffcc>
+               <TD>Invoice Number *</td>
+               <td><input type=text size=20 name=invoice ></td>
+       <TR VALIGN=TOP>
+               <TD>Notes</td>
+               <td><input type=text size=20 name=notes value="<TMPL_VAR name="notes">"></td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD colspan=2><input type=image  name=submit src=/images/add-order.gif border=0 width=187 height=42 align=right>        </td>
+       </tr>
+</table>
+</form>
+</center>
+<table>
+<tr><td bgcolor=#cccc99  background="/images/background-mem.gif"><B>HELP</B><br>
+<UL>
+<LI>If ordering more than one copy of an item you will be prompted to  choose additional bookfunds, and put in additional barcodes at the next screen<P>
+<LI><B>Bold</B> fields must be filled in to create a new bibilo and item.<p>
+<LI>Shaded fields can be used to do a "quick" receive, when items have been purchased locally or gifted. In this case the quantity "ordered" will also  be entered into the database as the quantity received.
+</UL>
+</td></tr></table>
+<p> &nbsp; </p>
+<TMPL_INCLUDE name="acquisitions-bottom.inc">
+
+
index 7b62af3..af38515 100644 (file)
@@ -6,10 +6,10 @@
 <CENTER>
 You searched on <b>supplier <TMPL_VAR name="supplier">,</b> <TMPL_VAR name="count"> results found<p>
 <table border=0 cellspacing=0 cellpadding=5 width="80%">
-<tr valign=top bgcolor=#99cc33>
-       <td background="/images/background-mem.gif" width="20%">&nbsp;</td>
-       <td background="/images/background-mem.gif" width="30%"><b>Company</b></td>
-       <td background="/images/background-mem.gif" width="50%">
+<tr valign=top bgcolor="#ffdf61">
+       <td width="20%">&nbsp;</td>
+       <td width="30%"><b>Company</b></td>
+       <td width="50%">
                <table width="100%" border=0 cellspacing=0 cellpadding=5>
                        <tr>
                                <td width="15%"><b>Basket</b></td>
@@ -24,7 +24,7 @@ You searched on <b>supplier <TMPL_VAR name="supplier">,</b> <TMPL_VAR name="coun
 <TMPL_LOOP name="loop_suppliers">
        <tr valign=top bgcolor=<TMPL_VAR name="color">>
                <td>
-                       <a href="newbasket.pl?id=<TMPL_VAR name="id">"><img src="/images/new-basket-short.gif" alt="New Basket" width=70 height=30 border=0 ></a>
+                       <a href="basket.pl?id=<TMPL_VAR name="id">"><img src="/images/new-basket-short.gif" alt="New Basket" width=70 height=30 border=0 ></a>
                        <a href="recieveorder.pl?id=<TMPL_VAR name="id">"><img src="/images/receive-order-short.gif" alt="Receive Order" width=70 height=30 border=0 ></a>
                </td>
                <td><a href="supplier.pl?id=<TMPL_VAR name="id">"><TMPL_VAR name="name"></a></td>
diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui/recieve.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui/recieve.tmpl
new file mode 100644 (file)
index 0000000..8afdc0c
--- /dev/null
@@ -0,0 +1,86 @@
+<TMPL_INCLUDE name="acquisitions-top.inc">
+
+<div align=right>
+Invoice: <TMPL_VAR name="invoice"><br>
+Received By: <TMPL_VAR name="user"><br>
+<TMPL_VAR name="date">
+</div>
+<FONT SIZE=6><em>Receipt Summary For : <a href=whitcoulls.html><TMPL_VAR name="name"></a> </em></FONT>
+<CENTER>
+
+<FORM ACTION="/cgi-bin/koha/acqui/acquire.pl">
+<input type=hidden name=gst value="<TMPL_VAR name="gst">">
+<input type=hidden name=freight value="<TMPL_VAR name="freight">">
+<input type=hidden name=invoice value="<TMPL_VAR name="invoice">">
+
+<b>Search ISBN or Title:</b> <INPUT TYPE="text"  SIZE="25"   NAME="recieve">
+</form>
+<p>
+<FORM ACTION="" method=post name=orderform>
+
+<table border=0 cellspacing=0 cellpadding=5>
+       <tr valign=top bgcolor="#ffdf61">
+               <td><b>BASKET</b></td>
+               <td><b>ISBN</b></td>
+               <td><b>TITLE</b></td>
+               <td><b>AUTHOR</b></td>
+               <td><b>ACTUAL</b></td>
+               <td><b>P&P</b></td>
+               <td><b>QTY</b></td>
+               <td><b>TOTAL</b></td>
+       </tr>
+       <TMPL_VAR name="count">
+       <TMPL_LOOP name="loop_orders">
+               <tr valign=top bgcolor="<TMPL_VAR name="color">">
+                       <td><TMPL_VAR name="basketno"></td>
+                       <td><TMPL_VAR name="isbn"></td>
+                       <td><a href="acquire.pl?recieve=<TMPL_VAR name="ordernumber">&biblio=<TMPL_VAR name="biblionumber">&invoice=<TMPL_VAR name="invoice">&gst=<TMPL_VAR name="gst">&freight=<TMPL_VAR name="freight">"><TMPL_VAR name="title"></a></td>
+                       <td><TMPL_VAR name="author"></td>
+                       <td>$<TMPL_VAR name="unitprice"></td>
+                       <td></td>
+                       <td><TMPL_VAR name="quantityrecieved"></td>
+                       <td>$<TMPL_VAR name="total"></td>
+               </tr>
+       </TMPL_LOOP>
+       <tr valign=top bgcolor=white>
+               <td colspan=8><hr>
+               </td>
+       </tr>
+       <tr valign=top bgcolor=white>
+               <td></td>
+               <td></td>
+               <td></td>
+               <td><b>SUBTOTALS</b></td>
+               <td>$<TMPL_VAR name="totalprice"></td>
+               <td><TMPL_VAR name="totalfreight"></td>
+               <td><TMPL_VAR name="totalquantity"></td>
+               <td>$<TMPL_VAR name="tototal"></td>
+       </tr>
+       <tr valign=top bgcolor=white>
+               <td colspan=5 rowspan=2  bgcolor="#ffdf61">
+               <b>HELP</b>
+               <br>
+               The total at the bottom of the page should be within a few cents of the total for the invoice.<p>
+               When you have finished this invoice save the changes.
+               </td>
+               <td colspan=2 align=right><b>GST</b></td>
+               <td>$<TMPL_VAR name="gst"></td>
+       </tr>
+       <tr valign=top bgcolor=white>
+               <td colspan=2 align=right ><b>TOTAL</b></td>
+               <td>$<TMPL_VAR name="grandtot"></td>
+       </tr>
+       <tr valign=top bgcolor=white>
+               <td></td>
+               <td></td>
+               <td></td>
+               <td></td>
+               <td></td>
+               <td></td>
+               <td colspan=3>
+                       <input type=image  name=submit src=/images/save-changes.gif border=0 width=187 height=42 align=right>
+               </td>
+       </tr>
+</table>
+</CENTER>
+
diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui/recieveorder.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui/recieveorder.tmpl
new file mode 100644 (file)
index 0000000..c4dad51
--- /dev/null
@@ -0,0 +1,34 @@
+<TMPL_INCLUDE name="acquisitions-top.inc">
+
+<FONT SIZE=6><em>Receive Orders From Supplier <a href=whitcoulls.html><TMPL_VAR name="name"></a></em></FONT>
+<p>
+<CENTER>
+<form method=post action="receive.pl">
+<input type=hidden name=id value=<TMPL_VAR name="id">>
+<p>
+<table border=1 cellspacing=0 cellpadding=5>
+<tr valign=top bgcolor="#ffdf61"><td  colspan=2><B>SUPPLIER INVOICE INFORMATION</B></td></tr>
+<TR VALIGN=TOP >
+<TD>Supplier Invoice Number</td>
+<td><input type=text size=20 name=invoice>
+</td>
+</tr>
+<TR VALIGN=TOP bgcolor="#ffffcc">
+<TD>GST</td>
+<td><input type=text size=20 name=gst>
+</td>
+</tr>
+<TR VALIGN=TOP>
+<TD>Freight</td>
+<td><input type=text size=20 name=freight>
+</td>
+</tr>
+<TR VALIGN=TOP>
+<TD></td>
+<td><input type=image  name=submit src=/images/continue.gif border=0 width=120 height=42>
+</td>
+</tr>
+</table>
+</CENTER>
+
+<TMPL_INCLUDE name="acquisitions-bottom.inc">
index 90db94a..fe70771 100644 (file)
@@ -7,92 +7,99 @@
 <P>
 <CENTER>
 <TABLE  CELLSPACING=0  CELLPADDING=5 border=1 align=left width="40%">
-<tr valign=top bgcolor=#99cc33><td background="/images/background-mem.gif" colspan=2><B>COMPANY DETAILS</B></td></tr>
-<TR VALIGN=TOP>
-<TD><b>Company Name</b></td>
-<td><input type=text size=20 name=company value="<TMPL_VAR name="name">">
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Postal Address</td>
-<td><textarea name=company_postal cols=20 rows=3><TMPL_VAR name="postal">
-</textarea></td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Physical Address</td>
-<td><textarea name=physical cols=20 rows=4><TMPL_VAR name="address1">
-<TMPL_VAR name="address2">
-<TMPL_VAR name="address3">
-<TMPL_VAR name="address4">
-</textarea>
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Phone</td>
-<td><input type=text size=20 name=company_phone value="<TMPL_VAR name="phone">">
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Fax</td>
-<td><input type=text size=20 name=company_fax value="<TMPL_VAR name="fax">">
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Website</td>
-<td><input type=text size=20 name=website value="<TMPL_VAR name="url">">
-</td>
-</tr>
-<tr valign=top bgcolor=#99cc33><td background="/images/background-mem.gif" colspan=2><B>CONTACT DETAILS</B></td></tr>
-<TR VALIGN=TOP>
-<TD>Contact Name</td>
-<td><input type=text size=20 name=company_contact_name value="<TMPL_VAR name="contact">">
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Position</td>
-<td><input type=text size=20 name=company_contact_position value="<TMPL_VAR name="contpos">">
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Phone</td>
-<td><input type=text size=20 name=contact_phone value="<TMPL_VAR name="contphone">">
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Alternative Phone</td>
-<td><input type=text size=20 name=contact_phone_2 value="<TMPL_VAR name="contaltphone">">
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Fax</td>
-<td><input type=text size=20 name=contact_fax value="<TMPL_VAR name="contfax">">
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>E-mail</td>
-<td><input type=text size=20 name=company_email value="<TMPL_VAR name="contemail">">
-</td>
-</tr>
-<TR VALIGN=TOP>
-<TD>Notes</td>
-<td><textarea name=notes cols=20 rows=4><TMPL_VAR name="contnotes"></textarea>
-</td>
-</tr>
-<tr valign=right><td><input type=image  name=submit src=/images/save-changes.gif border=0 width=187 height=42 align=right></td></tr>
+       <tr valign=top bgcolor="#ffdf61">
+               <td colspan=2><B>COMPANY DETAILS</B></td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD><b>Company Name</b></td>
+               <td><input type=text size=20 name=company value="<TMPL_VAR name="name">">
+               </td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Postal Address</td>
+               <td>
+                       <textarea name=company_postal cols=20 rows=3><TMPL_VAR name="postal">
+                       </textarea>
+               </td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Physical Address</td>
+               <td><textarea name=physical cols=20 rows=4><TMPL_VAR name="address1">
+                       <TMPL_VAR name="address2">
+                       <TMPL_VAR name="address3">
+                       <TMPL_VAR name="address4">
+                       </textarea>
+               </td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Phone</td>
+               <td><input type=text size=20 name=company_phone value="<TMPL_VAR name="phone">">
+               </td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Fax</td>
+               <td><input type=text size=20 name=company_fax value="<TMPL_VAR name="fax">">
+               </td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Website</td>
+               <td><input type=text size=20 name=website value="<TMPL_VAR name="url">">
+               </td>
+       </tr>
+       <tr valign=top bgcolor="#ffdf61">
+               <td colspan=2><B>CONTACT DETAILS</B></td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Contact Name</td>
+               <td><input type=text size=20 name=company_contact_name value="<TMPL_VAR name="contact">"></td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Position</td>
+               <td><input type=text size=20 name=company_contact_position value="<TMPL_VAR name="contpos">">
+               </td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Phone</td>
+               <td><input type=text size=20 name=contact_phone value="<TMPL_VAR name="contphone">">
+               </td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Alternative Phone</td>
+               <td><input type=text size=20 name=contact_phone_2 value="<TMPL_VAR name="contaltphone">">
+               </td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Fax</td>
+               <td><input type=text size=20 name=contact_fax value="<TMPL_VAR name="contfax">">
+               </td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>E-mail</td>
+               <td><input type=text size=20 name=company_email value="<TMPL_VAR name="contemail">">
+               </td>
+       </tr>
+       <TR VALIGN=TOP>
+               <TD>Notes</td>
+               <td><textarea name=notes cols=20 rows=4><TMPL_VAR name="contnotes"></textarea>
+               </td>
+       </tr>
+       <tr valign=right>
+               <td><input type=image  name=submit src=/images/save-changes.gif border=0 width=187 height=42 align=right></td>
+       </tr>
 </table>
 <img src="/images/holder.gif" width=32 height=250 align=left>
 
 <table border=1 cellspacing=0 cellpadding=5 width="40%">
-       <tr valign=top bgcolor=#99cc33>
-               <td background="/images/background-mem.gif" colspan=2><B>CURRENT STATUS</B></td>
+       <tr valign=top bgcolor="#ffdf61">
+               <td colspan=2><B>CURRENT STATUS</B></td>
        </tr>
        <TR VALIGN=TOP>
                <TD>Supplier is</td>
                <td><input type="radio" name="status" value="1" <TMPL_IF name="active">checked</TMPL_IF>>Active
                        <input type="radio" name="status" value="0" <TMPL_UNLESS name="active">checked</TMPL_UNLESS>>Inactive</td>
        </tr>
-       <tr valign=top bgcolor=#99cc33>
-               <td background="/images/background-mem.gif" colspan=2><B>ORDERING INFORMATION</B></td>
+       <tr valign=top bgcolor="#ffdf61">
+               <td colspan=2><B>ORDERING INFORMATION</B></td>
        </tr>
        <TR VALIGN=TOP>
                <TD>Publishers and Imprints</td>