Bug 20966: Add column configuration to table of orders in a basket
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / basket.tt
index ec4ed9a..f7048b2 100644 (file)
@@ -2,7 +2,7 @@
 [% USE Asset %]
 [% BLOCK csv_export %]
     <div class="btn-group">
-        <a id="exportbutton" class="btn btn-default btn-sm" href="[% script_name | html %]?op=export&amp;basketno=[% basketno | html %]&amp;booksellerid=[% booksellerid | html %]"><i class="fa fa-download"></i> Export as CSV</a>
+        <a id="exportbutton" class="btn btn-default btn-sm" href="[% script_name | url %]?op=export&amp;basketno=[% basketno | uri %]&amp;booksellerid=[% booksellerid | uri %]"><i class="fa fa-download"></i> Export as CSV</a>
       <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
       <ul class="dropdown-menu" id="export-csv-menu">
           <li><a href="#">Default</a></li>
@@ -18,6 +18,7 @@
 [% USE Branches %]
 [% USE Price %]
 [% USE AuthorisedValues %]
+[% USE ColumnsSettings %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Acquisitions &rsaquo; [% UNLESS ( basketno ) %]New [% END %]Basket [% basketname | html %] ([% basketno | html %]) for [% booksellername | html %]</title>
@@ -36,7 +37,7 @@
 <div id="breadcrumbs">
     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
     <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo;
-    <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">[% booksellername | html %]</a> &rsaquo;
+    <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a> &rsaquo;
     [% UNLESS ( basketno ) %][% IF ( delete_confirmed ) %]Deleted [% ELSE %]New [% END %][% END %]Basket [% basketname | html %] [% IF ( basketno ) %]([% basketno | html %])[% END %] for [% booksellername | html %]
 </div>
 
                     [% IF active %]
                         <div class="btn-group"><a href="#addtoBasket" role="button" class="btn btn-default btn-sm" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a></div>
                     [% END %]
-                    <div class="btn-group"><a href="basketheader.pl?booksellerid=[% booksellerid | html %]&amp;basketno=[% basketno | html %]&amp;op=add_form" class="btn btn-default btn-sm" id="basketheadbutton"><i class="fa fa-pencil"></i> Edit basket</a></div>
+                    <div class="btn-group"><a href="basketheader.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]&amp;op=add_form" class="btn btn-default btn-sm" id="basketheadbutton"><i class="fa fa-pencil"></i> Edit basket</a></div>
                     [%# FIXME This action should not be available for everyone %]
                     <div class="btn-group"><a href="#deleteBasketModal" role="button" class="btn btn-default btn-sm" data-toggle="modal" id="delbasketbutton"><i class="fa fa-trash"></i> Delete this basket</a></div>
                    [% IF ( unclosable ) %]
                     [% ELSIF ( uncertainprices ) %]
-                        <div class="btn-group"><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% booksellerid | html %]&amp;owner=1" class="btn btn-default btn-sm" id="uncertpricesbutton"><i class="fa fa-usd"></i> Uncertain prices</a></div>
+                        <div class="btn-group"><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% booksellerid | uri %]&amp;owner=1" class="btn btn-default btn-sm" id="uncertpricesbutton"><i class="fa fa-usd"></i> Uncertain prices</a></div>
                         <div title="Can not close baskets that have items with uncertain prices in them." class="btn-group">
                             <a href="" class="btn btn-default btn-sm disabled" id="closebutton"><i class="fa fa-times-circle"></i> Close this basket</a>
                         </div>
                     [% ELSE %]
                         <div class="btn-group">
-                            <a href="/cgi-bin/koha/acqui/basket.pl?op=close&amp;basketno=[% basketno | html %]&amp;booksellerid=[% booksellerid | html %]" class="btn btn-default btn-sm" id="closebutton"><i class="fa fa-times-circle"></i> Close this basket</a>
+                            <a href="/cgi-bin/koha/acqui/basket.pl?op=close&amp;basketno=[% basketno | uri %]&amp;booksellerid=[% booksellerid | uri %]" class="btn btn-default btn-sm" id="closebutton"><i class="fa fa-times-circle"></i> Close this basket</a>
                         </div>
                     [% END %]
 
                     [% PROCESS csv_export %]
 
                         [% IF ediaccount %]
-                        <div class="btn-group"><a href="/cgi-bin/koha/acqui/edi_ean.pl?op=ediorder&amp;basketno=[% basketno | html %]&amp;booksellerid=[% booksellerid | html %]" class="btn btn-default btn-sm" id="ediorderbutton"><i class="fa fa-download"></i> Create EDIFACT order</a></div>
+                        <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 btn-sm" id="ediorderbutton"><i class="fa fa-download"></i> Create EDIFACT order</a></div>
                         [% END %]
 
                         [% IF ( active && books_loop ) %]
                     <p><strong>The following records could not be deleted:</strong></p>
                     <ul>
                     [% FOREACH cannotdelbiblio IN cannotdelbiblios %]
