From 609e3f9d5e6781a18921eba54a06fb0a6a08367e Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sat, 4 Jan 2025 18:43:59 +0530 Subject: [PATCH 1/8] stock module latest today vadivel J 04-1-2025 --- app/Controllers/StockController.php | 194 ++++- app/Models/TrpProductionMaintenanceModel.php | 48 ++ app/Models/TrpProductionModel.php | 49 ++ app/Models/TrpProductionWasteModel.php | 46 ++ app/Views/trpProductionStockDetails.php | 779 +++++++++++++++++++ 5 files changed, 1114 insertions(+), 2 deletions(-) create mode 100644 app/Models/TrpProductionMaintenanceModel.php create mode 100644 app/Models/TrpProductionModel.php create mode 100644 app/Models/TrpProductionWasteModel.php create mode 100644 app/Views/trpProductionStockDetails.php diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index 9cc49b91..c581aa30 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -18,6 +18,9 @@ use App\Models\DustAndRoughModel; use App\Models\ResinStockModel; use App\Models\GasStockModel; use App\Models\TrpSandUseStockModel; +use App\Models\TrpProductionModel; +use App\Models\TrpProductionMaintenanceModel; +use App\Models\TrpProductionWasteModel; use CodeIgniter\HTTP\ResponseInterface; use DateTime; use DatePeriod; @@ -45,6 +48,12 @@ class StockController extends BaseController protected $TrpSandUseStock_model; + protected $TrpProduction_model; + + protected $TrpProductionMaintenance_model; + + protected $TrpProductionWaste_model; + protected $db; /** @@ -85,6 +94,12 @@ class StockController extends BaseController $this->TrpSandUseStock_model = new TrpSandUseStockModel(); + $this->TrpProduction_model = new TrpProductionModel(); + + $this->TrpProductionMaintenance_model = new TrpProductionMaintenanceModel(); + + $this->TrpProductionWaste_model = new TrpProductionWasteModel(); + $this->session = session(); helper('form'); @@ -1210,6 +1225,7 @@ class StockController extends BaseController } public function updateTrpSandUseStockDetails(){ + $postData = $this->request->getPost(); $updateTrpSandUseStockDetailsData = json_decode($postData['updateTrpSandUseStockDetails'], true); @@ -1266,9 +1282,183 @@ class StockController extends BaseController - public function trpProductionDetails(){} + public function trpProductionDetails(){ - public function updateTrpProductionDetails(){} + + if ($this->request->getMethod() === 'POST') { + $month = $this->request->getPost('month'); + + $date = DateTime::createFromFormat('M-Y', $month); + + $formattedDate = $date->format('Y-m'); + + $month = $formattedDate; + } else { + $month = date('Y-m'); + } + + $data = []; + + $data['month'] = $month; + + $this->global['pageTitle'] = 'Trp production Details'; + + $startDate = "$month-01"; + $endDate = date("Y-m-t", strtotime($startDate)); + $data['trpProductionDetails'] = $this->TrpProductionMaintenance_model + ->join('t_trpProduction', 't_trpProduction.date = t_trpProductionMaintenance.date') + ->join('t_trpProductionWaste', 't_trpProductionWaste.date = t_trpProductionMaintenance.date') + ->join('t_') + ->where('date >=', $startDate) + ->where('date <=', $endDate) + ->orderBy('date', 'asc') + ->findAll(); + + $date = DateTime::createFromFormat('Y-m', $month); + + $formattedDate = $date->format('M-Y'); + + $data['month'] = $formattedDate; + + return $this->loadViews("trpSandUseStockDetails", $this->global, $data, NULL); + + + + } + + public function updateTrpProductionDetails() { + + $postData = $this->request->getPost(); + + $updateTrpProductionDetails = json_decode($postData['updateTrpProductionDetails'], true); + + $updateProduction = []; + $updateMaintanence = []; + $updateWaste = []; + + $insertProduction = []; + $insertMaintanence = []; + $insertWaste = []; + + foreach ($updateTrpProductionDetails as $data) { + + $data['date'] = $this->convertToDateWithFlexibleFormats($data['Date'], ["d-m-Y", "Y-m-d", "m/d/Y", "m-d-Y"], "Y-m-d"); + + $date = $data['date']; + + $dbDataTrpMaintenance = [ + 'date' => $data['date'], + 'openingTime' => $data['openingTime'], + 'closingTime' => $data['closingTime'], + 'totalHours' => $data['totalHours'], + 'coldStart' => $data['coldStart'], + 'breakdownHours' => $data['breakdownHours'], + 'burnerFiringHours' => $data['burnerFiringHours'], + 'sandFeedingHours' => $data['sandFeedingHours'], + 'workingPersonEngineers' => $data['workingPersonEngineers'], + 'workingPersonSupervisiors' => $data['workingPersonSupervisiors'], + 'workingPersonOperators' => $data['workingPersonOperators'], + 'rollerDrivers' => $data['rollerDrivers'], + 'natureOfMaintenance' => $data['natureOfMaintenance'], + 'location' => $data['location'], + 'description' => $data['description'] + ]; + + $dbDataTrpProduction = [ + 'date' => $data['date'], + 'gasReceiptBg' => $data['gasReceiptBg'], + 'gasReceiptPg' => $data['gasReceiptPg'], + 'physicalGasConsumption'=> $data['physicalGasConsumption'], + 'trpPlusDrierGasConsumption'=> $data['trpPlusDrierGasConsumption'], + 'trpPhysicalGasPerTon' => $data['trpPhysicalGasPerTon'], + 'panelGasConsumption' => $data['panelGasConsumption'], + 'panelGasPerTon' => $data['panelGasPerTon'], + 'edRunningHours' => $data['edRunningHours'], + 'edProduction' => $data['edProduction'], + 'edUsage' => $data['edUsage'], + 'trpProduction' => $data['trpProduction'], + 'trpProductionPerHour' => $data['trpProductionPerHour'], + 'waterReceipt' => $data['waterReceipt'], + 'waterConsumption' => $data['waterConsumption'], + 'ebReading' => $data['ebReading'], + 'ebReadingPerUnitTon' => $data['ebReadingPerUnitTon'], + ]; + + $dbDataTrpWaste = [ + 'date' => $data['date'], + 'msSeperation' => $data['msSeperation'], + 'edWaste' => $data['edWaste'], + 'coolerBags' => $data['coolerBags'], + 'edPlus20Waste' => $data['edPlus20Waste'], + 'cycloneWaste' => $data['cycloneWaste'], + ]; + + $trpMaintenanceResultExists = $this->TrpProductionMaintenance_model + ->where('date', $date) + ->first(); + + $trpProductionResultExists = $this->TrpProduction_model + ->where('date', $date) + ->first(); + + $trpWasteResultExists = $this->TrpProductionWaste_model + ->where('date', $date) + ->first(); + + if (empty($trpMaintenanceResultExists)) { + $insertMaintanence[] = $dbDataTrpMaintenance; + $insertProduction[] = $dbDataTrpProduction; + $insertWaste[] = $dbDataTrpWaste; + } else { + $dbDataTrpMaintenance['id'] = $trpMaintenanceResultExists['id']; + $dbDataTrpProduction['id'] = $trpProductionResultExists['id']; + $dbDataTrpWaste['id'] = $trpWasteResultExists['id']; + + $updateMaintanence[] = $dbDataTrpMaintenance; + $updateProduction[] = $dbDataTrpProduction; + $updateWaste[] = $dbDataTrpWaste; + } + } + + // Start the transaction + $this->db->transBegin(); + + try { + if (!empty($insertMaintanence)) { + $this->TrpProductionMaintenance_model->insertBatch($insertMaintanence); + } + + if (!empty($insertProduction)) { + $this->TrpProduction_model->insertBatch($insertProduction); + } + + if (!empty($insertWaste)) { + $this->TrpProductionWaste_model->insertBatch($insertWaste); + } + + if (!empty($updateMaintanence)) { + $this->TrpProductionMaintenance_model->updateBatch($updateMaintanence, 'id'); + } + + if (!empty($updateProduction)) { + $this->TrpProduction_model->updateBatch($updateProduction, 'id'); + } + + if (!empty($updateWaste)) { + $this->TrpProductionWaste_model->updateBatch($updateWaste, 'id'); + } + + // Commit the transaction if all operations are successful + $this->db->transCommit(); + echo "Data Saved Successfully"; + + } catch (\Exception $error) { + // Rollback the transaction in case of any errors + $this->db->transRollback(); + echo "An error occurred: " . $error->getMessage(); + } + } + diff --git a/app/Models/TrpProductionMaintenanceModel.php b/app/Models/TrpProductionMaintenanceModel.php new file mode 100644 index 00000000..ca39b46e --- /dev/null +++ b/app/Models/TrpProductionMaintenanceModel.php @@ -0,0 +1,48 @@ + + .num { + text-align: right; + } + + .fht-table, + .fht-table thead, + .fht-table tfoot, + .fht-table tbody, + .fht-table tr, + .fht-table th, + .fht-table td { + margin: 0; + } + + .fht-table td { + text-align: center; + } + + .fht-table td:hover { + background-color: #00a65a; + color: #ffffff; + } + + .fht-table { + border: 0 none; + height: auto; + width: auto; + border-collapse: collapse; + border-spacing: 0; + /*table-layout: fixed; Algoritmo de distribucion fijo */ + white-space: nowrap; + } + + .fht-table th, + .fht-table td { + overflow: hidden; + } + + .fht-table-wrapper, + .fht-table-wrapper .fht-thead, + .fht-table-wrapper .fht-tfoot, + .fht-table-wrapper .fht-fixed-column .fht-tbody, + .fht-table-wrapper .fht-fixed-body .fht-tbody, + .fht-table-wrapper .fht-tbody { + overflow: hidden; + position: relative; + } + + .fht-table-wrapper .fht-fixed-body .fht-tbody, + .fht-table-wrapper .fht-tbody { + overflow: auto; + } + + .fht-table-wrapper .fht-table .fht-cell { + overflow: hidden; + height: 1px; + } + + .fht-table-wrapper .fht-fixed-column, + .fht-table-wrapper .fht-fixed-body { + top: 0; + left: 0; + position: absolute; + } + + .fht-table-wrapper .fht-fixed-column { + z-index: 1; + } + + .fht-fixed-body .fht-thead table { + margin-right: 20px; + border: 0 none; + } + + /*For Examples*/ + + .ContenedorTabla { + height: 500px; + margin: 0 auto; + overflow: auto; + width: auto; + position: relative; + } + + .header, + .main { + display: inline-block; + height: auto; + width: 100%; + } + + .titulosHeader { + border-bottom: 1px solid #e8bb25; + height: auto; + margin-bottom: 10px; + padding-bottom: 8px; + padding-top: 8px; + width: 100%; + } + + + .celda_encabezado_general { + background-color: #00a65a; + border: 1px solid #ccc; + color: #ffffff; + font-weight: bold; + padding: 6px 10px;; + text-align: center; + } + + + ._Separador { + background-color: #fff; + height: 12px; + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; + width: 7px; + } + + ._Separador div { + width: 4px; + } + + .celda_normal { + /*background-color: #fff;*/ + /* */ + text-align: center; + border: 1px solid #ccc; + padding: 2px 4px; + } + + /*style excel*/ + .excel_cell { + border: 1px solid #CCC; + color: #222; + text-align: center; + font-size: 13px; + font-weight: normal; + padding: 4px; + white-space: pre-line; + empty-cells: show; + } + + ._cell_header { + background-color: #EEE; + } + + ._cell_Default { + background-color: #FFF; + text-align: left; + } + + .excel_cell div { + width: 30px; + height: 20px; + } + + #resinStockDetailsTableId th:nth-child(1), + #resinStockDetailsTableId td:nth-child(1) { + position: sticky; + left: 0; + background-color: #00a65a; + z-index: 2; + border-right: 2px solid #ddd; + color: #ffffff; + } + + .modal { + padding-right: 30% ! important; + } + + + + + modify('first day of this month')->format('Y-m-d'); + $endDate = $date->modify('last day of this month')->format('Y-m-d'); + + $datesInMonth = []; + + + $period = new DatePeriod( + new DateTime($startDate), + new DateInterval('P1D'), + (new DateTime($endDate))->modify('+1 day') + ); + + foreach ($period as $day) { + $datesInMonth[] = $day->format('Y-m-d'); + } + + ?> + + + +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+
+ + + +
+
+
+
+ + +
+
+ +
+ " + class="form-control mt-2" data-provide="datepicker" + data-date-format="M-yyyy" data-date-min-view-mode="1"> +
+
+ +
+
+
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $resinStockDetails){ + ?> + format('d-m-Y'); + if ($dateInMonthDmYFormat === $currentDate) { echo 'style="background: #cef0ad;"';} + ?> + > + $resinStock){ ?> + + format('d-m-Y'); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + $dateInMonth){ ?> + format('d-m-Y'); + if ($dateInMonthDmYFormat === $currentDate) { echo 'style="background: #cef0ad;"';} + ?> + > + $resinMaterial){ ?> + + + + format('d-m-Y'); + ?> + + + + + + + + + + + + + + + + + + + + + + + +
material + + +
Date Opening StockReceiptUsedBalance Stock
+ + + + + oninput="openingStockChange(this)" + contenteditable="true" + + + > + + + + + +
+ + + + oninput="openingStockChange(this)" + contenteditable="true" + + + >00
+
+ +
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + From aa166057d79e6f2eab85a1746028cd093e95139c Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sat, 4 Jan 2025 18:46:41 +0530 Subject: [PATCH 2/8] stock module latest today vadivel J 04-1-2025 --- app/Controllers/StockController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index c581aa30..cba95223 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -1308,7 +1308,6 @@ class StockController extends BaseController $data['trpProductionDetails'] = $this->TrpProductionMaintenance_model ->join('t_trpProduction', 't_trpProduction.date = t_trpProductionMaintenance.date') ->join('t_trpProductionWaste', 't_trpProductionWaste.date = t_trpProductionMaintenance.date') - ->join('t_') ->where('date >=', $startDate) ->where('date <=', $endDate) ->orderBy('date', 'asc') From c28461f5c256aba212bed256fed88620892212f6 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sun, 5 Jan 2025 00:00:42 +0530 Subject: [PATCH 3/8] stock module latest today vadivel J 04-1-2025 --- api_test.http | 4 ++++ app/Controllers/StockController.php | 23 ++++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 api_test.http diff --git a/api_test.http b/api_test.http new file mode 100644 index 00000000..771a4c36 --- /dev/null +++ b/api_test.http @@ -0,0 +1,4 @@ + + +//$routes->match(['GET', 'POST'], 'trpProductionDetails', 'StockController::trpProductionDetails'); +GET http://localhost/ci4/ria/trpProductionDetails diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index cba95223..1abcfdab 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -1305,13 +1305,20 @@ class StockController extends BaseController $startDate = "$month-01"; $endDate = date("Y-m-t", strtotime($startDate)); + $data['trpProductionDetails'] = $this->TrpProductionMaintenance_model - ->join('t_trpProduction', 't_trpProduction.date = t_trpProductionMaintenance.date') - ->join('t_trpProductionWaste', 't_trpProductionWaste.date = t_trpProductionMaintenance.date') - ->where('date >=', $startDate) - ->where('date <=', $endDate) - ->orderBy('date', 'asc') - ->findAll(); + ->select('tpmd.*, tpd.*, tpwd.*') + ->from('t_trpProductionMaintenanceDetails tpmd') + ->join('t_trpProductionDetails tpd', 'tpd.date = tpmd.date') + ->join('t_trpProductionWasteDetails tpwd', 'tpwd.date = tpmd.date') + // ->join('ip_invoice_items', 'ip_invoice_items.item_date_added = tpmd.date',' AND ip_invoice_items.item_name = "Core Sand Reclaimed"') + ->where('tpmd.date >=', $startDate) + ->where('tpmd.date <=', $endDate) + ->orderBy('tpmd.date', 'asc') + ->get() + ->getResultArray(); + + $date = DateTime::createFromFormat('Y-m', $month); @@ -1319,7 +1326,9 @@ class StockController extends BaseController $data['month'] = $formattedDate; - return $this->loadViews("trpSandUseStockDetails", $this->global, $data, NULL); + return $this->response->setJSON($data); + + // return $this->loadViews("trpSandUseStockDetails", $this->global, $data, NULL); From afc9dd2c6b1620f1ec2a0d18b4a57ee34d0d1d96 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sun, 5 Jan 2025 22:30:55 +0530 Subject: [PATCH 4/8] stock module latest today vadivel J 05-1-2025 --- api_test.http | 2 +- app/Controllers/StockController.php | 145 ++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+), 1 deletion(-) diff --git a/api_test.http b/api_test.http index 771a4c36..7987d0c0 100644 --- a/api_test.http +++ b/api_test.http @@ -1,4 +1,4 @@ -//$routes->match(['GET', 'POST'], 'trpProductionDetails', 'StockController::trpProductionDetails'); +// $routes->match(['GET', 'POST'], 'trpProductionDetails', 'StockController::trpProductionDetails'); GET http://localhost/ci4/ria/trpProductionDetails diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index 1abcfdab..68ce7591 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -1466,6 +1466,151 @@ class StockController extends BaseController echo "An error occurred: " . $error->getMessage(); } } + + + // public function updateTrpProductionDetails() { + // $postData = $this->request->getPost(); + // $updateTrpProductionDetails = json_decode($postData['updateTrpProductionDetails'], true); + + // $updateProduction = []; + // $updateMaintenance = []; + // $updateWaste = []; + + // $insertProduction = []; + // $insertMaintenance = []; + // $insertWaste = []; + + // // Extract dates from the data + // $dates = array_column($updateTrpProductionDetails, 'Date'); + // $formattedDates = array_map(function($date) { + // return $this->convertToDateWithFlexibleFormats($date, ["d-m-Y", "Y-m-d", "m/d/Y", "m-d-Y"], "Y-m-d"); + // }, $dates); + + // // Fetch existing records in bulk + // $existingMaintenanceRecords = $this->TrpProductionMaintenance_model->whereIn('date', $formattedDates)->findAll(); + // $existingProductionRecords = $this->TrpProduction_model->whereIn('date', $formattedDates)->findAll(); + // $existingWasteRecords = $this->TrpProductionWaste_model->whereIn('date', $formattedDates)->findAll(); + + // // Convert fetched records to associative arrays for quick lookup + // $existingMaintenanceMap = []; + // foreach ($existingMaintenanceRecords as $record) { + // $existingMaintenanceMap[$record['date']] = $record; + // } + + // $existingProductionMap = []; + // foreach ($existingProductionRecords as $record) { + // $existingProductionMap[$record['date']] = $record; + // } + + // $existingWasteMap = []; + // foreach ($existingWasteRecords as $record) { + // $existingWasteMap[$record['date']] = $record; + // } + + // foreach ($updateTrpProductionDetails as $data) { + // $data['date'] = $this->convertToDateWithFlexibleFormats($data['Date'], ["d-m-Y", "Y-m-d", "m/d/Y", "m-d-Y"], "Y-m-d"); + // $date = $data['date']; + + // $dbDataTrpMaintenance = [ + // 'date' => $data['date'], + // 'openingTime' => $data['openingTime'], + // 'closingTime' => $data['closingTime'], + // 'totalHours' => $data['totalHours'], + // 'coldStart' => $data['coldStart'], + // 'breakdownHours' => $data['breakdownHours'], + // 'burnerFiringHours' => $data['burnerFiringHours'], + // 'sandFeedingHours' => $data['sandFeedingHours'], + // 'workingPersonEngineers' => $data['workingPersonEngineers'], + // 'workingPersonSupervisiors' => $data['workingPersonSupervisiors'], + // 'workingPersonOperators' => $data['workingPersonOperators'], + // 'rollerDrivers' => $data['rollerDrivers'], + // 'natureOfMaintenance' => $data['natureOfMaintenance'], + // 'location' => $data['location'], + // 'description' => $data['description'] + // ]; + + // $dbDataTrpProduction = [ + // 'date' => $data['date'], + // 'gasReceiptBg' => $data['gasReceiptBg'], + // 'gasReceiptPg' => $data['gasReceiptPg'], + // 'physicalGasConsumption' => $data['physicalGasConsumption'], + // 'trpPlusDrierGasConsumption' => $data['trpPlusDrierGasConsumption'], + // 'trpPhysicalGasPerTon' => $data['trpPhysicalGasPerTon'], + // 'panelGasConsumption' => $data['panelGasConsumption'], + // 'panelGasPerTon' => $data['panelGasPerTon'], + // 'edRunningHours' => $data['edRunningHours'], + // 'edProduction' => $data['edProduction'], + // 'edUsage' => $data['edUsage'], + // 'trpProduction' => $data['trpProduction'], + // 'trpProductionPerHour' => $data['trpProductionPerHour'], + // 'waterReceipt' => $data['waterReceipt'], + // 'waterConsumption' => $data['waterConsumption'], + // 'ebReading' => $data['ebReading'], + // 'ebReadingPerUnitTon' => $data['ebReadingPerUnitTon'] + // ]; + + // $dbDataTrpWaste = [ + // 'date' => $data['date'], + // 'msSeperation' => $data['msSeperation'], + // 'edWaste' => $data['edWaste'], + // 'coolerBags' => $data['coolerBags'], + // 'edPlus20Waste' => $data['edPlus20Waste'], + // 'cycloneWaste' => $data['cycloneWaste'] + // ]; + + // if (empty($existingMaintenanceMap[$date])) { + // $insertMaintenance[] = $dbDataTrpMaintenance; + // $insertProduction[] = $dbDataTrpProduction; + // $insertWaste[] = $dbDataTrpWaste; + // } else { + // $dbDataTrpMaintenance['id'] = $existingMaintenanceMap[$date]['id']; + // $dbDataTrpProduction['id'] = $existingProductionMap[$date]['id']; + // $dbDataTrpWaste['id'] = $existingWasteMap[$date]['id']; + + // $updateMaintenance[] = $dbDataTrpMaintenance; + // $updateProduction[] = $dbDataTrpProduction; + // $updateWaste[] = $dbDataTrpWaste; + // } + // } + + // // Start the transaction + // $this->db->transBegin(); + + // try { + // if (!empty($insertMaintenance)) { + // $this->TrpProductionMaintenance_model->insertBatch($insertMaintenance); + // } + + // if (!empty($insertProduction)) { + // $this->TrpProduction_model->insertBatch($insertProduction); + // } + + // if (!empty($insertWaste)) { + // $this->TrpProductionWaste_model->insertBatch($insertWaste); + // } + + // if (!empty($updateMaintenance)) { + // $this->TrpProductionMaintenance_model->updateBatch($updateMaintenance, 'id'); + // } + + // if (!empty($updateProduction)) { + // $this->TrpProduction_model->updateBatch($updateProduction, 'id'); + // } + + // if (!empty($updateWaste)) { + // $this->TrpProductionWaste_model->updateBatch($updateWaste, 'id'); + // } + + // // Commit the transaction if all operations are successful + // $this->db->transCommit(); + // echo "Data Saved Successfully"; + + // } catch (\Exception $error) { + // // Rollback the transaction in case of any errors + // $this->db->transRollback(); + // echo "An error occurred: " . $error->getMessage(); + // } + // } From af24792316e937f3db968e197460fe4eb9231713 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Mon, 6 Jan 2025 18:26:10 +0530 Subject: [PATCH 5/8] stock module latest today vadivel J 06-1-2025 --- app/Controllers/StockController.php | 104 ++++++++++++++++++++++++---- 1 file changed, 91 insertions(+), 13 deletions(-) diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index 68ce7591..acd084c3 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -1305,20 +1305,98 @@ class StockController extends BaseController $startDate = "$month-01"; $endDate = date("Y-m-t", strtotime($startDate)); - - $data['trpProductionDetails'] = $this->TrpProductionMaintenance_model - ->select('tpmd.*, tpd.*, tpwd.*') - ->from('t_trpProductionMaintenanceDetails tpmd') - ->join('t_trpProductionDetails tpd', 'tpd.date = tpmd.date') - ->join('t_trpProductionWasteDetails tpwd', 'tpwd.date = tpmd.date') - // ->join('ip_invoice_items', 'ip_invoice_items.item_date_added = tpmd.date',' AND ip_invoice_items.item_name = "Core Sand Reclaimed"') - ->where('tpmd.date >=', $startDate) - ->where('tpmd.date <=', $endDate) - ->orderBy('tpmd.date', 'asc') - ->get() - ->getResultArray(); - + + // Subquery definition + $subquery = $this->db->table('t_materialmaster') + ->select('materialCode') + ->where('Category', 'waste core') + ->get() + ->getResultArray(); + + $materialCodes = array_column($subquery, 'materialCode'); // Extracts 'materialCode' values + + // Convert the array of material codes to a comma-separated string + $materialCodesString = "'" . implode("','", $materialCodes) . "'"; + + // Main query + $sql = "SELECT + tpmd.*, + tpd.*, + tpwd.*, + tsu.*, + ip_invoice_items.*, + tigrd.* , + ( + SELECT ts.SupplierName + FROM t_supplierdetailsn ts + WHERE ts.SupplierID = ( + SELECT tpom.SupplierID + FROM t_purchaseorder_master tpom + WHERE tpom.PONO = ( + SELECT tigm.PONO + FROM t_igr_master tigm + WHERE tigm.IGRNo = tigrd.IGRNo + ) + ) + ) AS SupplierName + FROM + t_trpProductionMaintenanceDetails tpmd + JOIN + t_trpProductionDetails tpd ON tpd.date = tpmd.date + JOIN + t_trpProductionWasteDetails tpwd ON tpwd.date = tpmd.date + LEFT JOIN + t_coatingMachineDetails tcmd ON tcmd.date = tpmd.date + LEFT JOIN + t_drierMachineDetails tdmd ON tdmd.date = tpmd.date + LEFT JOIN + t_trp_sand_use tsu ON tsu.date = tpmd.date + LEFT JOIN + ip_invoice_items ON ip_invoice_items.item_date_added = tpmd.date + AND ip_invoice_items.item_name = 'Core Sand Reclaimed' + + LEFT JOIN + t_igr_master tigm + ON tigm.IGRNo = tigrd.IGRNo + + LEFT JOIN + t_purchaseorder_master tpom + ON tpom.PONO = tigm.PONO + + LEFT JOIN + t_supplierdetailsn ts + ON ts.SupplierID = tpom.SupplierID + + + + LEFT JOIN ( + SELECT + DATE(CreatedDate) AS GroupedDate, + IGRNo, + SUM(QuantityAsPerInvoice) AS GroupedQuantity + FROM + t_igr_details + WHERE + MaterialCode IN ($materialCodesString) + GROUP BY + IGRNo + ) tigrd ON tigrd.GroupedDate = tpmd.date + + + WHERE + tpmd.date >= ? + AND + tpmd.date <= ? + ORDER BY + tpmd.date ASC"; + + // Execute the query + $query = $this->db->query($sql, [$startDate, $endDate]); + $data['trpProductionDetails'] = $query->getResultArray(); + + + dd($data['trpProductionDetails']); $date = DateTime::createFromFormat('Y-m', $month); From cf032023d5dd1cb62acb73dc7cd8cbfb08416908 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Mon, 6 Jan 2025 23:39:46 +0530 Subject: [PATCH 6/8] stock module latest today vadivel J 06-1-2025 --- app/Controllers/StockController.php | 50 +++++++++++------------------ 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index acd084c3..8b282ad0 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -1327,19 +1327,7 @@ class StockController extends BaseController tsu.*, ip_invoice_items.*, tigrd.* , - ( - SELECT ts.SupplierName - FROM t_supplierdetailsn ts - WHERE ts.SupplierID = ( - SELECT tpom.SupplierID - FROM t_purchaseorder_master tpom - WHERE tpom.PONO = ( - SELECT tigm.PONO - FROM t_igr_master tigm - WHERE tigm.IGRNo = tigrd.IGRNo - ) - ) - ) AS SupplierName + ts.SupplierName FROM t_trpProductionMaintenanceDetails tpmd JOIN @@ -1356,6 +1344,13 @@ class StockController extends BaseController ip_invoice_items ON ip_invoice_items.item_date_added = tpmd.date AND ip_invoice_items.item_name = 'Core Sand Reclaimed' + + + LEFT JOIN + t_igr_details tigrd + ON DATE(tigrd.CreatedDate) = tpmd.date + AND tigrd.MaterialCode IN ($materialCodesString) + LEFT JOIN t_igr_master tigm ON tigm.IGRNo = tigrd.IGRNo @@ -1366,38 +1361,29 @@ class StockController extends BaseController LEFT JOIN t_supplierdetailsn ts - ON ts.SupplierID = tpom.SupplierID - - - - LEFT JOIN ( - SELECT - DATE(CreatedDate) AS GroupedDate, - IGRNo, - SUM(QuantityAsPerInvoice) AS GroupedQuantity - FROM - t_igr_details - WHERE - MaterialCode IN ($materialCodesString) - GROUP BY - IGRNo - ) tigrd ON tigrd.GroupedDate = tpmd.date - + ON tpom.SupplierID = ts.SupplierID + WHERE tpmd.date >= ? AND tpmd.date <= ? + + Group BY + ts.SupplierName , tpmd.date , tigrd.MaterialCode + + + ORDER BY tpmd.date ASC"; // Execute the query - $query = $this->db->query($sql, [$startDate, $endDate]); + $query = $this->db->query($sql, [ $startDate, $endDate]); $data['trpProductionDetails'] = $query->getResultArray(); - dd($data['trpProductionDetails']); + $date = DateTime::createFromFormat('Y-m', $month); $formattedDate = $date->format('M-Y'); From 9ec31b265b7a02e16b5affb3b4adae509a218359 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Tue, 7 Jan 2025 18:28:29 +0530 Subject: [PATCH 7/8] stock module latest today vadivel J 07-1-2025 --- app/Controllers/StockController.php | 224 +------ app/Models/TrpProductionModel.php | 185 ++++++ app/Views/trpProductionStockDetails.php | 745 +++++++++++++++++++----- 3 files changed, 774 insertions(+), 380 deletions(-) diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index 8b282ad0..c0d96a57 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -1307,81 +1307,12 @@ class StockController extends BaseController $endDate = date("Y-m-t", strtotime($startDate)); - // Subquery definition - $subquery = $this->db->table('t_materialmaster') - ->select('materialCode') - ->where('Category', 'waste core') - ->get() - ->getResultArray(); + + $data['trpProductionDetails'] = $this->TrpProduction_model->trpProductionDetails($startDate,$endDate); - $materialCodes = array_column($subquery, 'materialCode'); // Extracts 'materialCode' values + // dd($data['trpProductionDetails']); - // Convert the array of material codes to a comma-separated string - $materialCodesString = "'" . implode("','", $materialCodes) . "'"; - - // Main query - $sql = "SELECT - tpmd.*, - tpd.*, - tpwd.*, - tsu.*, - ip_invoice_items.*, - tigrd.* , - ts.SupplierName - FROM - t_trpProductionMaintenanceDetails tpmd - JOIN - t_trpProductionDetails tpd ON tpd.date = tpmd.date - JOIN - t_trpProductionWasteDetails tpwd ON tpwd.date = tpmd.date - LEFT JOIN - t_coatingMachineDetails tcmd ON tcmd.date = tpmd.date - LEFT JOIN - t_drierMachineDetails tdmd ON tdmd.date = tpmd.date - LEFT JOIN - t_trp_sand_use tsu ON tsu.date = tpmd.date - LEFT JOIN - ip_invoice_items ON ip_invoice_items.item_date_added = tpmd.date - AND ip_invoice_items.item_name = 'Core Sand Reclaimed' - - - - LEFT JOIN - t_igr_details tigrd - ON DATE(tigrd.CreatedDate) = tpmd.date - AND tigrd.MaterialCode IN ($materialCodesString) - - LEFT JOIN - t_igr_master tigm - ON tigm.IGRNo = tigrd.IGRNo - - LEFT JOIN - t_purchaseorder_master tpom - ON tpom.PONO = tigm.PONO - - LEFT JOIN - t_supplierdetailsn ts - ON tpom.SupplierID = ts.SupplierID - - - WHERE - tpmd.date >= ? - AND - tpmd.date <= ? - - Group BY - ts.SupplierName , tpmd.date , tigrd.MaterialCode - - - - ORDER BY - tpmd.date ASC"; - - // Execute the query - $query = $this->db->query($sql, [ $startDate, $endDate]); - $data['trpProductionDetails'] = $query->getResultArray(); - - dd($data['trpProductionDetails']); + // dd($this->db->getLastQuery()); $date = DateTime::createFromFormat('Y-m', $month); @@ -1392,7 +1323,7 @@ class StockController extends BaseController return $this->response->setJSON($data); - // return $this->loadViews("trpSandUseStockDetails", $this->global, $data, NULL); + // return $this->loadViews("trpProductionStockDetails", $this->global, $data, NULL); @@ -1532,151 +1463,6 @@ class StockController extends BaseController } - // public function updateTrpProductionDetails() { - // $postData = $this->request->getPost(); - // $updateTrpProductionDetails = json_decode($postData['updateTrpProductionDetails'], true); - - // $updateProduction = []; - // $updateMaintenance = []; - // $updateWaste = []; - - // $insertProduction = []; - // $insertMaintenance = []; - // $insertWaste = []; - - // // Extract dates from the data - // $dates = array_column($updateTrpProductionDetails, 'Date'); - // $formattedDates = array_map(function($date) { - // return $this->convertToDateWithFlexibleFormats($date, ["d-m-Y", "Y-m-d", "m/d/Y", "m-d-Y"], "Y-m-d"); - // }, $dates); - - // // Fetch existing records in bulk - // $existingMaintenanceRecords = $this->TrpProductionMaintenance_model->whereIn('date', $formattedDates)->findAll(); - // $existingProductionRecords = $this->TrpProduction_model->whereIn('date', $formattedDates)->findAll(); - // $existingWasteRecords = $this->TrpProductionWaste_model->whereIn('date', $formattedDates)->findAll(); - - // // Convert fetched records to associative arrays for quick lookup - // $existingMaintenanceMap = []; - // foreach ($existingMaintenanceRecords as $record) { - // $existingMaintenanceMap[$record['date']] = $record; - // } - - // $existingProductionMap = []; - // foreach ($existingProductionRecords as $record) { - // $existingProductionMap[$record['date']] = $record; - // } - - // $existingWasteMap = []; - // foreach ($existingWasteRecords as $record) { - // $existingWasteMap[$record['date']] = $record; - // } - - // foreach ($updateTrpProductionDetails as $data) { - // $data['date'] = $this->convertToDateWithFlexibleFormats($data['Date'], ["d-m-Y", "Y-m-d", "m/d/Y", "m-d-Y"], "Y-m-d"); - // $date = $data['date']; - - // $dbDataTrpMaintenance = [ - // 'date' => $data['date'], - // 'openingTime' => $data['openingTime'], - // 'closingTime' => $data['closingTime'], - // 'totalHours' => $data['totalHours'], - // 'coldStart' => $data['coldStart'], - // 'breakdownHours' => $data['breakdownHours'], - // 'burnerFiringHours' => $data['burnerFiringHours'], - // 'sandFeedingHours' => $data['sandFeedingHours'], - // 'workingPersonEngineers' => $data['workingPersonEngineers'], - // 'workingPersonSupervisiors' => $data['workingPersonSupervisiors'], - // 'workingPersonOperators' => $data['workingPersonOperators'], - // 'rollerDrivers' => $data['rollerDrivers'], - // 'natureOfMaintenance' => $data['natureOfMaintenance'], - // 'location' => $data['location'], - // 'description' => $data['description'] - // ]; - - // $dbDataTrpProduction = [ - // 'date' => $data['date'], - // 'gasReceiptBg' => $data['gasReceiptBg'], - // 'gasReceiptPg' => $data['gasReceiptPg'], - // 'physicalGasConsumption' => $data['physicalGasConsumption'], - // 'trpPlusDrierGasConsumption' => $data['trpPlusDrierGasConsumption'], - // 'trpPhysicalGasPerTon' => $data['trpPhysicalGasPerTon'], - // 'panelGasConsumption' => $data['panelGasConsumption'], - // 'panelGasPerTon' => $data['panelGasPerTon'], - // 'edRunningHours' => $data['edRunningHours'], - // 'edProduction' => $data['edProduction'], - // 'edUsage' => $data['edUsage'], - // 'trpProduction' => $data['trpProduction'], - // 'trpProductionPerHour' => $data['trpProductionPerHour'], - // 'waterReceipt' => $data['waterReceipt'], - // 'waterConsumption' => $data['waterConsumption'], - // 'ebReading' => $data['ebReading'], - // 'ebReadingPerUnitTon' => $data['ebReadingPerUnitTon'] - // ]; - - // $dbDataTrpWaste = [ - // 'date' => $data['date'], - // 'msSeperation' => $data['msSeperation'], - // 'edWaste' => $data['edWaste'], - // 'coolerBags' => $data['coolerBags'], - // 'edPlus20Waste' => $data['edPlus20Waste'], - // 'cycloneWaste' => $data['cycloneWaste'] - // ]; - - // if (empty($existingMaintenanceMap[$date])) { - // $insertMaintenance[] = $dbDataTrpMaintenance; - // $insertProduction[] = $dbDataTrpProduction; - // $insertWaste[] = $dbDataTrpWaste; - // } else { - // $dbDataTrpMaintenance['id'] = $existingMaintenanceMap[$date]['id']; - // $dbDataTrpProduction['id'] = $existingProductionMap[$date]['id']; - // $dbDataTrpWaste['id'] = $existingWasteMap[$date]['id']; - - // $updateMaintenance[] = $dbDataTrpMaintenance; - // $updateProduction[] = $dbDataTrpProduction; - // $updateWaste[] = $dbDataTrpWaste; - // } - // } - - // // Start the transaction - // $this->db->transBegin(); - - // try { - // if (!empty($insertMaintenance)) { - // $this->TrpProductionMaintenance_model->insertBatch($insertMaintenance); - // } - - // if (!empty($insertProduction)) { - // $this->TrpProduction_model->insertBatch($insertProduction); - // } - - // if (!empty($insertWaste)) { - // $this->TrpProductionWaste_model->insertBatch($insertWaste); - // } - - // if (!empty($updateMaintenance)) { - // $this->TrpProductionMaintenance_model->updateBatch($updateMaintenance, 'id'); - // } - - // if (!empty($updateProduction)) { - // $this->TrpProduction_model->updateBatch($updateProduction, 'id'); - // } - - // if (!empty($updateWaste)) { - // $this->TrpProductionWaste_model->updateBatch($updateWaste, 'id'); - // } - - // // Commit the transaction if all operations are successful - // $this->db->transCommit(); - // echo "Data Saved Successfully"; - - // } catch (\Exception $error) { - // // Rollback the transaction in case of any errors - // $this->db->transRollback(); - // echo "An error occurred: " . $error->getMessage(); - // } - // } - - diff --git a/app/Models/TrpProductionModel.php b/app/Models/TrpProductionModel.php index 7f6bc916..02cf5ba8 100644 --- a/app/Models/TrpProductionModel.php +++ b/app/Models/TrpProductionModel.php @@ -46,4 +46,189 @@ class TrpProductionModel extends Model protected $afterFind = []; protected $beforeDelete = []; protected $afterDelete = []; + + + + + public function trpProductionDetails($startDate,$endDate){ + + + + // Subquery definition + $subquery = $this->db->table('t_materialmaster') + ->select('materialCode') + ->where('Category', 'waste core') + ->get() + ->getResultArray(); + + $materialCodes = array_column($subquery, 'materialCode'); // Extracts 'materialCode' values + + // Convert the array of material codes to a comma-separated string + $materialCodesString = "'" . implode("','", $materialCodes) . "'"; + + + $sql = "SELECT + + tpmd.date, + tpmd.openingTime, + tpmd.closingTime, + tpmd.totalHours, + tpmd.coldStart, + tpmd.breakdownHours, + tpmd.burnerFiringHours, + tpmd.sandFeedingHours, + tpmd.workingPersonEngineers, + tpmd.workingPersonSupervisiors, + tpmd.workingPersonOperators, + tpmd.rollerDrivers, + tpmd.natureOfMaintenance, + tpmd.location, + tpmd.description, + + + + tpd.gasReceiptBg, + tpd.gasReceiptPg, + tpd.physicalGasConsumption, + tpd.trpPlusDrierGasConsumption, + tpd.trpPhysicalGasPerTon, + tpd.panelGasConsumption, + tpd.panelGasPerTon, + tpd.edRunningHours, + tpd.edProduction, + tpd.edUsage, + tpd.trpProduction, + tpd.trpProductionPerHour, + tpd.waterReceipt, + tpd.waterConsumption, + tpd.ebReading, + tpd.ebReadingPerUnitTon, + + + tpwd.msSeperation, + tpwd.edWaste, + tpwd.coolerBags, + tpwd.edPlus20Waste, + tpwd.cycloneWaste, + + + tcmd.totalGasConsumption as coatingGasConsumption, + + tdmd.total_gas_consumption as drierGasConsumption, + + + tsu.total_kgs as coating, + + invItems.item_date_added, + invItems.client_name, + invItems.TotalRsQuantity, + + tigrd.SupplierName, + tigrd.TotalQuantityAsPerInvoice, + tigrd.CreatedDate + + + FROM + t_trpProductionMaintenanceDetails tpmd + JOIN + t_trpProductionDetails tpd ON tpd.date = tpmd.date + JOIN + t_trpProductionWasteDetails tpwd ON tpwd.date = tpmd.date + LEFT JOIN + t_coatingMachineDetails tcmd ON tcmd.date = tpmd.date + LEFT JOIN + t_drierMachineDetails tdmd ON tdmd.date = tpmd.date + LEFT JOIN + t_trp_sand_use tsu ON tsu.date = tpmd.date + + + + LEFT JOIN + ( + Select + clients.client_name, + invItems.item_date_added, + SUM(invItems.item_quantity) AS TotalRsQuantity + + from ip_invoice_items invItems + + -- All joins to get client name thats it + LEFT JOIN + ip_invoices inv + ON inv.invoice_id = invItems.invoice_id + + LEFT JOIN + ip_clients clients + ON clients.client_id = inv.client_id + + -- getting core reclamation sand + Where invItems.item_name = 'Core Sand Reclaimed' + + -- grouping Client who provides reclamation sand on a particular date with 1 or more invoices + Group By invItems.item_date_added , clients.client_name + + ) invItems + ON invItems.item_date_added = tpmd.date + + + + LEFT JOIN + ( + Select tigrd.CreatedDate ,tigrd.MaterialCode , tigrd.IGRNo , ts.SupplierName, + SUM(QuantityAsPerInvoice) AS TotalQuantityAsPerInvoice + + from t_igr_details tigrd + + -- All joins to get supplier name thats it + LEFT JOIN + t_igr_master tigm + ON tigm.IGRNo = tigrd.IGRNo + + LEFT JOIN + t_purchaseorder_master tpom + ON tpom.PONO = tigm.PONO + + LEFT JOIN + t_supplierdetailsn ts + ON tpom.SupplierID = ts.SupplierID + + -- getting waste core sands using three distinct material codes + Where tigrd.MaterialCode IN ($materialCodesString) + + -- grouping supplier who provides waste core on a particular date with 1 or more IGRS + Group By Date(tigrd.CreatedDate) , ts.SupplierName + + ) tigrd + ON DATE(tigrd.CreatedDate) = tpmd.date + + + + + WHERE + tpmd.date >= ? + AND + tpmd.date <= ? + + + ORDER BY + tpmd.date ASC"; + + // Execute the query + $query = $this->db->query($sql, [ $startDate, $endDate]); + + $result = $query->getResultArray(); + + return $result; + + } + + + + + + + + + + } diff --git a/app/Views/trpProductionStockDetails.php b/app/Views/trpProductionStockDetails.php index cdf44e75..86e9730f 100644 --- a/app/Views/trpProductionStockDetails.php +++ b/app/Views/trpProductionStockDetails.php @@ -210,7 +210,7 @@ @@ -265,33 +265,134 @@ - - material - - - - - - - - + + Date + + Opening Time + + Closing Time + + Total Hours + + Cold Start + + Break Down Hours + + Burner Firing Hours + + Sand Feeding Hours + + Gas Receipt + + Physical Gas Consumption + + Drier Gas Consumption + + Coating Gas Consumption + + TRP plus Drier Gas Consumption + + TRP Physical Gas Per Ton + + Panel Gas Consumption + + Panel Gas Per Ton + + Incoming Sand/ Lump details + + ED details + + TRP Sand + + Usage + + Water + + EB Reading + + EB Unit Per Ton + + Working Persons + + Maintanence Details + + Description + + MS Seperation + + ED Waste + + Cooler Bags + + ED +20 Waste + + Cyclone Waste + + - - Date + + + BG + + PG + + AL(S) + + AL(E) + + ME + + SI + + caparo + + Nemak + + DR + + Running Hours + + Production + + Usage + + Production + + Production Per Hour + + Coating + + Hindhuja + + Nemak + + ME + + BI + + Karmen + + Receipt + + Consumption + + Engineers + + Supervisors + + Operators + + Roller Drivers + + Nature Of Maintenance + + Location + - - - Date - material - customer - Opening Stock - Receipt - Used - Balance Stock - + @@ -299,147 +400,486 @@ - $resinStockDetails){ - ?> - - format('d-m-Y'); - if ($dateInMonthDmYFormat === $currentDate) { echo 'style="background: #cef0ad;"';} - ?> - > - $resinStock){ ?> - - format('d-m-Y'); - ?> - - - - - - - - - - - - - - - oninput="openingStockChange(this)" - contenteditable="true" - - > - - - - - - - - - - - - - - $dateInMonth){ ?> - + + + 54465656 + - + + + 0 + - $currentDate = date('d-m-Y'); - $dateInMonthDmYFormat= DateTime::createFromFormat('Y-m-d', $dateInMonth)->format('d-m-Y'); - if ($dateInMonthDmYFormat === $currentDate) { echo 'style="background: #cef0ad;"';} - ?> - > - $resinMaterial){ ?> - + + + + 0 + - - format('d-m-Y'); - ?> - - - - - - - - + + + + 0 + - - - + + + + 0 + - - - + + + + 0 + - - - oninput="openingStockChange(this)" - contenteditable="true" + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + + 0 + + + + + + 0 + + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + + 0 + + + + + 0 + + + + + 0 + + + + + 0 + + + + + 0 + + + + + 0 + + + + + 0 + + + + + 0 + + + + + 0 + + + + + 0 + + + + + 0 + - - > - 0 - 0 - - - - @@ -467,7 +907,7 @@