-
+
-
-
+
-
+ Create Purchase Order from Requistion
- -
+
+
+
- Create Purchase Order from Requistion
-
+
getFlashdata('error');
if ($error) {
?>
-
-
- getFlashdata('error'); ?>
-
-
- getFlashdata('success');
- if ($success) {
- ?>
-
-
- getFlashdata('success'); ?>
-
-
-
-
-
+
- listErrors('
- ', '
');
- ?>
+
+ getFlashdata('error'); ?>
- getFlashdata('listErrors');
- if ($listErrors) {
- ?>
-
-
-
-
-
-
- getFlashdata('listErrors'); ?>
-
-
-
-
- -
-
-
-
- Create Purchase Order
-
-
-
-
-
+ getFlashdata('success');
+ if ($success) {
+ ?>
+
+
+ getFlashdata('success'); ?>
-
-
-
-
@@ -326,9 +395,13 @@
function selectReqNo(rowId) {
+
+ console.log("entered");
+
ckb = $('#chk' + rowId).is(':checked');
var tr = document.getElementById(rowId);
var cellval = tr.cells;
+ console.log(cellval)
//coo/kie_value_add = {};
if (!ckb) {
var removeItem = cellval[2].innerText;
@@ -340,22 +413,28 @@
} else {
var tr = document.getElementById(rowId);
var cellval = tr.cells;
+
+
//alert(RequistionList.Req.length);
if (RequistionList.Req.length > 0) {
-
+ console.log("111111111");
+
if (Type == cellval[3].innerText) {
+
RequistionList.Req.push({
"ReqNo": cellval[2].innerText,
"ReqType": cellval[3].innerText,
"ReqBy": cellval[4].innerText,
});
} else {
+ console.log("333333333");
+
alert('Same type of Requistion only can be together.')
$('#chk' + rowId).attr('checked', false);
}
} else {
-
+
RequistionList.Req.push({
"ReqNo": cellval[2].innerText,
"ReqType": cellval[3].innerText,
@@ -366,6 +445,9 @@
}
i = i + 1;
}
+
+ console.log(JSON.stringify(RequistionList));
+
$('#txtReqNo').val(JSON.stringify(RequistionList));
}
@@ -396,6 +478,10 @@
function Validate() {
var ReqNo = $('#txtReqNo').val();
+ console.log("--------------");
+
+ console.log(ReqNo);
+
if (ReqNo.length <= 0) {
alert('Please select the Requisition Number to Create Purchase Order');
return false;
@@ -425,8 +511,12 @@
});
-
\ No newline at end of file
+ // Date range filter function
+ $.fn.dataTable.ext.search.push(
+ function(settings, data, dataIndex) {
+ var fromDate = $('#fromDate').val();
+ var toDate = $('#toDate').val();
+
+ if (!fromDate || !toDate) {
+ return true; // If no dates selected, don't filter
+ }
+
+ var dateStr = data[1]; // Assuming the date is in the first column
+ var dateParts = dateStr.split("-");
+ var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
+
+ var startDate = new Date(fromDate);
+ var endDate = new Date(toDate);
+
+ // Adjust startDate to include the day before the selected fromDate
+ startDate.setDate(startDate.getDate() - 1);
+
+ // Ensure endDate includes the entire end date by setting time to the end of the day
+ endDate.setHours(23, 59, 59, 999);
+
+ // Return true if the date is within the range
+ return date >= startDate && date <= endDate;
+ }
+ );
+
+ // Handle form submission for the date range filter
+ $("#DateRangeFilter").click(function(e) {
+
+ e.preventDefault();
+ table.draw(); // Redraw the table to apply the filter
+ });
+
+ // Reset button functionality
+ $("#resetButton").click(function() {
+ $("#fromDate").val('');
+ $("#toDate").val('');
+ table.draw(); // Redraw the table to clear the filter
+ });
+
+ // Automatically focus and open the To Date picker when From Date is selected
+ document.getElementById('fromDate').addEventListener('change', function() {
+ var fromDate = this.value;
+ var toDateInput = document.getElementById('toDate');
+
+ // Set the min attribute of the To Date input to the selected From Date
+ toDateInput.min = fromDate;
+
+ // Optionally reset the To Date input if the current value is before the new min date
+ if (toDateInput.value < fromDate) {
+ toDateInput.value = fromDate;
+ }
+ });
+});
+
\ No newline at end of file
diff --git a/app/Views/includes/new_footer.php b/app/Views/includes/new_footer.php
index dc8c3a59..6d10bcf1 100644
--- a/app/Views/includes/new_footer.php
+++ b/app/Views/includes/new_footer.php
@@ -62,6 +62,11 @@
+
+
+
-
-
-
-
-
-
-
-
-
-
-
- | Select | -Requested Date | -Requistion Number | -Requistion Type | -Requested By | -Tot. No. Of Line Items | -Po Created Line Items | -Partial PO Created Line Items | -New Line Items | -Status | -Department | -Designation | -
|---|---|---|---|---|---|---|---|---|---|---|---|
| - | - ReqDate); - $RequestedDate = $dt->format('d-m-Y'); - echo $RequestedDate; - ?> - | -ReqNo; ?> | -ReqType; ?> | -FirstName; ?> | -TotalNoofLineItems; ?> | -PolineItems; ?> | -PartilallyLineItems; ?> | -newLineItem; ?> | -StatusName; ?> | -DepartmentName; ?> | -Designation; ?> | -
-
+
-
-
+ getFlashdata('listErrors');
+ if ($listErrors) { ?>
+
+
+
+
+
+
+
+
+ getFlashdata('listErrors'); ?>
+
+
+
+
+ +
+
+
+
+ Create Purchase Order
+
+
+
+
+
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | Select | +Requested Date | +Requistion Number | +Requistion Type | +Requested By | +Tot. No. Of Line Items | +Po Created Line Items | +Partial PO Created Line Items | +New Line Items | +Status | +Department | +Designation | +
|---|---|---|---|---|---|---|---|---|---|---|---|
| + | + ReqDate); + $RequestedDate = $dt->format('d-m-Y'); + echo $RequestedDate; + ?> + | +ReqNo; ?> | +ReqType; ?> | +FirstName; ?> | +TotalNoofLineItems; ?> | +PolineItems; ?> | +PartilallyLineItems; ?> | +newLineItem; ?> | +StatusName; ?> | +DepartmentName; ?> | +Designation; ?> | +
+
+
+
+
+