From a3275490cdca75ad902a495c25a1508fdcebf22b Mon Sep 17 00:00:00 2001 From: vadivel J Date: Fri, 18 Oct 2024 17:31:45 +0530 Subject: [PATCH 1/6] finished coating machine details --- app/Config/Routes.php | 1 + app/Controllers/StockController.php | 21 +++++++++++++ app/Views/CoatingMachineDetail.php | 46 ++++++++++++++++++++++++----- 3 files changed, 61 insertions(+), 7 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 861406c1..de22087a 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -421,6 +421,7 @@ $routes->post('getSilicaIGR', 'Supplier::getSilicaIGR'); //Stock Module $routes->get('coatingMachineDetails' , 'StockController::loadView_coatingMachineDetails'); +$routes->post('coatingMachineDetails' , 'StockController::loadView_coatingMachineDetails'); $routes->post('addNewCoatingMachineDetails' , 'StockController::addNewCoatingMachineDetails'); $routes->post('updateCoatingMachineDetails','StockController::updateCoatingMachineDetails'); $routes->get('deleteCoatingMachineDetails' , 'StockController::deleteCoatingMachineDetails'); diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index 6f1f2c49..b2901432 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -37,13 +37,34 @@ class StockController extends BaseController public function loadView_coatingMachineDetails(){ + 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'); + // dd($month); + } + $this->global['pageTitle'] = 'Coating Machine Details '; $data['coatingMachineDetails']= $this->coatingMachineDetails_model ->where('is_active', 1) ->orderBy('created_at','DESC') + ->like('created_at', $month, 'after') ->findAll(); + $date = DateTime::createFromFormat('Y-m', $month); + + $formattedDate = $date->format('M-Y'); + + $data['month']=$formattedDate; + return $this->loadViews("CoatingMachineDetail", $this->global, $data, NULL); } diff --git a/app/Views/CoatingMachineDetail.php b/app/Views/CoatingMachineDetail.php index af5ab65d..8ae76f9e 100644 --- a/app/Views/CoatingMachineDetail.php +++ b/app/Views/CoatingMachineDetail.php @@ -64,7 +64,9 @@ } - + + + @@ -113,8 +115,27 @@
+
+
-
+
+
+ + + + + +
+ +
+ +
+ +
+ + @@ -126,12 +147,12 @@ - + - + - - + @@ -569,7 +590,7 @@ var table = $('#datatable').DataTable({ dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination buttons: [ - 'csv', 'excel', 'pdf' // Export buttons + 'csv', 'excel', 'pdf', // Export buttons ], pageLength: 10, // Default rows per page lengthMenu: [[10, 20, 30, 50, -1], [10, 20, 30, 50, "All"]], // Rows per page options @@ -930,4 +951,15 @@ } + + + \ No newline at end of file From d14dee5b876b83ee9276a43461940979b10e1f94 Mon Sep 17 00:00:00 2001 From: vadivel J Date: Sat, 19 Oct 2024 14:30:18 +0530 Subject: [PATCH 2/6] working on incoming silica module -vadivel J --- app/Config/Routes.php | 8 +- app/Controllers/StockController.php | 11 + .../incomingSilicaSanddetails_model.php | 50 ++ app/Views/CoatingMachineDetail.php | 155 ++--- app/Views/includes/new_header.php | 7 + app/Views/incomingSilicaSanddetails.php | 553 ++++++++++++++++++ 6 files changed, 679 insertions(+), 105 deletions(-) create mode 100644 app/Models/incomingSilicaSanddetails_model.php create mode 100644 app/Views/incomingSilicaSanddetails.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 6919e4e1..1811b97e 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -420,8 +420,8 @@ $routes->post('getSilicaIGR', 'Supplier::getSilicaIGR'); //Stock Module -$routes->get('coatingMachineDetails' , 'StockController::loadView_coatingMachineDetails'); -$routes->post('coatingMachineDetails' , 'StockController::loadView_coatingMachineDetails'); +//coatingMachineDetails +$routes->match(['GET','POST'],'coatingMachineDetails' , 'StockController::loadView_coatingMachineDetails'); $routes->post('addNewCoatingMachineDetails' , 'StockController::addNewCoatingMachineDetails'); $routes->post('updateCoatingMachineDetails','StockController::updateCoatingMachineDetails'); $routes->get('deleteCoatingMachineDetails' , 'StockController::deleteCoatingMachineDetails'); @@ -431,3 +431,7 @@ $routes->get('deleteCoatingMachineDetails' , 'StockController::deleteCoatingMach $routes->match(['GET', 'POST', 'PUT', 'DELETE'],'drierMachineDetails', 'StockController::drierMachineDetails'); $routes->match(['GET', 'POST', 'PUT', 'DELETE'],'addOrEditdrierMachineDetails', 'StockController::addOrEditdrierMachineDetails'); +//incomingSilicaSandDetaails +$routes->match(['GET','POST'],'incomingSilicaSandDetails', 'StockController::loadView_incomingSilicaSandDetails'); +$routes->post('updateIncomingSilicaSandDetails', 'StockController::updateIncomingSilicaSandDetails'); +$routes->get('deleteIncomingSilicaSandDetails', 'StockController::deleteIncomingSilicaSandDetails'); diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index 1325d78c..4a149c74 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -125,6 +125,17 @@ class StockController extends BaseController + public function loadView_incomingSilicaSandDetails(){ + + } + + public function updateIncomingSilicaSandDetails(){ + + } + + public function deleteIncomingSilicaSandDetails(){ + + } diff --git a/app/Models/incomingSilicaSanddetails_model.php b/app/Models/incomingSilicaSanddetails_model.php new file mode 100644 index 00000000..90df8f2b --- /dev/null +++ b/app/Models/incomingSilicaSanddetails_model.php @@ -0,0 +1,50 @@ + - - - - - -
@@ -77,20 +71,6 @@
- -
@@ -254,7 +234,7 @@ * - - + + - - + + * + +
+
+ +
+
+ + + + + +
+
Shift Machine On Time Machine Off TimeMachine Running (hr)Machine Running(hr) Total CoatingTotal Coating Sand (kg)Total Coating Sand(kg) Total Gas ConsumptionPer Hour Gas ConsumptionPer Hour Coating Sand QTY (kg) + Hour GasHour QTY(kg) Customer Name Action
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
S.NOIGR NoInvoice NoInvoice DateReceived DateSupplier NameGrade Grade ConditionVehicle NoQty102030405070100140200300PANTotalAFS SpecAFS ActualPlus 20 loss%Plus 30 Loss %Moisture % SpecMoisture ActualMoisture LossMoisture loss Qty Sieve Loss Qty Salable Qty Remark
format('d-m-Y'); ?> + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file From 3edca946c4b3f77163a1969ecbe2bec0708fb6d6 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sun, 20 Oct 2024 23:38:41 +0530 Subject: [PATCH 3/6] stock module dev 17/10 changes -vadivel J --- app/Views/CoatingMachineDetail.php | 46 +++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/app/Views/CoatingMachineDetail.php b/app/Views/CoatingMachineDetail.php index d1db891a..c89ec637 100644 --- a/app/Views/CoatingMachineDetail.php +++ b/app/Views/CoatingMachineDetail.php @@ -232,7 +232,7 @@
* - @@ -273,7 +273,7 @@
* - @@ -293,7 +293,7 @@ ' . $formattedHour . ':00 PM'; @@ -413,7 +413,7 @@
* - @@ -434,7 +434,7 @@ * - Date: Mon, 21 Oct 2024 17:52:38 +0530 Subject: [PATCH 4/6] incoming silica sand details 70% comp --- app/Controllers/StockController.php | 30 +++- ...php => IncomingSilicaSandDetailsModel.php} | 0 app/Models/Inwardgateregister_model.php | 33 +++- app/Models/Rawmaterialdetails_model.php | 13 ++ app/Views/includes/new_header.php | 4 +- ...ails.php => incomingSilicaSandDetails.php} | 156 ++++++++++++------ 6 files changed, 180 insertions(+), 56 deletions(-) rename app/Models/{incomingSilicaSanddetails_model.php => IncomingSilicaSandDetailsModel.php} (100%) rename app/Views/{incomingSilicaSanddetails.php => incomingSilicaSandDetails.php} (72%) diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index 4a149c74..b37fe08b 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -5,6 +5,9 @@ namespace App\Controllers; use App\Controllers\BaseController; use App\Models\CoatingMachineDetailsModel; use App\Models\DrierMachineDetailsModel; +use App\Models\IncomingSilicaSandDetailsModel; +use App\Models\Inwardgateregister_model; +use App\Models\Rawmaterialdetails_model; use CodeIgniter\HTTP\ResponseInterface; use DateTime; @@ -13,7 +16,10 @@ class StockController extends BaseController protected $coatingMachineDetails_model; protected $drierMachineDetails_model; - protected $session; + protected $incomingSilicaSandDetails_model; + protected $inwardGateRegister_model; + protected $rawmaterialdetails_model; + protected $session; /** * This is default constructor of the class @@ -23,6 +29,9 @@ class StockController extends BaseController parent::__construct(); $this->coatingMachineDetails_model = new CoatingMachineDetailsModel(); $this->drierMachineDetails_model = new DrierMachineDetailsModel(); + $this->rawmaterialdetails_model = new Rawmaterialdetails_model(); + $this->incomingSilicaSandDetails_model = new IncomingSilicaSandDetailsModel(); + $this->inwardGateRegister_model = new Inwardgateregister_model(); $this->session = session(); helper('form'); @@ -48,7 +57,6 @@ class StockController extends BaseController } else{ $month = date('Y-m'); - // dd($month); } $this->global['pageTitle'] = 'Coating Machine Details '; @@ -127,6 +135,24 @@ class StockController extends BaseController public function loadView_incomingSilicaSandDetails(){ + $month='2024-09'; + $data['month']=$month; + + $this->global['pageTitle']='Incoming Silica Sand Details'; + + $materialCodes = $this->rawmaterialdetails_model->getAllSilicaRawMaterialCode(); + + if (!empty($materialCodes)) { // Proceed if there are matching MaterialCodes + $data['igrDetails'] = $this->inwardGateRegister_model->findIgrForSilicaSand($materialCodes,$month); + + } else { + $data['igrDetails'] = []; // If no materials found, return an empty array + } + + //$data['incomingSilicaSandDetails']=$this->incomingSilicaSandDetails_model-> + + return $this->loadViews("incomingSilicaSandDetails", $this->global, $data, NULL); + } public function updateIncomingSilicaSandDetails(){ diff --git a/app/Models/incomingSilicaSanddetails_model.php b/app/Models/IncomingSilicaSandDetailsModel.php similarity index 100% rename from app/Models/incomingSilicaSanddetails_model.php rename to app/Models/IncomingSilicaSandDetailsModel.php diff --git a/app/Models/Inwardgateregister_model.php b/app/Models/Inwardgateregister_model.php index b01167e6..2bb3b31e 100755 --- a/app/Models/Inwardgateregister_model.php +++ b/app/Models/Inwardgateregister_model.php @@ -1030,5 +1030,36 @@ class Inwardgateregister_model extends Model $result = $query->getResult(); return $result; } + + public function findIgrForSilicaSand($materialCodes, $month) + { + $builder = $this->db->table('t_igr_details') + ->select('t_igr_details.IGRNO, + t_igr_details.MaterialCode, + igrMast.DeliveryChellanOrInvoiceNo as invoiceNo, + igrMast.DeliveryChellanDate as invoiceDate, + igrMast.MaterialRcvdDate as materialRecievedDate, + supplierDetails.SupplierName, + igrMast.VehicleNo, + t_igr_details.Remarks, + SUM(t_igr_details.QuantityAsPerInvoice) as Qty, + issd.* ') + ->whereIn('t_igr_details.MaterialCode', $materialCodes) + ->like('t_igr_details.CreatedDate', $month, 'after') + ->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_purchaseorder_master poMaster', 'poMaster.PONO = igrMast.PONO', 'left') + ->join('t_supplierdetailsn supplierDetails', 'supplierDetails.SupplierID = poMaster.SupplierID', 'left') + + ->orderBy('t_igr_details.CreatedDate', 'DESC'); -} \ No newline at end of file + $query = $builder->get(); + $result = $query->getResultArray(); + return $result; + } + + + +} \ No newline at end of file diff --git a/app/Models/Rawmaterialdetails_model.php b/app/Models/Rawmaterialdetails_model.php index c13d89d6..f5d792f3 100755 --- a/app/Models/Rawmaterialdetails_model.php +++ b/app/Models/Rawmaterialdetails_model.php @@ -123,6 +123,19 @@ class Rawmaterialdetails_model extends Model return $query->getResult(); } + function getAllSilicaRawMaterialCode(){ + + $builder = $this->db->table('t_materialmaster') + ->select('MaterialCode') + ->where('IsActive', 1) + ->like('LOWER(MaterialName)', 'silica sand') + ->orderBy('CreatedDate', 'desc'); + $query = $builder->get(); + $materialResults = $query->getResultArray(); + + return $materialCodes = array_column($materialResults, 'MaterialCode'); + } + function getMaterialstock($MaterialCode, $currentdate) diff --git a/app/Views/includes/new_header.php b/app/Views/includes/new_header.php index c3dcb318..75b91194 100755 --- a/app/Views/includes/new_header.php +++ b/app/Views/includes/new_header.php @@ -767,8 +767,8 @@ 10 TON Drier Details Coating Machine Details - - incoming silica sand Details + + incoming silica sand Details
diff --git a/app/Views/incomingSilicaSanddetails.php b/app/Views/incomingSilicaSandDetails.php similarity index 72% rename from app/Views/incomingSilicaSanddetails.php rename to app/Views/incomingSilicaSandDetails.php index 4071fe74..347441e8 100644 --- a/app/Views/incomingSilicaSanddetails.php +++ b/app/Views/incomingSilicaSandDetails.php @@ -1,8 +1,4 @@ - -