3 #script to recieve orders
4 #written by chris@katipo.co.nz 24/2/2000
14 print $input->header();
15 my $id=$input->param('id');
19 print startmenu('acquisitions');
21 my $search=$input->param('recieve');
22 my $invoice=$input->param('invoice');
23 my $freight=$input->param('freight');
24 my $biblio=$input->param('biblio');
25 my $catview=$input->param('catview');
26 my $gst=$input->param('gst');
27 my ($count,@results)=ordersearch($search,$biblio,$catview);
28 my ($count2,@booksellers)=bookseller($results[0]->{'booksellerid'});
30 my @date=split('-',$results[0]->{'entrydate'});
31 my $date="$date[2]/$date[1]/$date[0]";
38 <script language="javascript" type="text/javascript">
40 function messenger(X,Y,etc){
41 win=window.open("","mess","height="+X+",width="+Y+",screenX=150,screenY=0");
44 win.document.write("<body link='#333333' bgcolor='#ffffff' text='#000000'><font size=2><p><br>");
45 win.document.write(etc);
46 win.document.write("<center><form><input type=button onclick='self.close()' value=Close></form></center>");
47 win.document.write("</font></body></html>");
51 <form action="/cgi-bin/koha/acqui/finishreceive.pl" method=post>
52 <input type=hidden name=biblio value=$results[0]->{'biblionumber'}>
53 <input type=hidden name=ordnum value=$results[0]->{'ordernumber'}>
54 <input type=hidden name=biblioitemnum value=$results[0]->{'biblioitemnumber'}>
55 <input type=hidden name=bookseller value=$results[0]->{'booksellerid'}>
56 <input type=hidden name=freight value=$freight>
57 <input type=hidden name=gst value=$gst>
60 if ($catview ne 'yes'){
61 print "<input type=image name=submit src=/images/save-changes.gif border=0 width=187 height=42 align=right>";
63 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>";
66 <FONT SIZE=6><em>$results[0]->{'ordernumber'} - Receive Order</em></FONT><br>
67 Shopping Basket For: $booksellers[0]->{'name'}
68 <br> Order placed: $date
71 <TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left width="40%">
72 <tr valign=top bgcolor=#99cc33><td background="/images/background-mem.gif" colspan=2><B>CATALOGUE DETAILS</B></td></tr>
75 <TD><b>Title *</b></td>
76 <td><input type=text size=20 name=title value="$results[0]->{'title'}" >
81 <td><input type=text size=20 name=author value="$results[0]->{'author'}" >
85 <TD>Copyright Date</td>
86 <td><input type=text size=20 name=copyright value="$results[0]->{'copyrightdate'}" >
93 <select name=format size=1>
98 my $query="Select itemtype,description from itemtypes order by description";
99 my $sth=$dbh->prepare($query);
101 while (my $data=$sth->fetchrow_hashref){
102 if ($data->{'itemtype'} eq $results[0]->{'itemtype'}) {
103 print "<option SELECTED value=\"" . $data->{'itemtype'} . "\">" . $data->{'description'} . "\n";
105 print "<option value=\"" . $data->{'itemtype'} . "\">" . $data->{'description'} . "\n";
120 <td><input type=text size=20 name=ISBN value="$results[0]->{'isbn'}">
127 <td><input type=text size=20 name=Series value="$results[0]->{'seriestitle'}">
133 <td><select name=branch size=1>
136 my ($count2,@branches)=branches();
137 for (my $i=0;$i<$count2;$i++){
138 print "<option value=$branches[$i]->{'branchcode'}";
139 if ($results[0]->{'branchcode'} == $branches[$i]->{'branchcode'}){
142 print ">$branches[$i]->{'branchname'}";
149 <TR VALIGN=TOP bgcolor=#ffffcc >
150 <TD><B>Item Barcode *</B></td>
152 <td><input type=text size=20 name=barcode value=
156 my %systemprefs=systemprefs();
157 if ($systemprefs{'autoBarcode'} eq '1') {
159 my $query="Select barcode from items order by barcode desc";
160 my $sth=$dbh->prepare($query);
162 my $data=$sth->fetchrow_hashref;
163 print $data->{'barcode'}+1;
173 <TR VALIGN=TOP bgcolor=#ffffcc >
174 <TD><B>Volume Info (for serials) *</B></td>
176 <td><input type=text size=20 name=volinf>
183 <img src="/images/holder.gif" width=32 height=250 align=left>
185 <table border=1 cellspacing=0 cellpadding=5 width="40%">
187 <tr valign=top bgcolor=#99cc33><td background="/images/background-mem.gif" colspan=2><B>ACCOUNTING DETAILS</B></td></tr>
189 <TD><B>Bookfund *</B></td>
190 <td><select name=bookfund size=1>
193 my ($count2,@bookfund)=bookfunds;
194 for (my $i=0;$i<$count2;$i++){
195 print "<option value=$bookfund[$i]->{'bookfundid'}";
196 if ($bookfund[$i]->{'bookfundid'}==$results[0]->{'bookfundid'}){
199 print ">$bookfund[$i]->{'bookfundname'}";
202 my $rrp=$results[0]->{'rrp'};
203 if ($results[0]->{'quantityreceived'} == 0){
204 $results[0]->{'quantityreceived'}='';
206 if ($results[0]->{'unitprice'} == 0){
207 $results[0]->{'unitprice'}='';
214 <TD>Quantity Ordered</td>
215 <td><input type=text size=20 name=quantity value=$results[0]->{'quantity'}>
218 <TR VALIGN=TOP bgcolor=#ffffcc>
219 <TD><B>Quantity Received *</B></td>
220 <td><input type=text size=20 name=quantityrec value=$results[0]->{'quantityreceived'}>
224 <TD>Replacement Cost</td>
225 <td><input type=text size=20 name=rrp value=$rrp>
230 <td><input type=text size=20 name=ecost value="$results[0]->{'ecost'}">
233 <TR VALIGN=TOP bgcolor=#ffffcc>
234 <TD><B>Actual Cost *</B></td>
235 <td><input type=text size=20 name=cost value="$results[0]->{'unitprice'}">
238 <TR VALIGN=TOP bgcolor=#ffffcc>
239 <TD>Invoice Number</td>
241 <input type=hidden name=invoice value="$invoice">
246 <td><input type=text size=20 name=notes value="$results[0]->{'notes'}">
258 print "<center><table>";
260 <tr valign=top bgcolor=#99cc33>
262 <td background="/images/background-mem.gif"><b>ISBN</b></td>
263 <td background="/images/background-mem.gif"><b>TITLE</b></td>
264 <td background="/images/background-mem.gif"><b>AUTHOR</b></td>
268 for (my $i=0;$i<$count;$i++){
269 print "<tr><td>$results[$i]->{'isbn'}</td>
270 <td><a href=acquire.pl?recieve=$results[$i]->{'ordernumber'}&biblio=$results[$i]->{'biblionumber'}&invoice=$invoice&freight=$freight&gst=$gst>$results[$i]->{'title'}</a></td>
271 <td>$results[$i]->{'author'}</td></tr>";
273 print "</table></center>";
278 print endmenu('acquisitions');