3 #script to show display basket of orders
4 #written by chris@katipo.co.nz 24/2/2000
14 print $input->header();
15 my $id=$input->param('id');
16 my $title=$input->param('title');
17 my $author=$input->param('author');
18 my $copyright=$input->param('copyright');
19 my ($count,@booksellers)=bookseller($id);
20 my $ordnum=$input->param('ordnum');
21 my $biblio=$input->param('biblio');
27 $data=bibdata($biblio);
28 if ($data->{'title'} eq ''){
29 $data->{'title'}=$title;
30 $data->{'author'}=$author;
31 $data->{'copyrightdate'}=$copyright;
34 $data=getsingleorder($ordnum);
35 $biblio=$data->{'biblionumber'};
40 print startmenu('acquisitions');
43 my $basket=$input->param('basket');
47 <script language="javascript" type="text/javascript">
53 quantity=f.quantity.value
54 discount=f.discount.value
55 listinc=parseInt(f.listinc.value)
56 currency=f.currency.value
57 applygst=parseInt(f.applygst.value)
58 listprice=f.list_price.value
60 // ecost=f.ecost.value //budgetted cost
62 // total=f.total.value
63 //make useful constants out of the above
64 exchangerate=f.elements[currency].value //get exchange rate
65 gst_on=(!listinc && applygst);
67 rrp=listprice*exchangerate;
68 ecost=rrp*(100-discount)/100
75 total=(ecost+GST)*quantity
78 f.rrp.value=display(rrp)
79 f.ecost.value=display(ecost)
80 f.GST.value=display(GST)
81 f.total.value=display(total)
87 function messenger(X,Y,etc){
88 win=window.open("","mess","height="+X+",width="+Y+",screenX=150,screenY=0");
91 win.document.write("<body link='#333333' bgcolor='#ffffff' text='#000000'><font size=2><p><br>");
92 win.document.write(etc);
93 win.document.write("<center><form><input type=button onclick='self.close()' value=Close></form></center>");
94 win.document.write("</font></body></html>");
99 <form action=/cgi-bin/koha/acqui/addorder.pl method=post name=frusin>
104 print "<input type=hidden name=existing value=no>";
109 <input type=hidden name=ordnum value=$ordnum>
110 <input type=hidden name=basket value=$basket>
111 <input type=hidden name=supplier value=$id>
112 <input type=hidden name=biblio value=$biblio>
113 <input type=hidden name=bibitemnum value=$data->{'biblioitemnumber'}>
114 <input type=hidden name=oldtype value=$data->{'itemtype'}>
115 <input type=hidden name=discount value=$booksellers[0]->{'discount'}>
116 <input type=hidden name=listinc value=$booksellers[0]->{'listincgst'}>
117 <input type=hidden name=currency value=$booksellers[0]->{'listprice'}>
118 <input type=hidden name=applygst value=$booksellers[0]->{'gstreg'}>
121 my ($count2,$currencies)=getcurrencies;
122 for (my $i=0;$i<$count2;$i++){
123 print "<input type=hidden name=\"$currencies->[$i]->{'currency'}\" value=$currencies->[0]->{'rate'}>\n";
126 print "<input type=hidden name=orderexists value=yes>\n";
129 <a href=basket.pl?basket=$basket><img src=/images/view-basket.gif width=187 heigth=42 border=0 align=right alt="View Basket"></a>
130 <FONT SIZE=6><em>$ordnum - Order Details </em></FONT><br>
131 Shopping Basket For: $booksellers[0]->{'name'}
134 <TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left width="40%">
135 <tr valign=top bgcolor=#99cc33><td background="/images/background-mem.gif" colspan=2><B>CATALOGUE DETAILS</B></td></tr>
137 <TD><b>Title *</b></td>
138 <td><input type=text size=20 name=title value="$data->{'title'}">
143 <td><input type=text size=20 name=author value="$data->{'author'}" >
147 <TD>Copyright Date</td>
148 <td><input type=text size=20 name=copyright value="$data->{'copyrightdate'}">
154 <select name=format size=1>
159 my $query="Select itemtype,description from itemtypes order by description";
160 my $sth=$dbh->prepare($query);
162 print "<option value=\"\">Please choose:\n";
163 while (my $data=$sth->fetchrow_hashref){
164 print "<option value=\"" . $data->{'itemtype'} . "\">" . $data->{'description'} . "\n";
177 <td><input type=text size=20 name=ISBN value=$data->{'isbn'}>
182 <td><input type=text size=20 name=Series value="$data->{'seriestitle'}">
187 <td><select name=branch size=1>
190 my ($count2,@branches)=branches;
191 for (my $i=0;$i<$count2;$i++){
192 print "<option value=$branches[$i]->{'branchcode'}";
193 if ($data->{'branchcode'} == $branches[$i]->{'branchcode'}){
196 print ">$branches[$i]->{'branchname'}";
203 <TR VALIGN=TOP bgcolor=#ffffcc>
204 <TD >Item Barcode</td>
205 <td><input type=text size=20 name=barcode value=
209 my %systemprefs=systemprefs();
210 if ($systemprefs{'autoBarcode'} eq '1') {
212 my $query="Select barcode from items order by barcode desc";
213 my $sth=$dbh->prepare($query);
215 my $data=$sth->fetchrow_hashref;
216 print $data->{'barcode'}+1;
226 <img src="/images/holder.gif" width=32 height=250 align=left>
227 <table border=1 cellspacing=0 cellpadding=5 width="40%">
228 <tr valign=top bgcolor=#99cc33><td background="/images/background-mem.gif" colspan=2><B>ACCOUNTING DETAILS</B></td></tr>
231 <td><input type=text size=20 name=quantity value="$data->{'quantity'}" onchange='update(this.form)' >
236 <td><select name=bookfund size=1>
240 my ($count2,@bookfund)=bookfunds;
241 for (my $i=0;$i<$count2;$i++){
242 print "<option value=$bookfund[$i]->{'bookfundid'}";
243 if ($data->{'bookfundid'} == $bookfund[$i]->{'bookfundid'}){
246 print ">$bookfund[$i]->{'bookfundname'}";
254 <TD>Suppliers List Price</td>
255 <td><input type=text size=20 name=list_price value="$data->{'listprice'}" onchange='update(this.form)'>
258 <TD>Replacement Cost <br>
259 <FONT SIZE=2>(NZ\$ inc GST)</td>
260 <td><input type=text size=20 name=rrp value="$data->{'rrp'}" onchange='update(this.form)'>
265 <FONT SIZE=2>(NZ\$ ex GST, inc discount)</FONT> </td>
266 <td><input type=text size=20 name=ecost value="$data->{'ecost'}" onchange='update(this.form)'>
272 <td><input type=text size=20 name=GST value="" onchange='update(this.form)'>
277 BUDGETED TOTAL</B></td>
278 <td><input type=text size=20 name=total value="" onchange='update(this.form)'>
281 <TR VALIGN=TOP bgcolor=#ffffcc>
283 <td><input type=text size=20 name=cost>
286 <TR VALIGN=TOP bgcolor=#ffffcc>
287 <TD>Invoice Number *</td>
288 <td><input type=text size=20 name=invoice >
291 <td><input type=text size=20 name=notes value="$data->{'notes'}">
296 <input type=image name=submit src=/images/add-order.gif border=0 width=187 height=42 align=right>
303 <tr><td bgcolor=#cccc99 background="/images/background-mem.gif"><B>HELP</B><br>
305 <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>
306 <LI><B>Bold</B> fields must be filled in to create a new bibilo and item.<p>
307 <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.
314 print endmenu('acquisitions');