From 9dc77bdae9a64c8f4474e98bd050017e9da8061b Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Mon, 13 Jan 2025 18:04:03 +0530 Subject: [PATCH] stock module latest today vadivel J 13-1-2025 --- app/Controllers/StockController.php | 26 ++++- app/Models/Employeedetails_model.php | 30 +++++ app/Models/Inwardgateregister_model.php | 9 +- app/Views/incomingSilicaSandDetails.php | 148 +++++++++++++++++------- 4 files changed, 164 insertions(+), 49 deletions(-) diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index 67ef970f..789ffe79 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -21,6 +21,11 @@ use App\Models\TrpSandUseStockModel; use App\Models\TrpProductionModel; use App\Models\TrpProductionMaintenanceModel; use App\Models\TrpProductionWasteModel; +use App\Models\Employeedetails_model; + + + + use CodeIgniter\HTTP\ResponseInterface; use DateTime; use DatePeriod; @@ -56,6 +61,8 @@ class StockController extends BaseController protected $db; + protected $employeedetails_model; + /** * This is default constructor of the class */ @@ -100,6 +107,8 @@ class StockController extends BaseController $this->TrpProductionWaste_model = new TrpProductionWasteModel(); + $this->employeedetails_model = new Employeedetails_model(); + $this->session = session(); helper('form'); @@ -343,6 +352,18 @@ class StockController extends BaseController $data['igrDetails'] = []; } + $data['testedBy'] = []; + + $DesignationConfigID = 'C010'; + + $data['testedBy'] = $this->employeedetails_model->incomingSilicaSandTestedBy($DesignationConfigID); + + $data['approvedBy'] = $this->employeedetails_model->incomingSilicaSandApprovedBy($DesignationConfigID); + + // dd($data['testedBy']); + + // dd($data['approvedBy']); + $date = DateTime::createFromFormat('Y-m', $month); $formattedDate = $date->format('M-Y'); @@ -454,6 +475,9 @@ class StockController extends BaseController 'moistureLossQty' => $postData['moistureLossQty'], 'sieveLossQty' => $postData['sieveLossQty'], 'salableQty' => $postData['salableQty'], + 'testedBy' => $postData['testedBy'], + 'approvedBy' => $postData['approvedBy'], + 'clayOrLossOfIgnitionPercent' => $postData['clayOrLossOfIgnition'], ]; @@ -466,7 +490,7 @@ class StockController extends BaseController } else { $updated = $this->incomingSilicaSandDetails_model ->insert($dbData); - } + } if ($updated) { diff --git a/app/Models/Employeedetails_model.php b/app/Models/Employeedetails_model.php index 7b1a7333..48e3eed2 100755 --- a/app/Models/Employeedetails_model.php +++ b/app/Models/Employeedetails_model.php @@ -52,6 +52,36 @@ class Employeedetails_model extends Model return $query->getResult(); } + function incomingSilicaSandTestedBy($ConfigID){ + + + $builder = $this->db->table('t_employee_details Emp') + ->select(' Emp.*') + ->whereIn('Designation', ['lab assistant', 'factory manager', 'lab head']) + ->orderBy("Emp.EmpID", "asc"); + + $query = $builder->get(); + + $result = $query->getResult(); + return $result; + + } + + function incomingSilicaSandApprovedBy($ConfigID){ + + $builder = $this->db->table('t_employee_details Emp') + ->select(' Emp.*') + ->whereIn('Designation', ['factory manager', 'lab head']) + ->orderBy("Emp.EmpID", "asc"); + + $query = $builder->get(); + + $result = $query->getResult(); + return $result; + + + } + /* */ /** * This function is used to get the Department details from t_departmentdetails diff --git a/app/Models/Inwardgateregister_model.php b/app/Models/Inwardgateregister_model.php index 613ef0ae..a6af106c 100755 --- a/app/Models/Inwardgateregister_model.php +++ b/app/Models/Inwardgateregister_model.php @@ -1083,7 +1083,8 @@ class Inwardgateregister_model extends Model igrMast.DeliveryChellanDate as invoiceDate, igrMast.MaterialRcvdDate as materialRecievedDate, igrMast.VehicleNo, - supplierDetails.SupplierName, + supplierDetails.SupplierName, + materialMaster.Category as sandType , t_igr_details.QuantityAsPerInvoice as Qty, issd.*') ->whereIn('t_igr_details.MaterialCode', $materialCodes) @@ -1096,11 +1097,11 @@ class Inwardgateregister_model extends Model $builder->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode') ->join('t_igr_master igrMast', 'igrMast.IGRNO = t_igr_details.IGRNO') - ->join('t_incomingSilicaSandDetails issd', - 'issd.igrNo_fk = t_igr_details.IGRNO AND issd.materialCode = t_igr_details.MaterialCode','left') + ->join('t_incomingSilicaSandDetails issd','issd.igrNo_fk = t_igr_details.IGRNO AND issd.materialCode = t_igr_details.MaterialCode','left') + ->join('t_materialmaster materialMaster', 'materialMaster.MaterialCode = t_igr_details.MaterialCode') ->join('t_purchaseorder_master poMaster', 'poMaster.PONO = igrMast.PONO', 'left') ->join('t_supplierdetailsn supplierDetails', 'supplierDetails.SupplierID = poMaster.SupplierID', 'left') - ->orderBy('t_igr_details.CreatedDate', 'DESC'); + ->orderBy('t_igr_details.CreatedDate', 'asc '); $query = $builder->get(); $result = $query->getResultArray(); diff --git a/app/Views/incomingSilicaSandDetails.php b/app/Views/incomingSilicaSandDetails.php index 5ed1bba2..02e359d6 100644 --- a/app/Views/incomingSilicaSandDetails.php +++ b/app/Views/incomingSilicaSandDetails.php @@ -290,9 +290,11 @@ Remark MaterialCode id + testedBy + approvedBy + clayOrLossOfIgnition - @@ -348,17 +350,17 @@ - - + + - + >Wet @@ -524,6 +526,22 @@ + + + + + + + + + + + + + + + + @@ -610,54 +628,63 @@ Invoice No - 8946551665 + Invoice Date - 2/12/1996 + Vehicle No - Tn 25 bb 6919 + IGR No - 25126919 + Igr Date - 10/12/2024 + Quantity - 69199 + Time + id="dwnldTimeId"> Grade 50-60 + id="dwnldGradeId"> - - Clay % + + + Clay % 20 - + id="dwnldClayId">0 + + + Loss Of Ignition % + + + Moisture Actual % 10 + id="dwnldMoistureActualId"> Moisture Spec % 10 + id="dwnldMoistureSpecId"> @@ -785,7 +812,7 @@   -  TOTAL +   TOTAL @@ -831,6 +858,12 @@ @@ -838,7 +871,12 @@ style="text-align: center !important; "> @@ -859,6 +897,7 @@ + @@ -877,9 +916,11 @@ - + - + + +