From aed59fb57381fcdb5416c26634e428083cb9c78d Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Wed, 19 Mar 2025 15:31:00 +0530 Subject: [PATCH] stock module - 19-03-2025 --- app/Controllers/Rawmaterialdetails.php | 15 --------------- app/Models/TrpProductionModel.php | 3 ++- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/app/Controllers/Rawmaterialdetails.php b/app/Controllers/Rawmaterialdetails.php index c18cd0a4..fb2c0ab6 100755 --- a/app/Controllers/Rawmaterialdetails.php +++ b/app/Controllers/Rawmaterialdetails.php @@ -147,7 +147,6 @@ class Rawmaterialdetails extends BaseController $this->rawmaterialdetails_model = new rawmaterialdetails_model(); $data['material'] = $this->rawmaterialdetails_model->getmaterialType(); $data['materialcategory'] = $this->rawmaterialdetails_model->getmaterialCategory(); - // $data['materialCategoryList']= $this->materialCategories_model->where('is_active',1)->findAll(); $data['UOM'] = $this->rawmaterialdetails_model->getUOM(); $data['assetcode'] = $this->rawmaterialdetails_model->getAssetcode(); $data['costcentercode'] = $this->rawmaterialdetails_model->getcostcentercode(); @@ -210,20 +209,6 @@ class Rawmaterialdetails extends BaseController $MaterialType = $this->request->getPost('MaterialType'); $UOM = $this->request->getPost('UOM'); $MaterialCategory = $this->request->getPost('MatCate'); - $materialcategoryarray = $this->rawmaterialdetails_model->getmaterialCategory(); - - foreach ($materialcategoryarray as $mc) { - $TempArr[] = $mc->ConfigValue; - } - //print_r($TempArr); - if (in_array($MaterialCategory, $TempArr)) { - //echo "Match found"; - } else { - //echo "Match not found"; - $configcode = 'C023'; - $config = array('Config_ID' => $configcode, 'ConfigValue' => $MaterialCategory); - $query = $this->rawmaterialdetails_model->insertvalueintoconfig($config); - } $Remarks = $this->request->getPost('remarks'); $HSN = $this->request->getPost('HSNcode'); $CreatedBy = $this->session->get('userId'); diff --git a/app/Models/TrpProductionModel.php b/app/Models/TrpProductionModel.php index 788be0da..ccc68c16 100644 --- a/app/Models/TrpProductionModel.php +++ b/app/Models/TrpProductionModel.php @@ -67,6 +67,7 @@ class TrpProductionModel extends Model $materialCodes = array_column($subquery, 'materialCode'); // Extracts 'materialCode' values + // Define your table @@ -261,7 +262,7 @@ class TrpProductionModel extends Model ->whereIn('tigrd.MaterialCode', $materialCodes) ->where('tigrd.CreatedDate >=', $startDate) ->where('tigrd.CreatedDate <=', $endDate) - ->groupBy('DATE(tigrd.CreatedDate)') + ->groupBy('DATE(tigm.CreatedDate)') ->getCompiledSelect(false); // Convert Query Builder to raw SQL