synch'ing 2.2 and head
[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   if (quantity ==0) {
9         alert("Quantity must be >0");
10   }
11   discount=f.discount.value
12   listinc=parseInt(f.listinc.value)
13   currency=f.currency.value
14   applygst=parseInt(f.applygst.value)
15   listprice=f.list_price.value
16   //  rrp=f.rrp.value
17   //  ecost=f.ecost.value  //budgetted cost
18   //  GST=f.GST.value
19   //  total=f.total.value
20   //make useful constants out of the above
21   exchangerate=f.elements[currency].value      //get exchange rate
22   gst_on=(!listinc && applygst);
23   //do real stuff
24   rrp=listprice*exchangerate;
25   ecost=rrp*(100-discount)/100
26   GST=0;
27   if (gst_on){
28     rrp=rrp*(1+<!-- TMPL_VAR NAME="gstrate" -->);
29     GST=ecost*(<!-- TMPL_VAR NAME="gstrate" -->);
30   }
31
32   total=(ecost+GST)*quantity
33
34   f.rrp.value=rrp;
35   f.ecost.value=ecost;
36   f.GST.value=GST;
37   f.total.value=total;
38   return true;
39 }
40
41
42
43 function messenger(X,Y,etc){
44         win=window.open("","mess","height="+X+",width="+Y+",screenX=150,screenY=0");
45         win.focus();
46         win.document.close();
47         win.document.write("<body link='#333333' bgcolor='#ffffff' text='#000000'><font size='2'><p><br>");
48         win.document.write(etc);
49         win.document.write("<center><form><input type=button onclick='self.close()' value='Close'></form></center>");
50         win.document.write("</font></body></html>");
51 }
52
53 function check(f) {
54   quantity=f.quantity.value
55   title=f.title.value
56   if (title == "") {
57         alert("Title can't be empty");
58         return false;
59   }
60   if (quantity ==0) {
61         alert("Quantity must be >0");
62         return false;
63   }
64         document.frusin.submit();
65 }
66
67 //-->
68
69 </script>
70 <div id="mainbloc">
71         <form action="/cgi-bin/koha/acqui/addorder.pl" method="post" name="frusin">
72         <!-- TMPL_UNLESS name="existing" --><input type="hidden" name="existing" value="no"><!-- /TMPL_UNLESS -->
73         <!-- <!-- TMPL_VAR NAME="title" --> -->
74         <input type="hidden" name="ordnum" value="<!-- TMPL_VAR NAME="ordnum" -->">
75         <input type="hidden" name="basketno" value="<!-- TMPL_VAR NAME="basketno" -->">
76         <input type="hidden" name="booksellerid" value="<!-- TMPL_VAR NAME="booksellerid" -->">
77         <input type="hidden" name="biblio" value="<!-- TMPL_VAR NAME="biblio" -->">
78         <input type="hidden" name="bibitemnum" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->">
79         <input type="hidden" name="oldtype" value="<!-- TMPL_VAR NAME="itemtype" -->">
80         <input type="hidden" name="discount" value="<!-- TMPL_VAR NAME="discount" -->">
81         <input type="hidden" name="listinc" value="<!-- TMPL_VAR NAME="listincgst" -->">
82         <input type="hidden" name="currency" value="<!-- TMPL_VAR NAME="currency" -->">
83         <input type="hidden" name="applygst" value="<!-- TMPL_VAR NAME="gstreg" -->">
84         <input type="hidden" name="suggestionid" value="<!-- TMPL_VAR NAME="suggestionid" -->">
85         <!-- TMPL_LOOP NAME="loop_currencies" -->
86                 <input type="hidden" name="<!-- TMPL_VAR NAME="currency" -->" value="<!-- TMPL_VAR NAME="rate" -->">
87         <!-- /TMPL_LOOP -->
88         <a href="basket.pl?basket=<!-- TMPL_VAR NAME="basket" -->" class="button acquisition">View Basket</a>
89         <h1 class="acquisition">
90                 <!-- TMPL_IF name="ordnum" -->
91                         Modify order details (line #<!-- TMPL_VAR NAME="ordnum" -->)
92                 <!-- TMPL_ELSE -->
93                         New order
94                 <!-- /TMPL_IF -->
95                  <!-- TMPL_IF name="suggestionid" -->(defined from suggestion #<!-- TMPL_VAR NAME="suggestionid" -->)<!-- /TMPL_IF -->
96         </h1>
97         Shopping Basket For <!-- TMPL_VAR NAME="name" -->
98         <div id="bloc25">
99                 <h2 class="acquisition">catalogue details</h2>
100                 <p>
101                         <label class="label100"><b>Title *</b></label>
102                         <!-- TMPL_IF name="biblio" -->
103                                 <input type="hidden" size="20" name="title" value="<!-- TMPL_VAR NAME="title" -->"><!-- TMPL_VAR NAME="title" -->
104                         <!-- TMPL_ELSE -->
105                                 <input type="text" size="20" name="title" value="<!-- TMPL_VAR NAME="title" -->">
106                         <!-- /TMPL_IF -->
107                 </p>
108                 <p>
109                         <label class="label100">Author</label>
110                         <!-- TMPL_IF name="biblio" -->
111                                 <input type="hidden" size="20" name="author" value="<!-- TMPL_VAR NAME="author" -->"><!-- TMPL_VAR NAME="author" -->
112                         <!-- TMPL_ELSE -->
113                                 <input type="text" size="20" name="author" value="<!-- TMPL_VAR NAME="author" -->">
114                         <!-- /TMPL_IF -->
115                 </p>
116                 <p>
117                         <label class="label100"> Publisher</label>
118                         <!-- TMPL_IF name="biblio" -->
119                                 <input type="hidden" size="20" name="publishercode" value="<!-- TMPL_VAR NAME="publishercode" -->"><!-- TMPL_VAR NAME="publishercode" -->
120                         <!-- TMPL_ELSE -->
121                                 <input type="text" size="20" name="publishercode" value="<!-- TMPL_VAR NAME="publishercode" -->">
122                         <!-- /TMPL_IF -->
123                 </p>
124                 <p>
125                         <label class="label100">Copyright Date</label>
126                         <!-- TMPL_IF name="biblio" -->
127                                 <input type="hidden" size="20" name="copyrightdate" value="<!-- TMPL_VAR NAME="copyrightdate" -->"><!-- TMPL_VAR NAME="copyrightdate" -->
128                         <!-- TMPL_ELSE -->
129                                 <input type="text" size="20" name="copyrightdate" value="<!-- TMPL_VAR NAME="copyrightdate" -->">
130                         <!-- /TMPL_IF -->
131                 </p>
132                 <p>
133                         <label class="label100">Format</label>
134                         <!-- TMPL_VAR NAME="CGIitemtype" -->
135                 </p>
136                 <p>
137                         <label class="label100">ISBN</label>
138                         <!-- TMPL_IF name="biblio" -->
139                                 <input type="hidden" size="20" name="ISBN" value="<!-- TMPL_VAR NAME="isbn" -->"><!-- TMPL_VAR NAME="isbn" -->
140                         <!-- TMPL_ELSE -->
141                                 <input type="text" size="20" name="ISBN" value="<!-- TMPL_VAR NAME="isbn" -->">
142                         <!-- /TMPL_IF -->
143                 </p>
144                 <p>
145                         <label class="label100">Series</label>
146                         <!-- TMPL_IF name="biblio" -->
147                                 <input type="hidden" size="20" name="series" value="<!-- TMPL_VAR NAME="seriestitle" -->"><!-- TMPL_VAR NAME="seriestitle" -->
148                         <!-- TMPL_ELSE -->
149                                 <input type="text" size="20" name="series" value="<!-- TMPL_VAR NAME="seriestitle" -->">
150                         <!-- /TMPL_IF -->
151                 </p>
152                 <p>
153                         <label class="label100">Branch</label>
154                         <!-- TMPL_VAR NAME="CGIbranch" -->
155                 </p>
156         </div>
157         <div id="bloc25">
158                 <h2 class="acquisition">Accounting details</h2>
159                 <p>
160                         <label class="label100">Quantity</label>
161                         <input type="text" size="20" name="quantity" value="<!-- TMPL_VAR NAME="quantity" -->" onchange="update(this.form);">
162                 </p>
163                 <p>
164                         <label class="label100">Bookfund</label>
165                         <!-- TMPL_VAR NAME="CGIbookfund" -->
166                 </p>
167                 <p>
168                         <label class="label100">Suppliers List Price</label>
169                         <input type="text" size="20" name="list_price" value="<!-- TMPL_VAR NAME="listprice" -->" onchange="update(this.form)">
170                 </p>
171                 <p>
172                         <label class="label100">Replacement Cost </label>
173                         <input type="text" size="20" name="rrp" value="<!-- TMPL_VAR NAME="rrp" -->" onchange="update(this.form)">
174                 </p>
175                 <p>
176                         <label class="label100">Budgeted Cost</label>
177                         <input type="text" size="20" name="ecost" value="<!-- TMPL_VAR NAME="ecost" -->" onchange="update(this.form)">
178                 </p>
179                 <p>
180                         <label class="label100">Budgeted GST</label>
181                         <input type="text" size="20" name="GST" value="" onchange="update(this.form)">
182                 </p>
183                 <p>
184                         <label class="label100"><b>BUDGETED TOTAL</b></label>
185                         <input type="text" size="20" name="total" value="" onchange="update(this.form)">
186                 </p>
187                 <p>
188                         <label class="label100">Actual Cost</label>
189                         <input type="text" size="20" name="cost" value="<!-- TMPL_VAR name="ecost"-->">
190                 </p>
191                 <p>
192                         <label class="label100">Invoice Number *</label>
193                         <input type="text" size="20" name="invoice"  value="<!-- TMPL_VAR name="invoice" -->">
194                 <p>
195                         <label class="label100">Notes</label>
196                         <input type="text" size="20" name="notes" value="<!-- TMPL_VAR NAME="notes" -->">
197                 </p>
198                 <p>The 2 following fields are available for your own usage. They can be useful for stat purposes</p>
199                 <p>
200                         <label class="label100">Sort field 1</label>
201                         <input type="text" size="20" name=sort1 value="<!-- TMPL_VAR NAME="sort1" -->">
202                 </p>
203                 <p>
204                         <label class="label100">Sort field 2</label>
205                         <input type="text" size="20" name=sort2 value="<!-- TMPL_VAR NAME="sort2" -->">
206                 </p>
207                 <p>
208                         <input type="button" value="OK" class="button acquisition" onClick="check(this.form)">
209                 </p>
210         </form>
211         </div>
212 </div>
213 <!-- TMPL_INCLUDE name="acquisitions-bottom.inc" -->