Bug 26160: Make POS items table configurable
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / en / modules / pos / pay.tt
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();