6 [% PROCESS 'i18n.inc' %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>[% FILTER collapse %]
10 [% tx("Basket grouping for '{vendor}'", { vendor = booksellername }) %] ›
11 [% t("Koha") | html %]
13 [% INCLUDE 'doc-head-close.inc' %]
16 <body id="acq_basketgroup" class="acq">
17 [% WRAPPER 'header.inc' %]
18 [% INCLUDE 'acquisitions-search.inc' %]
21 [% WRAPPER 'sub-header.inc' %]
22 [% WRAPPER breadcrumbs %]
23 [% WRAPPER breadcrumb_item %]
24 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
27 [% WRAPPER breadcrumb_item %]
28 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
30 [% WRAPPER breadcrumb_item %]
31 <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]">Basket grouping</a>
33 [% WRAPPER breadcrumb_item bc_active= 1 %]
34 <span>Add basket group for [% booksellername | html %]</span>
37 [% WRAPPER breadcrumb_item %]
38 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
40 [% WRAPPER breadcrumb_item bc_active= 1 %]
41 <span>Basket grouping</span>
43 [% END # /IF grouping %]
44 [% END #/ WRAPPER breadcrumbs %]
45 [% END #/ WRAPPER sub-header.inc %]
47 <div class="main container-fluid">
49 <div class="col-sm-10 col-sm-push-2">
54 <div id="toolbar" class="btn-toolbar">
55 <div class="btn-group"><a href="[% script_name | url %]?op=reopen&basketgroupid=[% basketgroupid | uri %]&booksellerid=[% booksellerid | uri %]&mode=singlebg" class="btn btn-default" id="reopenbutton"><i class="fa fa-download"></i> Reopen basket group</a></div>
56 <div class="btn-group"><a href="[% script_name | url %]?op=export&basketgroupid=[% basketgroupid | uri %]&booksellerid=[% booksellerid | uri %]" class="btn btn-default" id="exportbutton"><i class="fa fa-download"></i> Export basket group as CSV</a></div>
57 <div class="btn-group"><a href="[% script_name | url %]?op=print&basketgroupid=[% basketgroupid | uri %]&booksellerid=[% booksellerid | uri %]" class="btn btn-default" id="printbutton"><i class="fa fa-download"></i> Print basket group in PDF</a></div>
59 <div class="btn-group"><a href="[% script_name | url %]?op=ediprint&basketgroupid=[% basketgroupid | uri %]&booksellerid=[% booksellerid | uri %]" class="btn btn-default" id="printbutton"><i class="fa fa-download"></i> Generate EDIFACT order</a></div>
63 [% IF (name && closedbg) %]
64 <h1>Basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
66 <h1>Edit basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
68 <h1>Add basket group for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
70 <div id="basketgroupcolumns" class="row">
71 [% UNLESS (closedbg) %]
72 <div class="col-xs-6 col-xs-push-6">
74 <div class="workarea_alt" >
75 <h3>Ungrouped baskets</h3>
76 <div class="page-section">
77 <table id="ungrouped" class="basketgroup_baskets">
82 <th class="NoSort"></th>
87 [% FOREACH basket IN baskets %]
88 <tr class="ungrouped" id="b-[% basket.basketno | html %]">
90 <a href="basket.pl?basketno=[% basket.basketno | uri %]">
91 [% IF ( basket.basketname ) %]
92 [% basket.basketname | html %]
94 <span>No name, basketnumber: [% basket.basketno | html %]</span>
98 <td data-sort="[% basket.total | html %]">
99 [% basket.total | $Price %]
100 <input type="hidden" class="basket" name="basket" value="[% basket.basketno | html %]" />
103 <a class="addtogroup btn btn-default btn-xs" data-basketid="b-[% basket.basketno | html %]">
104 <i class="fa fa-plus" aria-hidden="true"></i> Add to group
112 </div><!--/.page-section -->
113 </div><!-- /#groups -->
114 </div><!-- /.col-xs-6 -->
118 [% IF ( closedbg ) %]
119 <div class="col-xs-12">
121 <div class="col-xs-6 col-xs-pull-6">
123 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post" id="groupingform">
124 <fieldset id="various" class="brief">
126 [% UNLESS (closedbg) %]
128 <label for="basketgroupname">Basket group name:</label>
129 <input type="text" name="basketgroupname" id="basketgroupname" value="[% name | html %]" class="focus" />
132 <input type="hidden" name="basketgroupname" id="basketgroupname" value="[% name | html %]" />
135 [% UNLESS (closedbg) %]
136 <label for="billingplace">Billing place:</label>
137 <select name="billingplace" id="billingplace">
138 <option value="">--</option>
139 [% PROCESS options_for_libraries libraries => Branches.all( selected => billingplace ) %]
142 <span class="label">Billing place:</span>
143 <input name="billingplace" id="billingplace" type ="hidden" value="[% billingplace | html %]" />[% Branches.GetName( billingplace ) | html %]
146 [% UNLESS (closedbg) %]
148 <label for="deliveryplace">Delivery place:</label>
149 <select name="deliveryplace" id="deliveryplace">
150 <option value="">--</option>
151 [% PROCESS options_for_libraries libraries => Branches.all( selected => deliveryplace ) %]
158 <label for="freedeliveryplace">Delivery place:</label>
159 <textarea cols="26" rows="3" name="freedeliveryplace" id="freedeliveryplace">[% freedeliveryplace | html %]</textarea>
163 <span class="label">Delivery place:</span>
164 [% IF (freedeliveryplace) %]
165 <input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="[% freedeliveryplace | html %]" />[% freedeliveryplace | html %]
166 <input name="deliveryplace" id="deliveryplace" type ="hidden" value="" />
168 <input name="deliveryplace" id="deliveryplace" type ="hidden" value="[% deliveryplace | html %]" />[% Branches.GetName( deliveryplace ) | html %]
169 <input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="" />
174 [% UNLESS (closedbg) %]
175 <label for="deliverycomment">Delivery comment:</label>
176 <textarea cols="26" rows="3" name="deliverycomment" id="deliverycomment">[% deliverycomment | html %]</textarea>
178 <span class="label">Delivery comment:</span>[% deliverycomment | html %]
179 <input name="deliverycomment" id="deliverycomment" type="hidden" value = "[% deliverycomment | html %]" />
183 <h3>Baskets in this group:</h3>
184 <table id="grouped" class="basketgroup_baskets">
189 <th class="NoSort"></th>
193 [% FOREACH selectedbasket IN selectedbaskets %]
194 <tr id="b-[% selectedbasket.basketno | html %]">
196 <a href="basket.pl?basketno=[% selectedbasket.basketno | uri %]">
197 [% IF ( selectedbasket.basketname ) %]
198 [% selectedbasket.basketname | html %]
200 <span>No name, basketnumber: [% selectedbasket.basketno | html %]</span>
204 <td data-sort="[% selectedbasket.total | html %]">
205 [% selectedbasket.total | $Price %]
206 <input type="hidden" class="basket" name="basket" value="[% selectedbasket.basketno | html %]" />
209 [% IF ( closedbg ) %]
211 <a class="removefromgroup btn btn-default btn-xs" data-basketid="b-[% selectedbasket.basketno | html %]" id="addtogroup[% selectedbasket.basketno | html %]">
212 <i class="fa fa-trash-can" aria-hidden="true"></i> Remove
220 [% UNLESS (closedbg) %]
222 <li><label for="closedbg">Close basket group</label><input type="checkbox" id="closedbg" name="closedbg" /></li>
225 <input type="hidden" id="closedbg" name="closedbg" value ="1"/>
229 [% UNLESS (closedbg) %]
230 <fieldset class="action"><input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
231 [% IF ( basketgroupid ) %]
232 <input type="hidden" name="basketgroupid" value="[% basketgroupid | html %]" />
234 <input type="hidden" name="op" value="attachbasket" />
235 <input type="submit" class="btn btn-primary" value="Save" /> <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]" class="cancel">Cancel</a>
242 <div id="toolbar" class="btn-toolbar">
243 <div class="btn-group"><a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% booksellerid | uri %]" class="btn btn-default" id="newbasketgroup"><i class="fa fa-plus"></i> New basket group</a></div>
245 <h1>Basket grouping for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
246 [% IF (NoEDIMessage && Koha.Preference('EDIFACT')) %]<div><strong>No EDIFACT configuration for [% booksellername | html %]</strong></div>[% END %]
248 [% WRAPPER tabs id= "basket_groups" %]
249 [% WRAPPER tabs_nav %]
250 [% WRAPPER tab_item tabname= "opened" bt_active= 1 %] <span>Open</span> [% END %]
251 [% WRAPPER tab_item tabname= "closed" %] <span>Closed</span> [% END %]
253 [% WRAPPER tab_panels %]
254 [% WRAPPER tab_panel tabname="opened" bt_active= 1 %]
255 <table id="basket_group_opened">
260 <th>Billing place</th>
261 <th>Delivery place</th>
262 <th>Number of baskets</th>
267 [% FOREACH basketgroup IN basketgroups %]
268 [% UNLESS ( basketgroup.closed ) %]
270 <td>[% IF ( basketgroup.name ) %]
271 [% basketgroup.name | html %]
273 <span>Basket group no. [% basketgroup.id | html %]</span>
276 <td>[% basketgroup.id | html %]</td>
277 <td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
278 <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
279 <td>[% basketgroup.basketsqty | html %]</td>
281 <input type="button" id="close_and_print" data-basketgroupid="[% basketgroup.id | html %]" value="Close and export as PDF" />
282 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="add" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid | html %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" class="btn btn-primary" value="Edit" /></form>
283 [% UNLESS basketgroup.basketsqty %]
284 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="delete" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid | html %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" id="delete_basketgroup" class="btn btn-primary" value="Delete" /></form>
294 [% WRAPPER tab_panel tabname="closed" %]
295 <table id="basket_group_closed">
300 <th>Billing place</th>
301 <th>Delivery place</th>
302 <th>Number of baskets</th>
307 [% FOREACH basketgroup IN basketgroups %]
308 [% IF ( basketgroup.closed ) %]
311 [% IF ( basketgroup.name ) %]
312 [% basketgroup.name | html %]
314 <span>Basket group no. [% basketgroup.id | html %]</span>
317 <td>[% basketgroup.id | html %]</td>
318 <td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
319 <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
320 <td>[% basketgroup.basketsqty | html %]</td>
322 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="add" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid | html %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" class="btn btn-primary" value="View" /></form>
323 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="reopen" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid | html %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" class="btn btn-primary" value="Reopen" /></form>
324 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="print" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" class="btn btn-primary" value="Export as PDF" /></form>
325 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="export" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" class="btn btn-primary" value="Export as CSV" /></form>
326 [% IF Koha.Preference('EDIFACT') %]
327 [% IF (ediaccount) %]
328 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="ediprint" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid | html %]" /><input type="submit" class="btn btn-primary" value="Generate EDIFACT order" /></form>
330 <div>No EDIFACT configuration for [% booksellername | html %]</div>
340 [% END # /WRAPPER tab_panels %]
341 [% END # /#basket_groups %]
344 </div> <!-- /.col-sm-10.col-sm-push-2 -->
346 <div class="col-sm-2 col-sm-pull-10">
348 [% IF ( booksellerid ) %]
349 [% INCLUDE 'vendor-menu.inc' %]
351 [% INCLUDE 'acquisitions-menu.inc' %]
354 </div> <!-- /.row -->
356 [% MACRO jsinclude BLOCK %]
357 [% INCLUDE 'datatables.inc' %]
359 function submitForm(form) {
360 if (form.closedbg.checked == true) {
361 var input = document.createElement("input");
362 input.setAttribute("type", "hidden");
363 input.setAttribute("name", "closed");
364 input.setAttribute("value", "1");
365 form.appendChild(input);
370 function closeandprint(bg){
371 if(document.location = '/cgi-bin/koha/acqui/basketgroup.pl?op=closeandprint&basketgroupid=' + bg ){
372 setTimeout("window.location.reload();", 3000);
374 alert( _("Error downloading the file") );
378 $(document).ready(function() {
379 [% IF ( listclosed) %]
380 $("#basket_groups a[href='#closed']").tab("show");
382 $("#basket_groups a[href='#opened']").tab("show");
384 [% UNLESS ( grouping ) %]
385 $("table").dataTable($.extend(true, {}, dataTablesDefaults, {
387 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
390 "sPaginationType": "full"
393 grouped = $("#grouped").DataTable($.extend(true, {}, dataTablesDefaults, {
396 { 'sortable': false, 'targets': [ 'NoSort' ] }
400 "emptyTable": _("There are no baskets in this group")
403 ungrouped = $("#ungrouped").DataTable($.extend(true, {}, dataTablesDefaults, {
406 { 'sortable': false, 'targets': [ 'NoSort' ] }
410 "emptyTable": _("There are no ungrouped baskets")
415 $("#basketgroupcolumns").on("click", ".addtogroup", function(){
416 const row = $("#" + $(this).data("basketid") );
418 $(this).removeClass("addtogroup").addClass("removefromgroup").html("<i class=\"fa fa-trash-can\" aria-hidden=\"true\"></i> " + _("Remove") );
419 row.removeClass("ungrouped").addClass("grouped");
420 ungrouped.row( row ).remove().draw();
421 grouped.row.add( row ).draw();
425 $("#basketgroupcolumns").on("click", ".removefromgroup", function(){
426 const row = $("#" + $(this).data("basketid") );
428 $(this).removeClass("removefromgroup").addClass("addtogroup").html("<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> " + _("Add to group") );
429 $(this).removeClass("").addClass("");
430 row.removeClass("grouped").addClass("ungrouped");
431 grouped.row( row ).remove().draw();
432 ungrouped.row.add( row ).draw();
436 $("#close_and_print").on("click", function(e){
438 const basketgroupid = $(this).data("basketgroupid");
439 closeandprint( basketgroupid );
442 $("#groupingform").on("submit", function(e){
447 $("#delete_basketgroup").on("click", function(e){
448 return confirm(_("Are you sure you want to delete this basket group?"));
453 [% INCLUDE 'intranet-bottom.inc' %]