diff --git a/app/Views/AmendPOlist.php b/app/Views/AmendPOlist.php index d8c1994e..0f78786f 100755 --- a/app/Views/AmendPOlist.php +++ b/app/Views/AmendPOlist.php @@ -68,9 +68,9 @@
- + - +
@@ -138,14 +138,14 @@ } echo $option ?> DeliveryOption == 0) { - $Ddt = new DateTime($record->DeliveryDate); - $Deliverydt = $Ddt->format('d-m-Y'); - echo $Deliverydt; - } else if ($record->DeliveryOption == 1) { - $Deliverydt = ''; - echo $Deliverydt; - } ?> + if ($record->DeliveryOption == 0) { + $Ddt = new DateTime($record->DeliveryDate); + $Deliverydt = $Ddt->format('d-m-Y'); + echo $Deliverydt; + } else if ($record->DeliveryOption == 1) { + $Deliverydt = ''; + echo $Deliverydt; + } ?> DeliverySchedule ?> @@ -237,17 +237,19 @@ function(settings, data, dataIndex) { var fromDate = $('#fromDate').val(); var toDate = $('#toDate').val(); + console.log(fromDate); // e.g., 01-09-2024 + console.log(toDate); // e.g., 08-09-2024 if (!fromDate || !toDate) { return true; // If no dates selected, don't filter } - var dateStr = data[0]; // 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 + // Convert the fromDate and toDate from dd-mm-yyyy to Date objects + var fromParts = fromDate.split("-"); + var toParts = toDate.split("-"); - var startDate = new Date(fromDate); - var endDate = new Date(toDate); + var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day + var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]); // Adjust startDate to include the day before the selected fromDate startDate.setDate(startDate.getDate() - 1); @@ -255,11 +257,17 @@ // 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; + // Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format) + var dateStr = data[0]; + var dateParts = dateStr.split("-"); + var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); + + // Return true if the row date is within the range + return rowDate >= startDate && rowDate <= endDate; } ); + // Handle form submission for the date range filter $("#DateRangeFilter").submit(function(e) { e.preventDefault(); diff --git a/app/Views/POlist.php b/app/Views/POlist.php index c98b5ee4..60e1ff8c 100755 --- a/app/Views/POlist.php +++ b/app/Views/POlist.php @@ -100,10 +100,10 @@ - + - + @@ -134,9 +134,9 @@ ?> PODate); - $PODate = $Pdt->format('d-m-Y'); - echo $PODate - ?> + $PODate = $Pdt->format('d-m-Y'); + echo $PODate + ?> PONO ?> ReqType ?> @@ -170,14 +170,14 @@ } echo $option ?> DeliveryOption == 0) { - $Ddt = new DateTime($record->DeliveryDate); - $Deliverydt = $Ddt->format('d-m-Y'); - echo $Deliverydt; - } else if ($record->DeliveryOption == 1) { - $Deliverydt = ''; - echo $Deliverydt; - } ?> + if ($record->DeliveryOption == 0) { + $Ddt = new DateTime($record->DeliveryDate); + $Deliverydt = $Ddt->format('d-m-Y'); + echo $Deliverydt; + } else if ($record->DeliveryOption == 1) { + $Deliverydt = ''; + echo $Deliverydt; + } ?> DeliverySchedule ?> StatusCode; @@ -282,17 +282,19 @@ function(settings, data, dataIndex) { var fromDate = $('#fromDate').val(); var toDate = $('#toDate').val(); + console.log(fromDate); // e.g., 01-09-2024 + console.log(toDate); // e.g., 08-09-2024 if (!fromDate || !toDate) { return true; // If no dates selected, don't filter } - var dateStr = data[0]; // 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 + // Convert the fromDate and toDate from dd-mm-yyyy to Date objects + var fromParts = fromDate.split("-"); + var toParts = toDate.split("-"); - var startDate = new Date(fromDate); - var endDate = new Date(toDate); + var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day + var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]); // Adjust startDate to include the day before the selected fromDate startDate.setDate(startDate.getDate() - 1); @@ -300,8 +302,13 @@ // 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; + // Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format) + var dateStr = data[0]; + var dateParts = dateStr.split("-"); + var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); + + // Return true if the row date is within the range + return rowDate >= startDate && rowDate <= endDate; } ); diff --git a/app/Views/assetListing.php b/app/Views/assetListing.php index 7e4b2c58..dd08c837 100755 --- a/app/Views/assetListing.php +++ b/app/Views/assetListing.php @@ -42,7 +42,7 @@
- +
@@ -58,10 +58,10 @@ - + - + @@ -180,17 +180,19 @@ function(settings, data, dataIndex) { var fromDate = $('#fromDate').val(); var toDate = $('#toDate').val(); + console.log(fromDate); // e.g., 01-09-2024 + console.log(toDate); // e.g., 08-09-2024 if (!fromDate || !toDate) { return true; // If no dates selected, don't filter } - var dateStr = data[0]; // 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 + // Convert the fromDate and toDate from dd-mm-yyyy to Date objects + var fromParts = fromDate.split("-"); + var toParts = toDate.split("-"); - var startDate = new Date(fromDate); - var endDate = new Date(toDate); + var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day + var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]); // Adjust startDate to include the day before the selected fromDate startDate.setDate(startDate.getDate() - 1); @@ -198,8 +200,13 @@ // 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; + // Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format) + var dateStr = data[0]; + var dateParts = dateStr.split("-"); + var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); + + // Return true if the row date is within the range + return rowDate >= startDate && rowDate <= endDate; } ); diff --git a/app/Views/configlisting.php b/app/Views/configlisting.php index fcade84d..319f635b 100755 --- a/app/Views/configlisting.php +++ b/app/Views/configlisting.php @@ -98,10 +98,10 @@ - + - + @@ -217,17 +217,19 @@ function(settings, data, dataIndex) { var fromDate = $('#fromDate').val(); var toDate = $('#toDate').val(); + console.log(fromDate); // e.g., 01-09-2024 + console.log(toDate); // e.g., 08-09-2024 if (!fromDate || !toDate) { return true; // If no dates selected, don't filter } - var dateStr = data[0]; // 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 + // Convert the fromDate and toDate from dd-mm-yyyy to Date objects + var fromParts = fromDate.split("-"); + var toParts = toDate.split("-"); - var startDate = new Date(fromDate); - var endDate = new Date(toDate); + var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day + var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]); // Adjust startDate to include the day before the selected fromDate startDate.setDate(startDate.getDate() - 1); @@ -235,8 +237,13 @@ // 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; + // Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format) + var dateStr = data[0]; + var dateParts = dateStr.split("-"); + var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); + + // Return true if the row date is within the range + return rowDate >= startDate && rowDate <= endDate; } ); diff --git a/app/Views/costListing.php b/app/Views/costListing.php index 9d6d5f88..a75b764e 100755 --- a/app/Views/costListing.php +++ b/app/Views/costListing.php @@ -56,10 +56,10 @@ - + - + @@ -238,17 +238,19 @@ function(settings, data, dataIndex) { var fromDate = $('#fromDate').val(); var toDate = $('#toDate').val(); + console.log(fromDate); // e.g., 01-09-2024 + console.log(toDate); // e.g., 08-09-2024 if (!fromDate || !toDate) { return true; // If no dates selected, don't filter } - var dateStr = data[0]; // 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 + // Convert the fromDate and toDate from dd-mm-yyyy to Date objects + var fromParts = fromDate.split("-"); + var toParts = toDate.split("-"); - var startDate = new Date(fromDate); - var endDate = new Date(toDate); + var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day + var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]); // Adjust startDate to include the day before the selected fromDate startDate.setDate(startDate.getDate() - 1); @@ -256,8 +258,13 @@ // 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; + // Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format) + var dateStr = data[0]; + var dateParts = dateStr.split("-"); + var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); + + // Return true if the row date is within the range + return rowDate >= startDate && rowDate <= endDate; } ); diff --git a/app/Views/createPOfromRequistion.php b/app/Views/createPOfromRequistion.php index 1f90a28c..89167946 100755 --- a/app/Views/createPOfromRequistion.php +++ b/app/Views/createPOfromRequistion.php @@ -273,10 +273,10 @@ - + - + @@ -307,21 +307,21 @@ foreach ($ReqList as $record) { ?> -   - +   + ReqDate); $RequestedDate = $dt->format('d-m-Y'); echo $RequestedDate; ?> - ReqNo; ?> - ReqType; ?> + ReqNo; ?> + ReqType; ?> FirstName; ?> - TotalNoofLineItems; ?> - PolineItems; ?> - PartilallyLineItems; ?> - newLineItem; ?> + TotalNoofLineItems; ?> + PolineItems; ?> + PartilallyLineItems; ?> + newLineItem; ?> StatusName; ?> DepartmentName; ?> Designation; ?> @@ -405,31 +405,38 @@ }); // Date range filter function $.fn.dataTable.ext.search.push( - function(settings, data, dataIndex) { - var fromDate = $('#fromDate').val(); - var toDate = $('#toDate').val(); + function(settings, data, dataIndex) { + var fromDate = $('#fromDate').val(); + var toDate = $('#toDate').val(); + console.log(fromDate); // e.g., 01-09-2024 + console.log(toDate); // e.g., 08-09-2024 - if (!fromDate || !toDate) { - return true; // If no dates selected, don't filter - } + 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 + // Convert the fromDate and toDate from dd-mm-yyyy to Date objects + var fromParts = fromDate.split("-"); + var toParts = toDate.split("-"); - var startDate = new Date(fromDate); - var endDate = new Date(toDate); + var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day + var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]); - // Adjust startDate to include the day before the selected fromDate - startDate.setDate(startDate.getDate() - 1); + // 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); + // 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; - } - ); + // Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format) + var dateStr = data[0]; + var dateParts = dateStr.split("-"); + var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); + + // Return true if the row date is within the range + return rowDate >= startDate && rowDate <= endDate; + } + ); // Handle form submission for the date range filter $("#DateRangeFilter").click(function(e) { diff --git a/app/Views/departmentListing.php b/app/Views/departmentListing.php index 2d65c55f..d90ec22c 100755 --- a/app/Views/departmentListing.php +++ b/app/Views/departmentListing.php @@ -83,10 +83,10 @@ - + - + @@ -178,17 +178,19 @@ function(settings, data, dataIndex) { var fromDate = $('#fromDate').val(); var toDate = $('#toDate').val(); + console.log(fromDate); // e.g., 01-09-2024 + console.log(toDate); // e.g., 08-09-2024 if (!fromDate || !toDate) { return true; // If no dates selected, don't filter } - var dateStr = data[0]; // 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 + // Convert the fromDate and toDate from dd-mm-yyyy to Date objects + var fromParts = fromDate.split("-"); + var toParts = toDate.split("-"); - var startDate = new Date(fromDate); - var endDate = new Date(toDate); + var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day + var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]); // Adjust startDate to include the day before the selected fromDate startDate.setDate(startDate.getDate() - 1); @@ -196,8 +198,13 @@ // 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; + // Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format) + var dateStr = data[0]; + var dateParts = dateStr.split("-"); + var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); + + // Return true if the row date is within the range + return rowDate >= startDate && rowDate <= endDate; } ); diff --git a/app/Views/employeeListing.php b/app/Views/employeeListing.php index 2b8602c3..0db28b67 100755 --- a/app/Views/employeeListing.php +++ b/app/Views/employeeListing.php @@ -190,52 +190,6 @@ } }); - // Initialize the datepickers - $("#fromDate").datepicker({ - dateFormat: 'dd-mm-yy', - onSelect: function(selectedDate) { - var minDate = $(this).datepicker("getDate"); - $("#toDate").datepicker("option", "minDate", minDate); - } - }); - - $("#toDate").datepicker({ - dateFormat: 'dd-mm-yy', - onSelect: function(selectedDate) { - var maxDate = $(this).datepicker("getDate"); - $("#fromDate").datepicker("option", "maxDate", maxDate); - } - }); - - // Reset button functionality - $("#resetButton").click(function() { - $("#fromDate").datepicker("setDate", null); - $("#toDate").datepicker("setDate", null); - $("#toDate").datepicker("option", "minDate", null); - $("#fromDate").datepicker("option", "maxDate", null); - table.draw(); - }); - - // Date range filter - $.fn.dataTable.ext.search.push( - - function(settings, data, dataIndex) { - var fromDate = $("#fromDate").datepicker("getDate"); - var toDate = $("#toDate").datepicker("getDate"); - - var dateStr = data[0]; // Assuming the date is in the first column - - // Convert dateStr to Date object - var dateParts = dateStr.split("-"); - var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object - - if (!fromDate || !toDate) { - return true; // No filter if dates are not selected - } - - return date >= fromDate && date <= toDate; - } - ); // Handle form submission $("#DateRangeFilter").submit(function(e) { diff --git a/app/Views/expense_list.php b/app/Views/expense_list.php index 25b0078d..2d6e01a5 100755 --- a/app/Views/expense_list.php +++ b/app/Views/expense_list.php @@ -76,10 +76,10 @@ - + - + @@ -89,16 +89,16 @@ - + - - - - - - - - + + + + + + + + @@ -467,22 +467,33 @@ function(settings, data, dataIndex) { var fromDate = $('#fromDate').val(); var toDate = $('#toDate').val(); + console.log(fromDate); // e.g., 01-09-2024 + console.log(toDate); // e.g., 08-09-2024 if (!fromDate || !toDate) { return true; // If no dates selected, don't filter } - var dateStr = data[0]; - var dateParts = dateStr.split("-"); - var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); + // Convert the fromDate and toDate from dd-mm-yyyy to Date objects + var fromParts = fromDate.split("-"); + var toParts = toDate.split("-"); - var startDate = new Date(fromDate); - var endDate = new Date(toDate); + var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day + var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]); + // 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 date >= startDate && date <= endDate; + // Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format) + var dateStr = data[0]; + var dateParts = dateStr.split("-"); + var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); + + // Return true if the row date is within the range + return rowDate >= startDate && rowDate <= endDate; } ); diff --git a/app/Views/includes/new_footer.php b/app/Views/includes/new_footer.php index 67b9e516..ca8238cd 100755 --- a/app/Views/includes/new_footer.php +++ b/app/Views/includes/new_footer.php @@ -59,6 +59,27 @@ - - - - - + \ No newline at end of file diff --git a/app/Views/sales_invoice.php b/app/Views/sales_invoice.php index 0a3e5bc4..2d836e83 100755 --- a/app/Views/sales_invoice.php +++ b/app/Views/sales_invoice.php @@ -127,10 +127,10 @@ - + - + @@ -210,7 +210,7 @@
Created DateCreated Date Supplier NameItem DescriptionCostCGSTSGSTIGSTTotalActionSupplier NameItem DescriptionCostCGSTSGSTIGSTTotalAction
- + + +
+ +
+
+ @@ -204,45 +204,45 @@ $date = $createddate->format('d-m-Y'); $time = $createddate->format('h:i A'); ?> - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + +   + + + + +   + + + + + \ No newline at end of file
Create Date Create time
IGRNO ?> PONO ?>SupplierName ?>DeliveryChellanOrInvoiceNo ?>DeliveryChellanDate); - echo $date->format('d-m-Y'); ?>MaterialName ?>ReceivedQuantity ?>NetWeight ?>VehicleNo ?>DriverName ?>TransporterName ?>IGRStatus == 'ST074' ? 'Draft' : 'Completed'; ?> - - - -   - FilePath)) { ?> +
IGRNO ?> PONO ?>SupplierName ?>DeliveryChellanOrInvoiceNo ?>DeliveryChellanDate); + echo $date->format('d-m-Y'); ?>MaterialName ?>ReceivedQuantity ?>NetWeight ?>VehicleNo ?>DriverName ?>TransporterName ?>IGRStatus == 'ST074' ? 'Draft' : 'Completed'; ?> + + + +   + FilePath)) { ?> - file)) { ?> + file)) { ?> - + - -   - - - - -   - - -