-                        <li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% cannotdelbiblio.biblionumber | html %]">[% cannotdelbiblio.title | html %]</a> by [% cannotdelbiblio.author | html %]:
+                        <li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% cannotdelbiblio.biblionumber | uri %]">[% cannotdelbiblio.title | html %]</a> by [% cannotdelbiblio.author | html %]:
                             <ul>
                             [% IF (cannotdelbiblio.itemcount) %]<li>[% cannotdelbiblio.itemcount | html %] item(s) attached.</li>[% END %]
                             [% IF (cannotdelbiblio.subscriptions) %]<li>[% cannotdelbiblio.subscriptions | html %] subscription(s) attached.</li>[% END %]
                 </div>
                 <a href="booksellers.pl">Click here to go back to booksellers page</a>
             [% ELSE %]
-                <a href="/cgi-bin/koha/acqui/booksellers.pl?booksellerid=[% booksellerid | html %]" 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>
+                <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>
             [% END %]
         [% ELSE %]
 
                 [% END %]
             </div>
         [% END %]
-        <h1>[% UNLESS ( basketno ) %]New [% END %]Basket [% basketname | html %] ([% basketno | html %]) for <a href="supplier.pl?booksellerid=[% booksellerid | html %]">[% booksellername | html %]</a></h1>
+        <h1>[% UNLESS ( basketno ) %]New [% END %]Basket [% basketname | html %] ([% basketno | html %]) for <a href="supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
         [% IF ( basketno ) %]
             <div id="acqui_basket_summary" class="yui-g">
                 <div class="rows">
                 [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote | html %]</li>[% END %]
                 [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote | html %]</li>[% END %]
                 [% IF ( basketcontractno ) %]
-                    <li><span class="label">Contract name:</span> <a href="../admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno | html %]&amp;booksellerid=[% booksellerid | html %]">[% basketcontractname | html %]</a></li>
+                    <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>
                 [% END %]
                 [% IF deliveryplace %]<li><span class="label">Delivery place:</span> [% Branches.GetName( deliveryplace ) | html %]</li>[% END %]
                 [% IF billingplace %]<li><span class="label">Billing place:</span> [% Branches.GetName( billingplace ) | html %]</li>[% END %]
                         <span class="label">Managed by:</span>
                         <div style="float:left">
                             <ul id="users_names" style="padding-left:0">
-                              [% FOREACH user IN users %]
-                                <li id="user_[% user.borrowernumber | html %]">
-                                    [% user.firstname | html %] [% user.surname | html %]
-                                    <a href="#" data-borrowernumber="[% user.borrowernumber | html %]" class="del_user"><i class="fa fa-trash"></i> Delete user</a>
+                                [% FOREACH user IN users %]
+                                    <li id="user_[% user.borrowernumber | html %]">
+                                        [% user.firstname | html %] [% user.surname | html %]
+                                        <a href="#" data-borrowernumber="[% user.borrowernumber | html %]" class="del_user"><i class="fa fa-trash"></i> Delete user</a>
+                                    </li>
+                                [% END %]
+                                <li>
+                                    <a href="#" id="add_user"><i class="fa fa-plus"></i> Add user</a>
+                                </li>
+                                <li id="add_user_submit" style="display:none;">
+                                    <button type="submit" class="btn btn-default btn-xs">Save changes</button>
                                 </li>
-                              [% END %]
                             </ul>
-                            <input type="hidden" id="basketno" name="basketno" value="[% basketno | html %]" />
-                            <input type="hidden" id="users_ids" name="users_ids" value="[% users_ids | html %]" />
-                            <input type="hidden" id="op" name="op" value="mod_users" />
-                            <input type="button" id="add_user" value="Add user" />
-                            <input type="submit" value="Save changes" />
                         </div>
+                        <input type="hidden" id="basketno" name="basketno" value="[% basketno | html %]" />
+                        <input type="hidden" id="users_ids" name="users_ids" value="[% users_ids | html %]" />
+                        <input type="hidden" id="op" name="op" value="mod_users" />
                     </form>
+
                 </li>
                 <li id="branch">
-                    <span class="label">Library:</span>
+                    <span class="label">Managing library:</span>
                     [% IF basketbranchcode %]
                         [% Branches.GetName( basketbranchcode ) | html %]
+                        <a href="#" id="set_managing_library"><i class="fa fa-pencil"></i> Change library</a>
                     [% ELSE %]
                         No library
