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