Remove payout invoice column and align datatable ordering for grouped pool

This commit is contained in:
DevSoftTech Server 2026-04-30 02:05:07 +05:30
parent e72e5590ff
commit ced87420b4
2 changed files with 28 additions and 13 deletions

View File

@ -11207,15 +11207,32 @@ class Medical extends BaseController
$orderColIndex = isset($order[0]['column']) ? (int) $order[0]['column'] : 6;
$orderDir = strtolower((string) ($order[0]['dir'] ?? 'desc')) === 'asc' ? 'ASC' : 'DESC';
$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',
];
$requestColumns = $this->request->getPost('columns');
if (! is_array($requestColumns)) {
$requestColumns = $this->request->getGet('columns');
}
$columnCount = is_array($requestColumns) ? count($requestColumns) : 0;
if ($columnCount >= 8) {
$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';
$baseSql = $this->buildMedicalCreditPoolBaseSql($scope, $fromDate, $toDate);

View File

@ -59,7 +59,6 @@
<tr>
<th style="width:42px;"><input type="checkbox" id="med_pool_master"></th>
<th>Source</th>
<th>Invoice</th>
<th>IPD</th>
<th>Case</th>
<th>Category</th>
@ -277,7 +276,7 @@
searching: true,
lengthMenu: [[10, 25, 50, 100], [10, 25, 50, 100]],
pageLength: 25,
order: [[6, 'desc']],
order: [[5, 'desc']],
ajax: {
url: BASE + 'Medical/credit_payout_pool_datatable',
type: 'POST',
@ -310,7 +309,6 @@
return String(row.source_type || '') + '#' + Number(row.source_ref_id || 0);
}
},
{ data: 'invoice_code', defaultContent: '' },
{ data: 'ipd_code', defaultContent: '' },
{ data: 'case_code', defaultContent: '' },
{ data: 'credit_category', defaultContent: '' },
@ -369,7 +367,7 @@
var groupValue = val !== '' ? val : 'Unmapped';
if (groupValue !== lastGroup) {
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);
lastGroup = groupValue;
}