-                    [% END %]
-                    [% IF branches_loop.size %]
-                        <form action="" method="post">
-                            <select id="branch" name="branch">
-                                <option value="">(no library)</option>
-                                [% FOREACH branch IN branches_loop %]
-                                    [% IF (branch.selected) %]
-                                        <option selected="selected" value="[% branch.branchcode | html %]"> [% branch.branchname | html %]</option>
-                                    [% ELSE %]
-                                        <option value="[% branch.branchcode | html %]"> [% branch.branchname | html %]</option>
-                                    [% END %]
-                                [% END %]
-                            </select>
-                            <input type="hidden" id="basketno" name="basketno" value="[% basketno | html %]" />
-                            <input type="hidden" id="op" name="op" value="mod_branch" />
-                            <input type="submit" value="Change" />
-                        </form>
+                        <a href="#" id="set_managing_library"><i class="fa fa-pencil"></i> Set library</a>
                     [% END %]
                 </li>
-                [% IF ( creationdate ) %]<li><span class="label">Opened on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
-                [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>[% END %]
-                [% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates | html %]</li>[% END %]
-                <li><span class="label">Orders are standing:</span> [% IF is_standing %]Yes[% ELSE %]No[% END %]</li>
-
-                [% IF basket.create_items %]
-                    <li>
-                        <span class="label">Create items when:</span>
-                        [% SWITCH basket.create_items %]
-                            [% CASE 'receiving' %]Receiving items
-                            [% CASE 'cataloguing' %]Cataloguing items
-                            [% CASE %]Placing orders
-                        [% END %]
+                [% IF branches_loop.size %]
+                    <li id="managing_library_entry" style="display:none;">
+                        <span class="label">&nbsp;</span>
+                        <div style="float:left">
+                            <form action="" method="post">
+                                <select id="select_managing_library" name="branch">
+                                    <option value="">(no library)</option>
+                                    [% FOREACH branch IN branches_loop %]
+                                        [% IF ( basketbranchcode == branch.branchcode ) %]
+                                            <option selected="selected" value="[% branch.branchcode | html %]"> [% branch.branchname | html %]</option>
+                                        [% ELSE %]
+                                            <option value="[% branch.branchcode | html %]"> [% branch.branchname | html %]</option>
+                                        [% END %]
+                                    [% END %]
+                                </select>
+                                <a id="library_entry_cancel" href="#" class="cancel">Cancel</a>
+                                <input type="hidden" id="basketno" name="basketno" value="[% basketno | html %]" />
+                                <input type="hidden" id="op" name="op" value="mod_branch" />
+                            </form>
+                        </div>
                     </li>
                 [% END %]
 
                 </ol>
                 </div>
-                [% IF ( closedate ) %]
+
                 <div class="yui-u">
-                    [% IF ( CAN_user_acquisition_group_manage ) %]
-                    <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
-                    [% END %]
+                    <ol>
+                        [% IF ( creationdate ) %]
+                            <li><span class="label">Opened on:</span>  [% creationdate | $KohaDates %]</li>
+                        [% END %]
+                        [% IF ( closedate ) %]
+                            <li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>
+                        [% END %]
+                        [% IF ( estimateddeliverydate ) %]
+                            <li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates %]</li>
+                        [% END %]
+                        <li><span class="label">Orders are standing:</span> [% IF is_standing %]Yes[% ELSE %]No[% END %]</li>
+
+                        [% IF basket.create_items %]
+                            <li>
+                                <span class="label">Create items when:</span>
+                                [% SWITCH basket.create_items %]
+                                    [% CASE 'receiving' %]Receiving items
+                                    [% CASE 'cataloguing' %]Cataloguing items
+                                    [% CASE %]Placing orders
+                                [% END %]
+                            </li>
+                        [% END %]
+                    </ol>
+
+                    [% IF ( closedate ) %]
                         <ol>
