Bug 35351: Adjust basket details template to avoid showing empty page-section
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / basket.tt
1 [% USE Koha %]
2 [% USE raw %]
3 [% USE Asset %]
4 [% PROCESS 'i18n.inc' %]
5 [% BLOCK csv_export %]
6     <div class="btn-group">
7         <a id="exportbutton" class="btn btn-default" href="[% script_name | url %]?op=export&amp;basketno=[% basketno | uri %]&amp;booksellerid=[% booksellerid | uri %]"><i class="fa fa-download"></i> Export as CSV</a>
8         <a class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
9         <ul class="dropdown-menu" id="export-csv-menu">
10             <li><a href="#">Default</a></li>
11             [% IF csv_profiles.count %]
12                 [% FOR csv IN csv_profiles %]
13                     <li><a href="#" data-value="[% csv.export_format_id | html %]">[% csv.profile | html %]</a></li>
14                 [% END %]
15             [% END %]
16         </ul>
17     </div>
18 [% END %]
19 [% USE KohaDates %]
20 [% USE Branches %]
21 [% USE Price %]
22 [% USE AuthorisedValues %]
23 [% USE TablesSettings %]
24 [% SET footerjs = 1 %]
25 [% INCLUDE 'doc-head-open.inc' %]
26 <title>[% FILTER collapse %]
27     [% tx("Basket {basketname} ({basketnumber}) for {vendor}", { basketname = basketname, basketnumber = basketno, vendor = booksellername }) | html %] &rsaquo;
28     [% t("Acquisitions") | html %] &rsaquo;
29     [% t("Koha") | html %]
30 [% END %]</title>
31 [% INCLUDE 'doc-head-close.inc' %]
32 <style>
33     .sortmsg {font-size: 80%;}
34 </style>
35 </head>
36
37 <body id="acq_basket" class="acq">
38 [% WRAPPER 'header.inc' %]
39     [% INCLUDE 'acquisitions-search.inc' %]
40 [% END %]
41
42 [% WRAPPER 'sub-header.inc' %]
43     [% WRAPPER breadcrumbs %]
44         [% WRAPPER breadcrumb_item %]
45             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
46         [% END %]
47         [% WRAPPER breadcrumb_item %]
48             <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
49         [% END %]
50         [% WRAPPER breadcrumb_item bc_active= 1 %]
51             [% UNLESS ( basketno ) %]
52                 [% IF ( delete_confirmed ) %]
53                     <span>Deleted</span>
54                 [% ELSE %]
55                     <span>New</span>
56                 [% END %]
57             [% END %]
58             [% IF ( basketno ) %]
59                 <span>Basket [% basketname | html %] ([% basketno | html %]) for [% booksellername | html %]</span>
60             [% ELSE %]
61                 <span>Basket [% basketname | html %] for [% booksellername | html %]</span>
62             [% END %]
63         [% END %]
64     [% END #/ WRAPPER breadcrumbs %]
65 [% END #/ WRAPPER sub-header.inc %]
66
67 <div class="main container-fluid">
68     <div class="row">
69         <div class="col-sm-10 col-sm-push-2">
70             <main>
71                 [% INCLUDE 'messages.inc' %]
72
73                 [% IF (cannot_manage_basket) %]
74                     <div class="dialog alert">You are not authorised to manage this basket.</div>
75                 [% ELSE %]
76
77                     [% IF !confirm_close && !edi_confirm %]
78                         [% UNLESS ( selectbasketg ) %]
79                             [% UNLESS ( closedate ) %]
80                                 [% UNLESS ( delete_confirmed ) %]
81                                     <div id="toolbar" class="btn-toolbar fh-fixedHeader">
82                                         [% IF active %]
83                                             <div class="btn-group"><a href="#addtoBasket" role="button" class="btn btn-default" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a></div>
84                                         [% END %]
85                                         <div class="btn-group"><a href="basketheader.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]&amp;op=add_form" class="btn btn-default" id="basketheadbutton"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit basket</a></div>
86                                         [% IF CAN_user_acquisition_delete_baskets %]
87                                             <div class="btn-group"><a href="#deleteBasketModal" role="button" class="btn btn-default" data-toggle="modal" id="delbasketbutton"><i class="fa fa-trash-can"></i> Delete basket</a></div>
88                                         [% END %]
89                                         [% IF ( unclosable ) %]
90                                         [% ELSIF ( uncertainprices ) %]
91                                             <div class="btn-group"><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% booksellerid | uri %]&amp;owner=1" class="btn btn-default" id="uncertpricesbutton"><i class="fa-solid fa-dollar-sign"></i> Uncertain prices</a></div>
92                                             <div title="Can not close baskets that have items with uncertain prices in them." class="btn-group">
93                                                 <a href="" class="btn btn-default disabled" id="closebutton"><i class="fa fa-times-circle"></i> Close basket</a>
94                                             </div>
95                                         [% ELSE %]
96                                             <div class="btn-group">
97                                                 <a href="/cgi-bin/koha/acqui/basket.pl?op=close&amp;basketno=[% basketno | uri %]&amp;booksellerid=[% booksellerid | uri %]" class="btn btn-default" id="closebutton"><i class="fa fa-times-circle"></i> Close basket</a>
98                                             </div>
99                                         [% END %]
100
101                                         [% PROCESS csv_export %]
102
103                                         [% IF Koha.Preference('EDIFACT') && ediaccount %]
104                                             <div class="btn-group"><a href="/cgi-bin/koha/acqui/edi_ean.pl?op=ediorder&amp;basketno=[% basketno | uri %]&amp;booksellerid=[% booksellerid | uri %]" class="btn btn-default" id="ediorderbutton"><i class="fa fa-download"></i> Create EDIFACT order</a></div>
105                                         [% END %]
106
107                                         [% IF ( active && books_loop ) %]
108                                             <div class="btn-group">
109                                                 <form action="/cgi-bin/koha/acqui/basket.pl" method="post">
110                                                     <input type="hidden" name="op" value="email" />
111                                                     <input type="hidden" name="basketno" value="[% basketno | html %]" />
112                                                     <button type="submit" class="btn btn-default" id="emailvendorbutton"><i class="fa-solid fa-envelope"></i> E-mail order</button>
113                                                 </form>
114                                             </div>
115                                         [% END %]
116                                     </div> <!-- /#toolbar -->
117                                 [% END # / UNLESS ( delete_confirmed ) %]
118
119                                 <!-- Modal for confirm deletion box-->
120                                 <div class="modal" id="deleteBasketModal" tabindex="-1" role="dialog" aria-labelledby="delbasketModalLabel" aria-hidden="true">
121                                     <div class="modal-dialog">
122                                         <div class="modal-content">
123                                             <div class="modal-header">
124                                                 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
125                                                 <h3>Confirm deletion</h3>
126                                             </div>
127                                             [% UNLESS book_foot_loop %]
128                                                 <div class="modal-body">
129                                                     <p>Are you sure you want to delete this basket?</p>
130                                                 </div>
131                                                 <div class="modal-footer">
132                                                     <button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
133                                                     <form action="/cgi-bin/koha/acqui/basket.pl" method="get">
134                                                         <input type="hidden" name="op" value="delete_confirm" />
135                                                         <input type="hidden" name="basketno" value="[% basketno | html %]" />
136                                                         <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
137                                                         <input type="hidden" name="delbiblio" value="0" />
138                                                         <button type="submit" class="btn btn-default btn-default">Delete basket</button>
139                                                     </form>
140                                                 </div>
141                                             [% ELSE %]
142                                                 <div class="modal-body">
143                                                     <p>Are you sure you want to delete this basket?</p>
144                                                     <p>Warning:</p>
145                                                     <p>All orders of this basket will be cancelled and used funds will be refunded.</p>
146                                                     <p>If items have been created when ordering or receiving, they will be deleted.</p>
147                                                     <p>You can choose to delete bibliographic records if possible (bibliographic records that have other items or that are used in a subscription or another order will not be deleted).</p>
148                                                 </div>
149                                                 <div class="modal-footer">
150                                                     <button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
151                                                     <form action="/cgi-bin/koha/acqui/basket.pl" method="get">
152                                                         <input type="hidden" name="op" value="delete_confirm" />
153                                                         <input type="hidden" name="basketno" value="[% basketno | html %]" />
154                                                         <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
155                                                         <input type="hidden" name="delbiblio" value="0" />
156                                                         <button type="submit" class="btn btn-default btn-default">Delete basket and orders</button>
157                                                     </form>
158
159                                                     <form action="/cgi-bin/koha/acqui/basket.pl" method="get">
160                                                         <input type="hidden" name="op" value="delete_confirm" />
161                                                         <input type="hidden" name="basketno" value="[% basketno | html %]" />
162                                                         <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
163                                                         <input type="hidden" name="delbiblio" value="1" />
164                                                         <button type="submit" class="btn btn-default btn-default">Delete basket, orders, and records</button>
165                                                     </form>
166                                                 </div> <!-- /.modal-footer -->
167                                             [% END # /UNLESS book_foot_loop %]
168                                         </div> <!-- /.modal-content -->
169                                     </div> <!-- /.modal-dialog -->
170                                 </div> <!-- /.modal#deleteBasketModal -->
171                                 <!-- End of Modal-->
172                             [% ELSE # UNLESS ( closedate ) %]
173                                 <div id="toolbar" class="btn-toolbar">
174                                     [% IF grouped %]
175                                         <div title="Can not reopen baskets that are part of a basket group." class="btn-group">
176                                             <div class="btn-group"><a href="#" class="btn btn-default disabled" id="reopenbutton"><i class="fa-solid fa-rotate"></i> Reopen basket</a></div>
177                                         </div>
178                                     [% ELSE %]
179                                         <div class="btn-group"><a href="#" class="btn btn-default" id="reopenbutton"><i class="fa-solid fa-rotate"></i> Reopen basket</a></div>
180
181                                         [% PROCESS csv_export %]
182                                     [% END %]
183                                 </div>
184                             [% END # /UNLESS ( closedate ) %]
185                         [% END # /UNLESS ( selectbasketg ) %]
186
187                         [% IF ( NO_BOOKSELLER ) %]
188                             <h1>Vendor not found</h1>
189                         [% ELSE %]
190                             [% IF ( delete_confirmed ) %]
191                                 <div class="dialog message">
192                                     <h3>Basket deleted</h3>
193                                 </div>
194                                 [% IF (cannotdelbiblios) %]
195                                     <div class="dialog alert">
196                                         <p><strong>Warning:</strong></p>
197                                         <p><strong>The following records could not be deleted:</strong></p>
198                                         <ul>
199                                             [% FOREACH cannotdelbiblio IN cannotdelbiblios %]
200                                                 <li>
201                                                     <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% cannotdelbiblio.biblionumber | uri %]">[% cannotdelbiblio.title | html %]</a> by [% cannotdelbiblio.author | html %]:
202                                                     <ul>
203                                                         [% IF (cannotdelbiblio.itemcount) %]<li>[% cannotdelbiblio.itemcount | html %] item(s) attached.</li>[% END %]
204                                                         [% IF (cannotdelbiblio.subscriptions) %]<li>[% cannotdelbiblio.subscriptions | html %] subscription(s) attached.</li>[% END %]
205                                                         [% IF (cannotdelbiblio.countbiblio) %]<li>[% cannotdelbiblio.countbiblio | html %] order(s) attached.</li>[% END %]
206                                                         [% IF (cannotdelbiblio.othererror) %]<li>Unknown error.</li>[% END %]
207                                                     </ul>
208                                                 </li>
209                                             [% END %]
210                                         </ul>
211                                     </div>
212                                     <a href="booksellers.pl">Go back to vendor page</a>
213                                 [% ELSE %]
214                                     <a href="/cgi-bin/koha/acqui/booksellers.pl?booksellerid=[% booksellerid | uri %]" class="btn btn-default btn-sm">Show baskets for vendor [% booksellername | html %]</a> <a href="/cgi-bin/koha/acqui/booksellers.pl" class="btn btn-default btn-sm">Show all active baskets</a>
215                                 [% END # /IF (cannotdelbiblios) %]
216                             [% ELSE # IF ( delete_confirmed ) %]
217
218                                 [% FOR m IN messages %]
219                                     <div class="dialog [% m.type | html %]">
220                                         [% SWITCH m.code %]
221                                         [% CASE 'no_email' %]
222                                             <span>This vendor has no contact selected for sending orders to or is missing an e-mail address.</span>
223                                         [% CASE 'no_basketno' %]
224                                             <span>No basket given.</span>
225                                         [% CASE 'no_letter' %]
226                                             <span>There is no notice template with code ACQORDER defined.</span>
227                                         [% CASE 'email_sent' %]
228                                             <span>Order e-mail was sent to the vendor.</span>
229                                         [% CASE %]
230                                             <span>ERROR! - [% m.code | html %]</span>
231                                         [% END %]
232                                     </div>
233                                 [% END # /FOR m %]
234
235                                 <h1>[% UNLESS ( basketno ) %]New [% END %]Basket [% basketname | html %] ([% basketno | html %]) for <a href="supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
236
237                                 [% IF ( basketno ) %]
238                                     <div id="acqui_basket_summary" class="row">
239                                         <div class="rows">
240                                             <div class="col-sm-6">
241                                                 <div class="page-section">
242                                                     <h2>General information</h3>
243                                                     <ol>
244                                                         [% IF ( basketnote ) %]
245                                                             <li><span class="label">Internal note:</span> [% basketnote | html %]</li>
246                                                         [% END %]
247                                                         [% IF ( basketbooksellernote ) %]
248                                                             <li><span class="label">Vendor note:</span> [% basketbooksellernote | html %]</li>
249                                                         [% END %]
250                                                         [% IF ( basketcontractno ) %]
251                                                             <li><span class="label">Contract name:</span> <a href="../admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno | uri %]&amp;booksellerid=[% booksellerid | uri %]">[% basketcontractname | html %]</a></li>
252                                                         [% END %]
253                                                         [% IF deliveryplace %]
254                                                             <li><span class="label">Delivery place:</span> [% Branches.GetName( deliveryplace ) | html %]</li>
255                                                         [% END %]
256                                                         [% IF billingplace %]
257                                                             <li><span class="label">Billing place:</span> [% Branches.GetName( billingplace ) | html %]</li>
258                                                         [% END %]
259                                                         [% IF ( authorisedbyname ) %]
260                                                             <li><span class="label">[% tp('basket created by', 'Created by:') | html %]</span>  [% authorisedbyname | html %]</li>
261                                                         [% END %]
262
263                                                         [% IF ( creationdate ) %]
264                                                             <li><span class="label">Opened on:</span>  [% creationdate | $KohaDates %]</li>
265                                                         [% END %]
266                                                         [% IF ( closedate ) %]
267                                                             <li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>
268                                                         [% END %]
269
270                                                         [% IF ( ediaccount ) %]
271                                                             [%- BLOCK edi_status -%]
272                                                                 [%- SWITCH edi_order.status -%]
273                                                                     [%- CASE 'pending'   -%]<span>Pending</span>
274                                                                     [%- CASE 'sent'      -%]<span>Sent</span>
275                                                                     [%- CASE 'processed' -%]<span>Processed</span>
276                                                                 [%- END -%]
277                                                             [%- END -%]
278                                                             [% IF ( edi_order ) %]
279                                                                 <li><span class="label">EDI status:</span> [%- PROCESS edi_status edi_order=edi_order -%] ([% edi_order.transfer_date | $KohaDates %])</li>
280                                                             [% ELSE %]
281                                                                 <li><span class="label">EDI status:</span> Not ordered</li>
282                                                             [% END %]
283                                                         [% END %]
284                                                         [% IF ( estimateddeliverydate ) %]
285                                                             <li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates %]</li>
286                                                         [% END %]
287                                                         <li><span class="label">Orders are standing:</span> [% IF is_standing %]Yes[% ELSE %]No[% END %]</li>
288
289                                                         [% IF basket.create_items %]
290                                                             <li>
291                                                                 <span class="label">Create items when:</span>
292                                                                 [% SWITCH basket.create_items %]
293                                                                     [% CASE 'receiving' %]<span>Receiving items</span>
294                                                                     [% CASE 'cataloguing' %]<span>Cataloguing items</span>
295                                                                     [% CASE %]<span>Placing orders</span>
296                                                                 [% END %]
297                                                             </li>
298                                                         [% END %]
299
300                                                         [% INCLUDE 'additional-fields-display.inc' available=available_additional_fields values=additional_field_values %]
301
302                                                     </ol>
303                                                 </div> <!-- /.page-section -->
304                                             </div> <!-- /.col-sm-6 -->
305
306                                             <div class="col-sm-6">
307                                                 <div class="page-section">
308                                                     <h2>Settings</h2>
309
310                                                     <ol>
311                                                         <li id="managedby">
312                                                             <form action="/cgi-bin/koha/acqui/basket.pl" method="post">
313                                                                 <span class="label">[% tp('Acquisitions basket managed by user', 'Managed by:') | html %]</span>
314                                                                 <div style="display:inline-block">
315                                                                     <ul id="users_names" style="padding-left:0">
316                                                                         [% FOREACH user IN users %]
317                                                                             <li id="user_[% user.borrowernumber | html %]">
318                                                                                 [% user.firstname | html %] [% user.surname | html %]
319                                                                                 <a href="#" data-borrowernumber="[% user.borrowernumber | html %]" class="del_user"><i class="fa fa-trash-can"></i> Delete user</a>
320                                                                             </li>
321                                                                         [% END %]
322                                                                         <li>
323                                                                             <a href="#" id="add_user"><i class="fa fa-plus"></i> Add user</a>
324                                                                         </li>
325                                                                         <li id="add_user_submit" style="display:none;">
326                                                                             <button type="submit" class="btn btn-default btn-xs">Save changes</button>
327                                                                         </li>
328                                                                     </ul>
329                                                                 </div>
330                                                                 <input type="hidden" id="basketno" name="basketno" value="[% basketno | html %]" />
331                                                                 <input type="hidden" id="users_ids" name="users_ids" value="[% users_ids | html %]" />
332                                                                 <input type="hidden" id="op" name="op" value="mod_users" />
333                                                             </form>
334
335                                                         </li> <!-- /#managedby -->
336                                                         <li id="branch">
337                                                             <span class="label">Managing library:</span>
338                                                             [% IF basketbranchcode %]
339                                                                 [% Branches.GetName( basketbranchcode ) | html %]
340                                                                 <a href="#" id="set_managing_library"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Change library</a>
341                                                             [% ELSE %]
342                                                                 No library
343                                                                 <a href="#" id="set_managing_library"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Set library</a>
344                                                             [% END %]
345                                                         </li> <!-- /#branch -->
346                                                         [% IF branches_loop.size %]
347                                                             <li id="managing_library_entry" style="display:none;">
348                                                                 <span class="label">&nbsp;</span>
349                                                                 <div>
350                                                                     <form action="/cgi-bin/koha/acqui/basket.pl" method="post">
351                                                                         <select id="select_managing_library" name="branch">
352                                                                             <option value="">(no library)</option>
353                                                                             [% FOREACH branch IN branches_loop %]
354                                                                                 [% IF ( basketbranchcode == branch.branchcode ) %]
355                                                                                     <option selected="selected" value="[% branch.branchcode | html %]"> [% branch.branchname | html %]</option>
356                                                                                 [% ELSE %]
357                                                                                     <option value="[% branch.branchcode | html %]"> [% branch.branchname | html %]</option>
358                                                                                 [% END %]
359                                                                             [% END %]
360                                                                         </select>
361                                                                         <a id="library_entry_cancel" href="#" class="cancel">Cancel</a>
362                                                                         <input type="hidden" id="basketno" name="basketno" value="[% basketno | html %]" />
363                                                                         <input type="hidden" id="op" name="op" value="mod_branch" />
364                                                                     </form>
365                                                                 </div>
366                                                             </li> <!-- #/managing_library_entry -->
367                                                         [% END # /IF branches_loop.size %]
368
369                                                     </ol>
370
371                                                     [% IF ( closedate ) %]
372                                                         <ol>
373                                                             <li>
374                                                                 <span class="label">Basket group:</span>
375                                                                 [% IF basketgroup.id and not basketgroup.name %]
376                                                                     [% SET basketgroup.name = "Basket group no. " _ basketgroup.id %]
377                                                                 [% END %]
378
379                                                                 [% IF basketgroup.closed %]
380                                                                     [% IF ( CAN_user_acquisition_group_manage ) %]
381                                                                         <a href="basketgroup.pl?op=add&booksellerid=[% booksellerid | uri %]&basketgroupid=[% basketgroup.id | uri %]" title="basketgroup">[% basketgroup.name | html %] <span>(closed)</span></a>
382                                                                     [% ELSE %]
383                                                                         [% basketgroup.name | html %] <span>(closed)</span>
384                                                                     [% END %]
385                                                                 [% ELSIF ( ! CAN_user_acquisition_group_manage ) %]
386                                                                     [%- IF basketgroup.id -%]
387                                                                         [% basketgroup.name | html %]
388                                                                     [%- ELSE -%]
389                                                                         <span>No group</span>
390                                                                     [%- END -%]
391                                                                 [% ELSE %]
392                                                                     [% IF ( CAN_user_acquisition_group_manage ) %]
393                                                                         [% IF ( basketgroup.id ) %]
394                                                                             <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&amp;booksellerid=[% basket.booksellerid | uri %]&amp;basketgroupid=[% basketgroup.id | uri %]">
395                                                                                 [% basketgroup.name | html %]
396                                                                             </a>
397                                                                             <a href="#" id="set_basket_group"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Change basket group</a>
398                                                                         [% ELSE %]
399                                                                             No group
400                                                                             <a href="#" id="set_basket_group"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Set basket group</a>
401                                                                         [% END %]
402                                                                     [% END %]
403                                                                 [% END %]
404                                                             </li>
405                                                             [% IF ( CAN_user_acquisition_group_manage ) %]
406                                                                 <li id="basket_grouping" style="display:none;">
407                                                                     <span class="label">&nbsp;</span>
408                                                                     <div style="float:left">
409                                                                         <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
410                                                                             <select id="basketgroupid" name="basketgroupid">
411                                                                                 <option value="">No group</option>
412                                                                                 [% FOREACH bg IN basketgroups %]
413                                                                                     [% IF ( bg.default ) %]
414                                                                                         <option value="[% bg.id | html %]" selected="selected">[% bg.name | html %]</option>
415                                                                                     [% ELSE %]
416                                                                                         [% UNLESS bg.closed %]
417                                                                                             <option value="[% bg.id | html %]">[% bg.name | html %]</option>
418                                                                                         [% ELSE %]
419                                                                                             <option value="[% bg.id | html %]" disabled="disabled">[% bg.name | html %] <span>(closed)</span></option>
420                                                                                         [% END %]
421                                                                                     [% END %]
422                                                                                 [% END %]
423                                                                                 <option value="new">Add new group</option>
424                                                                             </select>
425                                                                             <a href="#" id="basket_group_cancel" class="cancel">Cancel</a>
426                                                                             <input type="hidden" id="basketno" value="[% basketno | html %]" name="basketno" />
427                                                                             <input type="hidden" value="mod_basket" name="op" />
428                                                                             <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
429                                                                         </form>
430                                                                     </div>
431                                                                 </li>
432                                                             [% END # /IF ( CAN_user_acquisition_group_manage ) %]
433                                                             [% IF basketgroup.deliveryplace %]
434                                                                 <li>
435                                                                     <span class="label">Basket group delivery placename:</span> [% Branches.GetName( basketgroup.deliveryplace ) | html %]
436                                                                 </li>
437                                                             [% END %]
438                                                             [% IF basketgroup.billingplace %]
439                                                                 <li>
440                                                                     <span class="label">Basket group billing place:</span> [% Branches.GetName( basketgroup.billingplace ) | html %]
441                                                                 </li>
442                                                             [% END %]
443                                                         </ol>
444                                                     [% END # /IF closeddate %]
445                                                 </div> <!-- /.page-section -->
446                                             </div> <!-- /.rows -->
447                                         </div> <!-- /.col-sm-6 -->
448                                     </div> <!-- /#acqui_basket_summary.row -->
449                                 [% END # /IF ( basketno ) %]
450
451                                 [% IF ( duplinbatch ) %]
452                                     <div class="dialog alert">
453                                         <h4>Duplicate warning</h4>
454                                         <p>Some records have not been automatically added because they match an existing record in your catalog:<a href="/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=[% duplinbatch | uri %]&amp;basketno=[% basketno | uri %]&amp;booksellerid=[% booksellerid | uri %]" title="Open in new window" target="_blank" style="margin-left:10px"><i class="fa-solid fa-window-restore"></i> Display them</a></p>
455                                     </div>
456                                 [% END %]
457
458                                 [% IF ( books_loop ) %]
459                                     <div id="acqui_basket_content" class="page-section">
460                                         <h2>Orders</h2>
461                                         <table id="orders">
462                                             <thead>
463                                                 <tr>
464                                                     <th>No.</th>
465                                                     <th>[% tp('noun', 'Order') | html %]</th>
466                                                     <th>RRP tax exc.</th>
467                                                     <th>Actual cost tax exc.</th>
468                                                     <th>Budgeted cost tax exc.</th>
469                                                     <th>RRP tax inc.</th>
470                                                     <th>Actual cost tax inc.</th>
471                                                     <th>Budgeted cost tax inc.</th>
472                                                     <th>Replacement price</th>
473                                                     <th>Qty.</th>
474                                                     <th>Total tax exc. ([% currency | html %])</th>
475                                                     <th>Total tax inc. ([% currency | html %])</th>
476                                                     <th>GST %</th>
477                                                     <th>GST</th>
478                                                     <th>Fund</th>
479                                                     <th>Estimated delivery date</th>
480                                                     <th>Statistic 1</th>
481                                                     <th>Statistic 2</th>
482                                                     <th>Invoice</th>
483                                                     [% IF Koha.Preference('EDIFACT') && ediaccount %]
484                                                         <th>Supplier report</th>
485                                                     [% END %]
486                                                     <th class="NoSort">Place hold</th>
487                                                     [% IF ( active && !closedate ) %]
488                                                             <th class="NoSort">Modify</th>
489                                                     [% END %]
490                                                     [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %]
491                                                         <th class="NoSort">Cancel order</th>
492                                                     [% END %]
493                                                 </tr>
494                                             </thead>
495                                             <tfoot>
496                                                 [% FOREACH foot_loo IN book_foot_loop %]
497                                                     <tr>
498                                                         <th></th>
499                                                         <th>Total (GST [% foot_loo.tax_rate * 100 | html %])</th>
500                                                         <th>&nbsp;</th>
501                                                         <th>&nbsp;</th>
502                                                         <th>&nbsp;</th>
503                                                         <th>&nbsp;</th>
504                                                         <th>&nbsp;</th>
505                                                         <th>&nbsp;</th>
506                                                         <th>&nbsp;</th>
507                                                         <th>[% foot_loo.quantity | html %]</th>
508                                                         <th>[% foot_loo.total_tax_excluded | $Price %]</th>
509                                                         <th>[% foot_loo.total_tax_included | $Price %]</th>
510                                                         <th>&nbsp;</th>
511                                                         <th>[% foot_loo.tax_value | $Price %]</th>
512                                                         <th>&nbsp;</th>
513                                                         <th>&nbsp;</th>
514                                                         <th>&nbsp;</th>
515                                                         <th>&nbsp;</th>
516                                                         <th>&nbsp;</th>
517                                                         [% IF Koha.Preference('EDIFACT') && ediaccount %]
518                                                             <th>&nbsp;</th>
519                                                         [% END %]
520                                                         <th>&nbsp;</th>
521                                                         [% IF ( active && !closedate ) %]
522                                                             <th>&nbsp;</th>
523                                                         [% END %]
524                                                         [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %]
525                                                             <th>&nbsp;</th>
526                                                         [% END %]
527                                                     </tr>
528                                                 [% END %]
529                                                 <tr>
530                                                     <th></th>
531                                                     <th>Total ([% currency | html %])</th>
532                                                     <th>&nbsp;</th>
533                                                     <th>&nbsp;</th>
534                                                     <th>&nbsp;</th>
535                                                     <th>&nbsp;</th>
536                                                     <th>&nbsp;</th>
537                                                     <th>&nbsp;</th>
538                                                     <th>&nbsp;</th>
539                                                     <th>[% total_quantity | html %]</th>
540                                                     <th>[% total_tax_excluded | $Price %]</th>
541                                                     <th>[% total_tax_included | $Price %]</th>
542                                                     <th>&nbsp;</th>
543                                                     <th>[% total_tax_value | $Price %]</th>
544                                                     <th>&nbsp;</th>
545                                                     <th>&nbsp;</th>
546                                                     <th>&nbsp;</th>
547                                                     <th>&nbsp;</th>
548                                                     <th>&nbsp;</th>
549                                                     [% IF Koha.Preference('EDIFACT') && ediaccount %]
550                                                         <th>&nbsp;</th>
551                                                     [% END %]
552                                                     <th>&nbsp;</th>
553                                                     [% IF ( active && !closedate ) %]
554                                                         <th>&nbsp;</th>
555                                                     [% END %]
556                                                     [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %]
557                                                         <th>&nbsp;</th>
558                                                     [% END %]
559                                                 </tr>
560                                             </tfoot>
561                                             <tbody>
562                                                 [% FOREACH books_loo IN books_loop %]
563                                                     [% IF ( books_loo.order_received ) %]
564                                                         <tr class="disabled">
565                                                     [% ELSE %]
566                                                         <tr>
567                                                     [% END %]
568                                                         <td>
569                                                             [% books_loo.ordernumber | html %]
570                                                         </td>
571                                                         <td>
572                                                             <p>
573                                                                 [% IF ( books_loo.order_received ) %] <span class="order-received">(received)</span>[% END %]
574                                                                 [% IF books_loo.title %]
575                                                                     [% INCLUDE 'biblio-title.inc' biblio=books_loo link = 1 %] [% IF books_loo.author %] by [% books_loo.author | html %][% END %]
576                                                                 [% ELSE %]
577                                                                     <em>Deleted bibliographic record, can't find title</em><br />
578                                                                 [%- END %]
579                                                                 <br />
580                                                                 [%- IF ( books_loo.isbn ) %] - [% books_loo.isbn | html %][% END -%]
581                                                                 [%- IF ( books_loo.issn ) %] - [% books_loo.issn | html %][% END -%]
582                                                                 [%- IF ( books_loo.publishercode ) %], [% books_loo.publishercode | html %][% END -%]
583                                                                 [%- IF ( books_loo.publicationyear ) %], [% books_loo.publicationyear | html -%]
584                                                                 [%- ELSIF ( books_loo.copyrightdate ) %] [% books_loo.copyrightdate | html %][% END -%]
585                                                                 [%- IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement | html %][% END -%]
586                                                                 [%- IF ( books_loo.suggestionid ) %]
587                                                                     <br/>
588                                                                     Suggested by: [% books_loo.surnamesuggestedby | html %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby | html %] [% END %]
589                                                                     (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid | uri %]&amp;op=show">suggestion #[% books_loo.suggestionid | html %]</a>)
590                                                                 [% END %]
591                                                             </p>
592                                                             [% IF ( books_loo.order_internalnote ) %]
593                                                                 <p class="ordernote"><strong>Internal note: </strong><span id="internal-note-[% books_loo.ordernumber | html %]">[% books_loo.order_internalnote | html %]</span> <a class="edit_note noExport" data-ordernumber="[% books_loo.ordernumber | html %]" data-note_type="internal" href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber | html %]&type=internal" title="Edit internal note"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit internal note</a></p>
594                                                             [% ELSE %]
595                                                                 <a class="edit_note noExport" data-ordernumber="[% books_loo.ordernumber | html %]" data-note_type="internal" href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber | html %]&type=internal" title="Add internal note"><i class="fa fa-plus"></i> Add internal note</a>
596                                                             [% END %]
597                                                             [% IF ( books_loo.order_vendornote ) %]
598                                                                 <p class="ordernote"><strong>Vendor note: </strong> <span id="vendor-note-[% books_loo.ordernumber | html %]">[% books_loo.order_vendornote | html %]</span> <a class="edit_note noExport" data-ordernumber="[% books_loo.ordernumber | html %]" data-note_type="vendor" href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber | html %]&type=vendor" title="Edit vendor note"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit vendor note</a></p>
599                                                             [% ELSE %]
600                                                                 <a class="edit_note noExport" data-ordernumber="[% books_loo.ordernumber | html %]" data-note_type="vendor" href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber | html %]&type=vendor" title="Add vendor note"><i class="fa fa-plus"></i> Add vendor note</a>
601                                                             [% END %]
602                                                             [% IF (books_loo.transferred_from) %]
603                                                                 [% basket = books_loo.transferred_from.basket %]
604                                                                 [% bookseller = books_loo.transferred_from.bookseller %]
605                                                                 [% timestamp = books_loo.transferred_from.timestamp %]
606                                                                 <p>
607                                                                     Transferred from basket:
608                                                                     <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]"> [% basket.basketname | html %]</a>
609                                                                     (<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id | uri %]">[% bookseller.name | html %]</a>)
610                                                                     on <span title="[% timestamp | $KohaDates with_hours = 1 %]">
611                                                                     [% timestamp | $KohaDates %]
612                                                                     </span>
613                                                                 </p>
614                                                             [% END %]
615                                                             [% SET claims = books_loo.order_object.claims %]
616                                                             [% IF claims.count %]
617                                                                 <p>
618                                                                     This order has been claimed [% claims.count | html %] times. On [% FOR c IN claims %][% c.claimed_on | $KohaDates %][% UNLESS loop.last %], [% END %][% END %]
619                                                                 </p>
620                                                             [% END %]
621                                                         </td>
622                                                         [% SET zero_regex = "^0{1,}\.?0{1,}[^1-9]" %] [%# 0 or 0.0 or 0.00 or 00 or 00.0 or 00.00 or 0.000 ... %]
623                                                         [%# FIXME: use of a regexp is not ideal; bugs 9410 and 10929 suggest better way of handling this %]
624                                                         <td class="number [% IF books_loo.rrp_tax_excluded.search(zero_regex) %]error[% END %]">
625                                                             [% books_loo.rrp_tax_excluded | $Price %] [% IF ( books_loo.uncertainprice ) %] <span>(Uncertain)</span> [% END %]
626                                                         </td>
627                                                         <td class="number [% IF books_loo.unitprice_tax_excluded.search(zero_regex) %]error[% END %]">
628                                                             [% books_loo.unitprice_tax_excluded | $Price %]
629                                                         </td>
630                                                         <td class="number [% IF books_loo.ecost_tax_excluded.search(zero_regex) %]error[% END %]">
631                                                             [% books_loo.ecost_tax_excluded | $Price %]
632                                                         </td>
633                                                         <td class="number [% IF books_loo.rrp_tax_included.search(zero_regex) %]error[% END %]">
634                                                             [% books_loo.rrp_tax_included | $Price %]
635                                                         </td>
636                                                         <td class="number [% IF books_loo.unitprice_tax_included.search(zero_regex) %]error[% END %]">
637                                                             [% books_loo.unitprice_tax_included | $Price %]
638                                                         </td>
639                                                         <td class="number [% IF books_loo.ecost_tax_included.search(zero_regex) %]error[% END %]">
640                                                             [% books_loo.ecost_tax_included | $Price %]
641                                                         </td>
642                                                         <td class="number [% IF books_loo.replacementprice.search(zero_regex) %]error[% END %]">
643                                                             [% books_loo.replacementprice | $Price %]
644                                                         </td>
645                                                         <td class="number [% IF books_loo.quantity.search(zero_regex) %]error[% END %]">
646                                                             [% books_loo.quantity | html %]
647                                                         </td>
648                                                         <td class="number [% IF books_loo.total_tax_excluded.search(zero_regex) %]error[% END %]">
649                                                             [% books_loo.total_tax_excluded | $Price %]
650                                                         </td>
651                                                         <td class="number [% IF books_loo.total_tax_included.search(zero_regex) %]error[% END %]">
652                                                             [% books_loo.total_tax_included | $Price %]
653                                                         </td>
654                                                         <td class="number">
655                                                             [% books_loo.tax_rate * 100 | html %]
656                                                         </td>
657                                                         <td class="number [% IF books_loo.tax_value.search(zero_regex) %]error[% END %]">
658                                                             [% books_loo.tax_value | $Price %]
659                                                         </td>
660                                                         <td>
661                                                             [% books_loo.budget_name | html %]
662                                                         </td>
663                                                         <td data-order="[% books_loo.estimated_delivery_date | html %]" class="actions">
664                                                             [% books_loo.estimated_delivery_date | $KohaDates %]
665                                                             [% IF CAN_user_acquisition_order_manage %]
666                                                                     <a class="edit_delivery_date" href="/cgi-bin/koha/acqui/moddeliverydate.pl?ordernumber=[% books_loo.ordernumber | html %]" title="Edit delivery date" data-ordernumber="[% books_loo.ordernumber | html %]" id="delivery_date_[% books_loo.ordernumber | html %]" data-delivery_date="[% books_loo.estimated_delivery_date | html %]">
667                                                                     <i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
668                                                             [% END %]
669                                                         </td>
670                                                         <td>[% AuthorisedValues.GetByCode( books_loo.sort1_authcat, books_loo.sort1 ) | html %]</td>
671                                                         <td>[% AuthorisedValues.GetByCode( books_loo.sort2_authcat, books_loo.sort2 ) | html %]</td>
672                                                         <td>
673                                                             [% IF CAN_user_acquisition_edit_invoices %]
674                                                                 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% books_loo.invoice_object.invoiceid | url %]" class="invoice">[% books_loo.invoice_object.invoicenumber | html %]</a>
675                                                             [% ELSE %]
676                                                                 [% books_loo.invoice_object.invoicenumber | html %]
677                                                             [% END %]
678                                                         </td>
679
680                                                         [% IF Koha.Preference('EDIFACT') && ediaccount %]
681                                                             <td>[% books_loo.suppliers_report | html %]</td>
682                                                         [% END %]
683                                                         <td>
684                                                             [% IF ( CAN_user_reserveforothers_place_holds ) %]
685                                                                 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% books_loo.biblionumber | uri %]">
686                                                                     Place hold
687                                                                 </a>
688                                                             [% END %]
689                                                         </td>
690                                                         [% IF ( active && !closedate ) %]
691                                                             <td>
692                                                                 [% UNLESS (books_loo.order_received) %]
693                                                                     <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Modify</a>
694                                                                     <br />
695                                                                     <a href="#" class="transfer_order" data-ordernumber="[% books_loo.ordernumber | html %]">Transfer</a>
696                                                                 [% END %]
697                                                             </td>
698                                                         [% END %]
699                                                         [% IF ( !closedate || Koha.Preference('CancelOrdersInClosedBaskets') ) %]
700                                                             <td>
701                                                                 [% IF ( books_loo.orderstatus != "complete") %]
702                                                                     [% IF ( books_loo.left_holds_on_order ) %]
703                                                                         <span class="button" title="Can't cancel order, ([% books_loo.holds_on_order | html %]) holds are linked with this order. Cancel holds first">Can't cancel order</span><br>
704                                                                     [% ELSE %]
705                                                                         <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% books_loo.ordernumber | uri %]&biblionumber=[% books_loo.biblionumber | uri %]&basketno=[% basketno | uri %]&referrer=/cgi-bin/koha/acqui/basket.pl%3Fbasketno=[% basketno | uri %]" class="button">Cancel order</a><br>
706                                                                     [% END %]
707                                                                     [% IF ( books_loo.can_del_bib ) %]
708                                                                         <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% books_loo.ordernumber | uri %]&biblionumber=[% books_loo.biblionumber | uri %]&basketno=[% basketno | uri %]&del_biblio=1&referrer=/cgi-bin/koha/acqui/basket.pl%3Fbasketno=[% basketno | uri %]" class="button">Cancel order and delete catalog record</a><br>
709                                                                     [% ELSE %]
710                                                                         <span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br>
711                                                                     [% END %]
712                                                                     [% IF ( books_loo.left_item ) %]
713                                                                         <strong title="Can't delete catalog record, because of [% books_loo.items | html %] existing hold(s)" >[% books_loo.items | html %] item(s) left</strong><br>
714                                                                     [% END %]
715                                                                     [% IF ( books_loo.left_biblio ) %]
716                                                                         <strong title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios | html %] order(s) left</strong><br>
717                                                                     [% END %]
718                                                                     [% IF ( books_loo.left_subscription ) %]
719                                                                         <strong title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions | html %] subscription(s) left</strong><br>
720                                                                     [% END %]
721                                                                     [% IF ( books_loo.left_holds ) %]
722                                                                         <strong title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds | html %] hold(s) left</strong>
723                                                                     [% END %]
724                                                                 [% END %]
725                                                             </td>
726                                                         [% END %]
727                                                     </tr>
728                                                 [% END %]
729                                             </tbody>
730                                         </table> <!-- /#orders -->
731                                         [% IF ( listincgst ) %]<small class="highlight">** Vendor's listings already include tax.</small>[% END %]
732                                     </div> <!-- /#acqui_basket_content -->
733                                 [% END # / IF ( books_loop ) %]
734
735                                 [% IF (cancelledorders_loop) %]
736                                     <div id="cancelledorders" class="page-section">
737                                         <h2>Cancelled orders</h2>
738                                         <table id="cancelledorderst">
739                                             <thead>
740                                                 <tr>
741                                                     <th>No.</th>
742                                                     <th>[% tp('noun', 'Order') | html %]</th>
743                                                     <th class="tax_excluded">RRP tax exc.</th>
744                                                     <th class="tax_excluded">ecost tax exc.</th>
745                                                     <th class="tax_included">RRP tax inc.</th>
746                                                     <th class="tax_included">ecost tax inc.</th>
747                                                     <th class="replacementprice">Replacement price</th>
748                                                     <th>Qty.</th>
749                                                     <th class="tax_excluded">Total tax exc. ([% currency | html %])</th>
750                                                     <th class="tax_included">Total tax inc. ([% currency | html %])</th>
751                                                     <th>GST %</th>
752                                                     <th>GST</th>
753                                                     <th>Fund</th>
754                                                 </tr>
755                                             </thead>
756                                             <tbody>
757                                                 [% FOREACH order IN cancelledorders_loop %]
758                                                     <tr style="color:grey">
759                                                         <td>
760                                                             [% order.ordernumber | html %]
761                                                         </td>
762                                                         <td>
763                                                             <p>
764                                                                 [% IF ( order.order_received ) %] <span class="order-received">(received)</span>[% END %]
765                                                                 [% IF (order.title) %]
766                                                                     [% order.title | html %][% IF order.author %] by [% order.author | html %][% END %]
767                                                                 [% ELSE %]
768                                                                     <em>Deleted bibliographic record, can't find title</em>
769                                                                 [% END %]
770                                                                 <br />
771                                                                 [% IF ( order.order_internalnote ) %] [% order.order_internalnote | html %][% END %]
772                                                                 [% IF ( order.isbn ) %] - [% order.isbn | html %][% END %]
773                                                                 [% IF ( order.issn ) %] - [% order.issn | html %][% END %]
774                                                                 [% IF ( order.publishercode ) %], [% order.publishercode | html %][% END %]
775                                                                 [% IF ( order.publicationyear ) %]
776                                                                     , [% order.publicationyear | html %]
777                                                                 [% ELSIF ( order.copyrightdate ) %]
778                                                                     [% order.copyrightdate | html %]
779                                                                 [% END %]
780                                                                 [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement | html %][% END %]
781                                                                 [% IF ( order.cancellationreason ) %]
782                                                                     <br />
783                                                                     Cancellation reason: [% AuthorisedValues.GetByCode( 'ORDER_CANCELLATION_REASON', order.cancellationreason ) | html %]
784                                                                 [% END %]
785                                                             </p>
786                                                             [% IF order.transferred_to %]
787                                                                 [% basket = order.transferred_to.basket %]
788                                                                 [% bookseller = order.transferred_to.bookseller %]
789                                                                 [% timestamp = order.transferred_to.timestamp %]
790                                                                 <p>Transferred to basket:
791                                                                     <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]"> [% basket.basketname | html %]</a>
792                                                                     (<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id | uri %]">[% bookseller.name | html %]</a>)
793                                                                     on <span title="[% timestamp | $KohaDates with_hours = 1 %]">
794                                                                         [% timestamp | $KohaDates %]
795                                                                     </span>
796                                                                 </p>
797                                                             [% END %]
798                                                         </td>
799                                                         <td class="number">
800                                                             [% order.rrp_tax_excluded | $Price %]
801                                                             [% IF ( order.uncertain ) %]
802                                                                 <span>(Uncertain)</span>
803                                                             [% END %]
804                                                         </td>
805                                                         <td class="number">[% order.ecost_tax_excluded | $Price %]</td>
806                                                         <td class="number">[% order.rrp_tax_included | $Price %]</td>
807                                                         <td class="number">[% order.ecost_tax_included | $Price %]</td>
808                                                         <td class="number">[% order.replacementprice | $Price %]</td>
809                                                         <td class="number">[% order.quantity | html %]</td>
810                                                         <td class="number">[% order.total_tax_excluded | $Price %]</td>
811                                                         <td class="number">[% order.total_tax_included | $Price %]</td>
812                                                         <td class="number">[% order.tax_rate * 100 | html %]</td>
813                                                         <td class="number">[% order.tax_value | $Price %]</td>
814                                                         <td>[% order.budget_name | html %]
815                                                     </tr>
816                                                 [% END # /FOREACH order %]
817                                             </tbody>
818                                         </table> <!-- /#cancelledorderst -->
819                                     </div> <!-- /#cancelledorders -->
820                                 [% END # /IF (cancelledorders_loop) %]
821                                 <br />
822
823                                 [% UNLESS ( closedate ) %]
824                                     <!-- Modal -->
825                                     <div id="addtoBasket" class="modal" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel" aria-hidden="true" data-basketno="[% basket.basketname | html %]">
826                                         <div class="modal-dialog" role="document">
827                                             <div class="modal-content">
828                                                 <div class="modal-header">
829                                                     <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
830                                                     <h4 class="modal-title" id="addtoBasketLabel">Add order to basket</h4>
831                                                 </div>
832                                                 <div class="modal-body">
833                                                     [% IF active %]
834                                                         [% INCLUDE 'acquisitions-add-to-basket.inc' %]
835                                                     [% END %]
836                                                 </div>
837                                                 <div class="modal-footer">
838                                                     <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
839                                                 </div>
840                                             </div><!-- /.modal-content -->
841                                         </div><!-- /.modal-dialog -->
842                                     </div><!-- /.modal#addtoBasket -->
843                                 [% END # /UNLESS ( closedate ) %]
844
845                             [% END # /IF ( delete_confirmed ) %]
846                         [% END # /IF ( NO_BOOKSELLER ) %]
847                     [% ELSE %]
848                         <!-- if we want just to select a basketgroup for a closed basket -->
849                     [% END #/IF !confirm_close && !edi_confirm  %]
850
851                     [% IF ( confirm_close ) %]
852                         <div id="closebasket_needsconfirmation" class="dialog alert">
853
854                             <form action="/cgi-bin/koha/acqui/basket.pl">
855                                 <h1>Are you sure you want to close basket [% basketname | html %]?</h1>
856                                 [% IF ( CAN_user_acquisition_group_manage ) %]
857                                     <p>
858                                         <label for="createbasketgroup">Attach this basket to a new basket group with the same name</label>
859                                         <input type="checkbox" id="createbasketgroup" name="createbasketgroup"/>
860                                     </p>
861                                 [% END %]
862                                 <input type="hidden" id="basketno" value="[% basketno | html %]" name="basketno" />
863                                 <input type="hidden" value="close" name="op" />
864                                 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
865                                 <input type="hidden" name="confirm" value="1" />
866                                 <input type="hidden" name="basketgroupname" value="[% basketgroupname | html %]" />
867                                 <button type="submit" class="approve" accesskey="y"><i class="fa fa-fw fa-check"></i> Yes, close (Y)</button>
868                             </form>
869                             <form action="/cgi-bin/koha/acqui/basket.pl" method="get">
870                                 <input type="hidden" name="basketno" value="[% basketno | html %]" />
871                                 <button type="submit" class="deny" accesskey="n"><i class="fa fa-fw fa-times"></i> No, don't close (N)</button>
872                             </form>
873                         </div>
874                     [% END # /IF ( confirm_close ) %]
875
876                     [% IF edi_confirm %]
877                         <div id="closebasket_needsconfirmation" class="dialog alert">
878                             <form action="/cgi-bin/koha/acqui/basket.pl">
879                                 <h1>Are you sure you want to generate an EDIFACT order and close basket [% basketname | html %]?</h1>
880                                 [% IF CAN_user_acquisition_group_manage %]
881                                     <p>
882                                         <label for="createbasketgroup">Attach this basket to a new basket group with the same name</label>
883                                         <input type="checkbox" id="createbasketgroup" name="createbasketgroup"/>
884                                     </p>
885                                 [% END %]
886                                 <input type="hidden" id="basketno" value="[% basketno | html %]" name="basketno" />
887                                 <input type="hidden" value="ediorder" name="op" />
888                                 <input type="hidden" name="ean" value="[% ean | html %]" />
889                                 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
890                                 <input type="hidden" name="confirm" value="1" />
891                                 <input type="hidden" name="basketgroupname" value="[% basketgroupname | html %]" />
892                                 <button type="submit" class="approve" accesskey="Y"><i class="fa fa-fw fa-check"></i> Yes, close (Y)</button>
893                             </form>
894                             <form action="/cgi-bin/koha/acqui/basket.pl" method="get">
895                                 <input type="hidden" name="basketno" value="[% basketno | html %]" />
896                                 <button type="submit" class="deny" accesskey="N"><i class="fa fa-fw fa-times"></i> No, don't close (N)</button>
897                             </form>
898                         </div> <!-- /#closebasket_needsconfirmation -->
899                     [% END # /IF edi_confirm %]
900                 [% END # /IF (cannot_manage_basket) %]
901             </main>
902         </div> <!-- /.col-sm-10.col-sm-push-2 -->
903
904         <div class="col-sm-2 col-sm-pull-10">
905             <aside>
906                 [% INCLUDE 'vendor-menu.inc' %]
907                 [% INCLUDE 'acquisitions-menu.inc' %]
908             </aside>
909         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
910     </div> <!-- /.row -->
911
912
913     <!-- Modal for editing vendor and internal notes -->
914     <div class="modal" id="noteEditor" tabindex="-1" role="dialog" aria-labelledby="noteEditorLabel">
915         <div class="modal-dialog" role="document">
916             <form id="modify_order_notes" action="/cgi-bin/koha/acqui/modordernotes.pl" method="post">
917                 <div class="modal-content">
918                     <div class="modal-header">
919                         <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
920                         <h4 class="modal-title" id="noteEditorLabel">Order note</h4>
921                     </div>
922                     <div class="modal-body">
923                         <textarea id="ordernotes" name="ordernotes" rows="3" cols="30" class="focus">[% ordernotes | html %]</textarea>
924                         <input type="hidden" id="ordernumber" name="ordernumber" value="" />
925                         <input type="hidden" name="op" value="save" />
926                         <input type="hidden" id="type" name="type" value="" />
927                     </div>
928                     <div class="modal-footer">
929                         <button type="submit" class="btn btn-default">Save</button>
930                         <button type="button" class="btn btn-link cancel" data-dismiss="modal">Cancel</button>
931                     </div>
932                 </div> <!-- /.modal-content -->
933             </form> <!-- /#modify_order_notes -->
934         </div> <!-- /.modal-dialog -->
935     </div> <!-- /.modal#noteEditor -->
936
937     <!-- Modal for editing estimated delivery date -->
938     <div class="modal" id="dateEditor" tabindex="-1" role="dialog" aria-labelledby="dateEditorLabel">
939         <div class="modal-dialog" role="document">
940             <form id="modify_estimated_delivery_date" action="/cgi-bin/koha/acqui/moddeliverydate.pl" method="post">
941                 <div class="modal-content">
942                     <div class="modal-header">
943                         <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
944                         <h4 class="modal-title" id="dateEditorLabel">Estimated delivery date</h4>
945                     </div>
946                     <div class="modal-body">
947                         <input type="text" id="estimated_delivery_date" size="10" name="estimated_delivery_date" class="flatpickr" value="[% books_loo.estimated_delivery_date | html %]"/>
948                         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
949                         <input type="hidden" id="date_ordernumber" name="ordernumber" value="" />
950                         <input type="hidden" name="op" value="save" />
951                     </div>
952                     <div class="modal-footer">
953                         <button type="submit" class="btn btn-default">Save</button>
954                         <button type="button" class="btn btn-link cancel" data-dismiss="modal">Cancel</button>
955                     </div>
956                 </div> <!-- /.modal-content -->
957             </form> <!-- /#modify_estimated_delivery_date -->
958         </div> <!-- /.modal-dialog -->
959     </div> <!-- /.modal#dateEditor -->
960
961 [% MACRO jsinclude BLOCK %]
962     [% Asset.js("js/acquisitions-menu.js") | $raw %]
963     [% INCLUDE 'datatables.inc' %]
964     [% INCLUDE 'columns_settings.inc' %]
965     [% Asset.js("lib/hc-sticky.js") | $raw %]
966     [% Asset.js("js/acq.js") | $raw %]
967     [% INCLUDE 'calendar.inc' %]
968     <script>
969         function updateColumnsVisibility(visible) {
970             if ( visible ) {
971                 $("table .tax_excluded, .tax_included").show();
972             } else {
973                 [% IF ( listincgst ) %]
974                     $("table .tax_excluded").hide();
975                 [% ELSE %]
976                     $("table .tax_included").hide();
977                 [% END %]
978             }
979         }
980
981         var Sticky;
982
983         $(document).ready(function() {
984             if ( $('#toolbar').length ) {
985                 Sticky = $("#toolbar");
986                 Sticky.hcSticky({
987                     stickTo: "main",
988                     stickyClass: "floating"
989                 });
990             }
991
992             [% UNLESS ( closedate ) %]
993                 $('#addtoBasket').on('show', function () {
994                    $(this).find(".modal-body").html($(".acqui_basket_add")[0].outerHTML);
995                 });
996             [% END %]
997
998             $("body").on("click", ".del_user", function(e){
999                 e.preventDefault();
1000                 del_user( $(this).data("borrowernumber") );
1001             });
1002
1003             $("#add_user").on("click",function(e){
1004                 e.preventDefault();
1005                 UserSearchPopup();
1006             });
1007
1008             $(".transfer_order").on("click",function(e){
1009                 e.preventDefault();
1010                 transfer_order_popup( $(this).data("ordernumber"));
1011             });
1012
1013             $(".edit_note").on("click", function(e) {
1014                 e.preventDefault();
1015                 var ordernumber = $(this).data("ordernumber");
1016                 var note_type = $(this).data("note_type");
1017                 var order_number_text = _("(order number %s)").format(ordernumber);
1018                 var modalTitle = $(this).attr("title") + " " + order_number_text;
1019                 var note_text = $( "#" + note_type + "-note-" + ordernumber ).html();
1020                 $("#noteEditor .modal-title").text(modalTitle);
1021                 $("#ordernumber").val( ordernumber );
1022                 $("#ordernotes").html( note_text );
1023                 $("#type").val( note_type );
1024                 $("#noteEditor").modal("show");
1025                 $("#ordernotes").focus();
1026             });
1027
1028              $("#noteEditor").on('hidden.bs.modal', function (e) {
1029                 $("#noteEditorLabel").html("");
1030                 $("#noteEditor .modal-title").text("");
1031                 $("#ordernotes").html( "" );
1032                 $("#ordernumber").val("");
1033                 $("#type").val("");
1034             });
1035
1036             $("#set_managing_library").on("click", function(e){
1037                 e.preventDefault();
1038                 $(this).hide();
1039                 $("#managing_library_entry").show();
1040             });
1041
1042             $("#library_entry_cancel").on("click", function(e){
1043                 e.preventDefault();
1044                 $("#managing_library_entry").hide();
1045                 $("#set_managing_library").show();
1046             });
1047
1048             $("#set_basket_group").on("click", function(e){
1049                 e.preventDefault();
1050                 $(this).hide();
1051                 $("#basket_grouping").show();
1052             });
1053
1054             $("#basket_group_cancel").on("click", function(e){
1055                 e.preventDefault();
1056                 $("#basket_grouping").hide();
1057                 $("#set_basket_group").show();
1058             });
1059
1060             $("#addtoBasket").on("shown.bs.modal", function(){
1061                 var basket = $(this).data("basketno");
1062                 var legend = _("Add order to basket %s").format(basket);
1063                 $(this).find("h4").text( legend );
1064                 $(this).find("legend").html(legend);
1065                 $(this).find("input:text").focus();
1066             });
1067         });
1068     </script>
1069
1070     [% UNLESS ( closedate ) %]
1071         <script>
1072             function transfer_order_popup(ordernumber) {
1073                 var url = "/cgi-bin/koha/acqui/transferorder.pl?"
1074                     + "ordernumber=" + ordernumber
1075                 window.open(url, 'TransferOrder','width=600,height=400,toolbar=false,scrollbars=yes');
1076             }
1077
1078             function confirm_ediorder() {
1079                 var is_confirmed = confirm(_("Are you sure you want to close this basket and generate an EDIFACT order?"));
1080                 if (is_confirmed) {
1081                     window.location = "/cgi-bin/koha/acqui/basket.pl?op=edi_confirm&basketno=[% basketno | html %]";
1082                 }
1083             }
1084         </script>
1085     [% ELSE %]
1086         <script>
1087             $(document).ready(function(){
1088                 $("#basketgroupid").change(function(){
1089                     if($(this).val() == "new"){
1090                         location.href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% booksellerid | html %]";
1091                     } else {
1092                         $(this).parent().submit();
1093                     }
1094                 });
1095             });
1096         </script>
1097         [% UNLESS ( grouped ) %]
1098             <script>
1099                 function confirm_reopen() {
1100                     var skip = [% IF ( skip_confirm_reopen ) %] 1 [% ELSE %] 0 [% END %];
1101                     var is_confirmed = skip || confirm(_("Are you sure you want to reopen this basket?"));
1102                     if (is_confirmed) {
1103                         window.location = "/cgi-bin/koha/acqui/basket.pl?op=reopen&basketno=[% basketno | html %]";
1104                     }
1105                 }
1106             </script>
1107         [% END # /UNLESS grouped %]
1108     [% END # /UNLESS (closedate) %]
1109     <script>
1110         $(document).ready(function() {
1111             var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'basket', 'orders', 'json' ) | $raw %];
1112             [% IF !(Koha.Preference('EDIFACT') && ediaccount) %]
1113                 table_settings['columns'].splice(18, 1);
1114             [% END %]
1115             KohaTable("orders", {
1116                 "pagingType": "full",
1117                 "autoWidth": false,
1118                 "exportColumns": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18[% IF (Koha.Preference('EDIFACT') && ediaccount) %],19[% END %]],
1119             }, table_settings);
1120
1121             var cancelledorderst = $("#cancelledorderst").dataTable($.extend(true, {}, dataTablesDefaults, {
1122                 "pagingType": "full"
1123             } ) );
1124             $("#reopenbutton").on("click",function(e){
1125                 e.preventDefault();
1126                 confirm_reopen();
1127             });
1128             // Generates a dynamic link for exporting the selections data as CSV
1129             $("#exportbutton, #export-csv-menu a").click(function() {
1130                 // Building the url from currently checked boxes
1131                 var url = '/cgi-bin/koha/acqui/basket.pl';
1132                 url += $('#exportbutton').attr('href');
1133                 if($(this).attr("data-value")) {
1134                     url += '&amp;csv_profile=' + $(this).attr("data-value");
1135                 }
1136                 // And redirecting to the CSV page
1137                 location.href = url;
1138                 return false;
1139             });
1140             $("#select_managing_library").on("change", function(){
1141                 $(this).parent().submit();
1142             });
1143
1144             $(".edit_delivery_date").on("click", function(e) {
1145                 e.preventDefault();
1146                 var ordernumber = $(this).data("ordernumber");
1147                 var order_number_text = _("(order number %s)").format(ordernumber);
1148                 var modalTitle = $(this).attr("title") + " " + order_number_text;
1149                 var delivery_date = $( "#delivery_date_" + ordernumber ).data("delivery_date");
1150                 const estimated_delivery_date = document.querySelector("#estimated_delivery_date")._flatpickr;
1151                 estimated_delivery_date.setDate( delivery_date );
1152                 $("#dateEditor .modal-title").text(modalTitle);
1153                 $("#date_ordernumber").val(ordernumber);
1154                 $("#dateEditor").modal("show");
1155             });
1156
1157              $("#dateEditor").on('hidden.bs.modal', function (e) {
1158                 $("#dateEditorLabel").html("");
1159                 $("#dateEditor .modal-title").text("");
1160                 $("#estimated_delivery_date").html( "" );
1161                 $("#date_ordernumber").val("");
1162             });
1163         });
1164
1165         function UserSearchPopup(f) {
1166             window.open(
1167                 "/cgi-bin/koha/members/search.pl?columns=cardnumber,name,category,branch,action&selection_type=add&filter=baskets_managers",
1168                 'UserSearchPopup',
1169                 'width=1024, height=768, scrollbars=yes, toolbar=no,'
1170              );
1171         }
1172
1173         function add_user(borrowernumber, borrowername) {
1174             var ids = $("#users_ids").val();
1175             if(ids.length > 0) {
1176                 ids = ids.split(':');
1177             } else {
1178                 ids = new Array;
1179             }
1180             if (ids.indexOf(borrowernumber.toString()) < 0) {
1181                 ids.push(borrowernumber);
1182                 $("#users_ids").val(ids.join(':'));
1183                 var li = '<li id="user_'+borrowernumber+'">'+borrowername
1184                 + ' <a href="#" data-borrowernumber="'+borrowernumber+'" class="del_user"><i class="fa fa-trash-can"></i> '
1185                     + _("Delete user") + '</a></li>';
1186                 $("#users_names").prepend(li);
1187                 $("#add_user_submit").show();
1188                 return 0;
1189             }
1190             return -1;
1191         }
1192
1193         function del_user(borrowernumber) {
1194             $("#user_"+borrowernumber).remove();
1195             var ids = $("#users_ids").val().split(':');
1196             ids.splice(ids.indexOf(borrowernumber.toString()), 1);
1197             $("#users_ids").val(ids.join(':'));
1198             $("#add_user_submit").show();
1199         }
1200     </script>
1201 [% END %]
1202
1203 [% INCLUDE 'intranet-bottom.inc' %]