Merge remote branch 'colin/QA/bug_4506' into new/enh/bug_4506
[koha_gimpoz] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / neworderempty.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Acquisitions &rsaquo; Basket <!-- TMPL_VAR NAME="basketno" --> &rsaquo; <!-- TMPL_IF name="ordernumber" -->Modify order details (line #<!-- TMPL_VAR NAME="ordernumber" -->)<!-- TMPL_ELSE -->New order<!-- /TMPL_IF --></title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4
5 <script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/acq.js"></script>
6 <script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/additem.js"></script>
7 <script type="text/javascript">
8 //<![CDATA[
9 actTotal = "";
10
11 function Check(ff) {
12     var ok=0;
13     var _alertString= _("Form not submitted because of the following problem(s)")+"\n";
14
15     _alertString +="-------------------------------------------------------------------\n\n";
16
17     if ( isNull(ff.title,1)  &&  isNull(ff.entertitle,1)   ){
18         ok=1;
19                     _alertString += "\n- " + _("Title cannot be empty");
20     }
21
22     if (!(isNum(ff.quantity,0))){
23         ok=1;
24                     _alertString += "\n- " + _("Quantity must be greater than '0'");
25     }
26
27     if (!(isNum(ff.listprice,0))){
28         ok=1;
29                     _alertString += "\n- " + _("Vendor price must be a number");
30     }
31
32     if (!(isNum(ff.total,0))){
33         ok=1;
34                     _alertString += "\n- " + _("Total must be a number");
35     }
36
37     if (totalExceedsBudget(ff.budget_id.value, ff.total.value  )  ) {
38         ok=1;
39         _alertString += "\n- " + _("Order total (") + ff.total.value +
40             _(") exceeds budget available (") + actTotal+")";
41     }
42
43     var empty_item_mandatory = 0;
44     for (i = 0; i < ff.field_value.length; i++) {
45         if (ff.field_value[i].value.length == 0 && ff.mandatory[i].value == 1) {
46             empty_item_mandatory++;
47         }
48     }
49     if (empty_item_mandatory > 0) {
50         ok = 1;
51         _alertString +=
52             "\n- " + empty_item_mandatory + _(" item mandatory fields empty");
53     }
54
55 if (ok) {
56         alert(_alertString);
57     return false;
58     }
59
60 ff.submit();
61
62 }
63
64
65 //]]>
66 </script>
67 </head>
68 <body onload="calcNeworderTotal()">
69
70 <!-- TMPL_INCLUDE NAME="header.inc" -->
71 <!-- TMPL_INCLUDE NAME="acquisitions-search.inc" -->
72
73 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR NAME="basketno" -->">Basket <!-- TMPL_VAR NAME="basketno" --></a> &rsaquo; <!-- TMPL_IF name="ordernumber" -->Modify order details (line #<!-- TMPL_VAR NAME="ordernumber" -->)<!-- TMPL_ELSE -->New order<!-- /TMPL_IF --></div>
74
75 <div id="doc3" class="yui-t2">
76
77 <div id="bd">
78     <div id="yui-main">
79     <div class="yui-b">
80
81 <h2>
82     <!-- TMPL_IF name="ordernumber" -->
83         Modify order details (line #<!-- TMPL_VAR NAME="ordernumber" -->)
84     <!-- TMPL_ELSE -->
85         New order
86     <!-- /TMPL_IF -->
87         <!-- TMPL_IF name="suggestionid" -->(defined from suggestion #<!-- TMPL_VAR NAME="suggestionid" -->)<!-- /TMPL_IF -->
88 </h2>
89
90 <!-- TMPL_IF name="basketno" -->
91     <div id="acqui_basket_summary"  class="yui-g">
92         <fieldset class="rows">
93         <legend>Basket details</legend>
94                 <ol>
95         <!-- TMPL_IF NAME="basketnote" --><li><span class="label">Internal note:</span> <!-- TMPL_VAR NAME="basketnote" --></li><!-- /TMPL_IF -->
96         <!-- TMPL_IF NAME="basketbooksellernote" --><li><span class="label">Vendor note:</span> <!-- TMPL_VAR NAME="basketbooksellernote" --></li><!-- /TMPL_IF -->
97         <!-- TMPL_IF NAME="basketcontractno" -->
98             <li><span class="label">Contract number: </span><!-- TMPL_VAR NAME="basketcontractno" --></li>
99             <li><span class="label">Contract name:</span> <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;contractnumber=<!-- TMPL_VAR NAME="basketcontractno" -->"><!-- TMPL_VAR NAME="basketcontractname" --></a></li>
100         <!-- /TMPL_IF -->
101         <!-- TMPL_IF NAME="authorisedbyname" --><li><span class="label">Managed by:</span>  <!-- TMPL_VAR NAME="authorisedbyname" --></li><!-- /TMPL_IF -->
102         <!-- TMPL_IF NAME="creationdate" --><li><span class="label">Open on:</span>  <!-- TMPL_VAR NAME="creationdate" --></li><!-- /TMPL_IF -->
103         <!-- TMPL_IF name="closedate" -->
104         <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
105         <li><span class="label">Closed on:</span>  <!-- TMPL_VAR name="closedate" --></li>
106         <!-- TMPL_IF name="basketgroups" -->
107             <li>Basketgroup: <select id="basketgroupid" name="basketgroupid">
108                 <!-- TMPL_LOOP name="basketgroups" -->
109                     <!-- TMPL_IF name="default" -->
110                     <option value="<!-- TMPL_VAR name="id" -->" selected="selected"><!-- TMPL_VAR name="name" --></option>
111                     <!-- TMPL_ELSE -->
112                     <option value="<!-- TMPL_VAR name="id" -->"><!-- TMPL_VAR name="name" --></option>
113                     <!-- /TMPL_IF -->
114                 <!-- /TMPL_LOOP -->
115                 </select>
116                 <input type="hidden" id="basketno" value="<!-- TMPL_VAR name="basketno" -->" name="basketno" />
117                 <input type="hidden" value="mod_basket" name="op" />
118                 <input type="hidden" name="booksellerid" value="<!-- TMPL_VAR name="booksellerid" -->" />
119             </li>
120                 <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset>
121         </form>
122         <!-- /TMPL_IF -->
123         <!-- /TMPL_IF -->
124                         </ol>
125 </fieldset>
126     </div>
127 <!-- /TMPL_IF -->
128
129 <form action="/cgi-bin/koha/acqui/addorder.pl" method="post" id="Aform">
130
131 <fieldset class="rows">
132         <legend>Catalog details</legend>
133         <!-- TMPL_UNLESS name="existing" -->
134         <input type="hidden" name="existing" value="no" />
135         <!-- /TMPL_UNLESS -->
136         <input type="hidden" name="ordernumber" value="<!-- TMPL_VAR NAME="ordernumber" -->" />
137         <input type="hidden" name="basketno" value="<!-- TMPL_VAR NAME="basketno" -->" />
138         <input type="hidden" name="booksellerid" value="<!-- TMPL_VAR NAME="booksellerid" -->" />
139         <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
140         <input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->" />
141         <input type="hidden" name="discount" value="<!-- TMPL_VAR NAME="discount" -->" />
142         <input type="hidden" name="listinc" value="<!-- TMPL_VAR NAME="listincgst" -->" />
143         <input type="hidden" name="currency" value="<!-- TMPL_VAR NAME="currency" -->" />
144         <input type="hidden" name="applygst" value="<!-- TMPL_VAR NAME="gstreg" -->" />
145         <input type="hidden" name="invoiceincgst" value="<!-- TMPL_VAR NAME="invoiceincgst" -->" />
146         <input type="hidden" name="gstrate" value="<!-- TMPL_VAR NAME="gstrate" -->" />
147         <input type="hidden" name="suggestionid" value="<!-- TMPL_VAR NAME="suggestionid" -->" />
148         <input type="hidden" name="import_batch_id" value="<!-- TMPL_VAR name="import_batch_id" -->" />
149
150         <!-- TMPL_LOOP NAME="loop_currencies" -->
151             <input type="hidden" name="<!-- TMPL_VAR NAME="currency" -->" value="<!-- TMPL_VAR NAME="rate" -->" />
152         <!-- /TMPL_LOOP -->
153         <ol><li>
154             <!-- TMPL_IF name="biblionumber" -->
155             <span class="label">Title</span>
156                 <input type="hidden" size="50" name="title" value="<!-- TMPL_VAR NAME="title" ESCAPE="HTML" -->" /> <span class="title"><!-- TMPL_VAR NAME="title" ESCAPE="html" --></span>
157             <!-- TMPL_ELSE -->
158             <label for="entertitle" class="required">Title: </label>
159                 <input type="text" id="entertitle" size="50" name="title" value="<!-- TMPL_VAR NAME="title" ESCAPE="html" -->" />
160             <!-- /TMPL_IF -->
161         </li>
162         <li>
163             <!-- TMPL_IF name="biblionumber" -->
164             <span class="label">Author: </span>
165                 <input type="hidden" size="50" name="author" id="author" value="<!-- TMPL_VAR NAME="author" -->" /><!-- TMPL_VAR NAME="author" -->
166             <!-- TMPL_ELSE -->
167             <label for="author">Author: </label>
168                 <input type="text" size="50" name="author" id="author" value="<!-- TMPL_VAR NAME="author" -->" />
169             <!-- /TMPL_IF -->
170         </li>
171         <li>
172             <!-- TMPL_IF name="biblionumber" -->
173             <span class="label">Publisher: </span>
174                 <input type="hidden" size="50" name="publishercode" id="publishercode" value="<!-- TMPL_VAR NAME="publishercode" -->" /><!-- TMPL_VAR NAME="publishercode" -->
175             <!-- TMPL_ELSE -->
176             <label for="publishercode"> Publisher: </label>
177                 <input type="text" size="50" name="publishercode" id="publishercode" value="<!-- TMPL_VAR NAME="publishercode" -->" />
178             <!-- /TMPL_IF -->
179         </li>
180         <li>
181             <!-- TMPL_IF name="biblionumber" -->
182             <span class="label">Publication year: </span>
183                 <input type="hidden" size="10" name="publicationyear" id="publicationyear" value="<!-- TMPL_VAR NAME="publicationyear" -->" /><!-- TMPL_VAR NAME="publicationyear" -->
184             <!-- TMPL_ELSE -->
185             <label for="publicationyear">Publication year: </label>
186                 <input type="text" size="10" name="publicationyear" id="publicationyear" value="<!-- TMPL_VAR NAME="publicationyear" -->" />
187             <!-- /TMPL_IF -->
188         </li>
189         <li>
190             <!-- TMPL_IF name="biblionumber" -->
191             <span class="label">ISBN: </span>
192                 <input type="hidden" size="50" name="isbn" id="ISBN" value="<!-- TMPL_VAR NAME="isbn" -->" /><!-- TMPL_VAR NAME="isbn" -->
193             <!-- TMPL_ELSE -->
194             <label for="ISBN">ISBN: </label>
195                 <input type="text" size="50" name="isbn" id="ISBN" value="<!-- TMPL_VAR NAME="isbn" -->" />
196             <!-- /TMPL_IF -->
197         </li>
198         <li>
199             <!-- TMPL_IF name="biblionumber" -->
200             <span class="label">Series: </span>
201                 <input type="hidden" size="50" name="series" id="series" value="<!-- TMPL_VAR NAME="seriestitle" -->" /><!-- TMPL_VAR NAME="seriestitle" -->
202             <!-- TMPL_ELSE -->
203             <label for="series">Series: </label>
204                 <input type="text" size="50" name="series" id="series" value="<!-- TMPL_VAR NAME="seriestitle" -->" />
205             <!-- /TMPL_IF -->
206         </li>
207         </ol>
208     </fieldset>
209     <!-- TMPL_IF name="items" -->
210     <fieldset class="rows">
211         <legend>Item</legend>
212         <!-- TMPL_IF name="NoACQframework" -->
213             <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
214         <!-- /TMPL_IF -->
215
216         <!-- TMPL_LOOP NAME="items" -->
217         <div id="outeritemblock">
218         <div id="itemblock">
219             <ol><!-- TMPL_LOOP NAME="iteminformation" --><li>
220                 <div class="subfield_line" style="<!-- TMPL_VAR NAME='hidden' -->;" id="subfield<!-- TMPL_VAR NAME='serialid' --><!-- TMPL_VAR NAME='countitems' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->">
221
222                     <label><!-- TMPL_VAR NAME="subfield" --> - <!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF --><!-- TMPL_VAR NAME="marc_lib" --><!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF --></label>
223                     <!-- TMPL_VAR NAME="marc_value" -->
224                     <input type="hidden" name="itemid" value="1" />
225                     <input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
226                     <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
227                     <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
228                     <input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
229                     <!-- TMPL_IF NAME="ITEM_SUBFIELDS_ARE_NOT_REPEATABLE" -->
230                         <span class="buttonPlus" onclick="CloneSubfield('subfield<!-- TMPL_VAR NAME='serialid' --><!-- TMPL_VAR NAME='countitems' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->')">+</span>
231                     <!-- /TMPL_IF -->
232
233                 </div></li>
234             <!-- /TMPL_LOOP-->
235             </ol>
236             <a style="cursor: pointer; color: grey; font-size: 180%;" onclick="cloneItemBlock('itemblock<!-- TMPL_VAR name="itemBlockIndex" -->')">+</a>
237             <a style="display:none; cursor: pointer; color: grey; font-size: 180%;" onclick="deleteItemBlock('itemblock<!-- TMPL_VAR name="itemBlockIndex" -->')">-</a>
238         </div><!-- /iteminformation -->
239         </div>
240
241         <!--/TMPL_LOOP--> <!-- /items -->
242     </fieldset>
243     <!-- /TMPL_IF --> <!-- items -->
244     <fieldset class="rows">
245         <legend>Accounting Details</legend>
246         <ol>
247             <li>
248                 <!-- TMPL_IF name="close" -->
249             <span class="label required">Quantity: </span>
250                     <input type="hidden" size="20" name="quantity" value="<!-- TMPL_VAR NAME="quantity" -->" /><!-- TMPL_VAR NAME="quantity" -->
251                 <!-- TMPL_ELSE -->
252                 <label class="required" for="quantity">Quantity: </label>
253                     <!-- TMPL_IF name="items" -->
254                         <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" onchange="calcNeworderTotal();" />
255                     <!-- TMPL_ELSE -->
256                         <input type="text" size="20" id="quantity" name="quantity" value="<!-- TMPL_VAR name="quantityrec" -->" onchange="calcNeworderTotal();" />
257                     <!-- /TMPL_IF -->
258                 <!--/TMPL_IF-->
259                 <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
260                 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
261             </li>
262             <li>
263                 <!-- TMPL_IF name="close" -->
264             <span class="label">Budget: </span>
265                     <input type="hidden" size="20" name="budget_id" id="budget_id" value="<!-- TMPL_VAR NAME="budget_id" -->" /><!-- TMPL_VAR NAME="Budget_name" -->
266                 <!-- TMPL_ELSE -->
267                 <label for="budget_id">Budget: </label>
268                 <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id">
269                 <!-- TMPL_LOOP NAME="budget_loop" -->
270                     <!-- TMPL_IF NAME="b_sel" -->
271                         <option value="<!-- TMPL_VAR NAME='b_id' -->" selected="selected"><!-- TMPL_VAR NAME="b_txt" --></option>
272                     <!-- TMPL_ELSE -->
273                         <option value="<!-- TMPL_VAR NAME='b_id' -->"><!-- TMPL_VAR NAME="b_txt" --></option>
274                     <!-- /TMPL_IF -->
275                 <!-- /TMPL_LOOP -->
276                 </select>
277                 <!--/TMPL_IF-->
278             </li>
279             <li>
280                 <!-- TMPL_IF name="close" -->
281             <span class="label">Vendor price: </span>
282                     <input type="hidden" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" /><!-- TMPL_VAR NAME="listprice" -->
283                 <!-- TMPL_ELSE -->
284                 <label for="listprice">Vendor price: </label>
285                     <input type="text" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" onchange="calcNeworderTotal()" /> (entered as <!-- TMPL_VAR NAME="currency" -->)
286
287                 <!--/TMPL_IF-->
288             </li>
289             <!-- TMPL_UNLESS NAME="close" -->
290             <li>
291                     <label for="uncertainprice">Uncertain price: </label>
292                     <!--TMPL_IF NAME="uncertainprice" -->
293                     <input type="checkbox" name="uncertainprice"  id="uncertainprice" value="1" checked="checked" />
294                     <!-- TMPL_ELSE -->
295                     <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" />
296                 <!--/TMPL_IF-->
297             </li>
298             <!-- /TMPL_UNLESS -->
299                         <li>
300                 <!-- TMPL_IF name="close" -->
301             <span class="label">Replacement cost: </span>
302                     <input type="hidden" size="20" name="rrp" id="rrp" value="<!-- TMPL_VAR NAME="rrp" -->" /><!-- TMPL_VAR NAME="rrp" -->
303                 <!-- TMPL_ELSE -->
304                 <label for="rrp">Replacement cost: </label>
305                     <input type="text" size="20" name="rrp" id="rrp" value="<!-- TMPL_VAR NAME="rrp" -->" /> (adjusted for <!-- TMPL_VAR NAME="cur_active" -->)
306                 <!--/TMPL_IF-->
307             </li>
308             <li>
309                 <!-- TMPL_IF name="close" -->
310             <label for="ecost">Budgeted cost: </label>
311                     <input type="text" size="20" name="ecost" id="ecost" value="<!-- TMPL_VAR NAME="ecost" -->" readonly="readonly"  />
312                 <!-- TMPL_ELSE -->
313                 <label for="ecost">Budgeted cost: </label>
314                     <input type="text" size="20" name="ecost" id="ecost" value="<!-- TMPL_VAR NAME="ecost" -->" />
315                 <!--/TMPL_IF-->
316                 <!-- TMPL_IF name="discount_2dp" -->  (adjusted for <!-- TMPL_VAR name="discount_2dp" -->% discount)  <!--/TMPL_IF-->
317
318             </li>
319             <!-- TMPL_IF NAME="GST"-->
320             <li>
321                 <!-- TMPL_IF name="close" -->
322             <label for="GST">Budgeted GST: </label>
323                 <input type="text" id="" size="20" name="gst" value="" id="GST" readonly="readonly" />
324                 <!-- TMPL_ELSE -->
325                 <label for="GST">Budgeted GST: </label>
326                 <input type="text" size="20" name="gst" id="GST" value="" />
327                 <!--/TMPL_IF-->
328             </li>
329             <!-- /TMPL_IF -->
330             <li>
331                 <!-- TMPL_IF name="close" -->
332             <label for="total">Total: </label>
333                 <input type="text" id="total" size="20" name="total" value="<!-- TMPL_VAR name="total" -->" readonly="readonly" />
334                 <!-- TMPL_ELSE -->
335                 <label for="total">Total: </label>
336                 <input type="text" id="total" size="20" name="total" value="<!-- TMPL_VAR name="total" -->" /> (budgeted cost * quantity)
337                 <!--/TMPL_IF-->
338             </li>
339             <li>
340                 <!-- TMPL_IF name="close" -->
341             <label for="cost">Actual cost: </label>
342                 <input type="text" id="cost" size="20" name="cost" value="<!-- TMPL_VAR name="ecost"-->" readonly="readonly" />
343                 <!-- TMPL_ELSE -->
344                 <label for="cost">Actual cost: </label>
345                 <input type="text" id="cost" size="20" name="cost" value="<!-- TMPL_VAR name="ecost"-->" />
346                 <!--/TMPL_IF-->
347             </li>
348             <li>
349                 <label for="notes">Notes: </label>
350                 <textarea id="notes" cols="30" rows="3" name="notes"><!-- TMPL_VAR NAME="notes" --></textarea>
351             </li>
352             <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
353                 <label for="sort1">Planning value1: </label>
354
355                 <!-- TMPL_IF Name="CGIsort1" -->
356                     <!-- TMPL_VAR Name="CGIsort1" -->
357                 <!-- TMPL_ELSE -->
358
359                     <input type="text" id="sort1" size="20" name="sort1" value="<!-- TMPL_VAR NAME="sort1" -->" />
360                 <!--/TMPL_IF -->
361             </li>
362             <li>
363                 <label for="sort2">Planning value2: </label>
364
365                 <!-- TMPL_IF Name="CGIsort2" -->
366                     <!-- TMPL_VAR Name="CGIsort2" -->
367                 <!-- TMPL_ELSE -->
368                     <input type="text" id="sort2" size="20" name="sort2" value="<!-- TMPL_VAR NAME="sort2" -->" />
369                 <!--/TMPL_IF -->
370             </li>
371 </ol>
372     </fieldset>
373     <fieldset class="action">
374         <input type="button" value="Save" onclick="Check(this.form)" /> <!-- TMPL_IF name="suggestionid" --><a class="cancel" href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&amp;basketno=<!-- TMPL_VAR NAME="basketno" -->">Cancel</a><!-- TMPL_ELSE --><a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR NAME="basketno" -->">Cancel</a><!-- /TMPL_IF -->
375     </fieldset>
376 </form>
377 </div>
378 </div>
379 <div class="yui-b">
380 <!-- TMPL_INCLUDE NAME="acquisitions-menu.inc" -->
381 </div>
382 </div>
383 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->