Bug 21719: Fix typos
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / neworderempty.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE Price %]
6 [% USE ItemTypes %]
7 [% SET footerjs = 1 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha &rsaquo; Acquisitions &rsaquo; Basket [% basketno | html %] &rsaquo; [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber | html %])[% ELSE %]New order[% END %]</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 </head>
12
13 <body id="acq_neworderempty" class="acq">
14
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'acquisitions-search.inc' %]
17
18 <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/supplier.pl?booksellerid=[% booksellerid | html %]">[% name | html %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | html %]">Basket [% basketno | html %]</a> &rsaquo; [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber | html %])[% ELSE %]New order[% END %]</div>
19
20 <div class="main container-fluid">
21     <div class="row">
22         <div class="col-sm-10 col-sm-push-2">
23             <main>
24
25 <h2>
26     [% IF ( ordernumber ) %]
27         Modify order line
28     [% ELSE %]
29         New order
30     [% END %]
31 </h2>
32
33 <div class="dialog alert order_error" style="display:none"></div>
34
35 [% IF ( basketno ) %]
36     <div id="acqui_basket_summary"  class="yui-g">
37     <fieldset class="rows">
38         <legend>Basket details</legend>
39         <ol>
40         [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote | html %]</li>[% END %]
41         [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote | html %]</li>[% END %]
42         [% IF ( basketcontractno ) %]
43             <li><span class="label">Contract number: </span>[% basketcontractno | html %]</li>
44             <li><span class="label">Contract name:</span> <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno | uri %]">[% basketcontractname | html %]</a></li>
45         [% END %]
46         [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname | html %]</li>[% END %]
47         [% IF ( creationdate ) %]<li><span class="label">Open on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
48         [% IF ( closedate ) %]
49         <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
50         <li><span class="label">Closed on:</span>  [% closedate | $KohaDates %]</li>
51         [% IF ( basketgroups ) %]
52             <li>Basketgroup: <select id="basketgroupid" name="basketgroupid">
53                 [% FOREACH basketgroup IN basketgroups %]
54                     [% IF ( basketgroup.default ) %]
55                     <option value="[% basketgroup.id | html %]" selected="selected">[% basketgroup.name | html %]</option>
56                     [% ELSE %]
57                     <option value="[% basketgroup.id | html %]">[% basketgroup.name | html %]</option>
58                     [% END %]
59                 [% END %]
60                 </select>
61                 <input type="hidden" id="basketno" value="[% basketno | html %]" name="basketno" />
62                 <input type="hidden" value="mod_basket" name="op" />
63                 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
64             </li>
65             <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset>
66         [% END %]
67         </form>
68         [% END %]
69         </ol>
70     </fieldset>
71     </div>
72 [% END %]
73
74 <form action="/cgi-bin/koha/acqui/addorder.pl" method="post" class="validated" id="Aform" onsubmit="return Check(this);" >
75
76     <fieldset class="rows">
77         <legend>Patrons</legend>
78         <ol>
79             <li>
80                 <span class="label">To notify on receiving:</span>
81                 <div style="float:left">
82                     <ul id="users_names" style="padding-left:0">
83                       [% FOREACH user IN users %]
84                         <li id="user_[% user.borrowernumber | html %]">
85                             [% user.firstname | html %] [% user.surname | html %]
86                             [<a onclick="del_user([% user.borrowernumber | html %]);" style="cursor:pointer">Delete user</a>]
87                         </li>
88                       [% END %]
89                     </ul>
90                     <input type="hidden" id="users_ids" name="users_ids" value="[% users_ids | html %]" />
91                     <input type="hidden" id="op" name="op" value="mod_users" />
92                     <input type="button" id="add_user" onclick="UserSearchPopup();" value="Add user" />
93                 </div>
94             </li>
95         </ol>
96     </fieldset>
97
98 <fieldset class="rows">
99         <legend>
100             Catalog details
101             [% IF ( biblionumber ) %]
102                 <span><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | uri %]"> Edit record</a></span>
103             [% END %]
104         </legend>
105         [% UNLESS ( existing ) %]
106         <input type="hidden" name="existing" value="no" />
107         [% END %]
108         <input type="hidden" name="ordernumber" value="[% ordernumber | html %]" />
109         <input type="hidden" name="basketno" value="[% basketno | html %]" />
110         <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
111         <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
112         <input type="hidden" name="listinc" id="listinc" value="[% listincgst | html %]" />
113         <input type="hidden" name="invoiceincgst" id="invoiceincgst" value="[% invoiceincgst | html %]" />
114         <input type="hidden" name="suggestionid" value="[% suggestionid | html %]" />
115         <input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" />
116
117         [% FOREACH c IN currencies %]
118             <input type="hidden" id="currency_rate_[% c.currency | html %]"  name="[% c.currency | html %]" value="[% c.rate | html %]" />
119         [% END %]
120
121         [% IF NOT Koha.Preference('UseACQFrameworkForBiblioRecords') OR NoACQframework %]
122             <ol><li>
123                 [% IF ( biblionumber ) %]
124                 <span class="label">Title</span>
125                     <input type="hidden" name="title" value="[% title | html %]" /> <span class="title">[% title | html %]</span>
126                 [% ELSE %]
127                 <label for="entertitle">Title: </label>
128                     <input type="text" id="entertitle" size="50" name="title" value="[% title | html %]" class="focus" required="required" />
129                     <span class="required">Required</span>
130                 [% END %]
131             </li>
132             <li>
133                 [% IF ( biblionumber ) %]
134                 <span class="label">Author: </span>
135                     <input type="hidden" name="author" id="author" value="[% author | html %]" />[% author | html %]
136                 [% ELSE %]
137                 <label for="author">Author: </label>
138                     <input type="text" size="50" name="author" id="author" value="[% author | html %]" />
139                 [% END %]
140             </li>
141             <li>
142                 [% IF ( biblionumber ) %]
143                 <span class="label">Publisher: </span>
144                     <input type="hidden" name="publishercode" id="publishercode" value="[% publishercode | html %]" />[% publishercode | html %]
145                 [% ELSE %]
146                 <label for="publishercode"> Publisher: </label>
147                     <input type="text" size="50" name="publishercode" id="publishercode" value="[% publishercode | html %]" />
148                 [% END %]
149             </li>
150             <li>
151                 [% IF ( biblionumber ) %]
152                 <span class="label">Edition: </span>
153                     <input type="hidden" name="editionstatement" id="editionstatement" value="[% editionstatement | html %]" />[% editionstatement | html %]
154
155                 [% ELSE %]
156                 <label for="editionstatement">Edition: </label>
157                     <input type="text" size="20" name="editionstatement" id="editionstatement" value="[% editionstatement | html %]" />
158                 [% END %]
159             </li>
160             <li>
161                 [% IF ( biblionumber ) %]
162                 <span class="label">Publication year: </span>
163                     <input type="hidden" name="publicationyear" id="publicationyear" value="[% publicationyear | html %]" />[% publicationyear | html %]
164                 [% ELSE %]
165                 <label for="publicationyear">Publication year: </label>
166                     <input type="text" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear | html %]" />
167                 [% END %]
168             </li>
169             <li>
170                 [% IF ( biblionumber ) %]
171                 <span class="label">ISBN: </span>
172                     <input type="hidden" name="isbn" id="ISBN" value="[% isbn | html %]" />[% isbn | html %]
173                 [% ELSE %]
174                 <label for="ISBN">ISBN: </label>
175                     <input type="text" size="50" name="isbn" id="ISBN" value="[% isbn | html %]" />
176                 [% END %]
177             </li>
178             [% IF (UNIMARC) %]
179             <li>
180                 [% IF ( biblionumber ) %]
181                 <span class="label">EAN: </span>
182                     <input type="hidden" name="ean" id="EAN" value="[% ean | html %]" />[% ean | html %]
183                 [% ELSE %]
184                 <label for="EAN">EAN: </label>
185                     <input type="text" size="20" name="ean" id="EAN" value="[% ean | html %]" />
186                 [% END %]
187             </li>
188             [% END %]
189             <li>
190                 [% IF ( biblionumber ) %]
191                 <span class="label">Series: </span>
192                     <input type="hidden" name="series" id="series" value="[% seriestitle | html %]" />[% seriestitle | html %]
193                 [% ELSE %]
194                 <label for="series">Series: </label>
195                     <input type="text" size="50" name="series" id="series" value="[% seriestitle | html %]" />
196                 [% END %]
197             </li>
198                 [% UNLESS ( biblionumber ) %]
199                 [% IF ( itemtypeloop ) %]
200                 <li>
201                     <span class="label">Item type:</span>
202                     <select name="itemtype" style="width:12em;">
203                     [% FOREACH itemtype IN itemtypeloop %]
204                         <option value="[% itemtype.itemtype | html %]">[% itemtype.description | html %]</option>
205                     [% END %]
206                     </select>
207                 </li>
208                 [% END %]
209                 [% END %]
210             </ol>
211         [% ELSE %]
212             <input type="hidden" name="use_ACQ_framework" value="1" />
213             [% IF biblionumber %]
214                 <ol>
215                     [% FOREACH field IN catalog_details %]
216                         <li>
217                             <div class="subfield_line">
218                                 <label>[% field.lib | html %] ([% field.tag | html %][% field.subfield | html %])</label>
219                                 [% field.value | html %]
220                             </div>
221                         </li>
222                     [% END %]
223                 </ol>
224             [% ELSE %]
225                 <ol>
226                     [% FOREACH field IN catalog_details %]
227                         <li>
228                             <div class="subfield_line">
229                                 [% PROCESS display_subfield field=field %]
230                             </div>
231                         </li>
232                     [% END %]
233                 </ol>
234             [% END %]
235         [% END %]
236     </fieldset>
237
238     [% IF ( suggestionid ) %]
239         <fieldset class="rows">
240         <legend>Suggestion</legend>
241         <ol>
242           <li>
243             <span class="label">Suggested by: </span>
244             [% surnamesuggestedby | html %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby | html %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid | uri %]&amp;op=show">suggestion #[% suggestionid | html %]</a>)
245           </li>
246         </ol>
247         </fieldset>
248     [% END %]
249
250     [% UNLESS subscriptionid || basket.is_standing %][% # it is a suggestion, we have not items %]
251       [% IF (AcqCreateItemOrdering) %]
252
253       <div id="items_list" style="display:none">
254           <p><b>Items list</b></p>
255           <div style="width:100%;overflow:auto;">
256               <table>
257                   <thead>
258                       <tr>
259                           <th>&nbsp;</th>
260                           <th>&nbsp;</th>
261                           <th>Barcode</th>
262                           <th>Home library</th>
263                           <th>Holding library</th>
264                           <th>Not for loan</th>
265                           <th>Restricted</th>
266                           <th>Location</th>
267                           <th>Call number</th>
268                           <th>Copy number</th>
269                           <th>Inventory number</th>
270                           <th>Collection code</th>
271                           <th>Item type</th>
272                           <th>Materials</th>
273                           <th>Notes</th>
274                       </tr>
275                   </thead>
276                   <tbody>
277                   </tbody>
278               </table>
279           </div>
280       </div>
281
282       <fieldset class="rows" id="itemfieldset">
283           <legend>Item</legend>
284           [% IF ( NoACQframework ) %]
285               <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
286           [% END %]
287
288           [% UNLESS Koha.Preference('autoBarcode') == 'OFF' %]
289               <div class="dialog message">The autoBarcode system preference is set to [% Koha.Preference('autoBarcode') | html %] and items with blank barcodes will have barcodes generated upon save to database</div>
290           [% END %]
291
292           <div id="outeritemblock"></div>
293
294       </fieldset>
295       [% END %][%# | html UNLESS subscriptionid %]
296     [% END %][%# IF (AcqCreateItemOrdering) %]
297     <fieldset class="rows">
298         <legend>Accounting details</legend>
299         <ol>
300             <li>
301                 [% IF ( close ) %]
302                     <span class="label required">Quantity: </span>
303                     <input type="hidden" name="quantity" value="[% quantity | html %]" />[% quantity | html %]
304                 [% ELSE %]
305                     <label class="required" for="quantity">Quantity: </label>
306                     [% IF (AcqCreateItemOrdering) %]
307                         [% IF subscriptionid || basket.is_standing %]
308                             <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
309                         [% ELSE %]
310                             <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="0" />
311                         [% END %]
312                     [% ELSE %]
313                         [% IF subscriptionid || basket.is_standing %]
314                             <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
315                         [% ELSE %]
316                             <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec | html %]" onchange="updateCosts();" />
317                         [% END %]
318                     [% END %]
319                     <span class="required">Required</span>
320                 [% END %]
321                 <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, useful when receiveing an order -->
322                 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
323             </li>
324             <li>
325                 [% IF ( close ) %]
326             <span class="label required">Fund: </span>
327                     <input type="hidden" name="budget_id" id="budget_id" value="[% budget_id | html %]" />[% Budget_name | html %]
328                 [% ELSE %]
329                 <label class="required" for="budget_id">Fund: </label>
330                 [% active_count = 0 %]
331                 [% IF !ordernumber %]
332                     [% FOREACH budget_loo IN budget_loop %]
333                         [% active_count= active_count + budget_loo.b_active %]
334                     [% END %]
335                 [% END %]
336                 <select id="budget_id" size="1" name="budget_id">
337                     <option value="">Select a fund</option>
338                 [% FOREACH budget_loo IN budget_loop %]
339                     [% IF ( budget_loo.b_sel ) %]
340                         [% active_count = 0 #select no other fund %]
341                         <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"
342                                 style="padding-left:[% budget_loo.b_level | html %]em;"
343                         >
344                     [% ELSIF active_count==1 && budget_loo.b_active %]
345                         <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"
346                                 style="padding-left:[% budget_loo.b_level | html %]em;"
347                         >
348                     [% ELSE %]
349                         [% bdgclass=budget_loo.b_active? "": "b_inactive" | html %]
350                         <option value="[% budget_loo.b_id | html %]" class="[% bdgclass | html %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"
351                                 style="padding-left:[% budget_loo.b_level | html %]em;"
352                         >
353                     [% END %]
354                     [% budget_loo.b_txt | html %][% IF !budget_loo.b_active %] (inactive)[% END %]
355                     </option>
356                 [% END %]
357                 </select>
358                 <span class="required">Required</span>
359                 <label for="showallbudgets" style="float:none;">&nbsp;Show inactive:</label>
360                 <input type="checkbox" id="showallbudgets" />
361                 [% END %]
362             </li>
363                 <li>
364                 [% IF ( close ) %]
365                         <span class="label">Currency: </span>
366             <input type="hidden" name="currency" id="currency" value="[% currency | html %]" />[% currency | html %]
367                 [% ELSE %]
368                         <label for="currency">Currency:</label>
369             <select name="currency" id="currency" onchange="updateCosts();">
370                 [% FOREACH c IN currencies %]
371                     [% IF ordernumber and c.currency == currency or not ordernumber and c.currency == vendor_currency %]
372                         <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
373                     [% ELSIF not c.archived %]
374                         <option value="[% c.currency | html %]">[% c.currency | html %]</option>
375                     [% END %]
376                 [% END %]
377             </select>
378                 [% END %]
379                 </li>
380             <li>
381                 [% IF ( close ) %]
382                     <span class="label">Vendor price: </span>
383                     <input type="hidden" name="listprice" id="listprice" value="[% listprice | html %]" />[% listprice | html %] [% IF (listincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]
384                 [% ELSE %]
385                 <label for="listprice">Vendor price: </label>
386                     <input type="text" size="20" name="listprice" id="listprice" value="[% listprice | html %]" onchange="updateCosts()" /> [% IF (listincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]
387                 [% END %]
388             </li>
389             [% UNLESS ( close ) %]
390             <li>
391                     <label for="uncertainprice">Uncertain price: </label>
392                     [% IF ( uncertainprice ) %]
393                     <input type="checkbox" name="uncertainprice"  id="uncertainprice" value="1" checked="checked" />
394                     [% ELSE %]
395                     <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" />
396                 [% END %]
397             </li>
398             [% END %]
399             [% IF ( gst_values ) %]
400                 <li>
401                     [% IF ( close ) %]
402                         <span class="label">Tax rate: </span>
403                         <input type="hidden" name="tax_rate" id="tax_rate" value="[% tax_rate | html %]" />[% tax_rate | html %]%
404                     [% ELSE %]
405                         <label for="tax_rate">Tax rate: </label>
406                         <select name="tax_rate" id="tax_rate" onchange="updateCosts();">
407                         [% FOREACH gst IN gst_values %]
408                           [% IF ( gst.option == tax_rate ) %]
409                             <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
410                           [% ELSE %]
411                             <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
412                           [% END %]
413                         [% END %]
414                         </select>
415                     [% END %]
416                 [% ELSE %]
417                     <input type="hidden" name="tax_rate" value="0" />
418                 </li>
419             [% END %]
420             <li>
421                 <label for="discount">Discount: </label>
422                 [% IF ( close ) %]
423                     [% IF ( orderdiscount ) %]
424                         <input type="hidden" name="discount" id="discount" value="[% orderdiscount | html %]" />[% orderdiscount_2dp | html %]%
425                     [% ELSE %]
426                         <input type="hidden" name="discount" id="discount" value="[% discount | html %]" />[% discount_2dp | html %]%
427                     [% END %]
428                 [% ELSE %]
429                     [% IF ( orderdiscount ) %]
430                         <input type="text" size="6" name="discount" id="discount" value="[% orderdiscount | html %]" onchange="updateCosts();" />%
431                     [% ELSE %]
432                         <input type="text" size="6" name="discount" id="discount" value="[% discount | html %]" onchange="updateCosts();" />%
433                     [% END %]
434                 [% END %]
435             </li>
436             <li>
437                 [% IF ( close ) %]
438                     <span class="label">Retail price: </span>
439                     <input type="hidden" name="rrp" id="rrp" value="[% rrp | html %]" />[% rrp | html %]  (adjusted for [% cur_active | html %], [% IF (listincgst == 1) %]tax inclusive[% ELSE %]tax exclusive[% END %])
440                 [% ELSE %]
441                     <label for="rrp">Retail price: </label>
442                     <input type="text" size="20" name="rrp" id="rrp" value="[% rrp | html %]" /> (adjusted for [% cur_active | html %], [% IF (listincgst == 1) %]tax inclusive[% ELSE %]tax exclusive[% END %])
443                 [% END %]
444             </li>
445             <li>
446                 <label for="replacementprice">Replacement cost: </label>
447                 <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% replacementprice | html | $Price on_editing => 1 %]" />
448             </li>
449             <li>
450                 <label for="ecost">Budgeted cost: </label>
451                 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost | html %]" readonly="readonly"  /> [% IF (listincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]
452             </li>
453             <li>
454                 <label for="total">Total: </label>
455                 <input type="text" id="total" size="20" name="total" value="[% total | html %]" readonly="readonly" /> (budgeted cost * quantity)
456             </li>
457             <li>
458                 [% IF ( close ) %]
459                     <label for="unitprice">Actual cost: </label>
460                     <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice | html %]" readonly="readonly" /> [% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]
461                 [% ELSE %]
462                     <label for="unitprice">Actual cost: </label>
463                     <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice | html %]" /> [% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]
464                 [% END %]
465             </li>
466             <li>
467                 <label for="order_internalnote">Internal note: </label>
468                 <textarea id="order_internalnote" cols="30" rows="3" name="order_internalnote" >[% IF ( order_internalnote ) %][% order_internalnote | html %][% END %]</textarea>
469             </li>
470             <li>
471                 <label for="order_vendornote">Vendor note: </label>
472                 <textarea id="order_vendornote" cols="30" rows="3" name="order_vendornote" >[% IF ( order_vendornote ) %][% order_vendornote | html %][% END %]</textarea>
473             </li>
474             <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
475                 <label for="sort1">Statistic 1: </label>
476                 <input id="sort1" type="text" id="sort1" size="20" name="sort1" value="[% sort1 | html %]" />
477             <li>
478                 <label for="sort2">Statistic 2: </label>
479                 <input id="sort2" type="text" id="sort2" size="20" name="sort2" value="[% sort2 | html %]" />
480             </li>
481         </ol>
482     </fieldset>
483     <fieldset class="action">
484         <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
485         <input type="submit" value="Save" />
486         [% IF (suggestionid) %]
487             <a class="cancel" href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=[% booksellerid | html %]&amp;basketno=[% basketno | html %]">Cancel</a>
488         [% ELSE %]
489             [% IF subscriptionid %]
490                 <a class="cancel" href="/cgi-bin/koha/acqui/newordersubscription.pl?booksellerid=[% booksellerid | html %]&amp;basketno=[% basketno | html %]">Cancel</a>
491             [% ELSE %]
492                 <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | html %]">Cancel</a>
493             [% END %]
494         [% END %]
495     </fieldset>
496 </form>
497
498 <div id="procModal" data-backdrop="static" class="modal fade" aria-labelledby="procModal" aria-hidden="true">
499     <div class="modal-dialog">
500     <div class="modal-content">
501     <div class="modal-body">
502     <h3>Processing multiple items</h3>
503     </div>
504     </div>
505     </div>
506 </div>
507
508 <div id="multiCountModal" class="modal fade" aria-labelledby="multiCountModal" aria-hidden="true">
509     <div class="modal-dialog">
510     <div class="modal-content">
511     <h3>Invalid number of copies</h3>
512     <p>Please enter a <b>number</b>, greater than or equal to 1</p>
513     </div>
514     </div>
515 </div>
516
517 </main>
518 </div> <!-- /.col-sm-10.col-sm-push-2 -->
519
520 <div class="col-sm-2 col-sm-pull-10">
521     <aside>
522         [% INCLUDE 'acquisitions-menu.inc' %]
523     </aside>
524 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
525 </div> <!-- /.row -->
526
527 [% MACRO jsinclude BLOCK %]
528     [% Asset.js("js/acquisitions-menu.js") | $raw %]
529     [% Asset.js("js/acq.js") | $raw %]
530     [% INCLUDE 'additem.js.inc' %]
531     [% Asset.js("js/additem.js") | $raw %]
532     [% Asset.js("js/cataloging.js") | $raw %]
533     [% Asset.js("js/prevent_submit.js") | $raw %]
534     <script>
535         actTotal = "";
536
537         function Check(ff) {
538             [% IF (AcqCreateItemOrdering) %]
539                 // Remove last itemblock if it is not in items_list
540                 var lastitemblock = $("#outeritemblock > div:last");
541                 var tobedeleted = true;
542                 var listitems = $("#items_list tr");
543                 $(listitems).each(function(){
544                     if($(this).attr('idblock') == $(lastitemblock).attr('id')){
545                         tobedeleted = false;
546                     }
547                 });
548                 if(tobedeleted){
549                     $(lastitemblock).remove();
550                 }
551             [% END %]
552
553             var ok=0;
554             var _alertString= _("Form not submitted because of the following problem(s)")+"\n";
555
556             _alertString +="-------------------------------------------------------------------\n\n";
557
558             if(isNull(ff.budget_id,1)){
559                 ok=1;
560                 _alertString += "\n- "+ _("You must select a fund");
561             }
562
563             if (!(isNum(ff.quantity,0)) || ff.quantity.value == 0){
564                 ok=1;
565                             _alertString += "\n- " + _("Quantity must be greater than '0'");
566             }
567
568             if (!(isNum(ff.listprice,0))){
569                 ok=1;
570                             _alertString += "\n- " + _("Vendor price must be a number");
571             }
572
573             if (!(isNum(ff.total,0))){
574                 ok=1;
575                             _alertString += "\n- " + _("Total must be a number");
576             }
577
578             if (totalExceedsBudget(ff.budget_id.value, ff.total.value  )  ) {
579                 ok=1;
580                 _alertString += "\n- " + _("Order total (%s) exceeds budget available (%s)").format(ff.total.value, actTotal);
581             }
582
583             if ( ff.field_value ) {
584                 var empty_item_mandatory = CheckMandatorySubfields(ff);
585                 if (empty_item_mandatory > 0) {
586                     ok = 1;
587                     _alertString +=
588                         "\n- " + _("%s item mandatory fields empty").format(empty_item_mandatory);
589                 }
590
591             }
592
593             if (ok) {
594                 alert(_alertString);
595                 [% IF (AcqCreateItemOrdering) %]
596                     if(tobedeleted) {
597                         $(lastitemblock).appendTo('#outeritemblock');
598                     }
599                 [% END %]
600                 return false;
601             }
602
603             [% IF (AcqCreateItemOrdering) %]
604                 if(check_additem('[% UniqueItemFields | html %]') == false) {
605                     alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
606                     if(tobedeleted) {
607                         $(lastitemblock).appendTo('#outeritemblock');
608                     }
609                     return false;
610                 }
611             [% END %]
612         }
613
614         $(document).ready(function(){
615             [% IF AcqCreateItemOrdering and not basket.is_standing %]
616                 cloneItemBlock(0, '[% UniqueItemFields | html %]');
617             [% END %]
618
619             [% IF ( suggestionid ) %]updateCosts();[% END %]
620             $("#quantity").change(function() {
621                 updateCosts();
622             });
623
624             //We apply the fonction only for modify option
625             [% IF ( quantityrec ) %]
626                 [% IF ( acqcreate ) %]
627                     $('#quantity').blur(function(){
628                         // if user decreases the quantity
629                         if($(this).val() < [% quantityrec | html %]){
630                             alert(_("You have deleted item(s) in the order, don't forget to delete it(them) in the catalog"));
631                             return true;
632                         } else {
633                             // if user increases the quantity
634                             alert(_("You can't add a new item, please create a new order line"));
635                             // and we replace the original value
636                             $(this).val([% quantityrec | html %])
637                             updateCosts(); // blur is invoked after change which updated values
638                             return false;
639                         }
640                     });
641                 [% END %]
642             [% END %]
643
644             //keep a copy of all budgets before removing the inactives
645             disabledBudgetsCopy = $('#budget_id').html();
646             $('#budget_id .b_inactive').remove();
647
648             $('#showallbudgets').click(function() {
649                 if ($(this).is(":checked")) {
650                     $('#budget_id').html(disabledBudgetsCopy); //Puts back all the funds
651                 }
652                 else {
653                     $('#budget_id .b_inactive').remove();
654                 }
655             });
656
657             $("#budget_id").change(function(){
658                 var destination_sort1 = $(this).parents('fieldset.rows').find('input[name="sort1"]');
659                 var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
660                 var sort1 = $(destination_sort1).val() || "";
661                 if ( destination_sort1.length < 1 ) {
662                     destination_sort1 = $(this).parents('fieldset.rows').find('select[name="sort1"]');
663                 }
664                 var destination_sort2 = $(this).parents('fieldset.rows').find('input[name="sort2"]');
665                 var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
666                 var sort2 = $(destination_sort2).val() || "";
667                 if ( destination_sort2.length < 1 ) {
668                     destination_sort2 = $(this).parents('fieldset.rows').find('select[name="sort2"]');
669                 }
670                 getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
671                 getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
672             });
673             $("#budget_id").change();
674         });
675
676         function UserSearchPopup(f) {
677             window.open(
678                 "/cgi-bin/koha/acqui/add_user_search.pl",
679                 'UserSearchPopup',
680                 'width=740, height=450, scrollbars=yes, toolbar=no,'
681              );
682         }
683
684         function add_user(borrowernumber, borrowername) {
685             var ids = $("#users_ids").val();
686             if(ids.length > 0) {
687                 ids = ids.split(':');
688             } else {
689                 ids = new Array;
690             }
691         if (ids.indexOf(borrowernumber.toString()) < 0) {
692                 ids.push(borrowernumber);
693                 $("#users_ids").val(ids.join(':'));
694                 var li = '<li id="user_'+borrowernumber+'">'+borrowername
695                     + ' [<a style="cursor:pointer" onclick="del_user('+borrowernumber+');">'
696                     + _("Delete user") + '</a>]</li>';
697                 $("#users_names").append(li);
698                 return 0;
699             }
700             return -1;
701         }
702
703         function del_user(borrowernumber) {
704             $("#user_"+borrowernumber).remove();
705             var ids = $("#users_ids").val().split(':');
706             ids.splice(ids.indexOf(borrowernumber.toString()), 1);
707             $("#users_ids").val(ids.join(':'));
708         }
709     </script>
710 [% END %]
711
712 [% INCLUDE 'intranet-bottom.inc' %]
713
714 [% BLOCK display_subfield %]
715     <label>[% field.lib | html %] ([% field.tag | html %][% field.subfield | html %])</label>
716     [% IF field.authorised_value %]
717         [% SWITCH field.authorised_value %]
718         [% CASE 'branches' %]
719             [% IF field.mandatory %]
720             <select name="bib_field_value" required="required">
721             [% ELSE %]
722             <select name="bib_field_value">
723             [% END %]
724                 <option value=""></option>
725                 [% PROCESS options_for_libraries libraries => Branches.all( selected => "FIXME" ) %]
726             </select>
727         [% CASE 'itemtypes' %]
728             [% IF field.mandatory %]
729             <select name="bib_field_value" required="required">
730             [% ELSE %]
731             <select name="bib_field_value">
732             [% END %]
733                 <option value=""></option>
734                 [% PROCESS options_for_item_types itemtypes => ItemTypes.Get(), selected_itemtype => "FIXME" %]
735             </select>
736         [% CASE 'cn_source' %]
737         [% CASE %]
738             [% PROCESS 'av-build-dropbox.inc' name="bib_field_value", category=field.authorised_value, default="FIXME" %]
739         [% END %]
740     [% ELSE %]
741         [% IF field.mandatory %]
742         <input type="text" name="bib_field_value" value="[% field.value | html %]" required="required" size="50" />
743         [% ELSE %]
744         <input type="text" name="bib_field_value" value="[% field.value | html %]" size="50" />
745         [% END %]
746
747     [% END %]
748     <input type="hidden" name="bib_kohafield" value="[% field.kohafield | html %]" />
749     <input type="hidden" name="bib_tag" value="[% field.tag | html %]" />
750     <input type="hidden" name="bib_subfield" value="[% field.subfield | html %]" />
751     [% IF field.mandatory %] <span class="required">Required</span>[% END %]
752 [% END %]