From e868e8004611ef39b296d5789e1514f95a5caaee Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Thu, 6 Jun 2024 12:38:34 +0000 Subject: [PATCH] FIX_Mnor changes : ps --- app/Config/Routes.php | 6 +- app/Controllers/Inprocess.php | 40 ++-- app/Controllers/Inwardgateregister.php | 4 +- app/Models/Inprocess_model.php | 280 ++++++++++++++++++++++++ app/Models/Inwardgateregister_model.php | 2 +- app/Models/Purchaseorder_model.php | 4 +- app/Views/includes/header.php | 13 +- app/Views/inwardgateregister.php | 2 +- app/Views/porelease_view.php | 8 +- 9 files changed, 320 insertions(+), 39 deletions(-) create mode 100644 app/Models/Inprocess_model.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 0bf1f13d..4d982feb 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -21,6 +21,8 @@ $routes->match(['get', 'post', 'put', 'delete'],'checkEmailExists', 'User::check $routes->match(['get', 'post', 'put', 'delete'],'forgotPassword', 'Login::forgotPassword'); $routes->match(['get', 'post', 'put', 'delete'],'resetPasswordUser', 'Login::resetPasswordUser'); $routes->match(['get', 'post', 'put', 'delete'],'resetPasswordConfirmUser', 'Login::resetPasswordConfirmUser'); +$routes->post('user/Adduserdepartment', 'User::Adduserdepartment'); +$routes->post('user/Deleteuserdepartment', 'User::Deleteuserdepartment'); // $routes->match(['get', 'post', 'put', 'delete'],'resetPasswordConfirmUser/(:any)', 'Login::resetPasswordConfirmUser/$1'); // $routes->match(['get', 'post', 'put', 'delete'],'resetPasswordConfirmUser/(:any)/(:any)', 'Login::resetPasswordConfirmUser/$1/$2'); // $routes->match(['get', 'post', 'put', 'delete'],'createPasswordUser', 'Login::createPasswordUser'); @@ -315,4 +317,6 @@ $routes->match(['get', 'post', 'put', 'delete'],'Empperform', 'Report::per'); $routes->get('qualityreportlist', 'Quality::reportList'); $routes->get('qualityreportlistinward', 'Quality::reportListInward'); -$routes->get('shortagematerialListing', 'Rawmaterialdetails::shortagematerialListing'); \ No newline at end of file +$routes->get('shortagematerialListing', 'Rawmaterialdetails::shortagematerialListing'); + +$routes->get('inprocess', 'Inprocess::index'); diff --git a/app/Controllers/Inprocess.php b/app/Controllers/Inprocess.php index 316763f0..d527be6a 100644 --- a/app/Controllers/Inprocess.php +++ b/app/Controllers/Inprocess.php @@ -148,15 +148,15 @@ class Inprocess extends BaseController $resindesc = $this->request->getPost('param11'); $qty = $this->request->getPost('param12'); $times = $this->request->getPost('param13'); - $times = explode(",", $times); + $times = explode(",", (string)$times); $approvedby = $this->request->getPost('param14'); $remarks = $this->request->getPost('param15'); - $testphpdata = json_decode($testjson, true); - $testphpdata2 = json_decode($testjson2, true); - $loiphpdata = json_decode($loijson, true); - $afsphpdata = json_decode($afsjson, true); + $testphpdata = json_decode((string)$testjson, true); + $testphpdata2 = json_decode((string)$testjson2, true); + $loiphpdata = json_decode((string)$loijson, true); + $afsphpdata = json_decode((string)$afsjson, true); //print_r($afsphpdata);die(); $createdon = date('Y-m-d H:i:s'); $createby = $this->session->get('userId'); @@ -299,17 +299,17 @@ class Inprocess extends BaseController $resindesc = $this->request->getPost('param11'); $qty = $this->request->getPost('param12'); $times = $this->request->getPost('param13'); - $times = explode(",", $times); + $times = explode(",", (string)$times); $approvedby = $this->request->getPost('param14'); $remarks = $this->request->getPost('param15'); $masterid = $this->request->getPost('param16'); $olddoc = $this->request->getPost('param17'); - $testphpdata = json_decode($testjson, true); - $testphpdata2 = json_decode($testjson2, true); - $loiphpdata = json_decode($loijson, true); - $afsphpdata = json_decode($afsjson, true); + $testphpdata = json_decode((string)$testjson, true); + $testphpdata2 = json_decode((string)$testjson2, true); + $loiphpdata = json_decode((string)$loijson, true); + $afsphpdata = json_decode((string)$afsjson, true); //print_r($afsphpdata);die(); $createdon = date('Y-m-d H:i:s'); $createby = $this->session->get('userId'); @@ -557,16 +557,16 @@ class Inprocess extends BaseController $resindesc = $this->request->getPost('param11'); $qty = $this->request->getPost('param12'); $times = $this->request->getPost('param13'); - $times = explode(",", $times); + $times = explode(",", (string)$times); $approvedby = $this->request->getPost('param14'); $remarks = $this->request->getPost('param15'); $nissansubtype = $this->request->getPost('param16'); //echo $nissansubtype; - $testphpdata = json_decode($testjson, true); - $testphpdata2 = json_decode($testjson2, true); - $loiphpdata = json_decode($loijson, true); - $afsphpdata = json_decode($afsjson, true); + $testphpdata = json_decode((string)$testjson, true); + $testphpdata2 = json_decode((string)$testjson2, true); + $loiphpdata = json_decode((string)$loijson, true); + $afsphpdata = json_decode((string)$afsjson, true); //print_r($afsphpdata);die(); $createdon = date('Y-m-d H:i:s'); $createby = $this->session->get('userId'); @@ -764,7 +764,7 @@ class Inprocess extends BaseController $resindesc = $this->request->getPost('param11'); $qty = $this->request->getPost('param12'); $times = $this->request->getPost('param13'); - $times = explode(",",$times); + $times = explode(",",(string)$times); $approvedby = $this->request->getPost('param14'); $remarks = $this->request->getPost('param15'); $nissansubtype = $this->request->getPost('param16'); @@ -772,10 +772,10 @@ class Inprocess extends BaseController $olddoc = $this->request->getPost('param18'); //echo $nissansubtype; - $testphpdata = json_decode($testjson, true); - $testphpdata2 = json_decode($testjson2, true); - $loiphpdata = json_decode($loijson, true); - $afsphpdata = json_decode($afsjson, true); + $testphpdata = json_decode((string)$testjson, true); + $testphpdata2 = json_decode((string)$testjson2, true); + $loiphpdata = json_decode((string)$loijson, true); + $afsphpdata = json_decode((string)$afsjson, true); //print_r($afsphpdata);die(); $createdon = date('Y-m-d H:i:s'); $createby = $this->session->get('userId'); diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php index 7889e60c..82b775a4 100755 --- a/app/Controllers/Inwardgateregister.php +++ b/app/Controllers/Inwardgateregister.php @@ -539,7 +539,7 @@ class Inwardgateregister extends BaseController $addOgrline = $this->inwardgateregister_model->AddOgrLine($Ogrline); - if ((count($addogrmaster) > 0) && (count($addOgrlines > 0))) { + if ((count($addogrmaster) > 0) && ($addOgrline > 0)) { echo "Saved Successfully OGR No is OGR" . $OGRNO; } } else if ($type == 2) { @@ -725,7 +725,7 @@ class Inwardgateregister extends BaseController $addOgrline = $this->inwardgateregister_model->AddOgrLine($Ogrline); - if ((count($addogrmaster) > 0) && (count($addOgrline > 0))) { + if ((count($addogrmaster) > 0) && ($addOgrline > 0)) { echo "Saved Successfully OGR No is OGR" . $OGRNO; } } diff --git a/app/Models/Inprocess_model.php b/app/Models/Inprocess_model.php new file mode 100644 index 00000000..67b9ddda --- /dev/null +++ b/app/Models/Inprocess_model.php @@ -0,0 +1,280 @@ +db->table('ip_products') + ->select('product_id,product_name,product_description'); + $query =$builder->get(); + return $query->getResult(); + + } + + function getAllcustomers() + { + + $builder = $this->db->table('ip_clients') + ->select('client_id,client_name'); + $query =$builder->get(); + return $query->getResult(); + } + + function getAllTestReports() + { + $builder = $this->db->table('T_Inprocess_Testreport_Master') + ->select('masterreport_id,productid,ip_products.product_name,customerid,ip_clients.client_name,batchno,batchdate,document') + ->join('ip_products','T_Inprocess_Testreport_Master.productid=ip_products.product_id') + ->join('ip_clients','T_Inprocess_Testreport_Master.customerid=ip_clients.client_id'); + + $query =$builder->get(); + return $query->getResult(); + } + + + + function getSpecifications($productid,$customerid) + { + //echo 'from model'.$productid.'-'.$customerid; + // ->where('product_id',$productid); + // ->where('customer_id',$customerid); + // $res = $this->db->get('T_Prodcut_Specification_Master'); + $sql = "Select * from T_Prodcut_Specification_Master where product_id = ? and customer_id = ?"; + $res = $this->db->query($sql,array($productid,$customerid)); + // print_r($this->db->last_query()); + return $res->getResult(); + //print_r($res->result()); + + } + + function getEmplistforReport() + { + $builder = $this->db->table('T_Employee_Details')->select('T_Employee_Details.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.Departmentcode,T_DepartmentDetails.shortName') + + ->join('T_DepartmentDetails','T_Employee_Details.Departmentcode=T_DepartmentDetails.DEPCode') + //->join('ip_invoice_items','ip_invoices.invoice_number=ip_invoice_items.invoice_number'); + //->join('ip_products','ip_invoice_items.item_product_id=ip_products.product_id'); + //->join('ip_invoice_custom','ip_invoices.invoice_number=ip_invoice_custom.invoice_number and invoice_custom_fieldid=62'); + ->orderBy('T_Employee_Details.EmpID'); + $query =$builder->get(); + return $query->getResult(); + + } + + + function saveMasterTestData($masterreportdata) + { + + $builder = $this->db->table('T_Inprocess_Testreport_Master'); + $builder->insert($masterreportdata); + $row = $this->db->affectedRows(); + $id = $this->db->insertId(); + + return $id; + } + + function saveTestReportData($testreportdata) + { + + foreach($testreportdata as $data) + { + $builder = $this->db->table('T_Inprocess_Testreport'); + $builder->insert($data); + $row = $this->db->affectedRows(); + $id = $this->db->insertId(); + } + } + + function saveTestReportAFSData($afstabledata) + { + $builder = $this->db->table('T_Inprocess_AFSTestreport'); + $builder->insert($afstabledata); + $row = $this->db->affectedRows(); + //return $row; + } + + function saveTestReportLOIData($loitabledata) + { + $builder = $this->db->table('T_Inprocess_LOITestreport'); + $builder->insert($loitabledata); + $row = $this->db->affectedRows(); + //return $row; + } + + function getIndividualInprocessReportData($reportid) + { + + $builder = $this->db->table('T_Inprocess_Testreport_Master')->select('T_Inprocess_Testreport_Master.*,ip_clients.client_name,ip_products.product_name,ip_products.product_description,T_Employee_Details.FirstName,T_Employee_Details.LastName') + ->join('ip_clients','T_Inprocess_Testreport_Master.customerid=ip_clients.client_id') + ->join('ip_products','T_Inprocess_Testreport_Master.productid=ip_products.product_id') + ->join('tbl_users','T_Inprocess_Testreport_Master.createdby=tbl_users.userid') + ->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID') + ->where('T_Inprocess_Testreport_Master.masterreport_id',$reportid); + + $res =$builder->get(); + $reportdata['master'] = $res->getResult(); + + $builder = $this->db->table('T_Inprocess_Testreport') + ->select('T_Inprocess_Testreport.*,T_Prodcut_Specification_Master.testtype,T_Prodcut_Specification_Master.min,T_Prodcut_Specification_Master.max,T_Prodcut_Specification_Master.uom') + ->join('T_Prodcut_Specification_Master','T_Inprocess_Testreport.specid=T_Prodcut_Specification_Master.productspecmaster_id') + ->where('masterreport_id',$reportid); + $res1 = $builder->get(); + $reportdata['masterreport'] = $res1->getResult(); + + + + $builder = $this->db->table('T_Inprocess_LOITestreport') + ->select('T_Inprocess_LOITestreport.*') + ->where('masterreport_id',$reportid); + $res1 = $builder->get(); + $reportdata['masterreportloi'] = $res1->getResult(); + + + $builder = $this->db->table('T_Inprocess_AFSTestreport') + ->select('T_Inprocess_AFSTestreport.*') + ->where('masterreport_id',$reportid); + $res1 = $builder->get(); + $reportdata['masterreportafs'] = $res1->getResult(); + + + $builder = $this->db->table('T_Company_Details') + ->select('T_Company_Details.CompanyName,T_Company_Details.Address,T_Company_Details.ProfilePic'); + //->where('testreport_id',$reportid); + $res1 = $builder->get(); + $reportdata['company'] = $res1->getResult(); + + return $reportdata; + + } + + + + function getTestMasterforList() + { + $builder = $this->db->table('T_Test_Report_Master') + ->select('T_Test_Report_Master.testreport_id,T_Test_Report_Master.invoiceid,T_Test_Report_Master.batchdate,T_Test_Report_Master.document,ip_clients.client_id,ip_clients.client_name,ip_products.product_id,ip_products.product_name,ip_products.product_description') + ->join('ip_invoices','T_Test_Report_Master.invoiceid=ip_invoices.invoice_number') + ->join('ip_clients','ip_invoices.client_id=ip_clients.client_id') + ->join('ip_invoice_items','ip_invoices.invoice_id=ip_invoice_items.invoice_id') + ->join('ip_products','ip_products.product_id=ip_invoice_items.item_product_id'); + //->where('T_Test_Report_Master.invoiceid','!=0'); + $res = $builder->get(); + return $res->getResult(); + } + + + function updateMasterTestData($masterreportdata,$masterid) + { + $this->db->table('T_Inprocess_Testreport_Master') + ->where('masterreport_id',$masterid) + ->update($masterreportdata); + } + + + function updateTestReportData($testreportdata,$masterid,$specid) + { + + foreach($testreportdata as $data) + { + + $this->db->table('T_Inprocess_Testreport') + ->where('masterreport_id',$masterid) + ->where('specid',$specid) + ->where('iteration',$data['iteration']) + ->where('subtype',$data['subtype']) + ->update($data); + + //echo $this->db->last_query(); + + } + } + + function updateTestReportAFSData($afstabledata,$masterid,$ssize,$factor) + { + $this->db->table('T_Inprocess_AFSTestreport') + ->where('masterreport_id',$masterid) + ->where('sieve_size',$ssize) + ->where('factor',$factor) + ->update($afstabledata); + + // echo $this->db->last_query(); + + + } + + function updateTestReportLOIData($loitabledata,$masterid,$loidetails) + { + $this->db->table('T_Inprocess_LOITestreport') + ->where('masterreport_id',$masterid) + ->where('loidetails',$loidetails) + ->update($loitabledata); + //echo $this->db->last_query(); + + + } + + //FOR NISSAN INPROCESS + + + function updateNissanMasterTestData($masterreportdata,$masterid) + { + //echo "from model"; + //print_r($masterreportdata);die(); + $this->db->table('T_Inprocess_Testreport_Master') + ->where('masterreport_id',$masterid) + ->update($masterreportdata); + + + } + + + function updateNissanTestReportData($testreportdata,$masterid,$specid) + { + + foreach($testreportdata as $data) + { + + $this->db->table('T_Inprocess_Testreport') + ->where('masterreport_id',$masterid) + ->where('specid',$specid) + ->where('iteration',$data['iteration']) + ->where('subtype',$data['subtype']) + ->update($data); + + //echo $this->db->last_query(); + + } + } + + function updateNissanTestReportAFSData($afstabledata,$masterid,$ssize,$factor) + { + $this->db->table('T_Inprocess_AFSTestreport') + ->where('masterreport_id',$masterid) + ->where('sieve_size',$ssize) + ->where('factor',$factor) + ->update($afstabledata); + + // echo $this->db->last_query(); + + + } + + function updateNissanTestReportLOIData($loitabledata,$masterid,$loidetails) + { + + $this->db->table('T_Inprocess_LOITestreport') + ->where('masterreport_id',$masterid) + ->where('loidetails',$loidetails) + ->update($loitabledata); + //echo $this->db->last_query(); + + + } + +} +?> + \ No newline at end of file diff --git a/app/Models/Inwardgateregister_model.php b/app/Models/Inwardgateregister_model.php index 61e97074..0d38c759 100755 --- a/app/Models/Inwardgateregister_model.php +++ b/app/Models/Inwardgateregister_model.php @@ -146,7 +146,7 @@ class Inwardgateregister_model extends Model $builder = $this->db->table('T_PurchaseOrder_Master POM') ->distinct()->select('POM.PONO,POM.ServiceDescription,POM.DeliveryDate,sup.SupplierName,sup.Address,POM.status,OGR_Status,POM.PODate,POM.IsOpenOrder') ->select("IF(POM.PODate IS NOT NULL, DATE_FORMAT(POM.PODate, '%Y-%m-%d'), NULL) AS formatted_PODate") - ->select("IF(POM.IsOpenOrder IS NOT NULL, POM.IsOpenOrder, '%Y-%m-%d'), NULL) AS formatted_IsOpenOrder") + ->select("IF(POM.IsOpenOrder IS NULL OR POM.IsOpenOrder = '', 0, POM.IsOpenOrder) AS formatted_IsOpenOrder") ->join('T_PurchaseOrder_LineItem POL', 'POL.PONO = POM.PONO') ->join('T_SupplierDetailsN sup', 'POM.SupplierID = sup.SupplierID') ->join('T_OGR_Master OGM ', 'POM.PONO = OGM.PONO_INV', 'left') diff --git a/app/Models/Purchaseorder_model.php b/app/Models/Purchaseorder_model.php index a71c219b..331d3034 100644 --- a/app/Models/Purchaseorder_model.php +++ b/app/Models/Purchaseorder_model.php @@ -1557,8 +1557,10 @@ QuantityRejected,ROUND(Quantity-ReceivedQuantity)as PendingQty,Per, $builder = $this->db->table('T_PurchaseOrder_Master mast')->distinct() ->select('mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,ccm.CostCenterCode,mast.POType as RType,mast.Remarks,DepartmentName,mast.ApprovedBy,(select EmpID from tbl_users where userId=mast.ApprovedBy )as EID,rmast.ReqType,mast.Status,mast.CapitalRange, - (select FirstName from T_Employee_Details where EmpID=EID)as Approver') + (select FirstName from T_Employee_Details where EmpID=EID)as Approver,sup.SupplierName') // ->orderBy('mast.Status',"PO_CREATED"); + + ->join('T_SupplierDetailsN sup', 'sup.SupplierID = mast.SupplierID') ->join('T_Status st', 'st.StatusCode=mast.Status') ->join('T_PurchaseOrder_LineItem req', 'req.PONO= mast.PONO') ->join('T_Requestion_Master rmast', 'rmast.ReqNo=req.ReqNo') diff --git a/app/Views/includes/header.php b/app/Views/includes/header.php index 31ccad8f..695ba524 100644 --- a/app/Views/includes/header.php +++ b/app/Views/includes/header.php @@ -1488,7 +1488,8 @@
  • - + + View Inward Gate Register @@ -1506,12 +1507,6 @@
  • -
  • - - - View Inward Gate Register - -
  • @@ -1644,12 +1639,12 @@ Inward Gate Register Entry
  • -
  • +
  • diff --git a/app/Views/inwardgateregister.php b/app/Views/inwardgateregister.php index cc261f76..a4c642eb 100755 --- a/app/Views/inwardgateregister.php +++ b/app/Views/inwardgateregister.php @@ -172,7 +172,7 @@ Inputmask("A{2,3} 9{1,2} A{1,2} 9{4}").mask($("#VehicleNo")); -
    +
    diff --git a/app/Views/porelease_view.php b/app/Views/porelease_view.php index 327a7260..17da9b02 100644 --- a/app/Views/porelease_view.php +++ b/app/Views/porelease_view.php @@ -39,7 +39,7 @@ if(empty($Status)) Purchase Order Number Purchase Order Type Cost Center Name - Cost Center Code + Supplier Name Created By Department Created Date @@ -71,11 +71,11 @@ if(empty($Status)) - - + RType ?> CostCenterName ?> - CostCenterCode?> + + SupplierName ?> FirstName ?> DepartmentName?> CreatedDate);