From 7be2924d40a931a9aeecad5c40d18da87d7dfab6 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Mon, 21 Apr 2025 12:02:41 +0530 Subject: [PATCH 1/6] stock changes 21-04-2025 --- app/Views/stock/trpProductionStockDetails.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Views/stock/trpProductionStockDetails.php b/app/Views/stock/trpProductionStockDetails.php index 50e0d485..52a227c6 100644 --- a/app/Views/stock/trpProductionStockDetails.php +++ b/app/Views/stock/trpProductionStockDetails.php @@ -1216,7 +1216,7 @@ $timeOtions[] = "12:00 AM"; $summary['ebReading'] += is_numeric($trpProductionDetail['ebReading']) ? $trpProductionDetail['ebReading'] : 0; $summary['ebReadingPerUnitTon'] += is_numeric($trpProductionDetail['ebReadingPerUnitTon']) ? $trpProductionDetail['ebReadingPerUnitTon'] : 0; $summary['noOfEbReadingDays'] += is_numeric($trpProductionDetail['ebReading']) - && $trpProductionDetail['ebReading'] != 0 ? 1 : 0 ; + && $trpProductionDetail['ebReading'] != 0 ? 1 : 0 ; $summary['workingPersonEngineers'] += is_numeric($trpProductionDetail['workingPersonEngineers']) ? $trpProductionDetail['workingPersonEngineers'] : 0; $summary['workingPersonSupervisiors'] += is_numeric($trpProductionDetail['workingPersonSupervisiors']) ? $trpProductionDetail['workingPersonSupervisiors'] : 0; $summary['workingPersonOperators'] += is_numeric($trpProductionDetail['workingPersonOperators']) ? $trpProductionDetail['workingPersonOperators'] : 0; @@ -1445,7 +1445,7 @@ $timeOtions[] = "12:00 AM"; - + @@ -1705,7 +1705,7 @@ $timeOtions[] = "12:00 AM"; [ 'absDate' => $trpAbstract["Power Consumption"]['date'], 'absParticulars' => "Power Consumption", - 'absRunningHrs' => $summary['ebReadingPerUnitTon'] / ($summary['noOfEbReadingDays'] ?? 1 ) == 0 ? " " : number_format($summary['ebReadingPerUnitTon'] / ($summary['noOfEbReadingDays'] ?? 1 ),2), + 'absRunningHrs' => $summary['ebReadingPerUnitTon'] / ($summary['noOfEbReadingDays'] == 0 ? 1 : $summary['noOfEbReadingDays'] ) == 0 ? " " : number_format($summary['ebReadingPerUnitTon'] / ($summary['noOfEbReadingDays'] == 0 ? 1 : $summary['noOfEbReadingDays'] ),2), 'absPerHour' => "", 'absOpeningStock' => (int)$trpAbstract["Power Consumption"]['opening_stock'] == 0 ? " " : (int)$trpAbstract["Power Consumption"]['opening_stock'], 'absReceipt' => '', @@ -1865,7 +1865,7 @@ $timeOtions[] = "12:00 AM"; [ 'absParticulars' => "Power Consumption", - 'absRunningHrs' => $summary['ebReadingPerUnitTon'] / ($summary['noOfEbReadingDays'] ?? 1 ) == 0 ? " " : number_format($summary['ebReadingPerUnitTon'] / ($summary['noOfEbReadingDays'] ?? 1 ) , 2), + 'absRunningHrs' => $summary['ebReadingPerUnitTon'] / ($summary['noOfEbReadingDays'] == 0 ? 1 : $summary['noOfEbReadingDays'] ) == 0 ? " " : number_format($summary['ebReadingPerUnitTon'] / ($summary['noOfEbReadingDays'] == 0 ? 1 : $summary['noOfEbReadingDays'] ) , 2), 'absPerHour' => "", 'absOpeningStock' => '', 'absReceipt' => '', From adf94987108be5a737f718381e1054df1bb8101e Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Mon, 21 Apr 2025 12:57:54 +0530 Subject: [PATCH 2/6] stock changes 21-04-2025 --- app/Views/stock/CoatingMachineDetail.php | 8 ++---- app/Views/stock/drierMachineDetails.php | 26 +++++++++++++------ app/Views/stock/dustAndRoughStockDetails.php | 17 ++++++------ app/Views/stock/trpProductionStockDetails.php | 2 ++ app/Views/stock/trpSandUseStockDetails.php | 17 +++++++----- 5 files changed, 41 insertions(+), 29 deletions(-) diff --git a/app/Views/stock/CoatingMachineDetail.php b/app/Views/stock/CoatingMachineDetail.php index ae106fe5..1d1a29a4 100644 --- a/app/Views/stock/CoatingMachineDetail.php +++ b/app/Views/stock/CoatingMachineDetail.php @@ -365,9 +365,7 @@ " class="form-control " - data-provide="datepicker" - data-date-format="M-yyyy" - data-date-min-view-mode="1" readonly> + readonly> @@ -1713,8 +1711,7 @@ $('#changeMonthForm').submit(); }); - $(document).ready(function(){ - $('#month').datepicker({ + $('#month').datepicker({ format: 'M-yyyy', viewMode: 'months', minViewMode: 'months', @@ -1723,7 +1720,6 @@ startDate: new Date(2025, 0), // Jan is month 0 endDate: new Date() // current date as max }); - }) diff --git a/app/Views/stock/drierMachineDetails.php b/app/Views/stock/drierMachineDetails.php index 1e958eec..e990901d 100644 --- a/app/Views/stock/drierMachineDetails.php +++ b/app/Views/stock/drierMachineDetails.php @@ -327,9 +327,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); " class="form-control " - data-provide="datepicker" - data-date-format="M-yyyy" - data-date-min-view-mode="1" readonly> + readonly> @@ -1585,11 +1583,23 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); diff --git a/app/Views/stock/trpProductionStockDetails.php b/app/Views/stock/trpProductionStockDetails.php index 52a227c6..18e1c5c2 100644 --- a/app/Views/stock/trpProductionStockDetails.php +++ b/app/Views/stock/trpProductionStockDetails.php @@ -315,6 +315,8 @@ display: none; } + + diff --git a/app/Views/stock/trpSandUseStockDetails.php b/app/Views/stock/trpSandUseStockDetails.php index 66d41a47..3767b999 100644 --- a/app/Views/stock/trpSandUseStockDetails.php +++ b/app/Views/stock/trpSandUseStockDetails.php @@ -353,9 +353,7 @@ " class="form-control " - data-provide="datepicker" - data-date-format="M-yyyy" - data-date-min-view-mode="1" readonly + readonly style="max-width: 175px;"> @@ -1035,13 +1033,11 @@ From 0da85f5d7041f3895f55ccebc6f8652e37f9f631 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Mon, 21 Apr 2025 14:39:59 +0530 Subject: [PATCH 3/6] Leave report : GWM --- app/Controllers/Payslip.php | 34 +++- app/Models/Monthlypay_model.php | 40 ++++ app/Views/leavereports.php | 320 ++++++++++++++++++++------------ 3 files changed, 267 insertions(+), 127 deletions(-) diff --git a/app/Controllers/Payslip.php b/app/Controllers/Payslip.php index 5d09e9e2..887ee555 100755 --- a/app/Controllers/Payslip.php +++ b/app/Controllers/Payslip.php @@ -1718,20 +1718,34 @@ class Payslip extends BaseController public function leaveReport() { - $fyr = get_financial_year(); - if ($this->request->getMethod() == 'POST') { - $fyr = $this->request->getPost('fyr'); - } - // $fiscalYears = get_financial_year_list(); - $fiscalYears = get_financial_year_list(date('Y'), 8); + + $report = []; + + if ($this->request->getMethod(true) === 'POST' && $this->request->getPost('btn_submit')) { + + + $data['from_date'] = $this->request->getPost('from_date'); + $data['to_date'] = $this->request->getPost('to_date'); + $data['EmpID'] = $this->request->getPost('emp'); + + + + $report = $this->monthlypay_model->leave_report($data['from_date'], $data['to_date'], $data['EmpID']); + + + } + + $data['EmpData'] = $this->monthlypay_model->getActiveEmployee(); + + + $data['data'] = $report; +// dd($data); + // Load the view - $data['fiscalyears'] = $fiscalYears; - $data['selectedfiscalyears'] = $fyr; - $data['leaverecords'] = $this->payroll_model->getEmpDetailsforLeave($fyr); - // echo ''; $this->global['pageTitle'] = 'Leave Reports'; $this->loadViews("leavereports", $this->global, $data, NULL); } + function monthwiseLeaveReport($param1,$param2) { $EmployeeID = $param1; diff --git a/app/Models/Monthlypay_model.php b/app/Models/Monthlypay_model.php index d984d3d6..929a7d1f 100755 --- a/app/Models/Monthlypay_model.php +++ b/app/Models/Monthlypay_model.php @@ -663,5 +663,45 @@ where Month_Year = ? and att.EmpID in (select EmpID from t_attendance)"; // return [$current]; } + function getActiveEmployee() + { + $array = $this->db->table('t_employee_details') + ->select("FirstName,LastName,Gender,EmpID") + ->where('IsActive', 1) + ->get() + ->getResultArray(); + + return $array; + + } + + function leave_report($from_date, $to_date, $empID) + { + $builder = $this->db->table('t_monthly_pay_inputs MPI'); + $builder->selectSum('MPI.LOP_Days'); + $builder->selectSum('MPI.Paid_leave'); + $builder->selectSum('MPI.OT_Hrs_Worked'); + $builder->selectSum('MPI.OTSalary'); + $builder->select('MPI.EmpID, ED.FirstName , ED.LastName'); + $builder->join('t_employee_details ED', 'MPI.EmpID = ED.EmpID', 'left'); + + // Filter by EmpID if set + if (!empty($empID)) { + $builder->where('MPI.EmpID', $empID); + } + + // Filter by date range if both dates are provided + if (!empty($from_date) && !empty($to_date)) { + $builder->where("MPI.Month_Year >=", $from_date); + $builder->where("MPI.Month_Year <=", $to_date); + } + + $builder->groupBy('MPI.EmpID'); + + $query = $builder->get(); + return $query->getResultArray(); + } + + } \ No newline at end of file diff --git a/app/Views/leavereports.php b/app/Views/leavereports.php index 1f9eed8b..a47d765f 100755 --- a/app/Views/leavereports.php +++ b/app/Views/leavereports.php @@ -1,17 +1,37 @@ - - - - - - - - @@ -22,97 +42,132 @@
-
+
-
-
+
-
-
-
- -
+ -
- - -
-
-
- + + "> +
+ +
+
+ +
+ + +
+
+
+ +
+ +
+ +
+
+ + + + +
+ +
+ +
+ +
+ +
+ + + + +
+ +
+
+
+ +
+ + + +
+ + - - - - - + + + + + + - - - - NoofAbsentDays != 0) { ?> - - - - + + + - - - - - - - + + + + + + + + + + + + +
S.NoEmployee NameLeave TakenPaid Leave TakenEmplayee NameLOP DaysPaid LeavesTotal Leaves
EmpID . '/' . $selectedfiscalyears . '">' . $rec->EmpID . '-' . $rec->FullName . ''; ?>EmpID . '-' . $rec->FullName; ?>
NoofAbsentDays)) { - echo number_format((int)$rec->NoofAbsentDays, 0, '.', ''); - } else { - echo "0"; - } ?>NoofPaidLeaveDays)) { - echo number_format((int)$rec->NoofPaidLeaveDays, 0, '.', ''); - } else { - echo "0"; - } ?>
@@ -122,47 +177,78 @@
- - + + + + + + + - \ No newline at end of file From 403fbb59e936e87cc8e39f4fc280d1fef609f449 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Mon, 21 Apr 2025 15:14:17 +0530 Subject: [PATCH 4/6] Leave report : GWM --- app/Views/leavereports.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Views/leavereports.php b/app/Views/leavereports.php index a47d765f..c40e0a91 100755 --- a/app/Views/leavereports.php +++ b/app/Views/leavereports.php @@ -143,9 +143,9 @@ - - - + + + From 0cb5cb50b3c142a2dc6a3c8c625c52d4c76bb5dd Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Mon, 21 Apr 2025 17:44:44 +0530 Subject: [PATCH 5/6] stock changes 21-04-2025 --- app/Views/editconfig.php | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/app/Views/editconfig.php b/app/Views/editconfig.php index 1013c078..4cf8da5b 100755 --- a/app/Views/editconfig.php +++ b/app/Views/editconfig.php @@ -157,9 +157,9 @@ if (!empty($master)) { Config_ID === 'C023'){ ?> - + @@ -168,7 +168,7 @@ if (!empty($master)) { - ConfigValue; ?> + ConfigValue; ?> @@ -422,8 +422,6 @@ if (!empty($master)) { }, success: function(data) { - console.log(data); - if (data.length > 0) { if (data[0]?.isActive == 1) { @@ -509,15 +507,17 @@ if (!empty($master)) { var id = $(this).data('id'); var key = $(this).data('key'); var code = $(this).data('code'); - var configValue = $(this).data('configvalue'); + var configValue = $(this).attr('data-configvalue'); + + console.log(configValue); $('#key').val(key); $('#Config_ID').val(code); $('#configValue').val(configValue); - $('#EditConfiguration').modal('show'); - + }); + @@ -541,7 +541,25 @@ if (!empty($master)) { success: function(response) { if (response.status) { alert('Config Value updated successfully'); - location.reload(); + + let key = $('#key').val(); + + let configValue = $("#configValue").val(); + + let configId = $('#Config_ID').val(); + if (configId === "C023") { + $(`#configtable tbody tr td.config-value-td a[data-key="${key}"]`).text(configValue); + } else { + $(`#configtable tbody tr td.config-value-td[data-key="${key}"]`).text(configValue); + } + + $(`#configtable tbody tr td a.editConfigurationBtn[data-key="${key}"]`).attr('data-configvalue', configValue); + + + $("#configValue").val(" "); + + $('#EditConfiguration').modal('hide'); + } else { alert('Failed to update Config Value'); } From 47fd42baee848a5b2bac43d01c8464b742ed6a4b Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Tue, 22 Apr 2025 11:48:55 +0530 Subject: [PATCH 6/6] stock changes 22-04-2025 --- app/Config/Routes.php | 3 +++ app/Models/Dashboard_model.php | 10 +++++----- app/Views/Report_pending_purchase.php | 1 + app/Views/includes/new_header.php | 12 ++++++++++-- app/Views/reportslink.php | 2 +- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 752cfac5..56ca9f5a 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -544,3 +544,6 @@ $routes->post('updateTrpProductionDetails', 'StockController::updateTrpProductio $routes->post('updateAbstractDetails','StockController::updateAbstractDetails'); +//Reports Module + +$routes->get('allReports','Report::allReports'); \ No newline at end of file diff --git a/app/Models/Dashboard_model.php b/app/Models/Dashboard_model.php index 82e2cd67..3bfa49d0 100755 --- a/app/Models/Dashboard_model.php +++ b/app/Models/Dashboard_model.php @@ -1065,11 +1065,11 @@ pm.Status != 'ST030' and pm.Status != 'ST056' and pm.Status != 'ST027' "; $sql = "SELECT - CASE WHEN MONTH(PODate)>=4 THEN - concat(YEAR(PODate), '-',YEAR(PODate)+1) - ELSE concat(YEAR(PODate)-1,'-', YEAR(PODate)) END AS financial_year - FROM t_purchaseorder_master -GROUP BY financial_year"; + CASE WHEN MONTH(PODate)>=4 THEN + concat(YEAR(PODate), '-',YEAR(PODate)+1) + ELSE concat(YEAR(PODate)-1,'-', YEAR(PODate)) END AS financial_year + FROM t_purchaseorder_master + GROUP BY financial_year"; $query = $this->db->query($sql); return $query->getResult(); } diff --git a/app/Views/Report_pending_purchase.php b/app/Views/Report_pending_purchase.php index a4c5eafd..b46cc7f0 100755 --- a/app/Views/Report_pending_purchase.php +++ b/app/Views/Report_pending_purchase.php @@ -125,6 +125,7 @@
+
diff --git a/app/Views/reportslink.php b/app/Views/reportslink.php index f2840762..c03055cd 100755 --- a/app/Views/reportslink.php +++ b/app/Views/reportslink.php @@ -26,7 +26,7 @@

  Purchase

-

Purchase

+

Purchase

Year Wise

Pending

Purchase Supplier - Wise