From 663e526f291b7aede5e9497dee5f9cd18c63b05a Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Wed, 2 Apr 2025 18:34:33 +0530 Subject: [PATCH] stock module - 02-04-2025 --- app/Config/Routes.php | 4 +- app/Controllers/Inwardgateregister.php | 40 +- app/Models/GasShortageModel.php | 2 +- app/Models/Inwardgateregister_model.php | 30 + app/Models/Rawmaterialdetails_model.php | 12 + app/Views/gasCylinderEntered.php | 702 ++++++++++++++ app/Views/gasCylinderPending.php | 1103 ++++++++++++++++++++++ app/Views/gasCylinderReturned.php | 1109 +++++++++++++++++++++++ app/Views/includes/new_header.php | 16 + 9 files changed, 3012 insertions(+), 6 deletions(-) create mode 100644 app/Views/gasCylinderEntered.php create mode 100644 app/Views/gasCylinderPending.php create mode 100644 app/Views/gasCylinderReturned.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index c794b782..f2c5db30 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -326,7 +326,9 @@ $routes->post('inwardgateregister/edituploadfile', 'Inwardgateregister::edituplo $routes->post('getIGRRemarks', 'Inwardgateregister::getIGRRemarks'); $routes->post('saveIGRRemarks', 'Inwardgateregister::saveIGRRemarks'); $routes->post('updateGasShortage','Inwardgateregister::updateGasShortage'); -$routes->post('gasShortageList','Inwardgateregister::gasShortageList'); +$routes->get('gasCylinderEntered','Inwardgateregister::gasCylinderEntered'); +$routes->get('gasCylinderPending','Inwardgateregister::gasCylinderPending'); +$routes->get('gasCylinderReturned','Inwardgateregister::gasCylinderReturned'); $routes->post('getGasShortageDetail',"Inwardgateregister::getGasShortageDetail"); diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php index 5a361bbd..930ed0e0 100755 --- a/app/Controllers/Inwardgateregister.php +++ b/app/Controllers/Inwardgateregister.php @@ -10,6 +10,7 @@ use App\Models\Inwardgateregister_model; use App\Models\IGRRemarks_model; use App\Models\GasShortageModel; use App\Helpers\Notification; +use App\Models\Rawmaterialdetails_model; use DateTime; use ZipArchive; @@ -27,6 +28,8 @@ class Inwardgateregister extends BaseController protected $inwardgateregister_model; protected $IGRRemarks_model; protected $gasShortage_model; + + protected $rawMaterialDetails_model; protected $session; protected $logger; @@ -40,6 +43,7 @@ class Inwardgateregister extends BaseController $this->inwardgateregister_model = new Inwardgateregister_model(); $this->IGRRemarks_model = new IGRRemarks_model(); $this->gasShortage_model = new GasShortageModel(); + $this->rawMaterialDetails_model = new Rawmaterialdetails_model(); $this->session = session(); helper('form'); //$this->load->library('form_validation'); @@ -1521,13 +1525,41 @@ function updateIGRWeight(){ - public function gasShortageList(){ + public function gasCylinderEntered(){ - $postData = $this->request->getPost(); + $this->global['pageTitle'] = 'Gas Cylinder Entered'; - $allShortages = $this->gasShortage_model->where('invoiceNo',$postData['invoiceNo'])->findAll(); + $gasMaterialCodes = $this->rawMaterialDetails_model->getAllGasMaterialCode(); - return $this->response->setJSON(['status' => 'success', 'data' => $allShortages]); + $gasMaterialCodes = array_column($gasMaterialCodes,'MaterialCode'); + + $igrDetailsListByMcatGas = $this->inwardgateregister_model->getIgrDetailsListByMcatGas($gasMaterialCodes); + + $data['gasCylinderEnteredList'] = $igrDetailsListByMcatGas; + + $this->loadViews("gasCylinderEntered", $this->global, $data, NULL); + + + } + + public function gasCylinderPending(){ + + $this->global['pageTitle'] = 'Gas Shortage List'; + + $data['gasShortageList'] = $this->gasShortage_model->findAll(); + + $this->loadViews("gasCylinderPending", $this->global, $data, NULL); + + + } + + public function gasCylinderReturned(){ + + $this->global['pageTitle'] = 'Gas Shortage List'; + + $data['gasShortageList'] = $this->gasShortage_model->findAll(); + + $this->loadViews("gasCylinderReturned", $this->global, $data, NULL); } diff --git a/app/Models/GasShortageModel.php b/app/Models/GasShortageModel.php index 4b8f5be9..e7519acf 100644 --- a/app/Models/GasShortageModel.php +++ b/app/Models/GasShortageModel.php @@ -6,7 +6,7 @@ use CodeIgniter\Model; class GasShortageModel extends Model { - protected $table = 't_gasShortageDetails'; + protected $table = 't_gasshortagedetails'; protected $primaryKey = 'id'; protected $useAutoIncrement = true; protected $returnType = 'array'; diff --git a/app/Models/Inwardgateregister_model.php b/app/Models/Inwardgateregister_model.php index 09cc930e..0a3051c8 100755 --- a/app/Models/Inwardgateregister_model.php +++ b/app/Models/Inwardgateregister_model.php @@ -1379,5 +1379,35 @@ $builder = $this->db->table('t_igr_history') return $transportername; } + //Mcat -materialCategory + public function getIgrDetailsListByMcatGas($gasMaterialCodes){ + + $result = $this->db->table('t_igr_details as t_igrd') + ->select(" + t_igrd.IGRNO, + SUM(t_igrd.QuantityAsPerInvoice) as gasCylinderCount, + t_sd.SupplierName, + t_igrm.*, + 'gas entered' AS status + ") + ->join('t_igr_master t_igrm', 't_igrm.IGRNO = t_igrd.IGRNO') + ->join('t_purchaseorder_master t_pom', 't_igrm.PONO = t_pom.PONO', 'left') + ->join('t_supplierdetailsn t_sd', 't_sd.SupplierID = t_pom.SupplierID') + ->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrd.IGRNO', 'left') + ->whereIn('MaterialCode', $gasMaterialCodes) + ->where("DATE(t_igrd.CreatedDate) BETWEEN '2025-01-01' AND '2025-01-31' ") + ->where('t_gsd.IGRNO IS NULL') + ->groupBy('t_igrd.IGRNO') + ->get() + ->getResultArray(); + + + + return $result; + + } + + + } \ No newline at end of file diff --git a/app/Models/Rawmaterialdetails_model.php b/app/Models/Rawmaterialdetails_model.php index 22b261bb..51e60c69 100755 --- a/app/Models/Rawmaterialdetails_model.php +++ b/app/Models/Rawmaterialdetails_model.php @@ -232,6 +232,18 @@ class Rawmaterialdetails_model extends Model } + function getAllGasMaterialCode(){ + + $builder = $this->db->table('t_materialmaster') + ->select('MaterialCode') + ->where('Category', '334') + ->orderBy('MaterialCode', 'asc'); + $query = $builder->get(); + $materialResults = $query->getResultArray(); + + return $materialResults; + } + function getMaterialstock($MaterialCode, $currentdate) diff --git a/app/Views/gasCylinderEntered.php b/app/Views/gasCylinderEntered.php new file mode 100644 index 00000000..47961925 --- /dev/null +++ b/app/Views/gasCylinderEntered.php @@ -0,0 +1,702 @@ + + + + + + + + + + + + + +
+
+ +
+ +
+
+
+
+
+ +
+
+
+ +
+ getFlashdata('message')): ?> + + + +
+
+
+
+
+
+ + + + + + + + + + + + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +

