stock module latest today vadivel J 04-1-2025

This commit is contained in:
vadivelJ96 2025-01-05 00:00:42 +05:30
parent aa166057d7
commit c28461f5c2
2 changed files with 20 additions and 7 deletions

4
api_test.http Normal file
View File

@ -0,0 +1,4 @@
//$routes->match(['GET', 'POST'], 'trpProductionDetails', 'StockController::trpProductionDetails');
GET http://localhost/ci4/ria/trpProductionDetails

View File

@ -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);