fixing bug #526 : gst rate is now calculated through systempref gist entry.
[koha.git] / koha-tmpl / intranet-tmpl / default / en / acqui / newbiblio.tmpl
1 <TMPL_INCLUDE name="acquisitions-top.inc">
2 <script language="javascript" type="text/javascript">
3
4 <!--
5 function update(f){
6   //collect values
7   quantity=f.quantity.value
8   discount=f.discount.value
9   listinc=parseInt(f.listinc.value)
10   currency=f.currency.value
11   applygst=parseInt(f.applygst.value)
12   listprice=f.list_price.value
13   //  rrp=f.rrp.value
14   //  ecost=f.ecost.value  //budgetted cost
15   //  GST=f.GST.value
16   //  total=f.total.value
17   //make useful constants out of the above
18   exchangerate=f.elements[currency].value      //get exchange rate
19   gst_on=(!listinc && applygst);
20   //do real stuff
21   rrp=listprice*exchangerate;
22   ecost=rrp*(100-discount)/100
23   GST=0;
24   if (gst_on){
25     rrp=rrp*(1+<TMPL_VAR name="gstrate">);
26     GST=ecost*(<TMPL_VAR name="gstrate">);
27   }
28
29   total=(ecost+GST)*quantity
30
31   f.rrp.value=rrp;
32   f.ecost.value=ecost;
33   f.GST.value=GST;
34   f.total.value=total;
35
36 }
37
38
39
40 function messenger(X,Y,etc){
41 win=window.open("","mess","height="+X+",width="+Y+",screenX=150,screenY=0");
42 win.focus();
43 win.document.close();
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>");
48 }
49 //-->
50
51 </script>
52 <form action=/cgi-bin/koha/acqui/addorder.pl method=post name=frusin>
53 <TMPL_UNLESS name="existing"><input type=hidden name=existing value=no></TMPL_UNLESS>
54 <!-- <TMPL_VAR name="title"> -->
55 <input type=hidden name=ordnum value="<TMPL_VAR name="ordnum">">
56 <input type=hidden name=basket value="<TMPL_VAR name="basket">">
57 <input type=hidden name=supplier value="<TMPL_VAR name="id">">
58 <input type=hidden name=biblio value="<TMPL_VAR name="biblio">">
59 <input type=hidden name=bibitemnum value="<TMPL_VAR name="biblioitemnumber">">
60 <input type=hidden name=oldtype value="<TMPL_VAR name="itemtype">">
61 <input type=hidden name=discount value="<TMPL_VAR name="discount">">
62 <input type=hidden name=listinc value="<TMPL_VAR name="listincgst">">
63 <input type=hidden name=currency value="<TMPL_VAR name="currency">">
64 <input type=hidden name=applygst value="<TMPL_VAR name="gstreg">">
65 <TMPL_LOOP name="loop_currencies">
66         <input type=hidden name="<TMPL_VAR name="currency">" value="<TMPL_VAR name="rate">">
67 </TMPL_LOOP>
68 <TMPL_IF name="orderexists"><input type=hidden name=orderexists value=yes></TMPL_IF>
69 <a href=basket.pl?basket=<TMPL_VAR name="basket">><img src=<TMPL_VAR name="themelang">/images/view-basket.gif width=187 heigth=42 border=0 align=right alt="View Basket"></a>
70 <h1><TMPL_VAR name="ordnum"> - Order Details </h1><br>
71 Shopping Basket For: <TMPL_VAR name="name">
72 <P>
73 <CENTER>
74 <TABLE  CELLSPACING=0  CELLPADDING=5 border=1 align=left width="40%">
75         <tr valign=top bgcolor=#99cc33>
76                 <td background="/images/background-mem.gif" colspan=2><B>CATALOGUE DETAILS</B></td>
77         </tr>
78         <TR VALIGN=TOP>
79                 <TD><b>Title *</b></td>
80                 <td><input type=text size=20 name=title value="<TMPL_VAR name="title">"></td>
81         </tr>
82         <TR VALIGN=TOP>
83                 <TD>Author</td>
84                 <td><input type=text size=20 name=author value="<TMPL_VAR name="author">" ></td>
85         </tr>
86         <TR VALIGN=TOP>
87         <TD>Copyright Date</td>
88         <td><input type=text size=20 name=copyright value="<TMPL_VAR name="copyrightdate">">
89         </td>
90         </tr>
91         <TR VALIGN=TOP>
92                 <TD>Format</td>
93                 <td><TMPL_VAR name="CGIitemtype"></td>
94         </tr>
95         <TR VALIGN=TOP>
96                 <TD>ISBN</td>
97                 <td><input type=text size=20 name=ISBN value="<TMPL_VAR name="isbn">"></td>
98         </tr>
99         <TR VALIGN=TOP>
100                 <TD>Series</td>
101                 <td><input type=text size=20 name=Series value="<TMPL_VAR name="seriestitle">"></td>
102         </tr>
103         <TR VALIGN=TOP>
104                 <TD>Branch</td>
105                 <td><TMPL_VAR name="CGIbranch"></td>
106         </tr>
107 </table>
108 <img src="<TMPL_VAR name="themelang">/images/holder.gif" width=32 height=250 align=left>
109 <table border=1 cellspacing=0 cellpadding=5 width="40%">
110         <tr valign=top bgcolor=#99cc33><td background="/images/background-mem.gif" colspan=2><B>ACCOUNTING DETAILS</B></td></tr>
111         <TR VALIGN=TOP>
112                 <TD>Quantity</td>
113                 <td><input type=text size=20 name=quantity value="<TMPL_VAR name="quantity">" onchange='update(this.form)' ></td>
114         </tr>
115         <TR VALIGN=TOP>
116                 <TD>Bookfund</td>
117                 <td><TMPL_VAR name="CGIbookfund"></td>
118         </tr>
119         <TR VALIGN=TOP>
120                 <TD>Suppliers List Price</td>
121                 <td><input type=text size=20 name=list_price value="<TMPL_VAR name="listprice">" onchange='update(this.form)'></td>
122         </tr>
123         <TR VALIGN=TOP>
124                 <TD>Replacement Cost <br><FONT SIZE=2></td>
125                 <td><input type=text size=20 name=rrp value="<TMPL_VAR name="rrp">" onchange='update(this.form)'>
126         </tr>
127         <TR VALIGN=TOP>
128                 <TD>Budgeted Cost<BR><FONT SIZE=2>(ex GST, inc discount)</FONT> </td>
129                 <td><input type=text size=20 name=ecost value="<TMPL_VAR name="ecost">" onchange='update(this.form)'></td>
130         </tr>
131         <TR VALIGN=TOP>
132                 <TD>Budgeted GST</td>
133                 <td><input type=text size=20 name=GST value="" onchange='update(this.form)'></td>
134         </tr>
135         <TR VALIGN=TOP>
136                 <TD><B>BUDGETED TOTAL</B></td>
137                 <td><input type=text size=20 name=total value="" onchange='update(this.form)'></td>
138         </tr>
139         <TR VALIGN=TOP  bgcolor=#ffffcc>
140                 <TD>Actual Cost</td>
141                 <td><input type=text size=20 name=cost></td>
142         </tr>
143         <TR VALIGN=TOP  bgcolor=#ffffcc>
144                 <TD>Invoice Number *</td>
145                 <td><input type=text size=20 name=invoice ></td>
146         <TR VALIGN=TOP>
147                 <TD>Notes</td>
148                 <td><input type=text size=20 name=notes value="<TMPL_VAR name="notes">"></td>
149         </tr>
150         <TR VALIGN=TOP>
151                 <TD colspan=2><input type=image  name=submit src="<TMPL_VAR name="interface">/<TMPL_VAR name="theme">/images/2rightarrow.png" border=0 align=right>     </td>
152         </tr>
153 </table>
154 </form>
155 </center>
156 <table>
157 <tr><td bgcolor=#cccc99  background="/images/background-mem.gif"><B>HELP</B><br>
158 <UL>
159 <LI><B>Bold</B> fields must be filled in to create a new bibilo and item.<p>
160 <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.
161 </UL>
162 </td></tr></table>
163 <p> &nbsp; </p>
164 <TMPL_INCLUDE name="acquisitions-bottom.inc">
165
166