No Gas Cylinder Entered in the Given Dates..!!

+ + + $gasCylinder): + $gasCylinder['MaterialRcvdDate'] = date('d-m-Y',strtotime($gasCylinder['MaterialRcvdDate'])); + $gasCylinder['DeliveryChellanDate'] = date('d-m-Y',strtotime($gasCylinder['DeliveryChellanDate'])); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + +
Full Cylinder DateIGR NoSupplierBill/Invoice NoBill DateDriver NameVehicle NoCylinder CountStatusGas Details
+ + + +
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/Views/gasCylinderPending.php b/app/Views/gasCylinderPending.php new file mode 100644 index 00000000..51bbf798 --- /dev/null +++ b/app/Views/gasCylinderPending.php @@ -0,0 +1,1103 @@ + + + + + + + + + + + + + +
+
+ +
+ +
+
+
+
+
+ +
+
+
+ +
+ getFlashdata('message')): ?> + + + +
+
+
+
+
+
+ + + + + + + + + + + + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Full Cylinder DateIGR NoSupplierCylinder NoGross WeightActual WeightBill/Invoice NoBill DateDriver NameVehicle NoStatusAction
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/Views/gasCylinderReturned.php b/app/Views/gasCylinderReturned.php new file mode 100644 index 00000000..50a7d53e --- /dev/null +++ b/app/Views/gasCylinderReturned.php @@ -0,0 +1,1109 @@ + + + + + + + + + + + + + +
+
+ +
+ +
+
+
+
+
+ +
+
+
+ +
+ getFlashdata('message')): ?> + + + +
+
+
+
+
+
+ + + + + + + + + + + + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Full Cylinder DateIGR NoSupplierCylinder NoGross WeightEmpty Cylinder DateTare WeightNet WeightActual WeightshortageBill/Invoice NoBill DateDriver NameVehicle NoStatusAction
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/Views/includes/new_header.php b/app/Views/includes/new_header.php index 2b66ce48..3549eee3 100755 --- a/app/Views/includes/new_header.php +++ b/app/Views/includes/new_header.php @@ -746,6 +746,22 @@ Non IGR / Expense + + +