6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Basket grouping for [% booksellername | html %] › Koha</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 [% INCLUDE 'datatables.inc' %]
12 var MSG_CONFIRM_CLOSE_BASKETGROUP = _("Are you sure you want to close this basketgroup?");
13 var MSG_CLOSE_EMPTY_BASKET = _("Why close an empty basket?");
14 var MSG_SAVE_BEFORE_PRINTING = _("You need to save the page before printing");
15 var MSG_REOPEN_BASKETGROUP = _("reopen basketgroup");
16 var MSG_FILE_DOWNLOAD_ERROR = _("Error downloading the file");
18 function submitForm(form) {
19 if (form.close.checked == true) {
20 var input = document.createElement("input");
21 input.setAttribute("type", "hidden");
22 input.setAttribute("name", "closed");
23 input.setAttribute("value", "1");
24 form.appendChild(input);
28 function closeandprint(bg){
29 if(document.location = '/cgi-bin/koha/acqui/basketgroup.pl?op=closeandprint&basketgroupid=' + bg ){
30 setTimeout("window.location.reload();", 3000);
32 alert(MSG_FILE_DOWNLOAD_ERROR);
36 $(document).ready(function() {
37 [% IF ( listclosed) %]
38 $("#basket_groups a[href='#closed']").tab("show");
40 $("#basket_groups a[href='#opened']").tab("show");
42 [% UNLESS ( grouping ) %]
43 $("table").dataTable($.extend(true, {}, dataTablesDefaults, {
45 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
48 "sPaginationType": "full"
51 grouped = $("#grouped").DataTable($.extend(true, {}, dataTablesDefaults, {
54 { 'sortable': false, 'targets': [ 'NoSort' ] }
58 "emptyTable": _("There are no baskets in this group")
61 ungrouped = $("#ungrouped").DataTable($.extend(true, {}, dataTablesDefaults, {
64 { 'sortable': false, 'targets': [ 'NoSort' ] }
68 "emptyTable": _("There are no ungrouped baskets")
73 $("#basketgroupcolumns").on("click", ".addtogroup", function(){
74 const row = $("#" + $(this).data("basketid") );
76 $(this).removeClass("addtogroup").addClass("removefromgroup").html("<i class=\"fa fa-trash-can\" aria-hidden=\"true\"></i> " + _("Remove") );
77 row.removeClass("ungrouped").addClass("grouped");
78 ungrouped.row( row ).remove().draw();
79 grouped.row.add( row ).draw();
83 $("#basketgroupcolumns").on("click", ".removefromgroup", function(){
84 const row = $("#" + $(this).data("basketid") );
86 $(this).removeClass("removefromgroup").addClass("addtogroup").html("<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> " + _("Add to group") );
87 $(this).removeClass("").addClass("");
88 row.removeClass("grouped").addClass("ungrouped");
89 grouped.row( row ).remove().draw();
90 ungrouped.row.add( row ).draw();
97 <body id="acq_basketgroup" class="acq">
98 [% WRAPPER 'header.inc' %]
99 [% INCLUDE 'acquisitions-search.inc' %]
102 [% WRAPPER 'sub-header.inc' %]
103 [% WRAPPER breadcrumbs %]
104 [% WRAPPER breadcrumb_item %]
105 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
107 [% IF ( grouping ) %]
108 [% WRAPPER breadcrumb_item %]
109 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
111 [% WRAPPER breadcrumb_item %]
112 <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]">Basket grouping</a>
114 [% WRAPPER breadcrumb_item bc_active= 1 %]
115 <span>Add basket group for [% booksellername | html %]</span>
118 [% WRAPPER breadcrumb_item %]
119 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
121 [% WRAPPER breadcrumb_item bc_active= 1 %]
122 <span>Basket grouping</span>
124 [% END # /IF grouping %]
125 [% END #/ WRAPPER breadcrumbs %]
126 [% END #/ WRAPPER sub-header.inc %]
128 <div class="main container-fluid">
130 <div class="col-sm-10 col-sm-push-2">
133 [% IF ( grouping ) %]
135 <div id="toolbar" class="btn-toolbar">
136 <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>
137 <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>
138 <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>
139 [% IF (ediaccount) %]
140 <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>
144 [% IF (name && closedbg) %]
145 <h1>Basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
147 <h1>Edit basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
149 <h1>Add basket group for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
151 <div id="basketgroupcolumns" class="row">
152 [% UNLESS (closedbg) %]
153 <div class="col-xs-6 col-xs-push-6">
155 <div class="workarea_alt" >
156 <h3>Ungrouped baskets</h3>
157 <div class="page-section">
158 <table id="ungrouped" class="basketgroup_baskets">
163 <th class="NoSort"></th>
168 [% FOREACH basket IN baskets %]
169 <tr class="ungrouped" id="b-[% basket.basketno | html %]">
171 <a href="basket.pl?basketno=[% basket.basketno | uri %]">
172 [% IF ( basket.basketname ) %]
173 [% basket.basketname | html %]
175 <span>No name, basketnumber: [% basket.basketno | html %]</span>
179 <td data-sort="[% basket.total | html %]">
180 [% basket.total | $Price %]
181 <input type="hidden" class="basket" name="basket" value="[% basket.basketno | html %]" />
184 <a class="addtogroup btn btn-default btn-xs" data-basketid="b-[% basket.basketno | html %]">
185 <i class="fa fa-plus" aria-hidden="true"></i> Add to group
193 </div><!--/.page-section -->
194 </div><!-- /#groups -->
195 </div><!-- /.col-xs-6 -->
199 [% IF ( closedbg ) %]
200 <div class="col-xs-12">
202 <div class="col-xs-6 col-xs-pull-6">
204 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post" id="groupingform" onsubmit="return submitForm(this)">
205 <fieldset id="various" class="brief">
207 [% UNLESS (closedbg) %]
209 <label for="basketgroupname">Basket group name:</label>
210 <input type="text" name="basketgroupname" id="basketgroupname" value="[% name | html %]" class="focus" />
213 <input type="hidden" name="basketgroupname" id="basketgroupname" value="[% name | html %]" />
216 [% UNLESS (closedbg) %]
217 <label for="billingplace">Billing place:</label>
218 <select name="billingplace" id="billingplace">
219 <option value="">--</option>
220 [% PROCESS options_for_libraries libraries => Branches.all( selected => billingplace ) %]
223 <span class="label">Billing place:</span>
224 <input name="billingplace" id="billingplace" type ="hidden" value="[% billingplace | html %]" />[% Branches.GetName( billingplace ) | html %]
227 [% UNLESS (closedbg) %]
229 <label for="deliveryplace">Delivery place:</label>
230 <select name="deliveryplace" id="deliveryplace">
231 <option value="">--</option>
232 [% PROCESS options_for_libraries libraries => Branches.all( selected => deliveryplace ) %]
239 <label for="freedeliveryplace">Delivery place:</label>
240 <textarea cols="26" rows="3" name="freedeliveryplace" id="freedeliveryplace">[% freedeliveryplace | html %]</textarea>
244 <span class="label">Delivery place:</span>
245 [% IF (freedeliveryplace) %]
246 <input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="[% freedeliveryplace | html %]" />[% freedeliveryplace | html %]
247 <input name="deliveryplace" id="deliveryplace" type ="hidden" value="" />
249 <input name="deliveryplace" id="deliveryplace" type ="hidden" value="[% deliveryplace | html %]" />[% Branches.GetName( deliveryplace ) | html %]
250 <input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="" />
255 [% UNLESS (closedbg) %]
256 <label for="deliverycomment">Delivery comment:</label>
257 <textarea cols="26" rows="3" name="deliverycomment" id="deliverycomment">[% deliverycomment | html %]</textarea>
259 <span class="label">Delivery comment:</span>[% deliverycomment | html %]
260 <input name="deliverycomment" id="deliverycomment" type="hidden" value = "[% deliverycomment | html %]" />
264 <h3>Baskets in this group:</h3>
265 <table id="grouped" class="basketgroup_baskets">
270 <th class="NoSort"></th>
274 [% FOREACH selectedbasket IN selectedbaskets %]
275 <tr id="b-[% selectedbasket.basketno | html %]">
277 <a href="basket.pl?basketno=[% selectedbasket.basketno | uri %]">
278 [% IF ( selectedbasket.basketname ) %]
279 [% selectedbasket.basketname | html %]
281 <span>No name, basketnumber: [% selectedbasket.basketno | html %]</span>
285 <td data-sort="[% selectedbasket.total | html %]">
286 [% selectedbasket.total | $Price %]
287 <input type="hidden" class="basket" name="basket" value="[% selectedbasket.basketno | html %]" />
290 [% IF ( closedbg ) %]
292 <a class="removefromgroup btn btn-default btn-xs" data-basketid="b-[% selectedbasket.basketno | html %]" id="addtogroup[% selectedbasket.basketno | html %]">
293 <i class="fa fa-trash-can" aria-hidden="true"></i> Remove
301 [% UNLESS (closedbg) %]
303 <li><label for="closedbg">Close basket group</label><input type="checkbox" id="closedbg" name="closedbg" /></li>
306 <input type="hidden" id="closedbg" name="closedbg" value ="1"/>
310 [% UNLESS (closedbg) %]
311 <fieldset class="action"><input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
312 [% IF ( basketgroupid ) %]
313 <input type="hidden" name="basketgroupid" value="[% basketgroupid | html %]" />
315 <input type="hidden" name="op" value="attachbasket" />
316 <input type="submit" class="btn btn-primary" value="Save" /> <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]" class="cancel">Cancel</a>
323 <div id="toolbar" class="btn-toolbar">
324 <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>
326 <h1>Basket grouping for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
327 [% IF (NoEDIMessage && Koha.Preference('EDIFACT')) %]<div><strong>No EDIFACT configuration for [% booksellername | html %]</strong></div>[% END %]
329 [% WRAPPER tabs id= "basket_groups" %]
330 [% WRAPPER tabs_nav %]
331 [% WRAPPER tab_item tabname= "opened" bt_active= 1 %] <span>Open</span> [% END %]
332 [% WRAPPER tab_item tabname= "closed" %] <span>Closed</span> [% END %]
334 [% WRAPPER tab_panels %]
335 [% WRAPPER tab_panel tabname="opened" bt_active= 1 %]
336 <table id="basket_group_opened">
341 <th>Billing place</th>
342 <th>Delivery place</th>
343 <th>Number of baskets</th>
348 [% FOREACH basketgroup IN basketgroups %]
349 [% UNLESS ( basketgroup.closed ) %]
351 <td>[% IF ( basketgroup.name ) %]
352 [% basketgroup.name | html %]
354 <span>Basket group no. [% basketgroup.id | html %]</span>
357 <td>[% basketgroup.id | html %]</td>
358 <td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
359 <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
360 <td>[% basketgroup.basketsqty | html %]</td>
362 <input type="button" onclick="closeandprint('[% basketgroup.id | html %]');" value="Close and export as PDF" />
363 <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>
364 [% UNLESS basketgroup.basketsqty %]
365 <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" class="btn btn-primary" value="Delete" /></form>
375 [% WRAPPER tab_panel tabname="closed" %]
376 <table id="basket_group_closed">
381 <th>Billing place</th>
382 <th>Delivery place</th>
383 <th>Number of baskets</th>
388 [% FOREACH basketgroup IN basketgroups %]
389 [% IF ( basketgroup.closed ) %]
392 [% IF ( basketgroup.name ) %]
393 [% basketgroup.name | html %]
395 <span>Basket group no. [% basketgroup.id | html %]</span>
398 <td>[% basketgroup.id | html %]</td>
399 <td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
400 <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
401 <td>[% basketgroup.basketsqty | html %]</td>
403 <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>
404 <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>
405 <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>
406 <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>
407 [% IF Koha.Preference('EDIFACT') %]
408 [% IF (ediaccount) %]
409 <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="submit" class="btn btn-primary" value="Generate EDIFACT order" /></form>
411 <div>No EDIFACT configuration for [% booksellername | html %]</div>
421 [% END # /WRAPPER tab_panels %]
422 [% END # /#basket_groups %]
425 </div> <!-- /.col-sm-10.col-sm-push-2 -->
427 <div class="col-sm-2 col-sm-pull-10">
429 [% IF ( booksellerid ) %]
430 [% INCLUDE 'vendor-menu.inc' %]
432 [% INCLUDE 'acquisitions-menu.inc' %]
435 </div> <!-- /.row -->
436 [% INCLUDE 'intranet-bottom.inc' %]