-                        <li>
-                          <span class="label">Basket group:</span>
-                          [% IF basketgroup.id and not basketgroup.name %]
-                            [% SET basketgroup.name = "Basket group no. " _ basketgroup.id %]
-                          [% END %]
-                          [% IF basketgroup.closed %]
-                              [% IF ( CAN_user_acquisition_group_manage ) %]
-                                  <a href="basketgroup.pl?op=add&booksellerid=[% booksellerid | html %]&basketgroupid=[% basketgroup.id | html %]" title="basketgroup">[% basketgroup.name | html %] (closed)</a>
-                              [% ELSE %]
-                                  [% basketgroup.name | html %] (closed)
-                              [% END %]
-                          [% ELSIF ( ! CAN_user_acquisition_group_manage ) %]
-                            [%- IF basketgroup.id -%]
+                            <li>
+                                <span class="label">Basket group:</span>
+                                [% IF basketgroup.id and not basketgroup.name %]
+                                    [% SET basketgroup.name = "Basket group no. " _ basketgroup.id %]
+                                [% END %]
+
+                                [% IF basketgroup.closed %]
+                                    [% IF ( CAN_user_acquisition_group_manage ) %]
+                                        <a href="basketgroup.pl?op=add&booksellerid=[% booksellerid | uri %]&basketgroupid=[% basketgroup.id | uri %]" title="basketgroup">[% basketgroup.name | html %] (closed)</a>
+                                    [% ELSE %]
+                                        [% basketgroup.name | html %] (closed)
+                                    [% END %]
+                                [% ELSIF ( ! CAN_user_acquisition_group_manage ) %]
+                                    [%- IF basketgroup.id -%]
                                 [% basketgroup.name | html %]
-                            [%- ELSE -%]
-                                No group
-                            [%- END -%]
-                          [% ELSE %]
-                            <select id="basketgroupid" name="basketgroupid">
-                              <option value="">No group</option>
-                              [% FOREACH bg IN basketgroups %]
-                                [% IF ( bg.default ) %]
-                                    <option value="[% bg.id | html %]" selected="selected">[% bg.name | html %]</option>
+                                    [%- ELSE -%]
+                                        No group
+                                    [%- END -%]
                                 [% ELSE %]
-                                  [% UNLESS bg.closed %]
-                                    <option value="[% bg.id | html %]">[% bg.name | html %]</option>
-                                  [% ELSE %]
-                                    <option value="[% bg.id | html %]" disabled="disabled">[% bg.name | html %] (closed)</option>
-                                  [% END %]
+                                    [% IF ( CAN_user_acquisition_group_manage ) %]
+                                        [% IF ( basketgroup.id ) %]
+                                            [% basketgroup.name | html %]
+                                            <a href="#" id="set_basket_group"><i class="fa fa-pencil"></i> Change basket group</a>
+                                        [% ELSE %]
+                                            No group
+                                            <a href="#" id="set_basket_group"><i class="fa fa-pencil"></i> Set basket group</a>
+                                        [% END %]
+                                    [% END %]
                                 [% END %]
