5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Basket grouping for [% booksellername | html %] › Koha</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% INCLUDE 'datatables.inc' %]
11 var MSG_CONFIRM_CLOSE_BASKETGROUP = _("Are you sure you want to close this basketgroup?");
12 var MSG_CLOSE_EMPTY_BASKET = _("Why close an empty basket?");
13 var MSG_SAVE_BEFORE_PRINTING = _("You need to save the page before printing");
14 var MSG_REOPEN_BASKETGROUP = _("reopen basketgroup");
15 var MSG_FILE_DOWNLOAD_ERROR = _("Error downloading the file");
17 function submitForm(form) {
18 if (form.close.checked == true) {
19 var input = document.createElement("input");
20 input.setAttribute("type", "hidden");
21 input.setAttribute("name", "closed");
22 input.setAttribute("value", "1");
23 form.appendChild(input);
27 $(document).ready(function() {
28 [% IF ( listclosed) %]
29 $("#basket_groups a[href='#closed']").tab("show");
31 $("#basket_groups a[href='#opened']").tab("show");
33 [% UNLESS ( grouping ) %]
34 $("table").dataTable($.extend(true, {}, dataTablesDefaults, {
36 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
39 "sPaginationType": "full"
42 grouped = $("#grouped").DataTable($.extend(true, {}, dataTablesDefaults, {
45 { 'sortable': false, 'targets': [ 'NoSort' ] }
49 "emptyTable": _("There are no baskets in this group")
52 ungrouped = $("#ungrouped").DataTable($.extend(true, {}, dataTablesDefaults, {
55 { 'sortable': false, 'targets': [ 'NoSort' ] }
59 "emptyTable": _("There are no ungrouped baskets")
64 $("#basketgroupcolumns").on("click", ".addtogroup", function(){
65 const row = $("#" + $(this).data("basketid") );
67 $(this).removeClass("addtogroup").addClass("removefromgroup").html("<i class=\"fa fa-trash\" aria-hidden=\"true\"></i> " + _("Remove") );
68 row.removeClass("ungrouped").addClass("grouped");
69 ungrouped.row( row ).remove().draw();
70 grouped.row.add( row ).draw();
74 $("#basketgroupcolumns").on("click", ".removefromgroup", function(){
75 const row = $("#" + $(this).data("basketid") );
77 $(this).removeClass("removefromgroup").addClass("addtogroup").html("<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> " + _("Add to group") );
78 $(this).removeClass("").addClass("");
79 row.removeClass("grouped").addClass("ungrouped");
80 grouped.row( row ).remove().draw();
81 ungrouped.row.add( row ).draw();
88 <body id="acq_basketgroup" class="acq">
89 [% WRAPPER 'header.inc' %]
90 [% INCLUDE 'acquisitions-search.inc' %]
93 [% WRAPPER 'sub-header.inc' %]
94 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
97 <a href="/cgi-bin/koha/mainpage.pl"><i class="fa fa-home"></i></a>
100 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
103 [% IF ( grouping ) %]
105 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
108 <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]">Basket grouping</a>
111 <a href="#" aria-current="page">
112 Add basket group for [% booksellername | html %]
118 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
121 <a href="#" aria-current="page">
131 <div class="main container-fluid">
133 <div class="col-sm-10 col-sm-push-2">
136 [% IF ( grouping ) %]
138 <div id="toolbar" class="btn-toolbar">
139 <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>
140 <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>
141 <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>
142 [% IF (ediaccount) %]
143 <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>
147 [% IF (name && closedbg) %]
148 <h1>Basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
150 <h1>Edit basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
152 <h1>Add basket group for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
154 <div id="basketgroupcolumns" class="row">
155 [% UNLESS (closedbg) %]
156 <div class="col-xs-6 col-xs-push-6">
159 <div class="workarea_alt" >
160 <h3>Ungrouped baskets</h3>
161 <table id="ungrouped" class="basketgroup_baskets">
166 <th class="NoSort"></th>
171 [% FOREACH basket IN baskets %]
172 <tr class="ungrouped" id="b-[% basket.basketno | html %]">
174 <a href="basket.pl?basketno=[% basket.basketno | uri %]">
175 [% IF ( basket.basketname ) %]
176 [% basket.basketname | html %]
178 <span>No name, basketnumber: [% basket.basketno | html %]</span>
182 <td data-sort="[% basket.total | html %]">
183 [% basket.total | $Price %]
184 <input type="hidden" class="basket" name="basket" value="[% basket.basketno | html %]" />
187 <a class="addtogroup btn btn-default btn-xs" data-basketid="b-[% basket.basketno | html %]">
188 <i class="fa fa-plus" aria-hidden="true"></i> Add to group
201 [% IF ( closedbg ) %]
202 <div class="col-xs-12">
204 <div class="col-xs-6 col-xs-pull-6">
206 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post" id="groupingform" onsubmit="return submitForm(this)">
207 <fieldset id="various" class="brief">
209 [% UNLESS (closedbg) %]
211 <label for="basketgroupname">Basket group name:</label>
212 <input type="text" name="basketgroupname" id="basketgroupname" value="[% name | html %]" class="focus" />
215 <input type="hidden" name="basketgroupname" id="basketgroupname" value="[% name | html %]" />
218 [% UNLESS (closedbg) %]
219 <label for="billingplace">Billing place:</label>
220 <select name="billingplace" id="billingplace">
221 <option value="">--</option>
222 [% PROCESS options_for_libraries libraries => Branches.all( selected => billingplace ) %]
225 <span class="label">Billing place:</span>
226 <input name="billingplace" id="billingplace" type ="hidden" value="[% billingplace | html %]" />[% Branches.GetName( billingplace ) | html %]
229 [% UNLESS (closedbg) %]
231 <label for="deliveryplace">Delivery place:</label>
232 <select name="deliveryplace" id="deliveryplace">
233 <option value="">--</option>
234 [% 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" aria-hidden="true"></i> Remove
302 [% UNLESS (closedbg) %]
303 <li><label><input type="checkbox" id="closedbg" name="closedbg" /> Close basket group</label></li>
305 <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" 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) %]<div><strong>No EDIFACT configuration for [% booksellername | html %]</strong></div>[% END %]
328 <div id="basket_groups" class="toptabs">
329 <ul class="nav nav-tabs" role="tablist">
330 <li role="presentation"><a href="#opened" aria-controls="opened" role="tab" data-toggle="tab">Open</a></li>
331 <li role="presentation"><a href="#closed" aria-controls="closed" role="tab" data-toggle="tab">Closed</a></li>
333 <div class="tab-content">
334 <div role="tabpanel" class="tab-pane active" id="opened">
335 <table id="basket_group_opened">
340 <th>Billing place</th>
341 <th>Delivery place</th>
342 <th>Number of baskets</th>
347 [% FOREACH basketgroup IN basketgroups %]
348 [% UNLESS ( basketgroup.closed ) %]
350 <td>[% IF ( basketgroup.name ) %]
351 [% basketgroup.name | html %]
353 <span>Basket group no. [% basketgroup.id | html %]</span>
356 <td>[% basketgroup.id | html %]</td>
357 <td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
358 <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
359 <td>[% basketgroup.basketsqty | html %]</td>
361 <input type="button" onclick="closeandprint('[% basketgroup.id | html %]');" value="Close and export as PDF" />
362 <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" value="Edit" /></form>
363 [% UNLESS basketgroup.basketsqty %]
364 <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" value="Delete" /></form>
373 <div role="tabpanel" class="tab-pane" id="closed">
374 <table id="basket_group_closed">
379 <th>Billing place</th>
380 <th>Delivery place</th>
381 <th>Number of baskets</th>
386 [% FOREACH basketgroup IN basketgroups %]
387 [% IF ( basketgroup.closed ) %]
390 [% IF ( basketgroup.name ) %]
391 [% basketgroup.name | html %]
393 <span>Basket group no. [% basketgroup.id | html %]</span>
396 <td>[% basketgroup.id | html %]</td>
397 <td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
398 <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
399 <td>[% basketgroup.basketsqty | html %]</td>
401 <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" value="View" /></form>
402 <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" value="Reopen" /></form>
403 <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" value="Export as PDF" /></form>
404 <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" value="Export as CSV" /></form>
405 [% IF (ediaccount) %]
406 <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" value="Generate EDIFACT order" /></form>
408 <div>No EDIFACT configuration for [% booksellername | html %]</div>
421 </div> <!-- /.col-sm-10.col-sm-push-2 -->
423 <div class="col-sm-2 col-sm-pull-10">
425 [% IF ( booksellerid ) %]
426 [% INCLUDE 'vendor-menu.inc' %]
428 [% INCLUDE 'acquisitions-menu.inc' %]
431 </div> <!-- /.row -->
432 [% INCLUDE 'intranet-bottom.inc' %]