merging 2.2 branch with head. Sorry for not making it before, many many commits done...
[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   if (title == "") {
56         alert("Title can't be empty");
57         return false;
58   }
59   if (quantity ==0) {
60         alert("Quantity must be >0");
61         return false;
62   }
63         document.frusin.submit();
64 }
65
66 //-->
67
68 </script>
69 <div id="mainbloc">
70         <form action="/cgi-bin/koha/acqui/addorder.pl" method="post" name="frusin">
71         <!-- TMPL_UNLESS name="existing" --><input type="hidden" name="existing" value="no"><!-- /TMPL_UNLESS -->
72         <!-- <!-- TMPL_VAR NAME="title" --> -->
73         <input type="hidden" name="ordnum" value="<!-- TMPL_VAR NAME="ordnum" -->">
74         <input type="hidden" name="basketno" value="<!-- TMPL_VAR NAME="basketno" -->">
75         <input type="hidden" name="booksellerid" value="<!-- TMPL_VAR NAME="booksellerid" -->">
76         <input type="hidden" name="biblio" value="<!-- TMPL_VAR NAME="biblio" -->">
77         <input type="hidden" name="bibitemnum" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->">
78         <input type="hidden" name="oldtype" value="<!-- TMPL_VAR NAME="itemtype" -->">
79         <input type="hidden" name="discount" value="<!-- TMPL_VAR NAME="discount" -->">
80         <input type="hidden" name="listinc" value="<!-- TMPL_VAR NAME="listincgst" -->">
81         <input type="hidden" name="currency" value="<!-- TMPL_VAR NAME="currency" -->">
82         <input type="hidden" name="applygst" value="<!-- TMPL_VAR NAME="gstreg" -->">
83         <input type="hidden" name="suggestionid" value="<!-- TMPL_VAR NAME="suggestionid" -->">
84         <!-- TMPL_LOOP NAME="loop_currencies" -->
85                 <input type="hidden" name="<!-- TMPL_VAR NAME="currency" -->" value="<!-- TMPL_VAR NAME="rate" -->">
86         <!-- /TMPL_LOOP -->
87         <a href="basket.pl?basket=<!-- TMPL_VAR NAME="basket" -->" class="button acquisition">View Basket</a>
88         <h1 class="acquisition">
89                 <!-- TMPL_IF name="ordnum" -->
90                         Modify order details (line #<!-- TMPL_VAR NAME="ordnum" -->)
91                 <!-- TMPL_ELSE -->
92                         New order
93                 <!-- /TMPL_IF -->
94                  <!-- TMPL_IF name="suggestionid" -->(defined from suggestion #<!-- TMPL_VAR NAME="suggestionid" -->)<!-- /TMPL_IF -->
95         </h1>
96         Shopping Basket For <!-- TMPL_VAR NAME="name" -->
97         <div id="bloc25">
98                 <h2 class="acquisition">catalogue details</h2>
99                 <p>
100                         <label class="label100"><b>Title *</b></label>
101                         <!-- TMPL_IF name="biblio" -->
102                                 <input type="hidden" size="20" name="title" value="<!-- TMPL_VAR NAME="title" -->"><!-- TMPL_VAR NAME="title" -->
103                         <!-- TMPL_ELSE -->
104                                 <input type="text" size="20" name="title" value="<!-- TMPL_VAR NAME="title" -->">
105                         <!-- /TMPL_IF -->
106                 </p>
107                 <p>
108                         <label class="label100">Author</label>
109                         <!-- TMPL_IF name="biblio" -->
110                                 <input type="hidden" size="20" name="author" value="<!-- TMPL_VAR NAME="author" -->"><!-- TMPL_VAR NAME="author" -->
111                         <!-- TMPL_ELSE -->
112                                 <input type="text" size="20" name="author" value="<!-- TMPL_VAR NAME="author" -->">
113                         <!-- /TMPL_IF -->
114                 </p>
115                 <p>
116                         <label class="label100"> Publisher</label>
117                         <!-- TMPL_IF name="biblio" -->
118                                 <input type="hidden" size="20" name="publishercode" value="<!-- TMPL_VAR NAME="publishercode" -->"><!-- TMPL_VAR NAME="publishercode" -->
119                         <!-- TMPL_ELSE -->
120                                 <input type="text" size="20" name="publishercode" value="<!-- TMPL_VAR NAME="publishercode" -->">
121                         <!-- /TMPL_IF -->
122                 </p>
123                 <p>
124                         <label class="label100">Copyright Date</label>
125                         <!-- TMPL_IF name="biblio" -->
126                                 <input type="hidden" size="20" name="copyrightdate" value="<!-- TMPL_VAR NAME="copyrightdate" -->"><!-- TMPL_VAR NAME="copyrightdate" -->
127                         <!-- TMPL_ELSE -->
128                                 <input type="text" size="20" name="copyrightdate" value="<!-- TMPL_VAR NAME="copyrightdate" -->">
129                         <!-- /TMPL_IF -->
130                 </p>
131                 <p>
132                         <label class="label100">Format</label>
133                         <!-- TMPL_VAR NAME="CGIitemtype" -->
134                 </p>
135                 <p>
136                         <label class="label100">ISBN</label>
137                         <!-- TMPL_IF name="biblio" -->
138                                 <input type="hidden" size="20" name="ISBN" value="<!-- TMPL_VAR NAME="isbn" -->"><!-- TMPL_VAR NAME="isbn" -->
139                         <!-- TMPL_ELSE -->
140                                 <input type="text" size="20" name="ISBN" value="<!-- TMPL_VAR NAME="isbn" -->">
141                         <!-- /TMPL_IF -->
142                 </p>
143                 <p>
144                         <label class="label100">Series</label>
145                         <!-- TMPL_IF name="biblio" -->
146                                 <input type="hidden" size="20" name="series" value="<!-- TMPL_VAR NAME="seriestitle" -->"><!-- TMPL_VAR NAME="seriestitle" -->
147                         <!-- TMPL_ELSE -->
148                                 <input type="text" size="20" name="series" value="<!-- TMPL_VAR NAME="seriestitle" -->">
149                         <!-- /TMPL_IF -->
150                 </p>
151                 <p>
152                         <label class="label100">Branch</label>
153                         <!-- TMPL_VAR NAME="CGIbranch" -->
154                 </p>
155         </div>
156         <div id="bloc25">
157                 <h2 class="acquisition">Accounting details</h2>
158                 <p>
159                         <label class="label100">Quantity</label>
160                         <input type="text" size="20" name="quantity" value="<!-- TMPL_VAR NAME="quantity" -->" onchange="update(this.form);">
161                 </p>
162                 <p>
163                         <label class="label100">Bookfund</label>
164                         <!-- TMPL_VAR NAME="CGIbookfund" -->
165                 </p>
166                 <p>
167                         <label class="label100">Suppliers List Price</label>
168                         <input type="text" size="20" name="list_price" value="<!-- TMPL_VAR NAME="listprice" -->" onchange="update(this.form)">
169                 </p>
170                 <p>
171                         <label class="label100">Replacement Cost </label>
172                         <input type="text" size="20" name="rrp" value="<!-- TMPL_VAR NAME="rrp" -->" onchange="update(this.form)">
173                 </p>
174                 <p>
175                         <label class="label100">Budgeted Cost</label>
176                         <input type="text" size="20" name="ecost" value="<!-- TMPL_VAR NAME="ecost" -->" onchange="update(this.form)">
177                 </p>
178                 <p>
179                         <label class="label100">Budgeted GST</label>
180                         <input type="text" size="20" name="GST" value="" onchange="update(this.form)">
181                 </p>
182                 <p>
183                         <label class="label100"><b>BUDGETED TOTAL</b></label>
184                         <input type="text" size="20" name="total" value="" onchange="update(this.form)">
185                 </p>
186                 <p>
187                         <label class="label100">Actual Cost</label>
188                         <input type="text" size="20" name="cost" value="<!-- TMPL_VAR name="ecost"-->">
189                 </p>
190                 <p>
191                         <label class="label100">Invoice Number *</label>
192                         <input type="text" size="20" name="invoice"  value="<!-- TMPL_VAR name="invoice" -->">
193                 <p>
194                         <label class="label100">Notes</label>
195                         <input type="text" size="20" name="notes" value="<!-- TMPL_VAR NAME="notes" -->">
196                 </p>
197                 <p>The 2 following fields are available for your own usage. They can be useful for stat purposes</p>
198                 <p>
199                         <label class="label100">Sort field 1</label>
200                         <input type="text" size="20" name=sort1 value="<!-- TMPL_VAR NAME="sort1" -->">
201                 </p>
202                 <p>
203                         <label class="label100">Sort field 2</label>
204                         <input type="text" size="20" name=sort2 value="<!-- TMPL_VAR NAME="sort2" -->">
205                 </p>
206                 <p>
207                         <input type="button" value="OK" class="button acquisition" onClick="check(this.form)">
208                 </p>
209         </form>
210         </div>
211 </div>
212 <!-- TMPL_INCLUDE name="acquisitions-bottom.inc" -->