Bug 26160: Make POS items table configurable
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 6 Aug 2020 13:33:32 +0000 (14:33 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 12 Aug 2020 10:07:12 +0000 (12:07 +0200)
1)  System preference:  EnablePointOfSale - set to Enable
2)  System preference:  UseCashRegisters - set to Use
3)  Administration > Accounting > Cash registers - create a new cash register for the library you're logged in as
4)  Administration > Accounting > Debit types - create at least one debit type
5)  Home > Point of sale - verify that all four columns exist in the Items for purchase table:  Code, Description, Cost, Action
6)  Administration > Additional parameters > Table settings > Point of sale - change which columns can be hidden and/or toggled
7)  Home > Point of sale - verify that your choices have been implemented (columns are hidden, columns can be toggled, columns can't be toggled)
8) Repeat steps 6 and 7 for different combinations, checking that they all work.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Added Sally's test plan.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

admin/columns_settings.yml
koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt
koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt

index 1a24b30..aa39fc1 100644 (file)
@@ -1432,3 +1432,18 @@ modules:
               columnname: actions
               cannot_be_toggled: 1
               cannot_be_modified: 1
+
+  pos:
+    pay:
+      invoices:
+        columns:
+            -
+              columnname: code
+            -
+              columnname: description
+            -
+              columnname: cost
+            -
+              columnname: actions
+              cannot_be_toggled: 1
+              cannot_be_modified: 1
index 3d7a59e..e2a5448 100644 (file)
                                     [% PROCESS pagelist module=modules.members modulename="members" %]
                                 </div>
 
+                                <div class="panel_header"><a href="#pos">Point of sale</a></div>
+                                <div id="pos">
+                                    <h3>Point of sale tables</h3>
+                                    [% PROCESS pagelist module=modules.pos modulename="pos" %]
+                                </div>
+
                                 <div class="panel_header"><a href="#tools">Tools</a></div>
                                 <div id="tools">
                                     <h3>Tools tables</h3>
index 87cbd92..19da1e1 100644 (file)
@@ -2,6 +2,7 @@
 [% USE Asset %]
 [% USE Koha %]
 [% USE Price %]
+[% USE TablesSettings %]
 [% SET footerjs = 1 %]
 [% PROCESS 'payments.inc' %]
 [% INCLUDE 'doc-head-open.inc' %]
 [% MACRO jsinclude BLOCK %]
     [% INCLUDE 'format_price.inc' %]
     [% INCLUDE 'datatables.inc' %]
+    [% INCLUDE 'columns_settings.inc' %]
     [% Asset.js("lib/jquery/plugins/jquery.jeditable.mini.js") | $raw %]
     <script>
     function moneyFormat(textObj) {
                 sale_table.DataTable().row($(this).parents('tr')).remove().draw(false);
         });
 
-        var items_table = $("#invoices").dataTable($.extend(true,{}, dataTablesDefaults, {
+        var items_columns_settings = [% TablesSettings.GetColumns('pos', 'pay', 'invoices', 'json') | $raw %];
+        var items_table = KohaTable("invoices", {
+               "sPaginationType": "full",
+               "aaSorting": [[ 0, "asc" ]],
                "aoColumnDefs": [
                   { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable":false },
                ],
-               "aaSorting": [[ 0, "asc" ]],
-               "paginationType": "full",
-        }));
+        }, items_columns_settings);
 
         $(".add_button").on("click", function(e) {
             e.preventDefault();