-                              [% END %]
-                              <option value="new">Add new group</option>
-                            </select>
-                            <input type="hidden" id="basketno" value="[% basketno | html %]" name="basketno" />
-                            <input type="hidden" value="mod_basket" name="op" />
-                            <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
-                            <input type="submit" value="Change basket group" />
-                          [% END %]
-                        </li>
-                    [% IF basketgroup.deliveryplace %]<li><span class="label">Basket group delivery placename:</span> [% Branches.GetName( basketgroup.deliveryplace ) | html %]</li>[% END %]
-                    [% IF basketgroup.billingplace %]<li><span class="label">Basket group billing place:</span> [% Branches.GetName( basketgroup.billingplace ) | html %]</li>[% END %]
+                            </li>
+                            [% IF ( CAN_user_acquisition_group_manage ) %]
+                                <li id="basket_grouping" style="display:none;">
+                                    <span class="label">&nbsp;</span>
+                                    <div style="float:left">
+                                        <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
+                                            <select id="basketgroupid" name="basketgroupid">
+                                                <option value="">No group</option>
+                                                [% FOREACH bg IN basketgroups %]
+                                                    [% IF ( bg.default ) %]
+                                                        <option value="[% bg.id | html %]" selected="selected">[% bg.name | html %]</option>
+                                                    [% ELSE %]
+                                                        [% UNLESS bg.closed %]
+                                                            <option value="[% bg.id | html %]">[% bg.name | html %]</option>
+                                                        [% ELSE %]
+                                                            <option value="[% bg.id | html %]" disabled="disabled">[% bg.name | html %] (closed)</option>
+                                                        [% END %]
+                                                    [% END %]
+                                                [% END %]
+                                                <option value="new">Add new group</option>
+                                            </select>
+                                            <a href="#" id="basket_group_cancel" class="cancel">Cancel</a>
+                                            <input type="hidden" id="basketno" value="[% basketno | html %]" name="basketno" />
+                                            <input type="hidden" value="mod_basket" name="op" />
+                                            <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
+                                        </form>
+                                    </div>
+                                </li>
+                            [% END # /IF ( CAN_user_acquisition_group_manage ) %]
+                            [% IF basketgroup.deliveryplace %]
+                                <li>
+                                    <span class="label">Basket group delivery placename:</span> [% Branches.GetName( basketgroup.deliveryplace ) | html %]
+                                </li>
+                            [% END %]
+                            [% IF basketgroup.billingplace %]
+                                <li>
+                                    <span class="label">Basket group billing place:</span> [% Branches.GetName( basketgroup.billingplace ) | html %]
+                                </li>
+                            [% END %]
                         </ol>
-                    [% IF ( CAN_user_acquisition_group_manage ) %]
-                    </form>
-                    [% END %]
+                    [% END # /IF closeddate %]
                 </div>
-                [% END %]
             </div>
             </div>
         [% END %]
         [% IF ( duplinbatch ) %]<div class="dialog alert">
         <h4>Duplicate warning</h4>
-        <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 | html %]&amp;basketno=[% basketno | html %]&amp;booksellerid=[% booksellerid | html %]" title="Open in new window" target="_blank" class="popup" style="margin-left:10px">Display them</a></p>
+        <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" class="popup" style="margin-left:10px">Display them</a></p>
         </div>[% END %]
 
         <div id="acqui_basket_content" class="yui-g">
         [% IF ( books_loop ) %]
-        <h2>Orders</h2>
-        <label for="show_all_details">
-            <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
-            Show all details
-        </label>
+            <h2>Orders</h2>
             <table id="orders">
                 <thead>
                     <tr>
                         <th>No.</th>
-                        <th class="anti-the">Order</th>
-                        <th class="tax_excluded">RRP tax exc.</th>
-                        <th class="tax_excluded">ecost tax exc.</th>
-                        <th class="tax_included">RRP tax inc.</th>
-                        <th class="tax_included">ecost tax inc.</th>
+                        <th>Order</th>
+                        <th>RRP tax exc.</th>
+                        <th>ecost tax exc.</th>
+                        <th>RRP tax inc.</th>
+                        <th>ecost tax inc.</th>
+                        <th>Replacement price</th>
                         <th>Qty.</th>
-                        <th class="tax_excluded">Total tax exc. ([% currency | html %])</th>
-                        <th class="tax_included">Total tax inc. ([% currency | html %])</th>
+                        <th>Total tax exc. ([% currency | html %])</th>
+                        <th>Total tax inc. ([% currency | html %])</th>
                         <th>GST %</th>
                         <th>GST</th>
                         <th>Fund</th>
                         <th>Supplier report</th>
                         [% IF ( active ) %]
                             [% UNLESS ( closedate ) %]
-                                <th>Modify</th>
-                                <th>Cancel order</th>
+                                <th class="NoSort">Modify</th>
+                                <th class="NoSort">Cancel order</th>
                             [% END %]
                         [% END %]
                     </tr>
                     <tr>
                         <th></th>
                         <th>Total (GST [% foot_loo.tax_rate * 100 | html %])</th>
-                        <th class="tax_excluded">&nbsp;</th>
-                        <th class="tax_excluded">&nbsp;</th>
-                        <th class="tax_included">&nbsp;</th>
-                        <th class="tax_included">&nbsp;</th>
+                        <th>&nbsp;</th>
+                        <th>&nbsp;</th>
+                        <th>&nbsp;</th>
+                        <th>&nbsp;</th>
+                        <th>&nbsp;</th>
                         <th>[% foot_loo.quantity | html %]</th>
-                        <th class="tax_excluded">[% foot_loo.total_tax_excluded | $Price | html %]</th>
-                        <th class="tax_included">[% foot_loo.total_tax_included | $Price | html %]</th>
+                        <th>[% foot_loo.total_tax_excluded | $Price %]</th>
+                        <th>[% foot_loo.total_tax_included | $Price %]</th>
                         <th>&nbsp;</th>
-                        <th>[% foot_loo.tax_value | $Price | html %]</th>
+                        <th>[% foot_loo.tax_value | $Price %]</th>
                         <th>&nbsp;</th>
                         <th>&nbsp;</th>
                         [% IF ( active ) %]
                 <tr>
                     <th></th>
                     <th>Total ([% currency | html %])</th>
-                    <th class="tax_excluded">&nbsp;</th>
-                    <th class="tax_excluded">&nbsp;</th>
-                    <th class="tax_included">&nbsp;</th>
-                    <th class="tax_included">&nbsp;</th>
+                    <th>&nbsp;</th>
+                    <th>&nbsp;</th>
+                    <th>&nbsp;</th>
+                    <th>&nbsp;</th>
+                    <th>&nbsp;</th>
                     <th>[% total_quantity | html %]</th>
-                    <th class="tax_excluded">[% total_tax_excluded | $Price | html %]</th>
-                    <th class="tax_included">[% total_tax_included | $Price | html %]</th>
+                    <th>[% total_tax_excluded | $Price %]</th>
+                    <th>[% total_tax_included | $Price %]</th>
                     <th>&nbsp;</th>
-                    <th>[% total_tax_value | $Price | html %]</th>
+                    <th>[% total_tax_value | $Price %]</th>
                     <th>&nbsp;</th>
                     <th>&nbsp;</th>
                     [% IF ( active ) %]
                             <p>
                                 [% IF ( books_loo.order_received ) %] (rcvd)[% END %]
                                 [% IF books_loo.title %]
-                                    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber | html %]">[% books_loo.title | html %]</a>[% IF books_loo.author %] by [% books_loo.author | html %][% END %]
+                                    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber | uri %]">[% books_loo.title | html %]</a>[% IF books_loo.author %] by [% books_loo.author | html %][% END %]
                                 [% ELSE %]
                                     <em>Deleted bibliographic record, can't find title</em><br />
                                 [% END %]
                                 [% IF ( books_loo.suggestionid ) %]
                                     <br/>
                                     Suggested by: [% books_loo.surnamesuggestedby | html %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby | html %] [% END %]
