From 88966bc5f56797beff5ed12359926748cbdef037 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Thu, 6 Mar 2025 17:39:45 +0530 Subject: [PATCH 1/5] changes in stock module 06-03-2025 --- app/Controllers/StockController.php | 133 +--------------------------- app/Models/FactoryMachineModel.php | 2 +- 2 files changed, 4 insertions(+), 131 deletions(-) diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index 77651838..dbc2587b 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -1331,13 +1331,6 @@ class StockController extends BaseController - - - - - - - // Get the previous month's last date diesel stock details for next month updation $previousMonth = DateTime::createFromFormat('Y-m', $month)->modify('-1 month')->format('Y-m'); @@ -1416,46 +1409,7 @@ class StockController extends BaseController // Reset the structure to have indexed arrays without the date keys $data['groupedDieselMachineStockDetails'] = array_values($groupedByDate); - - - - //temp_code_s_2025_02 - - // getting diesel machines for creating table headers - // checking already existing stock if yes then get the diesel machines id from the existing stock - // if not get all the diesel machines from the factory Machine master table - - // if (!empty($data['groupedDieselMachineStockDetails'])) { - - // $result = $groupedByDate[$date]; - - // $distinctMachineId = []; - - // foreach ($result as $index => $eachResult) { - // $distinctMachineId[] = $result[$index]['machine_id']; - // } - - // $dieselMachines = $this->factoryMachine_model - // ->whereIn('id', $distinctMachineId) - // ->orderBy('id', 'asc') - // ->get() - // ->getResultArray(); - - - // } else { - - // $dieselMachines = $this->factoryMachine_model - // ->where('is_active', 1) - // ->where('energy_type', 'Diesel') - // ->orderBy('id', 'asc') - // ->get() - // ->getResultArray(); - - // } - - //temp_code_e_2025_02 - - + @@ -1819,35 +1773,6 @@ class StockController extends BaseController $data['groupedPowerConsumptionStockDetails'] = array_values($groupedByDate); - //temp_code_s_2025_02 - - // getting electric machines for creating table headers - // checking already existing stock if yes then get the electric machines id from the existing stock - // if not get all the electric machines from the factory Machine master table - - // if (!empty($data['groupedPowerConsumptionStockDetails'])) { - - // $result = $groupedByDate[$date]; - - // $distinctMachineId = []; - - // foreach ($result as $index => $eachResult) { - // $distinctMachineId[] = $result[$index]['machine_id']; - // } - - // $electricMachines = $this->factoryMachine_model->getSelectedElectricMachines($distinctMachineId); - - - // } else { - - // $electricMachines = $this->factoryMachine_model->getAllActiveElectricMachines(); - - // } - - //temp_code_e_2025_02 - - - $electricMachinesCount = count($electricMachines); $data['electricMachinesCount'] = $electricMachinesCount; @@ -2279,34 +2204,7 @@ class StockController extends BaseController // Reset the structure to have indexed arrays without the date keys $data['groupedResinStockDetails'] = array_values($groupedByDate); - - //temp_code_s_2025_02 - - // getting resin material for creating table headers - // checking already existing stock if yes then get the material code from the existing stock - // if not get all the material codes currently isActive from the raw material details table - - // if (!empty($data['groupedResinStockDetails'])) { - - // $result = $groupedByDate[$date]; - - // $distinctMaterialCodes = []; - - // foreach ($result as $index => $eachResult) { - // $distinctMaterialCodes[] = $result[$index]['materialCode']; - // } - - // $resinMaterials = $this->rawmaterialdetails_model->getSelectedResinMaterialCode($distinctMaterialCodes); - - // } else { - - // $resinMaterials = $this->rawmaterialdetails_model->getAllResinMaterialCode(); - - // } - - //temp_code_e_2025_02 - - + // getting customer for creating table headers // checking already existing stock if yes then get customer from the existing stock // if not set customer in db , then set '' empty string @@ -2655,32 +2553,7 @@ class StockController extends BaseController // Reset the structure to have indexed arrays without the date keys $data['groupedBagStockDetails'] = array_values($groupedByDate); - - - - //temp_code_s_2025_02 - - // // getting bag material for creating table headers - // // checking already existing stock if yes then get the material code from the existing bag - // // if not get all the material codes from the raw material details table - - // if (!empty($data['groupedBagStockDetails'])) { - // $result = $groupedByDate[$date]; - - // $distinctMaterialCodes = []; - - // foreach ($result as $index => $eachResult) { - // $distinctMaterialCodes[] = $result[$index]['materialCode']; - // } - - // $bagMaterials = $this->rawmaterialdetails_model->getSelectedBagMaterialCode($distinctMaterialCodes); - - // } else { - // $bagMaterials = $this->rawmaterialdetails_model->getAllBagMaterialCode(); - // } - - //temp_code_e_2025_02 - + // getting customer for creating table headers // checking already existing stock if yes then get customer from the existing stock diff --git a/app/Models/FactoryMachineModel.php b/app/Models/FactoryMachineModel.php index 6c363b76..3e77c081 100644 --- a/app/Models/FactoryMachineModel.php +++ b/app/Models/FactoryMachineModel.php @@ -92,7 +92,7 @@ class FactoryMachineModel extends Model $result = $this->db->table('t_factorymachinemaster') ->where('is_active', 1) ->where('energy_type', 'diesel') - ->orderBy('id', 'desc') + ->orderBy('id', 'asc') ->get() ->getResultArray(); From 82e00e2b3ad95293e9316d781e6904802cafccae Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Thu, 6 Mar 2025 19:47:40 +0530 Subject: [PATCH 2/5] changes in stock module 06-03-2025 --- app/Views/stock/bagStockDetails.php | 28 +++++++++++------ app/Views/stock/dieselStockDetails.php | 33 ++++++++++++++++----- app/Views/stock/powerConsumptionDetails.php | 33 +++++++++++++++------ app/Views/stock/resinStockDetails.php | 30 +++++++++++++++++-- 4 files changed, 96 insertions(+), 28 deletions(-) diff --git a/app/Views/stock/bagStockDetails.php b/app/Views/stock/bagStockDetails.php index 6b529812..a5adbade 100644 --- a/app/Views/stock/bagStockDetails.php +++ b/app/Views/stock/bagStockDetails.php @@ -304,7 +304,7 @@
" - class="form-control mt-2" data-provide="datepicker" + class="form-control mt-2" data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
@@ -682,12 +682,15 @@ > + foreach($previousMonthBagStockDetails as $index => $previousMonthBagStockDetail) + { + if($previousMonthBagStockDetail['materialCode'] == $bagMaterial['MaterialCode']){ + echo $previousMonthBagStockDetail['balanceStock'] ; + break; + } + + } + ?> @@ -704,8 +707,15 @@ data-id=" " > + foreach($previousMonthBagStockDetails as $index => $previousMonthBagStockDetail) + { + if($previousMonthBagStockDetail['materialCode'] == $bagMaterial['MaterialCode']){ + echo $previousMonthBagStockDetail['balanceStock'] ; + break; + } + + } + ?> diff --git a/app/Views/stock/dieselStockDetails.php b/app/Views/stock/dieselStockDetails.php index 5f0fedf1..c9df9250 100644 --- a/app/Views/stock/dieselStockDetails.php +++ b/app/Views/stock/dieselStockDetails.php @@ -839,10 +839,18 @@ foreach ($period as $day) { - > + > + + $previousMonthDieselMachineStockDetail) + { + if($previousMonthDieselMachineStockDetail['machine_id'] == $dieselMachine['id']){ + echo $previousMonthDieselMachineStockDetail['closing_reading'] ; + break; + } + + } + ?> - + $previousMonthDieselMachineStockDetail) + { + if($previousMonthDieselMachineStockDetail['machine_id'] == $dieselMachine['id']){ + echo $previousMonthDieselMachineStockDetail['closing_reading'] ; + break; + } + + } + + ?> >> + + + @@ -859,11 +862,17 @@ foreach ($period as $day) { data-id=" "> - $previousMonthPowerConsumptionStockDetail) + { + if($previousMonthPowerConsumptionStockDetail['machine_id'] == $powerMachine['id']){ + echo $previousMonthPowerConsumptionStockDetail['closing_units'] ; + break; + } + + } ?> + - $previousMonthPowerConsumptionStockDetail) + { + if($previousMonthPowerConsumptionStockDetail['machine_id'] == $powerMachine['id']){ + echo $previousMonthPowerConsumptionStockDetail['closing_units'] ; + break; + } + + } ?> + > + > + + $previousMonthResinStockDetail) + { + if($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']){ + echo $previousMonthResinStockDetail['balanceStock'] ; + break; + } + + } + ?> + + + data-id=" "> + + $previousMonthResinStockDetail) + { + if($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']){ + echo $previousMonthResinStockDetail['balanceStock'] ; + break; + } + + } + ?> + + From 725c96a12373862deb97f9dc6b02e78f34a6d32b Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Fri, 7 Mar 2025 12:01:30 +0530 Subject: [PATCH 3/5] changes in stock module 07-03-2025 --- app/Models/TrpProductionModel.php | 4 +- app/Views/stock/CoatingMachineDetail.php | 65 +- app/Views/stock/bagStockDetails.php | 64 +- app/Views/stock/dieselStockDetails.php | 84 +-- app/Views/stock/drierMachineDetails.php | 77 +-- app/Views/stock/dustAndRoughStockDetails.php | 28 +- app/Views/stock/gasStockDetails.php | 57 +- app/Views/stock/incomingSilicaSandDetails.php | 50 +- app/Views/stock/powerConsumptionDetails.php | 90 +-- app/Views/stock/resinStockDetails.php | 47 +- app/Views/stock/trpProductionStockDetails.php | 583 +++++++----------- app/Views/stock/trpSandUseStockDetails.php | 39 +- 12 files changed, 435 insertions(+), 753 deletions(-) diff --git a/app/Models/TrpProductionModel.php b/app/Models/TrpProductionModel.php index 55277d90..de14aba0 100644 --- a/app/Models/TrpProductionModel.php +++ b/app/Models/TrpProductionModel.php @@ -146,7 +146,7 @@ class TrpProductionModel extends Model $builder->join('t_trp_sand_use tsu', 'tsu.date = tpmd.date', 'left'); // Subquery: Coating Machine Gas Consumption - $subquery1 = $this->db->table('t_coatingMachineDetails') + $subquery1 = $this->db->table('t_coatingmachinedetails') ->select('date, SUM(totalGasConsumption) AS totalGasConsumption') ->groupBy('date') ->getCompiledSelect(false); // Convert Query Builder to raw SQL; @@ -154,7 +154,7 @@ class TrpProductionModel extends Model $builder->join("({$subquery1}) tcmd", 'tcmd.date = tpmd.date', 'left'); // Subquery: Drier Machine Gas Consumption - $subquery2 = $this->db->table('t_drierMachineDetails') + $subquery2 = $this->db->table('t_driermachinedetails') ->select('date, SUM(total_gas_consumption) AS totalGasConsumption') ->groupBy('date') ->getCompiledSelect(false); // Convert Query Builder to raw SQL; diff --git a/app/Views/stock/CoatingMachineDetail.php b/app/Views/stock/CoatingMachineDetail.php index 2e69cd0c..a0ecdce6 100644 --- a/app/Views/stock/CoatingMachineDetail.php +++ b/app/Views/stock/CoatingMachineDetail.php @@ -235,6 +235,10 @@ z-index: 5!important; } + tfoot tr { + background-color:rgb(235, 236, 203); + } +
@@ -456,49 +460,26 @@ } ?> - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ Total + - - - - - (avg) (avg)
Date ShiftMachine On TimeMachine Off TimeMachine Running(hr)Customer Name GradeTotal CoatingTotal Coating Sand(kg)Total Gas ConsumptionHour GasHour QTY(kg)
- Total - - - - - - (avg) (avg)
diff --git a/app/Views/stock/bagStockDetails.php b/app/Views/stock/bagStockDetails.php index a5adbade..9820c631 100644 --- a/app/Views/stock/bagStockDetails.php +++ b/app/Views/stock/bagStockDetails.php @@ -235,6 +235,9 @@ } */ + tfoot tr { + background-color:rgb(235, 236, 203); + } @@ -419,7 +422,7 @@
- " + " class="form-control mt-2" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1"> @@ -585,45 +588,27 @@ + + -
- + - - - - - - - - - - - + - + + + + + - - - - - - - - - - - + - + - -
+ Total +
Total SumOpening StockReceiptUsedBalance Stock
- Total -
-
@@ -1282,4 +1267,17 @@ }; }); + + + \ No newline at end of file diff --git a/app/Views/stock/dieselStockDetails.php b/app/Views/stock/dieselStockDetails.php index c9df9250..4e46e21c 100644 --- a/app/Views/stock/dieselStockDetails.php +++ b/app/Views/stock/dieselStockDetails.php @@ -226,8 +226,9 @@ max-width: 100px; } - - + tfoot tr{ + background-color:rgb(235, 236, 203); + } @@ -683,67 +684,40 @@ foreach ($period as $day) { } ?> -
- + + - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + - + - - - - - - + + + + + + + + + + + - - - - -
Total Sum Opening Purchase Diesel Filling Diesel Balance StockOpening ReadingClosing ReadingFilling DieselConsumptionRunning HoursMileage
- Total - + Total +
-
diff --git a/app/Views/stock/drierMachineDetails.php b/app/Views/stock/drierMachineDetails.php index 3cf051d8..4244ad46 100644 --- a/app/Views/stock/drierMachineDetails.php +++ b/app/Views/stock/drierMachineDetails.php @@ -238,6 +238,10 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); z-index: 5!important; } + tfoot tr { + background-color:rgb(235, 236, 203); + } +
@@ -503,62 +507,29 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - -
Date valueDrier On Time Drier Off TimeRunning HrsSupplier Name input Sand Qty (Metric Ton)inputp Sand Moisture(%)Sand Dried Qty (Metric Ton)Total Gas ConsumptionGas Per TonQty Per Hrs (Metric Ton)Moisture Loss Qty (Metric Ton)Dust Qty (Metric Ton)
- Total - ----
- - + + Total + + - + - + + - + + - + + + + + + + + + +

