Skip to content

Commit 710a8b4

Browse files
committed
Version 5.4.2
Improved bulk status update pages. Minor fixes and updates.
1 parent 57ee81d commit 710a8b4

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

app/generic-tests/results/generic-result-approval.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@
208208
</option>
209209
</select>
210210
</td>
211+
<td>&nbsp;<strong>
212+
<?php echo _translate("Sample Test Date"); ?>&nbsp;:
213+
</strong></td>
214+
<td>
215+
<input type="text" id="sampleTestDate" name="sampleTestDate" class="form-control" placeholder="<?php echo _translate('Select Test Date'); ?>" readonly style="width:220px;background:#fff;" />
216+
</td>
211217
</tr>
212218
<tr>
213219
<td colspan="3">&nbsp;<input type="button" onclick="searchVlRequestData();" value="<?= _translate('Search'); ?>" class="btn btn-success btn-sm">
@@ -397,6 +403,14 @@ class="btn btn-success btn-block">
397403

398404

399405
$(document).ready(function() {
406+
$("#batchCode").select2({
407+
placeholder: "<?php echo _translate("Select Batch Code"); ?>",
408+
allowClear: true
409+
});
410+
$("#sampleType").select2({
411+
placeholder: "<?php echo _translate("Select Sample Type"); ?>",
412+
allowClear: true
413+
});
400414
$("#facilityName").selectize({
401415
plugins: ["restore_on_backspace", "remove_button", "clear_button"],
402416
});
@@ -414,6 +428,32 @@ class="btn btn-success btn-block">
414428
$("#reviewer").select2({
415429
placeholder: "<?php echo _translate("Select reviewer"); ?>"
416430
});
431+
$('#sampleTestDate').daterangepicker({
432+
locale: {
433+
cancelLabel: "<?= _translate("Clear", true); ?>",
434+
format: 'DD-MMM-YYYY',
435+
separator: ' to ',
436+
},
437+
showDropdowns: true,
438+
alwaysShowCalendars: false,
439+
startDate: moment().subtract(28, 'days'),
440+
endDate: moment(),
441+
maxDate: moment(),
442+
ranges: {
443+
'Today': [moment(), moment()],
444+
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
445+
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
446+
'This Month': [moment().startOf('month'), moment().endOf('month')],
447+
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')],
448+
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
449+
'Last 90 Days': [moment().subtract(89, 'days'), moment()],
450+
'Last 120 Days': [moment().subtract(119, 'days'), moment()],
451+
'Last 180 Days': [moment().subtract(179, 'days'), moment()],
452+
'Last 12 Months': [moment().subtract(12, 'month').startOf('month'), moment().endOf('month')],
453+
'Previous Year': [moment().subtract(1, 'year').startOf('year'), moment().subtract(1, 'year').endOf('year')],
454+
'Current Year To Date': [moment().startOf('year'), moment()]
455+
}
456+
});
417457
$('#sampleCollectionDate').daterangepicker({
418458
locale: {
419459
cancelLabel: "<?= _translate("Clear", true); ?>",
@@ -445,6 +485,7 @@ function(start, end) {
445485
endDate = end.format('YYYY-MM-DD');
446486
});
447487
$('#sampleCollectionDate').val("");
488+
$('#sampleTestDate').val("");
448489
loadVlRequestData();
449490
});
450491

@@ -519,6 +560,10 @@ function loadVlRequestData() {
519560
"name": "sampleCollectionDate",
520561
"value": $("#sampleCollectionDate").val()
521562
});
563+
aoData.push({
564+
"name": "sampleTestDate",
565+
"value": $("#sampleTestDate").val()
566+
});
522567
aoData.push({
523568
"name": "facilityName",
524569
"value": $("#facilityName").val()

app/generic-tests/results/get-generic-results-for-approval.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,21 @@
101101
$sWhere[] = ' b.batch_code LIKE "%' . $_POST['batchCode'] . '%"';
102102
}
103103
[$start_date, $end_date] = DateUtility::convertDateRange($_POST['sampleCollectionDate'] ?? '');
104+
[$tested_start_date, $tested_end_date] = DateUtility::convertDateRange($_POST['sampleTestDate'] ?? '');
104105
if (!empty($_POST['sampleCollectionDate'])) {
105106
if (trim((string) $start_date) === trim((string) $end_date)) {
106107
$sWhere[] = ' DATE(vl.sample_collection_date) = "' . $start_date . '"';
107108
} else {
108109
$sWhere[] = ' DATE(vl.sample_collection_date) >= "' . $start_date . '" AND DATE(vl.sample_collection_date) <= "' . $end_date . '"';
109110
}
110111
}
112+
if (!empty($_POST['sampleTestDate'])) {
113+
if (trim((string) $tested_start_date) === trim((string) $tested_end_date)) {
114+
$sWhere[] = ' DATE(vl.sample_tested_datetime) = "' . $tested_start_date . '"';
115+
} else {
116+
$sWhere[] = ' DATE(vl.sample_tested_datetime) >= "' . $tested_start_date . '" AND DATE(vl.sample_tested_datetime) <= "' . $tested_end_date . '"';
117+
}
118+
}
111119
if (isset($_POST['sampleType']) && $_POST['sampleType'] != '') {
112120
$sWhere[] = ' s.sample_type_id = "' . $_POST['sampleType'] . '"';
113121
}

app/vl/results/getVlResultsForApproval.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@
6666
[$start_date, $end_date] = DateUtility::convertDateRange($_POST['sampleCollectionDate'] ?? '');
6767
$sWhere[] = " DATE(vl.sample_collection_date) BEWTEEN '$start_date' AND '$end_date' ";
6868
}
69+
if (!empty($_POST['sampleTestDate'])) {
70+
[$tested_start_date, $tested_end_date] = DateUtility::convertDateRange($_POST['sampleTestDate'] ?? '');
71+
$sWhere[] = " DATE(vl.sample_tested_datetime) BETWEEN '$tested_start_date' AND '$tested_end_date' ";
72+
}
6973
if (isset($_POST['sampleType']) && $_POST['sampleType'] != '') {
7074
$sWhere[] = ' s.sample_id = "' . $_POST['sampleType'] . '"';
7175
}

0 commit comments

Comments
 (0)