-                                    (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid | html %]&amp;op=show">suggestion #[% books_loo.suggestionid | html %]</a>)
+                                    (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid | uri %]&amp;op=show">suggestion #[% books_loo.suggestionid | html %]</a>)
                                 [% END %]
                             </p>
                                 [% IF ( books_loo.order_internalnote ) %]
                                     <a class="edit_note" 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>
                                 [% END %]
                             [% IF (books_loo.transferred_from) %]
-                              [% basket = books_loo.transferred_from.basket | html %]
-                              [% bookseller = books_loo.transferred_from.bookseller | html %]
-                              [% timestamp = books_loo.transferred_from.timestamp | html %]
+                              [% basket = books_loo.transferred_from.basket %]
+                              [% bookseller = books_loo.transferred_from.bookseller %]
+                              [% timestamp = books_loo.transferred_from.timestamp %]
                               <p>Transferred from basket:
-                                <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | html %]"> [% basket.basketname | html %]</a>
-                                (<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id | html %]">[% bookseller.name | html %]</a>)
-                                on <span title="[% timestamp | $KohaDates with_hours = 1 | html %]">
+                                <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]"> [% basket.basketname | html %]</a>
+                                (<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id | uri %]">[% bookseller.name | html %]</a>)
+                                on <span title="[% timestamp | $KohaDates with_hours = 1 %]">
                                   [% timestamp | $KohaDates %]
                                 </span>
                               </p>
                         </td>
                         [% 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 ... %]
                         [%# FIXME: use of a regexp is not ideal; bugs 9410 and 10929 suggest better way of handling this %]
-                        <td class="number tax_excluded [% IF books_loo.rrp_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.rrp_tax_excluded | $Price | html %]</td>
-                        <td class="number tax_excluded [% IF books_loo.ecost_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.ecost_tax_excluded | $Price | html %]</td>
-                        <td class="number tax_included [% IF books_loo.rrp_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.rrp_tax_included | $Price | html %]</td>
-                        <td class="number tax_included [% IF books_loo.ecost_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.ecost_tax_included | $Price | html %]</td>
+                        <td class="number [% IF books_loo.rrp_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.rrp_tax_excluded | $Price | html %]</td>
+                        <td class="number [% IF books_loo.ecost_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.ecost_tax_excluded | $Price | html %]</td>
+                        <td class="number [% IF books_loo.rrp_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.rrp_tax_included | $Price | html %]</td>
+                        <td class="number [% IF books_loo.ecost_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.ecost_tax_included | $Price | html %]</td>
+                        <td class="number [% IF books_loo.replacementprice.search(zero_regex) %]error[% END %]">[% books_loo.replacementprice | $Price %]</td>
                         <td class="number [% IF books_loo.quantity.search(zero_regex) %]error[% END %]">[% books_loo.quantity | html %]</td>
-                        <td class="number tax_excluded [% IF books_loo.total_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.total_tax_excluded | $Price | html %]</td>
-                        <td class="number tax_included [% IF books_loo.total_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.total_tax_included | $Price | html %]</td>
+                        <td class="number [% IF books_loo.total_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.total_tax_excluded | $Price | html %]</td>
+                        <td class="number [% IF books_loo.total_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.total_tax_included | $Price | html %]</td>
                         <td class="number">[% books_loo.tax_rate * 100 | html %]</td>
-                        <td class="number [% IF books_loo.tax_value.search(zero_regex) %]error[% END %]">[% books_loo.tax_value | $Price | html %]</td>
+                        <td class="number [% IF books_loo.tax_value.search(zero_regex) %]error[% END %]">[% books_loo.tax_value | $Price %]</td>
                         <td>[% books_loo.budget_name | html %]</td>
                         <td>[% books_loo.suppliers_report | html %]</td>
                         [% IF ( active ) %]
                             [% UNLESS ( closedate ) %]
                             <td>
-                                <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber | html %]&amp;booksellerid=[% booksellerid | html %]&amp;basketno=[% basketno | html %]">Modify</a>
+                                <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Modify</a>
                                 [% UNLESS (books_loo.order_received) %]
                                     <br />
                                     <a href="#" class="transfer_order" data-ordernumber="[% books_loo.ordernumber | html %]">Transfer</a>
                             [% IF ( books_loo.left_holds_on_order ) %]
                             <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>
                             [% ELSE %]