diff --git a/app/Views/stock/dustAndRoughStockDetails.php b/app/Views/stock/dustAndRoughStockDetails.php index a9860050..405c77ff 100644 --- a/app/Views/stock/dustAndRoughStockDetails.php +++ b/app/Views/stock/dustAndRoughStockDetails.php @@ -228,6 +228,10 @@ max-width: 150px; } + tfoot tr { + background-color:rgb(235, 236, 203); + } + @@ -273,10 +277,9 @@ data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
-
+
-
- LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; - } ?> + LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?> Quantity ?> UOM ?> @@ -1309,9 +1308,9 @@ if (!empty($getlogpodtl)) { Taxamount ?> TotalValue ?> - + + + @@ -1660,7 +1659,7 @@ if (!empty($getlogpodtl)) {   Submit   OK -   Submit +
@@ -2622,7 +2621,7 @@ if (!empty($getlogpodtl)) { // Taxvalue: TotalTaxValue, // TotalValue: TotalOrderValue // })); - PONOStatus = + var PONOStatus = ""; var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName; var rowHtml = ` @@ -2917,8 +2916,6 @@ if (!empty($getlogpodtl)) { $('#OtheritemDescription').val(''); } - var DeletedMaterialCode = ''; - var DeletedMaterialName = ''; function DeleteRow(rowid) { @@ -3152,6 +3149,7 @@ if (!empty($getlogpodtl)) { +