Bug 19918: Close span tag in opac-registration-confirmation.tt
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / orderreceive.tt
1 [% USE KohaDates %]
2 [% USE Branches %]
3 [% USE Price %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Acquisitions &rsaquo; Receipt summary for : [% name %] [% IF ( invoice ) %]invoice, [% invoice %][% END %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% INCLUDE 'calendar.inc' %]
8 [% INCLUDE 'additem.js.inc' %]
9 <script type="text/javascript" src="[% interface %]/[% theme %]/js/additem.js"></script>
10 <script type="text/javascript" src="[% interface %]/[% theme %]/js/cataloging.js"></script>
11 <script type="text/javascript" src="[% interface %]/[% theme %]/js/prevent_submit.js"></script>
12 <script type="text/javascript">
13 //<![CDATA[
14     function Check(form) {
15         [% IF (AcqCreateItemReceiving) %]
16             var total_errors = CheckMandatorySubfields(form);
17             if (total_errors != 0) {
18                 var alertString = _("Form not submitted because of the following problem(s)");
19                 alertString += "\n------------------------------------------------------------------------------------\n";
20                 alertString += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
21                 alert(alertString);
22                 return false;
23             }
24
25             if(check_additem('[% UniqueItemFields %]') == false){
26                 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
27                 return false;
28             };
29
30             // Remove last itemblock if it is not in items_list
31             var lastitemblock = $("#outeritemblock > div:last");
32             var tobedeleted = true;
33             var listitems = $("#items_list tr");
34             $(listitems).each(function(){
35                 if($(this).attr('idblock') == $(lastitemblock).attr('id')){
36                     tobedeleted = false;
37                 }
38             });
39             if(tobedeleted){
40                 $(lastitemblock).remove();
41             }
42
43             if(check_additem('[% UniqueItemFields %]') == false){
44                 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
45                 if(tobedeleted) {
46                     $(lastitemblock).appendTo("#outeritemblock");
47                 }
48                 return false;
49             };
50         [% END %]
51
52         return true;
53     }
54
55     [% IF (AcqCreateItem == 'ordering') %]
56         var items_columns = [null, null, 'barcode', 'homebranchname',
57             'holdingbranchname', 'notforloan', 'restricted', 'location',
58             'itemcallnumber', 'copynumber', 'stocknumber', 'collection',
59             'itemtype', 'materials', 'itemnotes'];
60
61         function PopupEditPage(biblionumber, itemnumber) {
62             var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
63                 + biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
64             var w = window.open(url);
65             var watchClose = setInterval(function() {
66                 if (w.closed) {
67                     clearTimeout(watchClose);
68                     $.getJSON('/cgi-bin/koha/catalogue/getitem-ajax.pl',
69                         {
70                             'itemnumber': itemnumber
71                         },
72                         function(item) {
73                             var tds = $("#item_"+itemnumber+" td");
74                             for(var i=2; i<tds.length; i++) {
75                                 var column = items_columns[i];
76                                 var text = item[column];
77                                 if ( text == null ) text = '';
78                                 $(tds[i]).text(text);
79                             }
80                         }
81                     );
82                 }
83             }, 500);
84         }
85
86         function CalcQtyToReceive() {
87             var qty = $("input[name='items_to_receive']:checked").length;
88             $("#quantity").val(qty);
89         }
90
91         function CheckNItems(n) {
92             $("input[name='items_to_receive']").each(function() {
93                 $(this).prop('checked', false);
94             });
95             $("input[name='items_to_receive']:lt("+n+")").each(function () {
96                 $(this).prop('checked', true);
97             });
98         }
99     [% END %]
100
101     $(document).ready(function() {
102         [% IF (AcqCreateItemReceiving) %]
103             cloneItemBlock(0, '[% UniqueItemFields %]');
104         [% ELSIF (AcqCreateItem == 'ordering') && not subscriptionid %]
105             $("input[name='items_to_receive']").change(function() {
106                 CalcQtyToReceive();
107             });
108             CalcQtyToReceive();
109             $("#quantity").keyup(function() {
110                 var qty = parseInt($("#quantity").val());
111                 var qtyto = parseInt($("#quantity_to_receive").val());
112                 if(qty > qtyto) {
113                     $("#qtyrecerror").show();
114                 } else {
115                     $("#qtyrecerror").hide();
116                 }
117                 CheckNItems($(this).val());
118             });
119         [% END %]
120     });
121 //]]>
122 </script>
123 </head>
124 <body id="acq_orderreceive" class="acq">
125 [% INCLUDE 'header.inc' %]
126 [% INCLUDE 'acquisitions-search.inc' %]
127
128 <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 %]">[% name %]</a> &rsaquo; Receive items from : [% name %] [% IF ( invoice ) %][[% invoice |html %]][% END %] (order #[% ordernumber %])</div>
129
130 <div id="doc3" class="yui-t2">
131    
132    <div id="bd">
133         <div id="yui-main">
134         <div class="yui-b">
135
136 <h1>Receive items from : [% name %] [% IF ( invoice ) %][[% invoice |html %]] [% END %] (order #[% ordernumber %])</h1>
137
138 [% IF ( count ) %]
139     <form action="/cgi-bin/koha/acqui/finishreceive.pl" method="post" onsubmit="return Check(this);">
140 <div class="yui-g">
141 <div class="yui-u first">
142     <div class="error" style="display:none"></div>
143
144     <fieldset class="rows">
145     <legend>Catalog details</legend>
146     <ol><li><span class="label">Title: </span><span class="title">[% title |html %]</span></li>
147     <li> <span class="label">Author: </span>
148         [% author %]</li>
149     <li><span class="label">Copyright: </span>
150         [% copyrightdate %]</li>
151     <li> <span class="label">ISBN: </span>
152         [% isbn %]</li>
153     <li> <span class="label">Series: </span>
154         [% seriestitle %]</li>
155     </ol>
156         </fieldset>
157
158     [% IF ( suggestionid ) %]
159         <fieldset class="rows">
160         <legend>Suggestion</legend>
161         <ol>
162           <li>
163             <span class="label">Suggested by: </span>
164             [% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]&amp;op=show">suggestion #[% suggestionid %]</a>)
165           </li>
166         </ol>
167         </fieldset>
168     [% END %]
169
170     [% IF (AcqCreateItemReceiving) %]
171         <div id="items_list" style="display:none">
172             <p><b>Items list</b></p>
173             <div style="width:100%;overflow:auto;">
174                 <table>
175                     <thead>
176                         <tr>
177                             <th>&nbsp;</th>
178                             <th>&nbsp;</th>
179                             <th>Barcode</th>
180                             <th>Home library</th>
181                             <th>Holding library</th>
182                             <th>Not for loan</th>
183                             <th>Restricted</th>
184                             <th>Location</th>
185                             <th>Call number</th>
186                             <th>Copy number</th>
187                             <th>Inventory number</th>
188                             <th>Collection code</th>
189                             <th>Item type</th>
190                             <th>Materials</th>
191                             <th>Notes</th>
192                         </tr>
193                     </thead>
194                     <tbody>
195                     </tbody>
196                 </table>
197             </div>
198         </div>
199
200         [% UNLESS subscriptionid %]
201           <fieldset class="rows" id="itemfieldset">
202               <legend>Item</legend>
203               [% IF ( NoACQframework ) %]
204                   <p class="required">
205                       No ACQ framework, using default. You should create a
206                       framework with code ACQ, the items framework would be
207                       used
208                   </p>
209               [% END %]
210               <div id="outeritemblock"></div>
211           </fieldset>
212         [% END %]
213     [% ELSIF (AcqCreateItem == 'ordering') %]
214         [% IF (items.size) %]
215             <h5>Items</h5>
216             <div style="width:100%;overflow:auto">
217                 <table>
218                     <thead>
219                         <tr>
220                             <th>Receive?</th>
221                             <th>&nbsp;</th>
222                             <th>Barcode</th>
223                             <th>Home branch</th>
224                             <th>Holding branch</th>
225                             <th>Not for loan</th>
226                             <th>Restricted</th>
227                             <th>Location</th>
228                             <th>Call number</th>
229                             <th>Copy number</th>
230                             <th>Inventory number</th>
231                             <th>Collection code</th>
232                             <th>Item type</th>
233                             <th>Materials</th>
234                             <th>Notes</th>
235                         </tr>
236                     </thead>
237                     <tbody>
238                         [% FOREACH item IN items %]
239                             <tr id="item_[% item.itemnumber %]">
240                                 <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber %]" /></td>
241                                 <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber %],[% item.itemnumber %]);">Edit</a></td>
242                                 <td>[% item.barcode %]</td>
243                                 <td>[% Branches.GetName( item.homebranch )%]</td>
244                                 <td>[% Branches.GetName( item.holdingbranch ) %]</td>
245                                 <td>[% item.notforloan %]</td>
246                                 <td>[% item.restricted %]</td>
247                                 <td>[% item.location %]</td>
248                                 <td>[% item.itemcallnumber %]</td>
249                                 <td>[% item.copynumber %]</td>
250                                 <td>[% item.stocknumber %]</td>
251                                 <td>[% item.collection %]</td>
252                                 <td>[% item.itemtype %]</td>
253                                 <td>[% item.materials %]</td>
254                                 <td>[% item.itemnotes %]</td>
255                             </tr>
256                         [% END %]
257                     </tbody>
258                 </table>
259             </div>
260         [% END %]
261     [% END %]
262     <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
263     <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
264     <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
265     <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
266         </div>
267         <div class="yui-u">
268     <fieldset class="rows">
269     <legend>Accounting details</legend>
270         <ol>
271             <li>
272                 <label for="datereceived">Date received: </label>
273                 <input type="text" size="10" id="datereceived" name="datereceived" value="[% datereceived | $KohaDates %]" class="datepicker" />
274             </li>
275        <li><label for="bookfund">Fund: </label><select id="bookfund" name="bookfund">
276             <option value="">Keep current ([% budget_period_description %] - [% bookfund %])</option>
277             [% FOREACH period IN budget_loop %]
278                 <optgroup label="[% period.description %]">
279                 [% FOREACH fund IN period.funds %]
280                     [% IF ( fund.b_sel ) %]
281                         <option value="[% fund.b_id %]" selected="selected">[% fund.b_txt %]</option>
282                     [% ELSE %]
283                         <option value="[% fund.b_id %]">[% fund.b_txt %]</option>
284                     [% END %]
285                 [% END %]
286             [% END %]
287        </select></li>
288        <li><label>&nbsp;</label><span>(Current: [% budget_period_description %] - [% bookfund %])</span></li>
289        <li><label for="creator">Created by: </label><span> [% IF ( memberfirstname and membersurname ) %][% IF ( memberfirstname ) %][% memberfirstname %][% END %] [% membersurname %][% ELSE %]No name[% END %]</span></li>
290        <li><label for="quantity_to_receive">Quantity to receive: </label><span class="label">
291            [% IF ( edit and not subscriptionid) %]
292                <input type="text" id="quantity_to_receive" name="quantity" value="[% quantity %]" />
293            [% ELSE%]
294                <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% quantity %]" />
295            [% END %]
296            </span></li>
297         <li><label for="quantity">Quantity received: </label>
298           [% IF (AcqCreateItemReceiving) %]
299             [% IF ( subscriptionid ) %]
300               <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="1" />
301             [% ELSE %]
302               <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
303             [% END %]
304           [% ELSE %]
305             [% IF ( quantityreceived ) %]
306                 [% IF ( edit ) %]
307                     <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived %]" />
308                     <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% quantityreceived %]" />
309                 [% ELSE %]
310                     [% IF ( items ) %]
311                         <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceivedplus1 %]" />
312                     [% ELSE %]
313                         <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceivedplus1 %]" />
314                     [% END %]
315                     <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% quantityreceived %]" />
316                 [% END %]
317             [% ELSE %]
318                 [% IF ( subscriptionid ) %]
319                     <input type="text" readonly="readonly" id="quantity" size="20" name="quantityrec" value="1" />
320                 [% ELSE %]
321                     <input type="text" id="quantity" size="20" name="quantityrec" value="1" />
322                 [% END %]
323                 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="0" />
324             [% END %]
325             <div id="qtyrecerror" style="display:none">
326                 <p class="error">Warning, you have entered more items than expected.
327                 Items will not be created.</p>
328             </div>
329           [% END %][%# IF (AcqCreateItemReceiving) %]
330                 </li>
331
332         [% IF ( gst_values ) %]
333             <li>
334                 <label for="tax_rate">Tax rate: </label>
335                 <select name="tax_rate" id="tax_rate">
336                 [% FOREACH gst IN gst_values %]
337                     [% IF gst.option == tax_rate %]
338                         <option value="[% gst.option %]" selected="selected">[% gst.option * 100 %]%</option>
339                     [% ELSE %]
340                         <option value="[% gst.option %]">[% gst.option * 100 %]%</option>
341                     [% END %]
342                 [% END %]
343                 </select>
344             </li>
345         [% ELSE %]
346             <input type="hidden" name="tax_rate" value="0" />
347         [% END %]
348
349         <li><label for="rrp">Replacement cost: </label>[% rrp | $Price %]</li>
350         <li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %]</li>
351         <li>
352             <label for="unitprice">Actual cost:</label>
353             <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price %]" />
354         </li>
355         <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote %]</textarea></li>
356         [% IF order_vendornote %]
357             <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote %]</span></li>
358         [% END %]
359         </ol>
360     </fieldset>
361
362 </div>
363 </div><div class="yui-g"><fieldset class="action">
364         <input type="submit"  value="Save" class="button" accesskey="w" />
365         <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]&sticky_filters=1">Cancel</a>
366 </fieldset></div>    </form>
367 [% ELSE %]
368     This ordernumber does not exist.
369 [% END %]
370
371 </div>
372 </div>
373 <div class="yui-b">
374 [% INCLUDE 'acquisitions-menu.inc' %]
375 </div>
376 </div>
377 [% INCLUDE 'intranet-bottom.inc' %]