-                            <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% books_loo.ordernumber | html %]&biblionumber=[% books_loo.biblionumber | html %]&basketno=[% basketno | html %]&referrer=/cgi-bin/koha/acqui/basket.pl%3Fbasketno=[% basketno | html %]" class="button">Cancel order</a><br>
+                            <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>
                             [% END %]
                             [% IF ( books_loo.can_del_bib ) %]
-                            <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% books_loo.ordernumber | html %]&biblionumber=[% books_loo.biblionumber | html %]&basketno=[% basketno | html %]&del_biblio=1&referrer=/cgi-bin/koha/acqui/basket.pl%3Fbasketno=[% basketno | html %]" class="button">Cancel order and delete catalog record</a><br>
+                            <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>
                             [% ELSE %]
                             <span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br>
                             [% END %]
                   <th class="tax_excluded">ecost tax exc.</th>
                   <th class="tax_included">RRP tax inc.</th>
                   <th class="tax_included">ecost tax inc.</th>
+                  <th class="replacementprice">Replacement price</th>
                   <th>Qty.</th>
                   <th class="tax_excluded">Total tax exc. ([% currency | html %])</th>
                   <th class="tax_included">Total tax inc. ([% currency | html %])</th>
                         [% END %]
                       </p>
                       [% IF order.transferred_to %]
-                        [% basket = order.transferred_to.basket | html %]
-                        [% bookseller = order.transferred_to.bookseller | html %]
-                        [% timestamp = order.transferred_to.timestamp | html %]
+                        [% basket = order.transferred_to.basket %]
+                        [% bookseller = order.transferred_to.bookseller %]
+                        [% timestamp = order.transferred_to.timestamp %]
                         <p>Transferred to basket:
-                          <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | html %]"> [% basket.basketname | html %]</a>
-                          (<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id | html %]">[% bookseller.name | html %]</a>)
-                          on <span title="[% timestamp | $KohaDates with_hours = 1 | html %]">
+                          <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]"> [% basket.basketname | html %]</a>
+                          (<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id | uri %]">[% bookseller.name | html %]</a>)
+                          on <span title="[% timestamp | $KohaDates with_hours = 1 %]">
                             [% timestamp | $KohaDates %]
                           </span>
                         </p>
                       [% END %]
                     </td>
-                    <td class="number tax_excluded">[% order.rrp_tax_excluded | $Price | html %]</td>
-                    <td class="number tax_excluded">[% order.ecost_tax_excluded | $Price | html %]</td>
-                    <td class="number tax_included">[% order.rrp_tax_included | $Price | html %]</td>
-                    <td class="number tax_included">[% order.ecost_tax_included | $Price | html %]</td>
+                    <td class="number">[% order.rrp_tax_excluded | $Price | html %]</td>
+                    <td class="number">[% order.ecost_tax_excluded | $Price | html %]</td>
+                    <td class="number">[% order.rrp_tax_included | $Price | html %]</td>
+                    <td class="number">[% order.ecost_tax_included | $Price | html %]</td>
+                    <td class="number">[% order.replacementprice | $Price %]</td>
                     <td class="number">[% order.quantity | html %]</td>
-                    <td class="number tax_excluded">[% order.total_tax_excluded | $Price | html %]</td>
-                    <td class="number tax_included">[% order.total_tax_included | $Price | html %]</td>
+                    <td class="number">[% order.total_tax_excluded | $Price | html %]</td>
+                    <td class="number">[% order.total_tax_included | $Price | html %]</td>
                     <td class="number">[% order.tax_rate * 100 | html %]</td>
