3 #script to recieve orders
4 #written by chris@katipo.co.nz 24/2/2000
15 print $input->header();
16 my $id=$input->param('id');
20 print startmenu('acquisitions');
22 my $search=$input->param('recieve');
23 my $invoice=$input->param('invoice');
24 my $freight=$input->param('freight');
25 my $biblio=$input->param('biblio');
26 my $catview=$input->param('catview');
27 my $gst=$input->param('gst');
28 my ($count,@results)=ordersearch($search,$biblio,$catview);
29 my ($count2,@booksellers)=bookseller($results[0]->{'booksellerid'});
31 my @date=split('-',$results[0]->{'entrydate'});
32 my $date="$date[2]/$date[1]/$date[0]";
39 <script language="javascript" type="text/javascript">
41 function messenger(X,Y,etc){
42 win=window.open("","mess","height="+X+",width="+Y+",screenX=150,screenY=0");
45 win.document.write("<body link='#333333' bgcolor='#ffffff' text='#000000'><font size=2><p><br>");
46 win.document.write(etc);
47 win.document.write("<center><form><input type=button onclick='self.close()' value=Close></form></center>");
48 win.document.write("</font></body></html>");
52 <form action="/cgi-bin/koha/acqui/finishreceive.pl" method=post>
53 <input type=hidden name=biblio value=$results[0]->{'biblionumber'}>
54 <input type=hidden name=ordnum value=$results[0]->{'ordernumber'}>
55 <input type=hidden name=biblioitemnum value=$results[0]->{'biblioitemnumber'}>
56 <input type=hidden name=bookseller value=$results[0]->{'booksellerid'}>
57 <input type=hidden name=freight value=$freight>
58 <input type=hidden name=gst value=$gst>
61 if ($catview ne 'yes'){
62 print "<input type=image name=submit src=/images/save-changes.gif border=0 width=187 height=42 align=right>";
64 print "<a href=/cgi-bin/koha/acqui/newbiblio.pl?ordnum=$results[0]->{'ordernumber'}&id=$results[0]->{'booksellerid'}><img src=/images/modify-mem.gif align=right border=0></a>";
67 <FONT SIZE=6><em>$results[0]->{'ordernumber'} - Receive Order</em></FONT><br>
68 Shopping Basket For: $booksellers[0]->{'name'}
69 <br> Order placed: $date
72 <TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left width="40%">
73 <tr valign=top bgcolor=#99cc33><td background="/images/background-mem.gif" colspan=2><B>CATALOGUE DETAILS</B></td></tr>
76 <TD><b>Title *</b></td>
77 <td><input type=text size=20 name=title value="$results[0]->{'title'}" >
82 <td><input type=text size=20 name=author value="$results[0]->{'author'}" >
86 <TD>Copyright Date</td>
87 <td><input type=text size=20 name=copyright value="$results[0]->{'copyrightdate'}" >
94 <select name=format size=1>
99 my $query="Select itemtype,description from itemtypes order by description";
100 my $sth=$dbh->prepare($query);
102 while (my $data=$sth->fetchrow_hashref){
103 if ($data->{'itemtype'} eq $results[0]->{'itemtype'}) {
104 print "<option SELECTED value=\"" . $data->{'itemtype'} . "\">" . $data->{'description'} . "\n";
106 print "<option value=\"" . $data->{'itemtype'} . "\">" . $data->{'description'} . "\n";
121 <td><input type=text size=20 name=ISBN value="$results[0]->{'isbn'}">
128 <td><input type=text size=20 name=Series value="$results[0]->{'seriestitle'}">
134 <td><select name=branch size=1>
137 my ($count2,@branches)=branches();
138 for (my $i=0;$i<$count2;$i++){
139 print "<option value=$branches[$i]->{'branchcode'}";
140 if ($results[0]->{'branchcode'} == $branches[$i]->{'branchcode'}){
143 print ">$branches[$i]->{'branchname'}";
150 <TR VALIGN=TOP bgcolor=#ffffcc >
151 <TD><B>Item Barcode *</B></td>
153 <td><input type=text size=20 name=barcode value=
157 my %systemprefs=systemprefs();
158 if ($systemprefs{'autoBarcode'} eq '1') {
160 my $query="Select barcode from items order by barcode desc";
161 my $sth=$dbh->prepare($query);
163 my $data=$sth->fetchrow_hashref;
164 print $data->{'barcode'}+1;
174 <TR VALIGN=TOP bgcolor=#ffffcc >
175 <TD><B>Volume Info (for serials) *</B></td>
177 <td><input type=text size=20 name=volinf>
184 <img src="/images/holder.gif" width=32 height=250 align=left>
186 <table border=1 cellspacing=0 cellpadding=5 width="40%">
188 <tr valign=top bgcolor=#99cc33><td background="/images/background-mem.gif" colspan=2><B>ACCOUNTING DETAILS</B></td></tr>
190 <TD><B>Bookfund *</B></td>
191 <td><select name=bookfund size=1>
195 ($count2,@bookfund)=bookfunds();
196 for (my $i=0;$i<$count2;$i++){
197 print "<option value=$bookfund[$i]->{'bookfundid'}";
198 if ($bookfund[$i]->{'bookfundid'}==$results[0]->{'bookfundid'}){
201 print ">$bookfund[$i]->{'bookfundname'}";
204 my $rrp=$results[0]->{'rrp'};
205 if ($results[0]->{'quantityreceived'} == 0){
206 $results[0]->{'quantityreceived'}='';
208 if ($results[0]->{'unitprice'} == 0){
209 $results[0]->{'unitprice'}='';
216 <TD>Quantity Ordered</td>
217 <td><input type=text size=20 name=quantity value=$results[0]->{'quantity'}>
220 <TR VALIGN=TOP bgcolor=#ffffcc>
221 <TD><B>Quantity Received *</B></td>
222 <td><input type=text size=20 name=quantityrec value=$results[0]->{'quantityreceived'}>
226 <TD>Replacement Cost</td>
227 <td><input type=text size=20 name=rrp value=$rrp>
232 <td><input type=text size=20 name=ecost value="$results[0]->{'ecost'}">
235 <TR VALIGN=TOP bgcolor=#ffffcc>
236 <TD><B>Actual Cost *</B></td>
237 <td><input type=text size=20 name=cost value="$results[0]->{'unitprice'}">
240 <TR VALIGN=TOP bgcolor=#ffffcc>
241 <TD>Invoice Number</td>
243 <input type=hidden name=invoice value="$invoice">
248 <td><input type=text size=20 name=notes value="$results[0]->{'notes'}">
260 print "<center><table>";
262 <tr valign=top bgcolor=#99cc33>
264 <td background="/images/background-mem.gif"><b>ISBN</b></td>
265 <td background="/images/background-mem.gif"><b>TITLE</b></td>
266 <td background="/images/background-mem.gif"><b>AUTHOR</b></td>
270 for (my $i=0;$i<$count;$i++){
271 print "<tr><td>$results[$i]->{'isbn'}</td>
272 <td><a href=acquire.pl?recieve=$results[$i]->{'ordernumber'}&biblio=$results[$i]->{'biblionumber'}&invoice=$invoice&freight=$freight&gst=$gst>$results[$i]->{'title'}</a></td>
273 <td>$results[$i]->{'author'}</td></tr>";
275 print "</table></center>";
280 print endmenu('acquisitions');