Remove payout invoice column and align datatable ordering for grouped pool
This commit is contained in:
parent
e72e5590ff
commit
ced87420b4
|
|
@ -11207,15 +11207,32 @@ class Medical extends BaseController
|
||||||
$orderColIndex = isset($order[0]['column']) ? (int) $order[0]['column'] : 6;
|
$orderColIndex = isset($order[0]['column']) ? (int) $order[0]['column'] : 6;
|
||||||
$orderDir = strtolower((string) ($order[0]['dir'] ?? 'desc')) === 'asc' ? 'ASC' : 'DESC';
|
$orderDir = strtolower((string) ($order[0]['dir'] ?? 'desc')) === 'asc' ? 'ASC' : 'DESC';
|
||||||
|
|
||||||
$orderCols = [
|
$requestColumns = $this->request->getPost('columns');
|
||||||
1 => 'q.source_type',
|
if (! is_array($requestColumns)) {
|
||||||
2 => 'q.invoice_code',
|
$requestColumns = $this->request->getGet('columns');
|
||||||
3 => 'q.ipd_code',
|
}
|
||||||
4 => 'q.case_code',
|
$columnCount = is_array($requestColumns) ? count($requestColumns) : 0;
|
||||||
5 => 'q.credit_category',
|
|
||||||
6 => 'q.inv_date',
|
if ($columnCount >= 8) {
|
||||||
7 => 'q.line_amount',
|
$orderCols = [
|
||||||
];
|
1 => 'q.source_type',
|
||||||
|
2 => 'q.invoice_code',
|
||||||
|
3 => 'q.ipd_code',
|
||||||
|
4 => 'q.case_code',
|
||||||
|
5 => 'q.credit_category',
|
||||||
|
6 => 'q.inv_date',
|
||||||
|
7 => 'q.line_amount',
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$orderCols = [
|
||||||
|
1 => 'q.source_type',
|
||||||
|
2 => 'q.ipd_code',
|
||||||
|
3 => 'q.case_code',
|
||||||
|
4 => 'q.credit_category',
|
||||||
|
5 => 'q.inv_date',
|
||||||
|
6 => 'q.line_amount',
|
||||||
|
];
|
||||||
|
}
|
||||||
$orderBy = $orderCols[$orderColIndex] ?? 'q.inv_date';
|
$orderBy = $orderCols[$orderColIndex] ?? 'q.inv_date';
|
||||||
|
|
||||||
$baseSql = $this->buildMedicalCreditPoolBaseSql($scope, $fromDate, $toDate);
|
$baseSql = $this->buildMedicalCreditPoolBaseSql($scope, $fromDate, $toDate);
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width:42px;"><input type="checkbox" id="med_pool_master"></th>
|
<th style="width:42px;"><input type="checkbox" id="med_pool_master"></th>
|
||||||
<th>Source</th>
|
<th>Source</th>
|
||||||
<th>Invoice</th>
|
|
||||||
<th>IPD</th>
|
<th>IPD</th>
|
||||||
<th>Case</th>
|
<th>Case</th>
|
||||||
<th>Category</th>
|
<th>Category</th>
|
||||||
|
|
@ -277,7 +276,7 @@
|
||||||
searching: true,
|
searching: true,
|
||||||
lengthMenu: [[10, 25, 50, 100], [10, 25, 50, 100]],
|
lengthMenu: [[10, 25, 50, 100], [10, 25, 50, 100]],
|
||||||
pageLength: 25,
|
pageLength: 25,
|
||||||
order: [[6, 'desc']],
|
order: [[5, 'desc']],
|
||||||
ajax: {
|
ajax: {
|
||||||
url: BASE + 'Medical/credit_payout_pool_datatable',
|
url: BASE + 'Medical/credit_payout_pool_datatable',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
|
@ -310,7 +309,6 @@
|
||||||
return String(row.source_type || '') + '#' + Number(row.source_ref_id || 0);
|
return String(row.source_type || '') + '#' + Number(row.source_ref_id || 0);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ data: 'invoice_code', defaultContent: '' },
|
|
||||||
{ data: 'ipd_code', defaultContent: '' },
|
{ data: 'ipd_code', defaultContent: '' },
|
||||||
{ data: 'case_code', defaultContent: '' },
|
{ data: 'case_code', defaultContent: '' },
|
||||||
{ data: 'credit_category', defaultContent: '' },
|
{ data: 'credit_category', defaultContent: '' },
|
||||||
|
|
@ -369,7 +367,7 @@
|
||||||
var groupValue = val !== '' ? val : 'Unmapped';
|
var groupValue = val !== '' ? val : 'Unmapped';
|
||||||
if (groupValue !== lastGroup) {
|
if (groupValue !== lastGroup) {
|
||||||
var title = (groupMode === 'ipd' ? 'IPD: ' : 'Case: ') + groupValue;
|
var title = (groupMode === 'ipd' ? 'IPD: ' : 'Case: ') + groupValue;
|
||||||
var header = window.jQuery('<tr class="med-group-row table-secondary"><td colspan="8" class="fw-semibold small">' + title + '</td></tr>');
|
var header = window.jQuery('<tr class="med-group-row table-secondary"><td colspan="7" class="fw-semibold small">' + title + '</td></tr>');
|
||||||
window.jQuery(domRows[i]).before(header);
|
window.jQuery(domRows[i]).before(header);
|
||||||
lastGroup = groupValue;
|
lastGroup = groupValue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user