-                    <td class="number">[% order.tax_value | $Price | html %]</td>
+                    <td class="number">[% order.tax_value | $Price %]</td>
                     <td>[% order.budget_name | html %]
                   </tr>
                 [% END %]
 [% END %][%# IF (cannot_manage_basket) %]
 </div>
 <div class="yui-b">
-[% INCLUDE 'acquisitions-menu.inc' %]
+    [% INCLUDE 'vendor-menu.inc' %]
+    [% INCLUDE 'acquisitions-menu.inc' %]
 </div>
 </div>
 
 
 [% MACRO jsinclude BLOCK %]
     [% Asset.js("js/acquisitions-menu.js") | $raw %]
-[% INCLUDE 'datatables.inc' %]
+    [% INCLUDE 'datatables.inc' %]
+    [% INCLUDE 'columns_settings.inc' %]
     [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") | $raw %]
-    <script type="text/javascript">
+    <script>
         function updateColumnsVisibility(visible) {
             if ( visible ) {
                 $("table .tax_excluded, .tax_included").show();
 
         $(document).ready(function() {
             if ( $('#toolbar').length ) {$('#toolbar').fixFloat();}
-            $("#show_all_details").click(function(){
-                updateColumnsVisibility($(this).is(":checked"));
-            });
-
-            $("#show_all_details").prop('checked', false);
-            updateColumnsVisibility(false);
             [% UNLESS ( closedate ) %]
                 $('#addtoBasket').on('show', function () {
                    $(this).find(".modal-body").html($(".acqui_basket_add")[0].outerHTML);
                 $("#type").val("");
             });
 
+            $("#set_managing_library").on("click", function(e){
+                e.preventDefault();
+                $(this).hide();
+                $("#managing_library_entry").show();
+            });
+
+            $("#library_entry_cancel").on("click", function(e){
+                e.preventDefault();
+                $("#managing_library_entry").hide();
+                $("#set_managing_library").show();
+            });
+
+            $("#set_basket_group").on("click", function(e){
+                e.preventDefault();
+                $(this).hide();
+                $("#basket_grouping").show();
+            });
+
+            $("#basket_group_cancel").on("click", function(e){
+                e.preventDefault();
+                $("#basket_grouping").hide();
+                $("#set_basket_group").show();
+            });
+
         });
     </script>
 
     [% UNLESS ( closedate ) %]
-        <script type="text/javascript">
+        <script>
             function transfer_order_popup(ordernumber) {
                 var url = "/cgi-bin/koha/acqui/transferorder.pl?"
                     + "ordernumber=" + ordernumber
             }
         </script>
     [% ELSE %]
-        <script type="text/javascript">
+        <script>
             $(document).ready(function(){
                 $("#basketgroupid").change(function(){
                     if($(this).val() == "new"){
                         location.href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% booksellerid | html %]";
+                    } else {
+                        $(this).parent().submit();
                     }
                 });
             });
         </script>
         [% UNLESS ( grouped ) %]
-            <script type="text/javascript">
+            <script>
                 function confirm_reopen() {
                     var skip = [% IF ( skip_confirm_reopen ) %] 1 [% ELSE %] 0 [% END %];
                     var is_confirmed = skip || confirm(_("Are you sure you want to reopen this basket?"));
             </script>
         [% END %]
     [% END %]
-    <script type="text/javascript">
+    <script>
+<<<<<<< HEAD
+=======
+        var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'basket', 'orders', 'json' ) %];
+>>>>>>> Bug 20966: Add column configuration to table of orders in a basket
         $(document).ready(function() {
-            var orderst = $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
-                "sPaginationType": "four_button",
+            KohaTable("orders", {
                 [% IF ( active ) %]
                     "aoColumnDefs": [
-                        [% UNLESS ( closedate ) %]
-                            { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
-                        [% END %]
+                        { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
                         { "sType": "anti-the", "aTargets": [ "anti-the" ] }
                     ],
                 [% END %]
-            } ) );
+                "sPaginationType": "four_button",
+                "autoWidth": false
+            }, columns_settings);
+
             var cancelledorderst = $("#cancelledorderst").dataTable($.extend(true, {}, dataTablesDefaults, {
                 "sPaginationType": "four_button"
             } ) );
                 location.href = url;
                 return false;
             });
+            $("#select_managing_library").on("change", function(){
+                $(this).parent().submit();
+            });
         });
 
         function UserSearchPopup(f) {
                 var li = '<li id="user_'+borrowernumber+'">'+borrowername
                 + ' <a href="#" data-borrowernumber="'+borrowernumber+'" class="del_user"><i class="fa fa-trash"></i> '
                     + _("Delete user") + '</a></li>';
-                $("#users_names").append(li);
+                $("#users_names").prepend(li);
+                $("#add_user_submit").show();
                 return 0;
             }
             return -1;
             var ids = $("#users_ids").val().split(':');
             ids.splice(ids.indexOf(borrowernumber.toString()), 1);
             $("#users_ids").val(ids.join(':'));
+            $("#add_user_submit").show();
         }
     </script>
 [% END %]