Server IP : 150.95.80.236 / Your IP : 18.222.113.190 Web Server : Apache System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : social-telecare ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/pcu.in.th/uat.pcu.in.th/demo15/src/js/custom/apps/customers/view/ |
Upload File : |
"use strict"; // Class definition var KTCustomerViewInvoices = function () { // Private functions // Init current year datatable var initInvoiceYearCurrent = function () { // Define table element const id = '#kt_customer_details_invoices_table_1'; var table = document.querySelector(id); // Set date data order const tableRows = table.querySelectorAll('tbody tr'); tableRows.forEach(row => { const dateRow = row.querySelectorAll('td'); const realDate = moment(dateRow[0].innerHTML, "DD MMM YYYY, LT").format(); // select date from 1st column in table dateRow[0].setAttribute('data-order', realDate); }); // Init datatable --- more info on datatables: https://datatables.net/manual/ var datatable = $(id).DataTable({ "info": false, 'order': [], "pageLength": 5, "lengthChange": false, 'columnDefs': [ { orderable: false, targets: 4 }, // Disable ordering on column 0 (download) ] }); } // Init year 2020 datatable var initInvoiceYear2020 = function () { // Define table element const id = '#kt_customer_details_invoices_table_2'; var table = document.querySelector(id); // Set date data order const tableRows = table.querySelectorAll('tbody tr'); tableRows.forEach(row => { const dateRow = row.querySelectorAll('td'); const realDate = moment(dateRow[0].innerHTML, "DD MMM YYYY, LT").format(); // select date from 1st column in table dateRow[0].setAttribute('data-order', realDate); }); // Init datatable --- more info on datatables: https://datatables.net/manual/ var datatable = $(id).DataTable({ "info": false, 'order': [], "pageLength": 5, "lengthChange": false, 'columnDefs': [ { orderable: false, targets: 4 }, // Disable ordering on column 0 (download) ] }); } // Init year 2019 datatable var initInvoiceYear2019 = function () { // Define table element const id = '#kt_customer_details_invoices_table_3'; var table = document.querySelector(id); // Set date data order const tableRows = table.querySelectorAll('tbody tr'); tableRows.forEach(row => { const dateRow = row.querySelectorAll('td'); const realDate = moment(dateRow[0].innerHTML, "DD MMM YYYY, LT").format(); // select date from 1st column in table dateRow[0].setAttribute('data-order', realDate); }); // Init datatable --- more info on datatables: https://datatables.net/manual/ var datatable = $(id).DataTable({ "info": false, 'order': [], "pageLength": 5, "lengthChange": false, 'columnDefs': [ { orderable: false, targets: 4 }, // Disable ordering on column 0 (download) ] }); } // Init year 2018 datatable var initInvoiceYear2018 = function () { // Define table element const id = '#kt_customer_details_invoices_table_4'; var table = document.querySelector(id); // Set date data order const tableRows = table.querySelectorAll('tbody tr'); tableRows.forEach(row => { const dateRow = row.querySelectorAll('td'); const realDate = moment(dateRow[0].innerHTML, "DD MMM YYYY, LT").format(); // select date from 1st column in table dateRow[0].setAttribute('data-order', realDate); }); // Init datatable --- more info on datatables: https://datatables.net/manual/ var datatable = $(id).DataTable({ "info": false, 'order': [], "pageLength": 5, "lengthChange": false, 'columnDefs': [ { orderable: false, targets: 4 }, // Disable ordering on column 0 (download) ] }); } // Public methods return { init: function () { initInvoiceYearCurrent(); initInvoiceYear2020(); initInvoiceYear2019(); initInvoiceYear2018(); } } }(); // On document ready KTUtil.onDOMContentLoaded(function () { KTCustomerViewInvoices.init(); });