1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Recieve <!-- TMPL_VAR name="bookselname" --><!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
3 <!-- TMPL_INCLUDE NAME="menus.inc" -->
4 <!-- TMPL_INCLUDE NAME="menu-acqui.inc" -->
5 <script type="text/javascript">
6 function docalculate(){
8 received=document.getElementsByName('received');
9 actual=document.getElementsByName('actual');
10 freight=document.getElementsByName('freight');
11 discounts=document.getElementsByName('discount');
12 gstrate=document.getElementsByName('gstrate');
18 for (var s=0; s<received.length; s++){
19 receivedvalue =received.item(s).value;
20 totalreceived +=(receivedvalue*1);
21 thisactual =actual.item(s).value*receivedvalue;
22 totalactual +=thisactual;
23 totalfreight +=freight.item(s).value*receivedvalue;
24 thisdiscount =thisactual*discounts.item(s).value/100;
25 totaldiscount +=thisdiscount;
26 totalgst +=(thisactual - thisdiscount)*gstrate.item(s).value/100;
28 document.f.totalreceived.value=totalreceived*1;
29 document.f.totalactual.value=totalactual;
30 document.f.totalfreight.value=totalfreight*1;
31 document.f.actualdiscount.value=totaldiscount;
32 includesgst=parseInt(document.f.incgst.value);
34 document.f.actualgst.value="-inc.-";
36 document.f.actualgst.value=totalgst;
38 document.f.freightgst.value=totalfreight*document.f.freightgstrate.value/100;
40 if ( document.f.actualgst.value>0){
41 disct= document.f.actualgst.value;
43 document.f.actualtotal.value=totalactual + -totaldiscount +disct*1;
44 document.f.actualfreight.value=totalfreight+ document.f.freightgst.value*1;
45 document.f.invoicetotal.value=document.f.actualfreight.value*1 +document.f.actualtotal.value*1;
46 <!--TMPL_IF NAME="invcurrency"-->
47 document.f.localtotal.value=document.f.invoicetotal.value*<!--TMPL_VAR NAME="currencyrate"-->;
51 function updatetotal(){
52 document.f.actualtotal.value= document.f.totalactual.value - document.f.actualdiscount.value + document.f.actualgst.value*1;
53 document.f.invoicetotal.value=document.f.actualfreight.value*1+document.f.actualtotal.value*1;
54 <!--TMPL_IF NAME="invcurrency"-->
55 document.f.localtotal.value=document.f.invoicetotal.value*<!--TMPL_VAR NAME="currencyrate"-->;
60 if (document.f.invoice.value==""){
61 alert ("You need a suppliers Invoice number!");
64 if ( document.f.totalreceived.value==0 || document.f.totalreceived.value==""){
65 alert ("no items entered as received !");
72 Orders being recieved from <!-- TMPL_VAR NAME="name" -->
75 <form action="finishreceive.pl" method="post" name="orderform" id="f">
76 <input type="hidden" name="supplierid" value="<!--TMPL_VAR NAME="supplierid"-->" />
78 <p>Received By: <!-- TMPL_VAR NAME="user" --></p>
79 <p> Suppliers Invoice No: <input type="text" name="invoice" value="<!-- TMPL_VAR NAME="invoice" -->" />
81 Date received: <input type="text" name="datereceived" value="<!-- TMPL_VAR NAME="date" -->" /></p>
85 <input type="hidden" name="incgst" value="<!--TMPL_VAR NAME="incgst"-->" />
86 <input type="hidden" name="currencyrate" value="<!--TMPL_VAR NAME="currencyrate"-->" />
88 <tr>Rate of tax used for P&P:<input type="text" size="2" name="freightgstrate" value="<!--TMPL_VAR NAME="gstrate"-->" />%</td>
89 <tr> <th align="left">Basket/Order</th>
90 <th class="acquisition">ISBN</th>
91 <th class="acquisition">Title</th>
92 <th class="acquisition">Price</th>
93 <th class="acquisition">Actual <!--TMPL_VAR NAME="invcurrency"--></th>
94 <th class="acquisition">P&P <!--TMPL_VAR NAME="invcurrency"--></th>
95 <th class="acquisition">Qty</th>
96 <th class="acquisition">Received</th>
99 <!-- TMPL_LOOP NAME="loop_orders" -->
100 <tr><input type="hidden" name="ordernumber" value="<!-- TMPL_VAR NAME="ordernumber" -->" />
101 <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
102 <input type="hidden" name="title" value="<!-- TMPL_VAR NAME="title" -->" />
103 <td ><!-- TMPL_VAR NAME="basketno" -->/<!-- TMPL_VAR NAME="ordernumber" --></td>
104 <td><!-- TMPL_VAR NAME="isbn" --></td>
105 <td><!-- TMPL_VAR NAME="title" --></td>
106 <td align="right"><!-- TMPL_VAR NAME="rrp" --></td>
107 <td align="right"> <input type="text" size="2" name="actual" value="<!-- TMPL_VAR NAME="actualrrp" -->" onChange="docalculate();"/></td>
108 <td align="right"> <input type="text" size="2" name="freight" value="0.00" onChange="docalculate();"/></td>
109 <td><!-- TMPL_VAR NAME="quantity" --></td>
110 <td> <input type="text" size="2" name="received" value="<!-- TMPL_VAR NAME="toreceive" -->" onChange="docalculate();"/></td>
111 <input type="hidden" name="discount" value="<!--TMPL_VAR NAME="discount"-->" />
112 <input type="hidden" name="gstrate" value="<!--TMPL_VAR NAME="gst"-->" />
118 <th class="acquisition" align="right">SubTotals</th>
119 <td align="right"><b><!-- TMPL_VAR NAME="totalprice" --></b></td>
120 <td align="right"><b><input type="text" name="totalactual" size="2" value="<!-- TMPL_VAR NAME="totalactual" -->" /></b></td>
121 <td align="right"><b><input type="text" size="2" name="totalfreight" /></b></th>
122 <td ><b><!-- TMPL_VAR NAME="totalquantity" --></b></td>
123 <td ><b><input type="text" size="2" name="totalreceived" value="<!-- TMPL_VAR NAME="totaltoreceive" -->" READONLY /></b></td>
126 <!--TMPL_IF NAME="totaldiscount"--> <tr>
129 <th class="acquisition" align="right">- Discount</th>
130 <td align="right"><b><!-- TMPL_VAR NAME="totaldiscount" --></b></td>
131 <td align="right"><b><input type="text" name="actualdiscount" size="2" value="<!-- TMPL_VAR NAME="actualdiscount" -->" onChange="updatetotal();"/></b></td>
133 <!--TMPL_IF NAME="gstreg"--> <tr>
136 <th class="acquisition" align="right">Tax</th>
137 <td align="right"><b><!-- TMPL_VAR NAME="totalgst" --></b></td>
138 <td align="right"><b><input type="text" name="actualgst" size="2" value="<!-- TMPL_VAR NAME="actualgst" -->"/></b></td>
139 <td align="right"><b><input type="text" name="freightgst" size="2" /></td></b>
144 <th class="acquisition" align="right">Totals</th>
145 <td align="right"><b><!-- TMPL_VAR NAME="total" --></b></td>
146 <td align="right"><b><input type="text" name="actualtotal" size="2" value="<!-- TMPL_VAR NAME="actualtotal" -->" onChange="updatetotal();"/></b></td>
147 <td align="right"><b><input type="text" name="actualfreight" size="2" onChange="updatetotal();"/></b></td>
152 <th class="acquisition" align="right" colspan="5">Invoice Total <!--TMPL_VAR NAME="invcurrency"--></th>
153 <td ><b><input type="text" name="invoicetotal" size="4" /></b></td>
155 <!--TMPL_IF NAME="invcurrency"-->
159 <th class="acquisition" align="right" colspan="5">Invoice Total </th>
160 <td ><b><input type="text" name="localtotal" size="4" /></b></td>
164 Note: P&P is per item. If you have a total freight fill the Total P&P only.!
165 <p><input type="button" value="Receive" onClick="checkform();" /></p>
171 <!-- TMPL_INCLUDE name="intranet-bottom.inc" -->