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