6 [% PROCESS 'i18n.inc' %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% FILTER collapse %]
9 [% tx("Basket grouping for '{vendor}'", { vendor = booksellername }) %] ›
10 [% t("Koha") | html %]
12 [% INCLUDE 'doc-head-close.inc' %]
13 [% INCLUDE 'datatables.inc' %]
16 var MSG_CONFIRM_CLOSE_BASKETGROUP = _("Are you sure you want to close this basketgroup?");
17 var MSG_CLOSE_EMPTY_BASKET = _("Why close an empty basket?");
18 var MSG_SAVE_BEFORE_PRINTING = _("You need to save the page before printing");
19 var MSG_REOPEN_BASKETGROUP = _("reopen basketgroup");
20 var MSG_FILE_DOWNLOAD_ERROR = _("Error downloading the file");
22 function submitForm(form) {
23 if (form.close.checked == true) {
24 var input = document.createElement("input");
25 input.setAttribute("type", "hidden");
26 input.setAttribute("name", "closed");
27 input.setAttribute("value", "1");
28 form.appendChild(input);
32 function closeandprint(bg){
33 if(document.location = '/cgi-bin/koha/acqui/basketgroup.pl?op=closeandprint&basketgroupid=' + bg ){
34 setTimeout("window.location.reload();", 3000);
36 alert(MSG_FILE_DOWNLOAD_ERROR);
40 $(document).ready(function() {
41 [% IF ( listclosed) %]
42 $("#basket_groups a[href='#closed']").tab("show");
44 $("#basket_groups a[href='#opened']").tab("show");
46 [% UNLESS ( grouping ) %]
47 $("table").dataTable($.extend(true, {}, dataTablesDefaults, {
49 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
52 "sPaginationType": "full"
55 grouped = $("#grouped").DataTable($.extend(true, {}, dataTablesDefaults, {
58 { 'sortable': false, 'targets': [ 'NoSort' ] }
62 "emptyTable": _("There are no baskets in this group")
65 ungrouped = $("#ungrouped").DataTable($.extend(true, {}, dataTablesDefaults, {
68 { 'sortable': false, 'targets': [ 'NoSort' ] }
72 "emptyTable": _("There are no ungrouped baskets")
77 $("#basketgroupcolumns").on("click", ".addtogroup", function(){
78 const row = $("#" + $(this).data("basketid") );
80 $(this).removeClass("addtogroup").addClass("removefromgroup").html("<i class=\"fa fa-trash-can\" aria-hidden=\"true\"></i> " + _("Remove") );
81 row.removeClass("ungrouped").addClass("grouped");
82 ungrouped.row( row ).remove().draw();
83 grouped.row.add( row ).draw();
87 $("#basketgroupcolumns").on("click", ".removefromgroup", function(){
88 const row = $("#" + $(this).data("basketid") );
90 $(this).removeClass("removefromgroup").addClass("addtogroup").html("<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> " + _("Add to group") );
91 $(this).removeClass("").addClass("");
92 row.removeClass("grouped").addClass("ungrouped");
93 grouped.row( row ).remove().draw();
94 ungrouped.row.add( row ).draw();
101 <body id="acq_basketgroup" class="acq">
102 [% WRAPPER 'header.inc' %]
103 [% INCLUDE 'acquisitions-search.inc' %]
106 [% WRAPPER 'sub-header.inc' %]
107 [% WRAPPER breadcrumbs %]
108 [% WRAPPER breadcrumb_item %]
109 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
111 [% IF ( grouping ) %]
112 [% WRAPPER breadcrumb_item %]
113 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
115 [% WRAPPER breadcrumb_item %]
116 <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]">Basket grouping</a>
118 [% WRAPPER breadcrumb_item bc_active= 1 %]
119 <span>Add basket group for [% booksellername | html %]</span>
122 [% WRAPPER breadcrumb_item %]
123 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
125 [% WRAPPER breadcrumb_item bc_active= 1 %]
126 <span>Basket grouping</span>
128 [% END # /IF grouping %]
129 [% END #/ WRAPPER breadcrumbs %]
130 [% END #/ WRAPPER sub-header.inc %]
132 <div class="main container-fluid">
134 <div class="col-sm-10 col-sm-push-2">
137 [% IF ( grouping ) %]
139 <div id="toolbar" class="btn-toolbar">
140 <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>
141 <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>
142 <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>
143 [% IF (ediaccount) %]
144 <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>
148 [% IF (name && closedbg) %]
149 <h1>Basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
151 <h1>Edit basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
153 <h1>Add basket group for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
155 <div id="basketgroupcolumns" class="row">
156 [% UNLESS (closedbg) %]
157 <div class="col-xs-6 col-xs-push-6">
159 <div class="workarea_alt" >
160 <h3>Ungrouped baskets</h3>
161 <div class="page-section">
162 <table id="ungrouped" class="basketgroup_baskets">
167 <th class="NoSort"></th>
172 [% FOREACH basket IN baskets %]
173 <tr class="ungrouped" id="b-[% basket.basketno | html %]">
175 <a href="basket.pl?basketno=[% basket.basketno | uri %]">
176 [% IF ( basket.basketname ) %]
177 [% basket.basketname | html %]
179 <span>No name, basketnumber: [% basket.basketno | html %]</span>
183 <td data-sort="[% basket.total | html %]">
184 [% basket.total | $Price %]
185 <input type="hidden" class="basket" name="basket" value="[% basket.basketno | html %]" />
188 <a class="addtogroup btn btn-default btn-xs" data-basketid="b-[% basket.basketno | html %]">
189 <i class="fa fa-plus" aria-hidden="true"></i> Add to group
197 </div><!--/.page-section -->
198 </div><!-- /#groups -->
199 </div><!-- /.col-xs-6 -->
203 [% IF ( closedbg ) %]
204 <div class="col-xs-12">
206 <div class="col-xs-6 col-xs-pull-6">
208 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post" id="groupingform" onsubmit="return submitForm(this)">
209 <fieldset id="various" class="brief">
211 [% UNLESS (closedbg) %]
213 <label for="basketgroupname">Basket group name:</label>
214 <input type="text" name="basketgroupname" id="basketgroupname" value="[% name | html %]" class="focus" />
217 <input type="hidden" name="basketgroupname" id="basketgroupname" value="[% name | html %]" />
220 [% UNLESS (closedbg) %]
221 <label for="billingplace">Billing place:</label>
222 <select name="billingplace" id="billingplace">
223 <option value="">--</option>
224 [% PROCESS options_for_libraries libraries => Branches.all( selected => billingplace ) %]
227 <span class="label">Billing place:</span>
228 <input name="billingplace" id="billingplace" type ="hidden" value="[% billingplace | html %]" />[% Branches.GetName( billingplace ) | html %]
231 [% UNLESS (closedbg) %]
233 <label for="deliveryplace">Delivery place:</label>
234 <select name="deliveryplace" id="deliveryplace">
235 <option value="">--</option>
236 [% PROCESS options_for_libraries libraries => Branches.all( selected => deliveryplace ) %]
243 <label for="freedeliveryplace">Delivery place:</label>
244 <textarea cols="26" rows="3" name="freedeliveryplace" id="freedeliveryplace">[% freedeliveryplace | html %]</textarea>
248 <span class="label">Delivery place:</span>
249 [% IF (freedeliveryplace) %]
250 <input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="[% freedeliveryplace | html %]" />[% freedeliveryplace | html %]
251 <input name="deliveryplace" id="deliveryplace" type ="hidden" value="" />
253 <input name="deliveryplace" id="deliveryplace" type ="hidden" value="[% deliveryplace | html %]" />[% Branches.GetName( deliveryplace ) | html %]
254 <input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="" />
259 [% UNLESS (closedbg) %]
260 <label for="deliverycomment">Delivery comment:</label>
261 <textarea cols="26" rows="3" name="deliverycomment" id="deliverycomment">[% deliverycomment | html %]</textarea>
263 <span class="label">Delivery comment:</span>[% deliverycomment | html %]
264 <input name="deliverycomment" id="deliverycomment" type="hidden" value = "[% deliverycomment | html %]" />
268 <h3>Baskets in this group:</h3>
269 <table id="grouped" class="basketgroup_baskets">
274 <th class="NoSort"></th>
278 [% FOREACH selectedbasket IN selectedbaskets %]
279 <tr id="b-[% selectedbasket.basketno | html %]">
281 <a href="basket.pl?basketno=[% selectedbasket.basketno | uri %]">
282 [% IF ( selectedbasket.basketname ) %]
283 [% selectedbasket.basketname | html %]
285 <span>No name, basketnumber: [% selectedbasket.basketno | html %]</span>
289 <td data-sort="[% selectedbasket.total | html %]">
290 [% selectedbasket.total | $Price %]
291 <input type="hidden" class="basket" name="basket" value="[% selectedbasket.basketno | html %]" />
294 [% IF ( closedbg ) %]
296 <a class="removefromgroup btn btn-default btn-xs" data-basketid="b-[% selectedbasket.basketno | html %]" id="addtogroup[% selectedbasket.basketno | html %]">
297 <i class="fa fa-trash-can" aria-hidden="true"></i> Remove
305 [% UNLESS (closedbg) %]
307 <li><label for="closedbg">Close basket group</label><input type="checkbox" id="closedbg" name="closedbg" /></li>
310 <input type="hidden" id="closedbg" name="closedbg" value ="1"/>
314 [% UNLESS (closedbg) %]
315 <fieldset class="action"><input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
316 [% IF ( basketgroupid ) %]
317 <input type="hidden" name="basketgroupid" value="[% basketgroupid | html %]" />
319 <input type="hidden" name="op" value="attachbasket" />
320 <input type="submit" class="btn btn-primary" value="Save" /> <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]" class="cancel">Cancel</a>
327 <div id="toolbar" class="btn-toolbar">
328 <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>
330 <h1>Basket grouping for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
331 [% IF (NoEDIMessage && Koha.Preference('EDIFACT')) %]<div><strong>No EDIFACT configuration for [% booksellername | html %]</strong></div>[% END %]
333 [% WRAPPER tabs id= "basket_groups" %]
334 [% WRAPPER tabs_nav %]
335 [% WRAPPER tab_item tabname= "opened" bt_active= 1 %] <span>Open</span> [% END %]
336 [% WRAPPER tab_item tabname= "closed" %] <span>Closed</span> [% END %]
338 [% WRAPPER tab_panels %]
339 [% WRAPPER tab_panel tabname="opened" bt_active= 1 %]
340 <table id="basket_group_opened">
345 <th>Billing place</th>
346 <th>Delivery place</th>
347 <th>Number of baskets</th>
352 [% FOREACH basketgroup IN basketgroups %]
353 [% UNLESS ( basketgroup.closed ) %]
355 <td>[% IF ( basketgroup.name ) %]
356 [% basketgroup.name | html %]
358 <span>Basket group no. [% basketgroup.id | html %]</span>
361 <td>[% basketgroup.id | html %]</td>
362 <td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
363 <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
364 <td>[% basketgroup.basketsqty | html %]</td>
366 <input type="button" onclick="closeandprint('[% basketgroup.id | html %]');" value="Close and export as PDF" />
367 <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>
368 [% UNLESS basketgroup.basketsqty %]
369 <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>
379 [% WRAPPER tab_panel tabname="closed" %]
380 <table id="basket_group_closed">
385 <th>Billing place</th>
386 <th>Delivery place</th>
387 <th>Number of baskets</th>
392 [% FOREACH basketgroup IN basketgroups %]
393 [% IF ( basketgroup.closed ) %]
396 [% IF ( basketgroup.name ) %]
397 [% basketgroup.name | html %]
399 <span>Basket group no. [% basketgroup.id | html %]</span>
402 <td>[% basketgroup.id | html %]</td>
403 <td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
404 <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
405 <td>[% basketgroup.basketsqty | html %]</td>
407 <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>
408 <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>
409 <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>
410 <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>
411 [% IF Koha.Preference('EDIFACT') %]
412 [% IF (ediaccount) %]
413 <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>
415 <div>No EDIFACT configuration for [% booksellername | html %]</div>
425 [% END # /WRAPPER tab_panels %]
426 [% END # /#basket_groups %]
429 </div> <!-- /.col-sm-10.col-sm-push-2 -->
431 <div class="col-sm-2 col-sm-pull-10">
433 [% IF ( booksellerid ) %]
434 [% INCLUDE 'vendor-menu.inc' %]
436 [% INCLUDE 'acquisitions-menu.inc' %]
439 </div> <!-- /.row -->
440 [% INCLUDE 'intranet-bottom.inc' %]