diff --git a/app/Config/Routes.php b/app/Config/Routes.php index b08ca39c..b613750c 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -43,9 +43,9 @@ $routes->get('user/deleteUser', 'User::deleteUser'); $routes->get('user/reActivateUser', 'User::reActivateUser'); // Supplier Routes -$routes->get('supplierlisting', 'Supplier::index'); // list supplier +$routes->match(["GET","POST"],'supplierlisting', 'Supplier::index'); // list supplier $routes->add('addsupplier', 'Supplier::addsupplier');//load add supplier page -$routes->get('viewsupplier', 'Supplier::viewsupplier');// load edit supplier page +$routes->get('viewsupplier', 'Supplier::viewsupplier'); $routes->post('editsupplier', 'Supplier::updatesupplierdetails'); //save supplier details $routes->post('addNewsupplier', 'Supplier::savesupplierdetails'); // update supplier details $routes->post('supplierExist', 'Supplier::checksupplier'); @@ -68,7 +68,7 @@ $routes->post('deleteMaterial', 'Rawmaterialdetails::deleteMaterial'); $routes->post('reActivateMaterial', 'Rawmaterialdetails::reActivateMaterial'); // Cost Center Routes -$routes->get('costListing', 'CostCenter::index'); +$routes->match(['GET','POST'],'costListing', 'CostCenter::index'); $routes->post('fetchCostCenterDetails', 'CostCenter::fetchCostCenterDetails');// for Ajax both add and edit.... $routes->get('reActivateCostCenter', 'CostCenter::reActivateCostCenter'); $routes->get('deleteCostCenter', 'CostCenter::deleteCostCenter'); @@ -97,7 +97,7 @@ $routes->post('getDriver', 'Driver::getDriver'); $routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'driverPrintPdf', 'Driver::driverPrintPdf'); // Asset Detail Routes -$routes->get('assetListing', 'Assetdetails::assetListing'); +$routes->match(['GET','POST'],'assetListing', 'Assetdetails::assetListing'); $routes->get('addasset', 'Assetdetails::addasset'); $routes->post('assetdetails/getpodetails', 'Assetdetails::getpodetails'); $routes->post('assetdetails/getline', 'Assetdetails::getline'); @@ -151,7 +151,7 @@ $routes->get('configurationctrl/deleteConfig', 'Configurationctrl::deleteConfig' $routes->get('configurationctrl/reActivateConfig', 'Configurationctrl::reActivateConfig'); // Department Master Routes -$routes->get('departmentListing', 'Department::index'); +$routes->match(["GET","POST"],'departmentListing', 'Department::index'); $routes->get('adddepartment', 'Department::adddepartment'); $routes->post('savedepartment', 'Department::savedepartment'); $routes->get('editOlddepartment', 'Department::viewdepartment'); @@ -295,10 +295,10 @@ $routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'storerequisitionlisting', 'Sto $routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'EditStoreRequisition', 'Storerequisitioncontroller::EditStoreRequistion'); // Application IGR Routes -$routes->get('AddIGR', 'Inwardgateregister::addIGR'); // ADD IGR page - working -$routes->get('ViewIGR', 'Inwardgateregister::viewIGR'); // View IGR PAGE - Working +$routes->get( 'AddIGR', 'Inwardgateregister::addIGR'); // ADD IGR page - working +$routes->get( 'ViewIGR', 'Inwardgateregister::viewIGR'); // View IGR PAGE - Working $routes->post('ViewIGR', 'Inwardgateregister::viewIGR');//for filter purpose -$routes->get('accountsDashboard', 'Inwardgateregister::accountsDashboard'); // View IGR PAGE - Working +$routes->get( 'accountsDashboard', 'Inwardgateregister::accountsDashboard'); // View IGR PAGE - Working $routes->post('ViewIGRDetails', 'Inwardgateregister::viewIGRDetails'); $routes->post('GetIGRLineItemDetails', 'Inwardgateregister::getIGRLineItemDetails'); $routes->post('SaveIGR', 'Inwardgateregister::SaveIGR');// Save IGR PAGE - Working @@ -309,10 +309,13 @@ $routes->post('getCostCenterData', 'Inwardgateregister::getCostCenterData'); $routes->post('ViewIGRfile', 'Inwardgateregister::ViewIGRfile'); $routes->post('getAdditionalIGRFile', 'Inwardgateregister::getAdditionalIGRFile'); $routes->post('deleteAdditionalIGRFile', 'Inwardgateregister::deleteAdditionalIGRFile'); -$routes->get('download-files/(:segment)', 'Inwardgateregister::downloadFilesAsZip/$1'); +$routes->get( 'download-files/(:segment)', 'Inwardgateregister::downloadFilesAsZip/$1'); $routes->post('inwardgateregister/edituploadfile', 'Inwardgateregister::edituploadfile'); $routes->post('getIGRRemarks', 'Inwardgateregister::getIGRRemarks'); $routes->post('saveIGRRemarks', 'Inwardgateregister::saveIGRRemarks'); +$routes->post('updateGasShortage','Inwardgateregister::updateGasShortage'); +$routes->post('gasShortageList','Inwardgateregister::gasShortageList'); +$routes->post('getGasShortageDetail',"Inwardgateregister::getGasShortageDetail"); // Non IGR / Expense @@ -439,7 +442,7 @@ $routes->post('download_sales_invoice', 'Sales::download_sales_invoice'); $routes->post('updateInvRecQty', 'Sales::updateInvRecQty'); // transporter Routes -$routes->get('transporterListing', 'Supplier::transporterListing'); +$routes->match(['GET', 'POST'],'transporterListing', 'Supplier::transporterListing'); $routes->post('fetchTransporterDetails', 'Supplier::fetchTransporterDetails');// for Ajax both add and edit.... $routes->get('deleteTransporter', 'Supplier::deleteTransporter'); $routes->get('reActivateTransporter', 'Supplier::reActivateTransporter'); @@ -449,6 +452,7 @@ $routes->post('checkTransporter', 'Supplier::checkTransporter'); $routes->post('createFactoryMachineMasterDetails', 'FactoryMachineController::createFactoryMachineMasterDetails'); $routes->get('readFactoryMachineMasterDetails', 'FactoryMachineController::readFactoryMachineMasterDetails'); +$routes->post('readFactoryMachineMasterDetails', 'FactoryMachineController::readFactoryMachineMasterDetails'); $routes->get('readFactoryMachineMasterDetailsById', 'FactoryMachineController::readFactoryMachineMasterDetailsById'); $routes->post('updateFactoryMachineMasterDetails', 'FactoryMachineController::updateFactoryMachineMasterDetails'); $routes->get('deleteFactoryMachineMasterDetails', 'FactoryMachineController::deleteFactoryMachineMasterDetails'); diff --git a/app/Controllers/Assetdetails.php b/app/Controllers/Assetdetails.php index d1b2977a..abe28116 100755 --- a/app/Controllers/Assetdetails.php +++ b/app/Controllers/Assetdetails.php @@ -50,9 +50,22 @@ class Assetdetails extends BaseController */ function assetListing() { + $isActiveFilter = 1 ; // default showing active data + $showArchive = 0 ; // + + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown then we are making active filter 0 + if($showArchive){ + $isActiveFilter = 0; + } + } + + $data['showArchive'] = $showArchive; - $data['userRecords'] = $this->assetdetails_model->assetListing(); + $data['userRecords'] = $this->assetdetails_model->assetListing($isActiveFilter); $this->global['pageTitle'] = 'Asset List'; //print_r($data);die(); diff --git a/app/Controllers/CostCenter.php b/app/Controllers/CostCenter.php index d23a4a2d..b91be7f4 100755 --- a/app/Controllers/CostCenter.php +++ b/app/Controllers/CostCenter.php @@ -45,7 +45,21 @@ class CostCenter extends BaseController */ public function index() { - $data['userRecords'] = $this->costcenter_model->CostListing(); + + $isActiveFilter = 1 ; // default showing active data + $showArchive = 0 ; // + + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown we are making active filter + if($showArchive){ + $isActiveFilter = 0; + } + } + + $data['showArchive'] = $showArchive; + $data['userRecords'] = $this->costcenter_model->CostListing($isActiveFilter); $this->global['pageTitle'] = 'Cost List'; $this->loadViews("costListing", $this->global, $data, NULL); diff --git a/app/Controllers/Department.php b/app/Controllers/Department.php index 79d4d956..fa607f43 100755 --- a/app/Controllers/Department.php +++ b/app/Controllers/Department.php @@ -48,20 +48,25 @@ class Department extends BaseController public function index() { - // if($this->isAdmin() == TRUE) - // { - // $this->loadThis(); - // } - // else - // { + + $isActiveFilter = 1 ; // default showing active data + $showArchive = 0 ; // + + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown then we are making active filter 0 + if($showArchive){ + $isActiveFilter = 0; + } + } + + $data['showArchive'] = $showArchive; + + $this->department_model = new department_model(); - //$searchText = $this->request->getPost('searchText'); - //$data['searchText'] = $searchText; - //$count = $this->department_model->departmentListing($searchText); - //$returns = $this->paginationCompress ( "departmentListing/", $count, 20 ); - - $data['userRecords'] = $this->department_model->departmentListing(); //$searchText, $returns["page"], $returns["segment"]); + $data['userRecords'] = $this->department_model->departmentListing($isActiveFilter); //$searchText, $returns["page"], $returns["segment"]); $this->global['pageTitle'] = 'Department Listing'; diff --git a/app/Controllers/Expense.php b/app/Controllers/Expense.php index 4483e649..4d4a61d6 100755 --- a/app/Controllers/Expense.php +++ b/app/Controllers/Expense.php @@ -25,6 +25,8 @@ class Expense extends BaseController public function index() { + + $isActiveFilter = 1 ; if ($this->request->getMethod() === 'GET') { @@ -38,7 +40,7 @@ class Expense extends BaseController } $data['expense_list'] = $this->expense_model->getAllExpense($fromDate,$toDate); - $data['supplier_list'] = json_encode($this->supplier_model->supplierlisting()); + $data['supplier_list'] = json_encode($this->supplier_model->supplierlisting($isActiveFilter)); $this->global['pageTitle'] = 'Non IGR / Expense List'; $data['fromDate'] = date('d-m-Y', strtotime($fromDate)); $data['toDate'] = date('d-m-Y', strtotime($toDate)); diff --git a/app/Controllers/FactoryMachineController.php b/app/Controllers/FactoryMachineController.php index 002f78dd..aac84358 100644 --- a/app/Controllers/FactoryMachineController.php +++ b/app/Controllers/FactoryMachineController.php @@ -80,9 +80,25 @@ class FactoryMachineController extends BaseController public function readFactoryMachineMasterDetails(){ + + $isActiveFilter = 1 ; // default showing active data + $showArchive = 0 ; // + + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown then we are making active filter 0 + if($showArchive){ + $isActiveFilter = 0; + } + } + + $data['showArchive'] = $showArchive; + $this->global['pageTitle'] = 'Factory Machine Master Details'; $data['masterData'] = $this->factoryMachineMaster_model + ->where('is_active',$isActiveFilter) ->orderBy('created_at','DESC') ->findAll(); diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php index 438272e9..a66fabb8 100755 --- a/app/Controllers/Inwardgateregister.php +++ b/app/Controllers/Inwardgateregister.php @@ -8,6 +8,7 @@ use CodeIgniter\Validation\Exceptions\ValidationException; use App\Models\Inwardgateregister_model; use App\Models\IGRRemarks_model; +use App\Models\GasShortageModel; use App\Helpers\Notification; use DateTime; @@ -25,6 +26,7 @@ class Inwardgateregister extends BaseController { protected $inwardgateregister_model; protected $IGRRemarks_model; + protected $gasShortage_model; protected $session; protected $logger; @@ -37,6 +39,7 @@ class Inwardgateregister extends BaseController parent::__construct(); $this->inwardgateregister_model = new Inwardgateregister_model(); $this->IGRRemarks_model = new IGRRemarks_model(); + $this->gasShortage_model = new GasShortageModel(); $this->session = session(); helper('form'); //$this->load->library('form_validation'); @@ -1472,4 +1475,62 @@ function updateIGRWeight(){ } } + + + public function gasShortageList(){ + + $postData = $this->request->getPost(); + + $allShortages = $this->gasShortage_model->where('invoiceNo',$postData['invoiceNo'])->findAll(); + + return $this->response->setJSON(['status' => 'success', 'data' => $allShortages]); + + + } + + + public function getGasShortageDetail(){ + + $postData = $this->request->getPost(); + + $shortage = $this->gasShortage_model->where('id',$postData['id'])->find(); + + return $this->response->setJSON(['status' => 'success', 'data' => $shortage]); + + } + + + + public function updateGasShortage() + { + $postData = $this->request->getPost(); + + // Validate required data + if (!$postData) { + return $this->response->setJSON(['status' => 'error', 'message' => 'Invalid request. No data received.']); + } + + // Validate required fields for adding + if ( !isset($postData['invoiceNo']) ) { + return $this->response->setJSON(['status' => 'error', 'message' => 'Missing required fields: invoice No.']); + } + + // Handle update (edit) + if (isset($postData["id"])) { + return $this->gasShortage_model->update($postData["id"], $postData) + ? $this->response->setJSON(['status' => 'success', 'message' => 'Gas shortage details updated successfully.']) + : $this->response->setJSON(['status' => 'error', 'message' => 'Failed to update gas shortage details.']); + } + + // Insert new shortage (add) + return ($insertId = $this->gasShortage_model->insert($postData)) + ? $this->response->setJSON(['status' => 'success', 'message' => 'Gas shortage details added successfully.', 'data' => ['id' => $insertId]]) + : $this->response->setJSON(['status' => 'error', 'message' => 'Failed to save gas shortage details.']); + + } + + + + + } \ No newline at end of file diff --git a/app/Controllers/Rawmaterialdetails.php b/app/Controllers/Rawmaterialdetails.php index 738e2c69..0c48421e 100755 --- a/app/Controllers/Rawmaterialdetails.php +++ b/app/Controllers/Rawmaterialdetails.php @@ -66,9 +66,22 @@ class Rawmaterialdetails extends BaseController function rawmaterialListing() { - $this->rawmaterialdetails_model = new rawmaterialdetails_model();; + $isActiveFilter = 1 ; // default showing active data + $showArchive = 0 ; // - $data['userRecords'] = $this->rawmaterialdetails_model->rawmaterialListing(); + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown we are making active filter + if($showArchive){ + $isActiveFilter = 0; + } + } + + $this->rawmaterialdetails_model = new rawmaterialdetails_model(); + + $data['userRecords'] = $this->rawmaterialdetails_model->rawmaterialListing($isActiveFilter); + $data['showArchive'] = $showArchive ; $data['materialCategoryList']= $this->materialCategories_model->where('is_active',1)->findAll(); $this->global['pageTitle'] = 'RawMaterial Listing'; diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index c3b26a66..de76134c 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -17,14 +17,16 @@ use App\Models\BagStockDetailsModel; use App\Models\DustAndRoughModel; use App\Models\ResinStockModel; use App\Models\GasStockModel; -use App\Models\TrpAbstract; -use App\Models\TrpAbstractParticulars; use App\Models\TrpSandUseStockModel; use App\Models\TrpProductionModel; use App\Models\TrpProductionMaintenanceModel; use App\Models\TrpProductionWasteModel; use App\Models\Employeedetails_model; use App\Models\PowerConsumptionSummaryModel; +use App\Models\MonthWiseMaterialInStockModel; +use App\Models\MonthWiseMachinesInStockModel; +use App\Models\TrpAbstractModel; + @@ -68,9 +70,11 @@ class StockController extends BaseController protected $employeedetails_model; - protected $trpAbstractParticularsModel ; + protected $monthWiseMaterialInStockModel ; - protected $trpAbstractModel ; + protected $monthWiseMachineInStockModel ; + + protected $trpAbstract_model ; /** @@ -120,10 +124,12 @@ class StockController extends BaseController $this->employeedetails_model = new Employeedetails_model(); $this->powerConsumptionSummary_model = new PowerConsumptionSummaryModel(); + + $this->monthWiseMaterialInStockModel = new MonthWiseMaterialInStockModel(); - $this->trpAbstractParticularsModel = new TrpAbstractParticulars(); + $this->monthWiseMachineInStockModel = new MonthWiseMachinesInStockModel(); - $this->trpAbstractModel = new TrpAbstract(); + $this->trpAbstract_model = new TrpAbstractModel(); $this->session = session(); @@ -791,6 +797,98 @@ class StockController extends BaseController $this->global['pageTitle'] = 'Bag Stock Details'; + $startDate = "$month-01"; + $endDate = date("Y-m-t", strtotime($startDate)); + + + + $customisedMaterialCodes = $this->request->getPost('customisedMaterialCodes') ?? []; + + $existingCustomMaterialCodes = $this->monthWiseMaterialInStockModel + ->select('materialCode') + ->where('date',"$month-01") + ->where('stock_category','packing_material') + ->findAll(); + + + //check user applies for filter currently + if(!empty($customisedMaterialCodes)){ + + //user applied filter, + + //check already filter existing , if exists remove that , + if(!empty($existingCustomMaterialCodes)){ + + //hard delete done..!! + $existingCustomMaterialCodes = $this->monthWiseMaterialInStockModel + ->where('date',"$month-01") + ->where('stock_category','packing_material') + ->delete(); + + } + + + //if no filter already exists or removed current one , just add current filter for that month ....!! + $inserts = []; + + foreach($customisedMaterialCodes as $index => $customisedMaterialCode){ + + $inserts [] = [ + 'date' => "$month-01", + 'stock_category' => "packing_material", + 'materialCode' => $customisedMaterialCode + ]; + + //checking filtered material code present in table , if not create dummy one for whole month + $findMaterialCode = $this->bagStockDetails_model + ->where('date >=', $startDate) + ->where('date <=', $endDate) + ->where('materialCode',$customisedMaterialCode) + ->findAll(); + + //check any material code is not present in stock table but applied in filter + if(empty($findMaterialCode)){ + //create dummy entry for that + $this->createDummyEntryForBag($customisedMaterialCode,$startDate,$endDate); + } + + } + + if(!empty($inserts)){ + //insert all the latest applied filter + $this->monthWiseMaterialInStockModel->insertBatch($inserts); + + //get the currently applied filter + $existingCustomMaterialCodes = $this->monthWiseMaterialInStockModel + ->select('materialCode') + ->where('date',"$month-01") + ->where('stock_category','packing_material') + ->get()->getResultArray(); + + } + + } + + + //possible if no filter applied at all...!!! + if(empty($existingCustomMaterialCodes)){ + //no filter applied at all just present all active material codes + $existingCustomMaterialCodes = $this->rawmaterialdetails_model + ->getAllBagMaterialCode(); + }else{ + //if filter present,get that material codes + $existingCustomMaterialCodes = $this->rawmaterialdetails_model + ->getSelectedBagMaterialCode(array_column($existingCustomMaterialCodes, 'materialCode')); + } + + + $materialCodeList = array_column($existingCustomMaterialCodes, 'MaterialCode'); + + $bagMaterials = $existingCustomMaterialCodes ; + + $data['activeBagMaterials'] = $this->rawmaterialdetails_model->getAllBagMaterialCode(); + + // Get the previous month's last date bag stock details for next month updation $previousMonth = DateTime::createFromFormat('Y-m', $month)->modify('-1 month')->format('Y-m'); @@ -809,11 +907,10 @@ class StockController extends BaseController // checking in database if the data is available for the month - $startDate = "$month-01"; - $endDate = date("Y-m-t", strtotime($startDate)); $data['bagStockDetails'] = $this->bagStockDetails_model ->where('date >=', $startDate) ->where('date <=', $endDate) + ->whereIn('materialCode',$materialCodeList) ->groupBy(['materialCode', 'date']) ->orderBy('date', 'asc') ->orderBy('materialCode', 'asc') @@ -856,25 +953,28 @@ class StockController extends BaseController + //temp_code_s_2025_02 - // getting bag material for creating table headers - // checking already existing stock if yes then get the material code from the existing bag - // if not get all the material codes from the raw material details table + // // getting bag material for creating table headers + // // checking already existing stock if yes then get the material code from the existing bag + // // if not get all the material codes from the raw material details table - if (!empty($data['groupedBagStockDetails'])) { - $result = $groupedByDate[$date]; + // if (!empty($data['groupedBagStockDetails'])) { + // $result = $groupedByDate[$date]; - $distinctMaterialCodes = []; + // $distinctMaterialCodes = []; - foreach ($result as $index => $eachResult) { - $distinctMaterialCodes[] = $result[$index]['materialCode']; - } + // foreach ($result as $index => $eachResult) { + // $distinctMaterialCodes[] = $result[$index]['materialCode']; + // } - $bagMaterials = $this->rawmaterialdetails_model->getSelectedBagMaterialCode($distinctMaterialCodes); + // $bagMaterials = $this->rawmaterialdetails_model->getSelectedBagMaterialCode($distinctMaterialCodes); - } else { - $bagMaterials = $this->rawmaterialdetails_model->getAllBagMaterialCode(); - } + // } else { + // $bagMaterials = $this->rawmaterialdetails_model->getAllBagMaterialCode(); + // } + + //temp_code_e_2025_02 // getting customer for creating table headers @@ -1104,6 +1204,97 @@ class StockController extends BaseController $this->global['pageTitle'] = 'Resin Stock Details'; + $startDate = "$month-01"; + $endDate = date("Y-m-t", strtotime($startDate)); + + + + $customisedMaterialCodes = $this->request->getPost('customisedMaterialCodes') ?? []; + + $existingCustomMaterialCodes = $this->monthWiseMaterialInStockModel + ->select('materialCode') + ->where('date',"$month-01") + ->where('stock_category','resin') + ->findAll(); + + + //check user applies for filter currently + if(!empty($customisedMaterialCodes)){ + + //user applied filter, + + //check already filter existing , if exists remove that , + if(!empty($existingCustomMaterialCodes)){ + + //hard delete done..!! + $existingCustomMaterialCodes = $this->monthWiseMaterialInStockModel + ->where('date',"$month-01") + ->where('stock_category','resin') + ->delete(); + + } + + + //if no filter already exists or removed current one , just add current filter for that month ....!! + $inserts = []; + + foreach($customisedMaterialCodes as $index => $customisedMaterialCode){ + + $inserts [] = [ + 'date' => "$month-01", + 'stock_category' => "resin", + 'materialCode' => $customisedMaterialCode + ]; + + //checking filtered material code present in table , if not create dummy one for whole month + $findMaterialCode = $this->resinStockDetails_model + ->where('date >=', $startDate) + ->where('date <=', $endDate) + ->where('materialCode',$customisedMaterialCode) + ->findAll(); + + //check any material code is not present in stock table but applied in filter + if(empty($findMaterialCode)){ + //create dummy entry for that + $this->createDummyEntryForResin($customisedMaterialCode,$startDate,$endDate); + } + + } + + if(!empty($inserts)){ + //insert all the latest applied filter + $this->monthWiseMaterialInStockModel->insertBatch($inserts); + + //get the currently applied filter + $existingCustomMaterialCodes = $this->monthWiseMaterialInStockModel + ->select('materialCode') + ->where('date',"$month-01") + ->where('stock_category','resin') + ->get()->getResultArray(); + + } + + } + + + //possible if no filter applied at all...!!! + if(empty($existingCustomMaterialCodes)){ + //no filter applied at all just present all active material codes + $existingCustomMaterialCodes = $this->rawmaterialdetails_model->getAllResinMaterialCode(); + }else{ + //if filter present,get that material codes + $existingCustomMaterialCodes = $this->rawmaterialdetails_model + ->getSelectedResinMaterialCode(array_column($existingCustomMaterialCodes, 'materialCode')); + } + + + $materialCodeList = array_column($existingCustomMaterialCodes, 'MaterialCode'); + + $resinMaterials = $existingCustomMaterialCodes ; + + $data['activeResinMaterials'] = $this->rawmaterialdetails_model->getAllResinMaterialCode(); + + // Get the previous month's last date resin stock details for next month updation @@ -1123,11 +1314,12 @@ class StockController extends BaseController // checking in database if the data is available for the month - $startDate = "$month-01"; - $endDate = date("Y-m-t", strtotime($startDate)); + + $data['resinStockDetails'] = $this->resinStockDetails_model ->where('date >=', $startDate) ->where('date <=', $endDate) + ->whereIn('materialCode',$materialCodeList) ->groupBy(['materialCode', 'date']) ->orderBy('date', 'asc') ->orderBy('materialCode', 'asc') @@ -1166,28 +1358,31 @@ class StockController extends BaseController $data['groupedResinStockDetails'] = array_values($groupedByDate); + //temp_code_s_2025_02 // getting resin material for creating table headers // checking already existing stock if yes then get the material code from the existing stock - // if not get all the material codes from the raw material details table + // if not get all the material codes currently isActive from the raw material details table - if (!empty($data['groupedResinStockDetails'])) { + // if (!empty($data['groupedResinStockDetails'])) { - $result = $groupedByDate[$date]; + // $result = $groupedByDate[$date]; - $distinctMaterialCodes = []; + // $distinctMaterialCodes = []; - foreach ($result as $index => $eachResult) { - $distinctMaterialCodes[] = $result[$index]['materialCode']; - } + // foreach ($result as $index => $eachResult) { + // $distinctMaterialCodes[] = $result[$index]['materialCode']; + // } - $resinMaterials = $this->rawmaterialdetails_model->getSelectedResinMaterialCode($distinctMaterialCodes); + // $resinMaterials = $this->rawmaterialdetails_model->getSelectedResinMaterialCode($distinctMaterialCodes); - } else { + // } else { - $resinMaterials = $this->rawmaterialdetails_model->getAllResinMaterialCode(); + // $resinMaterials = $this->rawmaterialdetails_model->getAllResinMaterialCode(); - } + // } + + //temp_code_e_2025_02 // getting customer for creating table headers @@ -1218,6 +1413,119 @@ class StockController extends BaseController return $this->loadViews("stock/resinStockDetails", $this->global, $data, NULL); } + public function createDummyEntryForResin($customisedMaterialCode, $startDate, $endDate) + { + if (!empty($customisedMaterialCode)) { + $inserts = []; + + // Convert start and end date to timestamps + $startTimestamp = strtotime($startDate); + $endTimestamp = strtotime($endDate); + + while ($startTimestamp <= $endTimestamp) { + $inserts[] = [ + 'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format + 'materialCode' => $customisedMaterialCode, + 'customer' => ' ', + 'opening' => ' ', + 'receipt' => ' ', + 'used' => ' ', + 'balanceStock' => ' ', + ]; + + $startTimestamp = strtotime('+1 day', $startTimestamp); // Move to the next day + } + + if (!empty($inserts)) { + $this->resinStockDetails_model->insertBatch($inserts); + } + } + } + + public function createDummyEntryForBag($customisedMaterialCode, $startDate, $endDate) + { + if (!empty($customisedMaterialCode)) { + $inserts = []; + + // Convert start and end date to timestamps + $startTimestamp = strtotime($startDate); + $endTimestamp = strtotime($endDate); + + while ($startTimestamp <= $endTimestamp) { + $inserts[] = [ + 'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format + 'materialCode' => $customisedMaterialCode, + 'customer' => ' ', + 'opening' => ' ', + 'receipt' => ' ', + 'used' => ' ', + 'balanceStock' => ' ', + ]; + + $startTimestamp = strtotime('+1 day', $startTimestamp); // Move to the next day + } + + if (!empty($inserts)) { + $this->bagStockDetails_model->insertBatch($inserts); + } + } + } + + public function createDummyEntryForDieselMachine($customisedMachineCode, $startDate, $endDate) + { + if (!empty($customisedMachineCode)) { + $inserts = []; + + // Convert start and end date to timestamps + $startTimestamp = strtotime($startDate); + $endTimestamp = strtotime($endDate); + + while ($startTimestamp <= $endTimestamp) { + $inserts[] = [ + 'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format + 'machine_id' => $customisedMachineCode, + 'opening_units' => ' ', + 'closing_units' => ' ', + 'total_units' => ' ', + ]; + + $startTimestamp = strtotime('+1 day', $startTimestamp); // Move to the next day + } + + if (!empty($inserts)) { + $this->factoryVehicleDieselDetails_model->insertBatch($inserts); + } + } + } + + public function createDummyEntryForElectricMachine($customisedMachineCode, $startDate, $endDate) + { + if (!empty($customisedMachineCode)) { + $inserts = []; + + // Convert start and end date to timestamps + $startTimestamp = strtotime($startDate); + $endTimestamp = strtotime($endDate); + + while ($startTimestamp <= $endTimestamp) { + $inserts[] = [ + 'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format + 'machine_id' => $customisedMachineCode, + 'opening_units' => ' ', + 'closing_units' => ' ', + 'total_units' => ' ', + ]; + + $startTimestamp = strtotime('+1 day', $startTimestamp); // Move to the next day + } + + if (!empty($inserts)) { + $this->powerConsumptionDetails_model->insertBatch($inserts); + } + } + } + + public function updateResinStockDetails() { @@ -1737,6 +2045,7 @@ class StockController extends BaseController $data['wcsSupplierList'] = $result[2] ; + $data['trpAbstract'] = $this->trpAbstract_model->currentMonthTrpAbstract($startDate,$endDate); $date = DateTime::createFromFormat('Y-m', $month); @@ -1931,24 +2240,6 @@ class StockController extends BaseController foreach ($datesInMonth as $datesInMonthIndex => $dateInMonth) { - if($datesInMonthIndex == 0){ - - $trpAbstractParticulars =$this->trpAbstractParticularsModel->findAll(); - - foreach($trpAbstractParticulars as $index => $trpAbstractParticular){ - - $trpAbstract[] = [ - 'date' => $dateInMonth , - 'abs_opening_stock' => 0 , - 'abs_physical_stock'=> 0 , - 'abs_remarks' => " " , - 'abs_particular_id' => $trpAbstractParticular['id'], - ]; - } - - - } - $inserts[] = [ 'Date' => $dateInMonth, @@ -2091,10 +2382,11 @@ class StockController extends BaseController $monthData = $this->getMonthDatesFromInput($currentMonth); + $isActiveFilter = 1 ; $data['startDate'] = $monthData[0]['database']; $data['endDate'] = $monthData[count($monthData) - 1]['database']; $data['timeDropdown'] = $this->generateTimeOptions(); - $data['supplierData'] = $this->supplier_model->supplierlisting(); + $data['supplierData'] = $this->supplier_model->supplierlisting($isActiveFilter); $data['drierDetails'] = $this->drierMachineDetails_model ->where('date >=', $data['startDate']) @@ -2130,14 +2422,12 @@ class StockController extends BaseController $data = $row; - if (($existingRow)) { - // dd("inside update"); + if (($existingRow)) { $existingRow = $this->drierMachineDetails_model->where('id', $row['id'] ?? '')->first(); $this->handleGasStockUpdate($existingRow, $row); $updates[] = $data; } else { - // dd("inside insert"); $this->updateGasStockConsumption($data['date'], $data['total_gas_consumption']); $inserts[] = $data; } @@ -2261,6 +2551,121 @@ class StockController extends BaseController $this->global['pageTitle'] = 'Power Consumption Stock Details'; + + + //filter part starts + + //start date dynamic from front-end + $startDate = "$month-01"; + //end date of given month + $endDate = date("Y-m-t", strtotime($startDate)); + + + //filter applied currently + $customisedMachineCodes = $this->request->getPost('customisedMachineCodes') ?? []; + + + //already applied filter + $existingCustomMachineCodes = $this->monthWiseMachineInStockModel + ->select('machine_id') + ->where('date',"$month-01") + ->where('machine_category','electric') + ->findAll(); + + + //check user applies for filter currently + if(!empty($customisedMachineCodes)){ + + //user applied filter, + + //check already filter existing , if exists remove that , + if(!empty($existingCustomMachineCodes)){ + + //hard delete done..!! + $existingCustomMachineCodes = $this->monthWiseMachineInStockModel + ->where('date',"$month-01") + ->where('machine_category','electric') + ->delete(); + + } + + + //if no filter already exists or removed current one , just add current filter for that month ....!! + $inserts = []; + + foreach($customisedMachineCodes as $index => $customisedMachineCode){ + + $inserts [] = [ + 'date' => "$month-01", + 'machine_category' => "electric", + 'machine_id' => $customisedMachineCode + ]; + + + //checking filtered material code present in table , if not create dummy one for whole month + $findMachineCode = $this->powerConsumptionDetails_model + ->where('date >=', $startDate) + ->where('date <=', $endDate) + ->where('machine_id',$customisedMachineCode) + ->findAll(); + + + //check any material code is not present in stock table but applied in filter + if(empty($findMachineCode)){ + + + //create dummy entry for this + $this->createDummyEntryForElectricMachine($customisedMachineCode,$startDate,$endDate); + } + + } + + if(!empty($inserts)){ + //insert all the latest applied filter + $this->monthWiseMachineInStockModel->insertBatch($inserts); + + //get the currently applied filter + $existingCustomMachineCodes = $this->monthWiseMachineInStockModel + ->select('machine_id') + ->where('date',"$month-01") + ->where('machine_category','electric') + ->get() + ->getResultArray(); + + } + + } + + + //possible if no filter applied at all...!!! + if(empty($existingCustomMachineCodes)){ + //no filter applied at all just present all active material codes + $existingCustomMachineCodes = $this->factoryMachine_model + ->getAllActiveElectricMachines(); + }else{ + //if filter present,get that material codes + $existingCustomMachineCodes = $this->factoryMachine_model + ->getSelectedElectricMachines(array_column($existingCustomMachineCodes, 'machine_id')); + } + + + + //this existingCustomMachineCodes gets its machine after visiting factory machine master table + $machineCodeList = array_column($existingCustomMachineCodes, 'id'); + + $electricMachines = $existingCustomMachineCodes; + + $data['activeElectricMachines'] = $this->factoryMachine_model->getAllActiveElectricMachines(); + + + + + + + + + + // Get the previous month's last date power consumption stock details for next month updation $previousMonth = DateTime::createFromFormat('Y-m', $month)->modify('-1 month')->format('Y-m'); @@ -2288,12 +2693,12 @@ class StockController extends BaseController // checking in database if the data is available for the month - $startDate = "$month-01"; - $endDate = date("Y-m-t", strtotime($startDate)); + $data['powerConsumptionStockDetails'] = $this->powerConsumptionDetails_model ->where('date >=', $startDate) ->where('date <=', $endDate) + ->whereIn('machine_id',$machineCodeList) ->groupBy(['machine_id', 'date']) ->orderBy('date', 'asc') ->orderBy('machine_id', 'asc') @@ -2338,37 +2743,32 @@ class StockController extends BaseController $data['groupedPowerConsumptionStockDetails'] = array_values($groupedByDate); + //temp_code_s_2025_02 + // getting electric machines for creating table headers // checking already existing stock if yes then get the electric machines id from the existing stock // if not get all the electric machines from the factory Machine master table - if (!empty($data['groupedPowerConsumptionStockDetails'])) { + // if (!empty($data['groupedPowerConsumptionStockDetails'])) { - $result = $groupedByDate[$date]; + // $result = $groupedByDate[$date]; - $distinctMachineId = []; + // $distinctMachineId = []; - foreach ($result as $index => $eachResult) { - $distinctMachineId[] = $result[$index]['machine_id']; - } + // foreach ($result as $index => $eachResult) { + // $distinctMachineId[] = $result[$index]['machine_id']; + // } - $electricMachines = $this->factoryMachine_model - ->whereIn('id', $distinctMachineId) - ->orderBy('id', 'asc') - ->get() - ->getResultArray(); + // $electricMachines = $this->factoryMachine_model->getSelectedElectricMachines($distinctMachineId); - } else { + // } else { - $electricMachines = $this->factoryMachine_model - ->where('is_active', 1) - ->where('energy_type', 'Electric') - ->orderBy('id', 'asc') - ->get() - ->getResultArray(); + // $electricMachines = $this->factoryMachine_model->getAllActiveElectricMachines(); - } + // } + + //temp_code_e_2025_02 @@ -2545,6 +2945,119 @@ class StockController extends BaseController $this->global['pageTitle'] = 'Diesel Machine Stock Details'; + //filter part starts + + //start date dynamic from front-end + $startDate = "$month-01"; + //end date of given month + $endDate = date("Y-m-t", strtotime($startDate)); + + + //filter applied currently + $customisedMachineCodes = $this->request->getPost('customisedMachineCodes') ?? []; + + + //already applied filter + $existingCustomMachineCodes = $this->monthWiseMachineInStockModel + ->select('machine_id') + ->where('date',"$month-01") + ->where('machine_category','diesel') + ->findAll(); + + + //check user applies for filter currently + if(!empty($customisedMachineCodes)){ + + //user applied filter, + + //check already filter existing , if exists remove that , + if(!empty($existingCustomMachineCodes)){ + + //hard delete done..!! + $existingCustomMachineCodes = $this->monthWiseMachineInStockModel + ->where('date',"$month-01") + ->where('machine_category','diesel') + ->delete(); + + } + + + //if no filter already exists or removed current one , just add current filter for that month ....!! + $inserts = []; + + foreach($customisedMachineCodes as $index => $customisedMachineCode){ + + $inserts [] = [ + 'date' => "$month-01", + 'machine_category' => "diesel", + 'machine_id' => $customisedMachineCode + ]; + + + //checking filtered material code present in table , if not create dummy one for whole month + $findMachineCode = $this->factoryVehicleDieselDetails_model + ->where('date >=', $startDate) + ->where('date <=', $endDate) + ->where('machine_id',$customisedMachineCode) + ->findAll(); + + //check any material code is not present in stock table but applied in filter + if(empty($findMachineCode)){ + + //create dummy entry for this + $this->createDummyEntryForDieselMachine($customisedMachineCode,$startDate,$endDate); + } + + } + + if(!empty($inserts)){ + //insert all the latest applied filter + $this->monthWiseMachineInStockModel->insertBatch($inserts); + + //get the currently applied filter + $existingCustomMachineCodes = $this->monthWiseMachineInStockModel + ->select('machine_id') + ->where('date',"$month-01") + ->where('machine_category','diesel') + ->get() + ->getResultArray(); + + } + + } + + + //possible if no filter applied at all...!!! + if(empty($existingCustomMachineCodes)){ + //no filter applied at all just present all active material codes + $existingCustomMachineCodes = $this->factoryMachine_model + ->getAllActiveDieselMachines(); + }else{ + //if filter present,get that material codes + $existingCustomMachineCodes = $this->factoryMachine_model + ->getSelectedDieselMachines(array_column($existingCustomMachineCodes, 'machine_id')); + } + + + + //this existingCustomMachineCodes gets its machine 'id' after visiting factory machine master table in above step, + + $machineCodeList = array_column($existingCustomMachineCodes, 'id'); + + $dieselMachines = $existingCustomMachineCodes; + + $data['activeDieselMachines'] = $this->factoryMachine_model->getAllActiveDieselMachines(); + + + + + + + + + + + // Get the previous month's last date diesel stock details for next month updation $previousMonth = DateTime::createFromFormat('Y-m', $month)->modify('-1 month')->format('Y-m'); @@ -2579,6 +3092,7 @@ class StockController extends BaseController $data['dieselMachineStockDetails'] = $this->factoryVehicleDieselDetails_model ->where('date >=', $startDate) ->where('date <=', $endDate) + ->whereIn('machine_id',$machineCodeList) ->groupBy(['machine_id', 'date']) ->orderBy('date', 'asc') ->orderBy('machine_id', 'asc') @@ -2625,38 +3139,41 @@ class StockController extends BaseController + //temp_code_s_2025_02 + // getting diesel machines for creating table headers // checking already existing stock if yes then get the diesel machines id from the existing stock // if not get all the diesel machines from the factory Machine master table - if (!empty($data['groupedDieselMachineStockDetails'])) { + // if (!empty($data['groupedDieselMachineStockDetails'])) { - $result = $groupedByDate[$date]; + // $result = $groupedByDate[$date]; - $distinctMachineId = []; + // $distinctMachineId = []; - foreach ($result as $index => $eachResult) { - $distinctMachineId[] = $result[$index]['machine_id']; - } + // foreach ($result as $index => $eachResult) { + // $distinctMachineId[] = $result[$index]['machine_id']; + // } - $dieselMachines = $this->factoryMachine_model - ->whereIn('id', $distinctMachineId) - ->orderBy('id', 'asc') - ->get() - ->getResultArray(); + // $dieselMachines = $this->factoryMachine_model + // ->whereIn('id', $distinctMachineId) + // ->orderBy('id', 'asc') + // ->get() + // ->getResultArray(); - } else { + // } else { - $dieselMachines = $this->factoryMachine_model - ->where('is_active', 1) - ->where('energy_type', 'Diesel') - ->orderBy('id', 'asc') - ->get() - ->getResultArray(); + // $dieselMachines = $this->factoryMachine_model + // ->where('is_active', 1) + // ->where('energy_type', 'Diesel') + // ->orderBy('id', 'asc') + // ->get() + // ->getResultArray(); - } + // } + //temp_code_e_2025_02 diff --git a/app/Controllers/Supplier.php b/app/Controllers/Supplier.php index 3cc7562b..2aacb665 100755 --- a/app/Controllers/Supplier.php +++ b/app/Controllers/Supplier.php @@ -47,7 +47,22 @@ class Supplier extends BaseController */ public function index() { - $data['userRecords'] = $this->supplier_model->supplierlisting(); + + $isActiveFilter = 1 ; // default showing active transporters data + $showArchive = 0 ; // + + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown we are making active filter + if($showArchive){ + $isActiveFilter = 0; + } + } + + + $data['userRecords'] = $this->supplier_model->supplierlisting($isActiveFilter); + $data['showArchive'] = $showArchive ; $this->global['pageTitle'] = 'Supplier Listing'; $this->loadViews("supplierListing", $this->global, $data, NULL); } @@ -473,7 +488,20 @@ class Supplier extends BaseController */ public function transporterListing() { - $data['userRecords'] = $this->supplier_model->transporterListing(); + $isActiveFilter = 1 ; // default showing active transporters data + $showArchive = 0 ; // + + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown we are making active filter + if($showArchive){ + $isActiveFilter = 0; + } + } + + $data['userRecords'] = $this->supplier_model->transporterListing($isActiveFilter); + $data['showArchive'] = $showArchive ; $this->global['pageTitle'] = 'Transporter List'; $this->loadViews("transporterListing", $this->global, $data, NULL); } diff --git a/app/Controllers/User.php b/app/Controllers/User.php index 5cea8b2e..04999c49 100755 --- a/app/Controllers/User.php +++ b/app/Controllers/User.php @@ -891,14 +891,26 @@ class User extends BaseController */ function userListing() { - // if($this->isAdmin() == TRUE) - // { - // $this->loadThis(); - // } - // else - // { + + $isDeleted = 0 ; // default showing active data + $showArchive = 0 ; // + + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown then we are making active filter 0 + if($showArchive){ + $isDeleted = 1; + } + } + + $data['showArchive'] = $showArchive; + + // dd($data); + + + $data['userRecords'] = $this->user_model->userListing($isDeleted); - $data['userRecords'] = $this->user_model->userListing(); $this->global['pageTitle'] = 'User Listing'; // dd($data); diff --git a/app/Models/Assetdetails_model.php b/app/Models/Assetdetails_model.php index db2b81cf..e1340547 100755 --- a/app/Models/Assetdetails_model.php +++ b/app/Models/Assetdetails_model.php @@ -14,12 +14,13 @@ class Assetdetails_model extends Model * @param number $segment : This is pagination limit * @return array $result : This is result */ - function assetListing() + function assetListing($isActiveFilter) { $builder = $this->db->table('t_asset_details asd') ->select('asd.*,dep.DepartmentName,sup.SupplierName') ->join('t_departmentdetails dep', ' dep.DEPCode = asd.DEPCode', 'left') ->join('t_supplierdetailsn sup', 'sup.SupplierID = asd.SupplierCode', 'left') + ->where('asd.IsActive',$isActiveFilter) ->orderBy('asd.CreatedDt', 'desc'); $query = $builder->get(); diff --git a/app/Models/Costcenter_model.php b/app/Models/Costcenter_model.php index 01c6d783..bb7105ea 100755 --- a/app/Models/Costcenter_model.php +++ b/app/Models/Costcenter_model.php @@ -13,12 +13,13 @@ class Costcenter_model extends Model * @param number $segment : This is pagination limit * @return array $result : This is result */ - function CostListing() + function CostListing($isActiveFilter) { $builder = $this->db->table('t_costcenter_master as Cost') ->select('Cost.id as id, Cost.CostCenterCode as code,Cost.CostCenterName as CostCenterName , Cost.ApprovedBy as ApprovedBy,Emp.FirstName as FirstName,Emp.Designation as Designation ,Cost.CreatedDate,Cost.IsActive,Cost.DeletedBy,Cost.DeletedBy') ->join('t_employee_details as Emp', 'Emp.EmpID=Cost.ApprovedBy') + ->where('Cost.IsActive',$isActiveFilter) ->orderBy('Cost.CreatedDate', 'desc'); $query =$builder->get(); diff --git a/app/Models/Department_model.php b/app/Models/Department_model.php index 7e943aa2..9ab32dfe 100755 --- a/app/Models/Department_model.php +++ b/app/Models/Department_model.php @@ -49,11 +49,13 @@ class Department_model extends Model * @param number $segment : This is pagination limit * @return array $result : This is result */ - function departmentListing() + function departmentListing($isActiveFilter) { $builder = $this->db->table('t_departmentdetails as BaseT') ->select('BaseT.CreatedDt,BaseT.DepartmentName, BaseT.DEPCode, BaseT.HeadDept, BaseT.IsActive , - BaseT.HeadDept') + BaseT.HeadDept,HeadDept.DepartmentName as headDepartmentName') + ->join('t_departmentdetails as HeadDept', 'BaseT.HeadDept = HeadDept.DEPCode' ,'left') + ->where('BaseT.IsActive',$isActiveFilter) ->orderBy("BaseT.DEPCode", "desc"); $query = $builder->get(); $result = $query->getResult(); diff --git a/app/Models/FactoryMachineModel.php b/app/Models/FactoryMachineModel.php index 12fd7af4..83d6eaed 100644 --- a/app/Models/FactoryMachineModel.php +++ b/app/Models/FactoryMachineModel.php @@ -62,6 +62,57 @@ class FactoryMachineModel extends Model } + public function getAllActiveElectricMachines(){ + + $result = $this->db->table('t_factoryMachineMaster') + ->where('is_active', 1) + ->where('energy_type', 'electric') + ->orderBy('id', 'asc') + ->get() + ->getResultArray(); + + return $result ; + + } + + public function getSelectedElectricMachines($distinctMachineId){ + + $result = $this->db->table('t_factoryMachineMaster') + ->whereIn('id', $distinctMachineId) + ->orderBy('id', 'asc') + ->get() + ->getResultArray(); + + return $result; + + } + + public function getAllActiveDieselMachines(){ + + $result = $this->db->table('t_factoryMachineMaster') + ->where('is_active', 1) + ->where('energy_type', 'diesel') + ->orderBy('id', 'asc') + ->get() + ->getResultArray(); + + return $result ; + + } + + public function getSelectedDieselMachines($distinctMachineId){ + + $result = $this->db->table('t_factoryMachineMaster') + ->whereIn('id', $distinctMachineId) + ->orderBy('id', 'asc') + ->get() + ->getResultArray(); + + return $result; + + } + + } diff --git a/app/Models/GasShortageModel.php b/app/Models/GasShortageModel.php new file mode 100644 index 00000000..4b8f5be9 --- /dev/null +++ b/app/Models/GasShortageModel.php @@ -0,0 +1,49 @@ +db->table('t_igr_master igr') ->distinct() - ->select("igr.IGRNO,igr.*,igrd.*,MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity,POL.Rate,POM.POType,POM.IsOpenOrder, - POM.CapitalRange,POM.CapitalRange,st.CGST as service_cgst,st.SGST as service_sgst,st.IGST as service_igst,it.IGST as import_igst,rt.CGST as revenue_cgst,rt.SGST as revenue_sgst,rt.IGST as revenue_igst") + ->select(" + igr.IGRNO,igr.*,igrd.*, + MM.MaterialName,MM.UOM, + sup.Address,sup.SupplierName, + POL.Rate, + POM.ServiceDescription,POL.Quantity,POM.POType,POM.IsOpenOrder, + POM.CapitalRange,POM.CapitalRange, + st.CGST as service_cgst,st.SGST as service_sgst,st.IGST as service_igst, + it.IGST as import_igst, + rt.CGST as revenue_cgst,rt.SGST as revenue_sgst,rt.IGST as revenue_igst, + cd.ConfigValue As MaterialCategory") + ->join('t_igr_details igrd', 'igrd.IGRNO = igr.IGRNO') ->join('t_purchaseorder_master POM', 'igr.PONO = POM.PONO') ->join('t_purchaseorder_lineitem POL', 'igr.PONO = POL.PONO and POL.MaterialCode=igrd.MaterialCode ') @@ -562,6 +572,7 @@ class Inwardgateregister_model extends Model ->join('t_service_tax st', 'st.LineItemNo = POL.LineItemNo' , 'left') ->join('t_revenue_tax rt', 'rt.LineItemNo = POL.LineItemNo' , 'left') ->join('t_import_tax it', 'it.LineItemNo = POL.LineItemNo' , 'left') + ->join('t_configdetails cd','cd.key = MM.Category','left') ->where('igr.IGRNO', $IGRNO); $query = $builder->get(); @@ -1189,7 +1200,7 @@ class Inwardgateregister_model extends Model igrMast.MaterialRcvdDate as materialRecievedDate, igrMast.VehicleNo, supplierDetails.SupplierName, - materialMaster.Category as sandType , + cd.ConfigValue as sandType , t_igr_details.QuantityAsPerInvoice as Qty, issd.*') ->whereIn('t_igr_details.MaterialCode', $materialCodes) @@ -1205,6 +1216,7 @@ class Inwardgateregister_model extends Model ->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_materialmaster materialMaster', 'materialMaster.MaterialCode = t_igr_details.MaterialCode') + ->join('t_configdetails cd','cd.key = materialMaster.Category','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', 'asc '); @@ -1336,5 +1348,6 @@ $builder = $this->db->table('t_igr_history') return $result; } + } \ No newline at end of file diff --git a/app/Models/TrpAbstractParticulars.php b/app/Models/MonthWiseMachinesInStockModel.php similarity index 86% rename from app/Models/TrpAbstractParticulars.php rename to app/Models/MonthWiseMachinesInStockModel.php index 4cef5bd9..ff901a90 100644 --- a/app/Models/TrpAbstractParticulars.php +++ b/app/Models/MonthWiseMachinesInStockModel.php @@ -4,15 +4,15 @@ namespace App\Models; use CodeIgniter\Model; -class TrpAbstractParticulars extends Model +class MonthWiseMachinesInStockModel extends Model { - protected $table = 't_trp_abstract_particulars'; + protected $table = 't_monthwisemachinesinstock'; protected $primaryKey = 'id'; protected $useAutoIncrement = true; protected $returnType = 'array'; protected $useSoftDeletes = false; protected $protectFields = true; - protected $allowedFields = ['particular']; + protected $allowedFields = ['date','machine_id','machine_category']; protected bool $allowEmptyInserts = false; protected bool $updateOnlyChanged = true; diff --git a/app/Models/TrpAbstract.php b/app/Models/MonthWiseMaterialInStockModel.php similarity index 85% rename from app/Models/TrpAbstract.php rename to app/Models/MonthWiseMaterialInStockModel.php index 3df62676..e4626b70 100644 --- a/app/Models/TrpAbstract.php +++ b/app/Models/MonthWiseMaterialInStockModel.php @@ -4,15 +4,15 @@ namespace App\Models; use CodeIgniter\Model; -class TrpAbstract extends Model +class MonthWiseMaterialInStockModel extends Model { - protected $table = 't_trp_abstract'; + protected $table = 't_monthwisematerialinstock'; protected $primaryKey = 'id'; protected $useAutoIncrement = true; protected $returnType = 'array'; protected $useSoftDeletes = false; protected $protectFields = true; - protected $allowedFields = ['abs_opening_stock','abs_physical_stock','abs_remarks','abs_particular_id']; + protected $allowedFields = ['date','materialCode','stock_category']; protected bool $allowEmptyInserts = false; protected bool $updateOnlyChanged = true; diff --git a/app/Models/Rawmaterialdetails_model.php b/app/Models/Rawmaterialdetails_model.php index cbd3a5fa..5c589be8 100755 --- a/app/Models/Rawmaterialdetails_model.php +++ b/app/Models/Rawmaterialdetails_model.php @@ -14,7 +14,7 @@ class Rawmaterialdetails_model extends Model * @param number $segment : This is pagination limit * @return array $result : This is result */ - function rawmaterialListing() + function rawmaterialListing($isActiveFilter) { $builder = $this->db->table('t_materialmaster') @@ -22,6 +22,7 @@ class Rawmaterialdetails_model extends Model ->join('tbl_users as user', 'user.UserId = t_materialmaster.createdby', 'left') ->join('t_employee_details as emp', 'emp.EmpID = user.EmpID', 'left') ->join('t_configdetails as cd', 'cd.Key = t_materialmaster.Category', 'left') + ->where('t_materialmaster.IsActive',$isActiveFilter) ->orderBy('CreatedDate','desc'); $query = $builder->get(); $result = $query->getResult(); diff --git a/app/Models/Supplier_model.php b/app/Models/Supplier_model.php index 16cba09a..69613bb2 100755 --- a/app/Models/Supplier_model.php +++ b/app/Models/Supplier_model.php @@ -14,7 +14,7 @@ class Supplier_model extends Model * @param number $segment : This is pagination limit * @return array $result : This is result */ - function supplierlisting() + function supplierlisting($isActiveFilter) { $builder = $this->db->table('t_supplierdetailsn as BaseT') @@ -22,6 +22,7 @@ class Supplier_model extends Model ->join('t_paymentterms as pmt', 'pmt.PaymentID = BaseT.PaymentID', 'left') ->join('tbl_users as user', 'user.UserId = BaseT.createdby', 'left') ->join('t_employee_details as emp', 'emp.EmpID = user.EmpID', 'left') + ->where('BaseT.IsActive',$isActiveFilter) ->orderBy('BaseT.CreatedOn', 'desc'); $query = $builder->get(); @@ -224,17 +225,19 @@ class Supplier_model extends Model } /*SUPPLIER */ /** for transporter listing */ - function transporterListing() + function transporterListing($isActiveFilter) { + $builder = $this->db->table('t_transporter as t') ->select('t.id,t.name,t_employee_details.FirstName as FirstName,t.created_on,t.isactive') ->join('tbl_users', 'tbl_users.userId = t.created_by') ->join('t_employee_details', 't_employee_details.EmpID=tbl_users.EmpID') - ->orderBy('t.created_on', 'desc'); + ->where('t.isactive',$isActiveFilter); + $builder->orderBy('t.created_on', 'desc'); $query =$builder->get(); $result = $query->getResult(); - // echo $this->db->getLastQuery()->getQuery();die; + // echo $this->db->getLastQuery()->getQuery();die; return $result; } diff --git a/app/Models/TrpAbstractModel.php b/app/Models/TrpAbstractModel.php new file mode 100644 index 00000000..487749ac --- /dev/null +++ b/app/Models/TrpAbstractModel.php @@ -0,0 +1,73 @@ +db->table('t_trp_abstract') + ->where('date',$startDate) + ->where('date',$endDate) + ->get() + ->getResultArray(); + + return $currentMonthTrpAbstract; + + } + + + + + + + + + + + + +} + diff --git a/app/Models/TrpProductionModel.php b/app/Models/TrpProductionModel.php index 0b498b98..e6691ebd 100644 --- a/app/Models/TrpProductionModel.php +++ b/app/Models/TrpProductionModel.php @@ -66,6 +66,8 @@ class TrpProductionModel extends Model $materialCodes = array_column($subquery, 'materialCode'); // Extracts 'materialCode' values + + // dd($this->db->getLastQuery()); // Convert the array of material codes to a comma-separated string diff --git a/app/Models/User_model.php b/app/Models/User_model.php index 2abe7eb9..ebafde7c 100755 --- a/app/Models/User_model.php +++ b/app/Models/User_model.php @@ -15,14 +15,16 @@ class User_model extends Model * @param number $segment : This is pagination limit * @return array $result : This is result */ - function userListing() + function userListing($isDeleted) { $builder = $this->db->table('t_employee_details EMP') - ->select('user.isDeleted,user.createdDtm,EMP.EmpID,EMP.FirstName,EMP.LastName,EMP.Designation,user.email as EmailId,EMP.ContactNumber, + ->select('user.isDeleted,user.createdDtm,EMP.EmpID,EMP.FirstName, + EMP.LastName,EMP.Designation,user.email as EmailId,EMP.ContactNumber, DEPT.DEPCode,DEPT.DepartmentName,role.role,user.userId') - ->join('t_departmentdetails DEPT', 'EMP.Departmentcode = DEPT.DEPCode') - ->join('tbl_users user', 'user.EmpID = EMP.EmpID') - ->join('tbl_roles role', 'user.roleId = role.roleId') + ->join('t_departmentdetails DEPT', 'EMP.Departmentcode = DEPT.DEPCode','left') + ->join('tbl_users user', 'user.EmpID = EMP.EmpID','left') + ->join('tbl_roles role', 'user.roleId = role.roleId','left') + ->where('user.isDeleted',$isDeleted) ->orderBy('user.createdDtm', 'desc'); $query = $builder->get(); diff --git a/app/Views/addasset.php b/app/Views/addasset.php index 4458c5e9..b9e18ed3 100755 --- a/app/Views/addasset.php +++ b/app/Views/addasset.php @@ -102,7 +102,7 @@
- +
@@ -355,6 +355,13 @@ $("#User").focus(); return false; } + + if ($('#DateOfPurchase').val().length < 1) { + alert('Please Enter the purchase date'); + $("#DateOfPurchase").focus(); + return false; + } + if ($('#Location').val().length < 1) { alert('Please Enter the Asset Location'); $("#Location").focus(); diff --git a/app/Views/adddepartment.php b/app/Views/adddepartment.php index 78e4bff2..7f2c2182 100755 --- a/app/Views/adddepartment.php +++ b/app/Views/adddepartment.php @@ -115,6 +115,12 @@ let departmentName = $("#DepartmentName").val().trim(); let headDepCode =$("#HeadDept").val()??''; let depCode =$("#DEPCode").val() ?? ''; + + if(departmentName.length<1){ + alert(`Department Name cannot be empty..!!`); + return; + } + $('#loader').show(); $.ajax({ type:"POST", diff --git a/app/Views/assetListing.php b/app/Views/assetListing.php index ec575ecf..58770a69 100755 --- a/app/Views/assetListing.php +++ b/app/Views/assetListing.php @@ -79,22 +79,30 @@ -
+ +
+ + +
- - +
+ + style="width: 18px; height: 18px;"> + +
-
- + + + +
@@ -121,12 +129,7 @@ if (!empty($userRecords)) { foreach ($userRecords as $record) { ?> - " - style="IsActive == 0) { - echo "display:none"; - } ?>"> + CreatedDt)) == "30-11--0001") { $cdate = '00-00-0000'; @@ -150,7 +153,7 @@ ' + '' + '' + @@ -969,9 +1250,10 @@ '' + '' + '' + - '' + + '' + '' + '' + + '' + '' + '' + '' + @@ -982,8 +1264,21 @@ '' + '' + '' + - '' + - ''; + '' ; + + + + if(item.MaterialCategory == "gas"){ + $('#gasShortageHeader').show(); + $('#gasShortageListHeader').show(); + trIGRHTML += '' ; + trIGRHTML += '' ; + + trIGRHTML +=''; + }else{ + trIGRHTML +=''; + } + if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) { $('#QuantityAsPerInvoice' + i).attr('readonly', 'true'); @@ -1009,7 +1304,7 @@ '' + '' + '' + - '' + + '' + '' + '' + '' + @@ -1022,8 +1317,18 @@ '' + '' + '' + - '' + - ''; + '' ; + + if(item.MaterialCategory == "gas"){ + $('#gasShortageHeader').show(); + $('#gasShortageListHeader').show(); + trIGRHTML += '' ; + trIGRHTML += '' ; + + trIGRHTML +=''; + }else{ + trIGRHTML +=''; + } if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) { $('#QuantityAsPerInvoice' + i).attr('readonly', 'true'); @@ -1043,7 +1348,7 @@ '' + '' + '' + - '' + + '' + '' + '' + '' + @@ -1056,8 +1361,18 @@ '' + '' + '' + - '' + - ''; + ''; + + if(item.MaterialCategory == "gas"){ + $('#gasShortageHeader').show(); + $('#gasShortageListHeader').show(); + trIGRHTML += '' ; + trIGRHTML += '' ; + + trIGRHTML +=''; + }else{ + trIGRHTML +=''; + } } } @@ -1097,12 +1412,18 @@ + + + + \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IsActive == 0) { ?> - @@ -288,29 +291,6 @@ + + + + \ No newline at end of file diff --git a/app/Views/costListing.php b/app/Views/costListing.php index 71e3a7df..66baab6f 100755 --- a/app/Views/costListing.php +++ b/app/Views/costListing.php @@ -78,21 +78,26 @@ -
-
- - -
-
+
+ + +
+
+
+ + style="width: 18px; height: 18px;"> + +
+
+
@@ -114,11 +119,7 @@ $date = $createdat->format('d-m-Y'); $time = $createdat->format('h:i A'); ?> - " style="IsActive == 0) { - echo "display:none"; - } ?>"> + @@ -406,29 +407,6 @@ - function showArchiveList() { - let isChecked = $("#showArchiveId").prop('checked'); - - // Show or hide the rows based on checkbox status - $(".deactivatedRow").each(function () { - if (isChecked) { - $(this).show(); - } else { - $(this).hide(); - } - }); - } - - $(document).ready(function () { - let table = $('#cost_listing').DataTable(); - - showArchiveList(); - - table.on('draw', function () { - showArchiveList(); - }); - - }); @@ -440,4 +418,12 @@ $(document).on('keydown', function(event) { } }); + + + \ No newline at end of file diff --git a/app/Views/departmentListing.php b/app/Views/departmentListing.php index bd6b4184..2b36b420 100755 --- a/app/Views/departmentListing.php +++ b/app/Views/departmentListing.php @@ -107,20 +107,23 @@ title="Reset"> -
-
- - -
- -
- -
+ +
+
+
+ + style="width: 18px; height: 18px;"> + + +
+
+
code ?> CostCenterName ?>
@@ -139,13 +142,7 @@ if (!empty($userRecords)) { foreach ($userRecords as $record) { ?> - " - style="IsActive == 0) { - echo "display:none"; - } ?>"> + CreatedDt)) == "30-11--0001") { $cdate = '00-00-0000'; @@ -155,7 +152,7 @@ - + " style=""> + @@ -260,30 +258,11 @@ - function showArchiveList() { - let isChecked = $("#showArchiveId").prop('checked'); - - // Show or hide the rows based on checkbox status - $(".deactivatedRow").each(function () { - if (isChecked) { - $(this).show(); - } else { - $(this).hide(); - } - }); - } - - $(document).ready(function () { - let table = $('#datatable').DataTable(); - - showArchiveList(); - - table.on('draw', function () { - showArchiveList(); - }); + + \ No newline at end of file diff --git a/app/Views/rawmaterialListing.php b/app/Views/rawmaterialListing.php index de3eac73..fc5811b2 100755 --- a/app/Views/rawmaterialListing.php +++ b/app/Views/rawmaterialListing.php @@ -97,19 +97,27 @@ -
-
- - -
-
+
+ + +
+
+
+ + style="width: 18px; height: 18px;"> + + +
+
+
DEPCode; ?> DepartmentName ?>HeadDept ?>headDepartmentName)?$record->DepartmentName:$record->headDepartmentName ?> IsActive == 1) {echo"Active";}else{echo "InActive";}?> IsActive == 0) { ?> @@ -339,4 +336,14 @@ if(result){return;}else{event.preventDefault();} } + + + + \ No newline at end of file diff --git a/app/Views/editasset.php b/app/Views/editasset.php index e50ed279..a3850daa 100755 --- a/app/Views/editasset.php +++ b/app/Views/editasset.php @@ -176,7 +176,7 @@ if (!empty($assetList)) {
- +
diff --git a/app/Views/factoryMachineMasterDetails.php b/app/Views/factoryMachineMasterDetails.php index fe129dba..518c5e5c 100644 --- a/app/Views/factoryMachineMasterDetails.php +++ b/app/Views/factoryMachineMasterDetails.php @@ -111,18 +111,20 @@

-
-
- - +
+
+
+ + style="width: 18px; height: 18px;"> + +
+
-
@@ -147,11 +149,7 @@ foreach ($masterData as $record) { ?> -
@@ -134,12 +142,7 @@ foreach ($userRecords as $record) { $date = date("Y-m-d"); ?> - " - style="IsActive == 0) { - echo "display:none"; - } ?>"> + CreatedDate)) == "30-11--0001") { $cdate = '00-00-0000'; @@ -156,7 +159,7 @@ - + - + @@ -1080,4 +1187,89 @@ } }); + + + + + \ No newline at end of file diff --git a/app/Views/stock/dieselStockDetails.php b/app/Views/stock/dieselStockDetails.php index 50b61eb4..5f0fedf1 100644 --- a/app/Views/stock/dieselStockDetails.php +++ b/app/Views/stock/dieselStockDetails.php @@ -3,6 +3,15 @@ text-align: right; } + + .grab { + cursor: grab; /* Default open-hand cursor */ + } + + .grab:active { + cursor: grabbing; /* Closed-hand cursor when dragging */ + } + .fht-table, .fht-table thead, .fht-table tfoot, @@ -291,12 +300,27 @@ foreach ($period as $day) { " class="form-control mt-2" data-provide="datepicker" style="z-index:30;" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly> - - $dieselStockDetails) { - - ?> + + + \ No newline at end of file diff --git a/app/Views/stock/drierMachineDetails.php b/app/Views/stock/drierMachineDetails.php index ee3a217e..3cf051d8 100644 --- a/app/Views/stock/drierMachineDetails.php +++ b/app/Views/stock/drierMachineDetails.php @@ -294,7 +294,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- +
@@ -343,7 +343,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- + @@ -452,7 +452,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); - @@ -682,7 +682,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- @@ -717,7 +717,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- + type="text" class="form-control" id="additionalEntryInputSandQtyId" name="input_sand_qty" value="" required>
- +
@@ -745,7 +745,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
+ type="text" class="form-control" id="additionalEntrySandDriedQtyId" name="sand_dried_qty" value="" required>
@@ -758,13 +758,13 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
+ type="text" class="form-control" id="additionalEntryTotalGasConsumptionId" name="total_gas_consumption" value="" required>
-
@@ -772,7 +772,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
-
@@ -780,7 +780,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
-
@@ -792,14 +792,14 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- +
- +
diff --git a/app/Views/stock/dustAndRoughStockDetails.php b/app/Views/stock/dustAndRoughStockDetails.php index e799142e..c3435ccf 100644 --- a/app/Views/stock/dustAndRoughStockDetails.php +++ b/app/Views/stock/dustAndRoughStockDetails.php @@ -172,12 +172,14 @@ .fht-table thead { position: sticky; top: 0; - z-index: 20; /* Ensure the entire header stays above table rows */ - background-color: #50bbd9; /* Header background color */ + z-index: 20; + /* Ensure the entire header stays above table rows */ + background-color: #50bbd9; + /* Header background color */ } - .dropdown-menu { - z-index :25 ; + .dropdown-menu { + z-index: 25; } @@ -186,8 +188,10 @@ .fht-table thead th { position: sticky; top: 0; - z-index: 11; /* Higher than table rows but lower than first column */ - background-color: #50bbd9; /* Green background */ + z-index: 11; + /* Higher than table rows but lower than first column */ + background-color: #50bbd9; + /* Green background */ color: #ffffff; border: 1px solid #ddd; padding: 10px; @@ -199,7 +203,8 @@ position: sticky; left: 0; background-color: #50bbd9; - z-index: 15; /* Ensures it stays above other cells */ + z-index: 15; + /* Ensures it stays above other cells */ border-right: 2px solid #ddd; color: #ffffff; } @@ -207,23 +212,25 @@ /* Table Wrapper for Scrolling */ .table-responsive { overflow-x: auto; - overflow-y: auto; - max-height: 500px; /* Adjust as needed */ + overflow-y: auto; + max-height: 500px; + /* Adjust as needed */ position: relative; } - td{ - min-width: 100px; - max-width: 100px; + td { + min-width: 150px; + max-width: 150px; } - - - - - + th { + min-width: 150px; + max-width: 150px; + } + +
@@ -263,7 +270,7 @@
" class="form-control mt-2" data-provide="datepicker" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
@@ -372,10 +379,10 @@
stock ?> 0 CategoryName ?> HSNCODE ?> IsActive == 1) { @@ -501,32 +504,6 @@ $(document).ready(function () { + + \ No newline at end of file diff --git a/app/Views/stock/CoatingMachineDetail.php b/app/Views/stock/CoatingMachineDetail.php index 6dea2e9d..03b7d201 100644 --- a/app/Views/stock/CoatingMachineDetail.php +++ b/app/Views/stock/CoatingMachineDetail.php @@ -296,7 +296,7 @@ + class="form-control monthpicker" id="monthpicker" readonly> diff --git a/app/Views/stock/bagStockDetails.php b/app/Views/stock/bagStockDetails.php index d95a023c..6b529812 100644 --- a/app/Views/stock/bagStockDetails.php +++ b/app/Views/stock/bagStockDetails.php @@ -13,6 +13,14 @@ margin: 0; } + .grab { + cursor: grab; /* Default open-hand cursor */ + } + + .grab:active { + cursor: grabbing; /* Closed-hand cursor when dragging */ + } + .fht-table td { text-align: center; } @@ -297,12 +305,26 @@
" class="form-control mt-2" data-provide="datepicker" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
-
material Material
Moisture Loss Qty (Metric Ton) Dust Qty (Metric Ton)Customer NameCustomer Name Action +
- - - - + + + + @@ -509,6 +516,7 @@ $('#loader').hide(); console.log(data); alert(data); + window.location.reload(); } }, diff --git a/app/Views/stock/gasStockDetails.php b/app/Views/stock/gasStockDetails.php index 406a7da0..672242db 100644 --- a/app/Views/stock/gasStockDetails.php +++ b/app/Views/stock/gasStockDetails.php @@ -262,7 +262,7 @@
" class="form-control mt-2" data-provide="datepicker" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
@@ -478,14 +478,14 @@ // Sum values for the material $summary["opening"] = 0 ; - $summary["purchaseBharath"] = is_numeric($gasStockDetail['purchaseBharath']) ? $gasStockDetail['purchaseBharath'] : 0 ; + $summary["purchaseBharath"] += is_numeric($gasStockDetail['purchaseBharath']) ? $gasStockDetail['purchaseBharath'] : 0 ; $summary["purchaseIndian"] += is_numeric($gasStockDetail['purchaseIndian']) ? $gasStockDetail['purchaseIndian'] : 0 ; $summary["total"] += is_numeric($gasStockDetail['total']) ? $gasStockDetail['total'] : 0 ; $summary["consumption"] += is_numeric($gasStockDetail['consumption']) ? $gasStockDetail['consumption'] : 0 ; $summary["balanceStock"] += is_numeric($gasStockDetail['balanceStock']) ? $gasStockDetail['balanceStock'] : 0 ; - $summary["drierMachineGasConsumption"] = is_numeric( $gasStockDetail['drierMachineGasConsumption']) ? $gasStockDetail['drierMachineGasConsumption'] : 0 ; - $summary["sandDried"] = is_numeric( $gasStockDetail['sandDried']) ? $gasStockDetail['sandDried'] : 0 ; + $summary["drierMachineGasConsumption"] += is_numeric( $gasStockDetail['drierMachineGasConsumption']) ? $gasStockDetail['drierMachineGasConsumption'] : 0 ; + $summary["sandDried"] += is_numeric( $gasStockDetail['sandDried']) ? $gasStockDetail['sandDried'] : 0 ; $summary["coatingMachineGasconsumption"] += is_numeric($gasStockDetail['coatingMachineGasconsumption']) ? $gasStockDetail['coatingMachineGasconsumption'] : 0 ; $summary["coatedSand"] += is_numeric($gasStockDetail['coatedSand']) ? $gasStockDetail['coatedSand'] : 0 ; $summary["trp_panel_gas_consumption"] += is_numeric($gasStockDetail['trp_panel_gas_consumption']) ? $gasStockDetail['trp_panel_gas_consumption'] : 0 ; diff --git a/app/Views/stock/incomingSilicaSandDetails.php b/app/Views/stock/incomingSilicaSandDetails.php index 080ee3fe..8f84ac0e 100644 --- a/app/Views/stock/incomingSilicaSandDetails.php +++ b/app/Views/stock/incomingSilicaSandDetails.php @@ -4,6 +4,10 @@ text-align: right; } + .side-table tbody td{ + padding:3px !important ; + } + .fht-table, .fht-table thead, .fht-table tfoot, @@ -292,7 +296,7 @@
- " class="form-control mt-2" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1"> + " class="form-control mt-2" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
@@ -704,7 +708,7 @@
- + @@ -813,7 +817,7 @@ - + @@ -1018,7 +1022,7 @@
-
Total Final Rough Dust Total Total Final Rough Dust Total
-
total
Total
-
Supplier NameSupplier Name
+
@@ -1497,7 +1501,7 @@ function calculateRow(value){ - var table = $('#meshTableId'); + var table = $('#meshTableId'); if( value != "moistureValue" ){ var tr = $(value).closest('tr'); @@ -1610,7 +1614,7 @@ $(document).ready(function() { + + \ No newline at end of file diff --git a/app/Views/stock/powerConsumptionDetails.php b/app/Views/stock/powerConsumptionDetails.php index a8c272c8..2de8b655 100644 --- a/app/Views/stock/powerConsumptionDetails.php +++ b/app/Views/stock/powerConsumptionDetails.php @@ -17,6 +17,14 @@ text-align: center; } + .grab { + cursor: grab; /* Default open-hand cursor */ + } + + .grab:active { + cursor: grabbing; /* Closed-hand cursor when dragging */ + } + /* .fht-table td[contenteditable="true"] { background-color: lightyellow; color:rgb(13, 7, 7); @@ -295,12 +303,26 @@ foreach ($period as $day) { " class="form-control mt-2" data-provide="datepicker" style="z-index:30;" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly> - - + + \ No newline at end of file diff --git a/app/Views/stock/resinStockDetails.php b/app/Views/stock/resinStockDetails.php index 502b17ee..0f8b0693 100644 --- a/app/Views/stock/resinStockDetails.php +++ b/app/Views/stock/resinStockDetails.php @@ -302,15 +302,23 @@ foreach ($period as $day) {
" class="form-control mt-2" data-provide="datepicker" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
+ + +
+ + + + + + +
+ + + + +
+ +
+ + + " + class="form-control mt-2" data-provide="datepicker" + data-date-format="M-yyyy" data-date-min-view-mode="1"> + @@ -336,7 +433,7 @@ foreach ($period as $day) {
- + @@ -656,71 +753,7 @@ foreach ($period as $day) { - -
- -
@@ -1140,12 +1173,6 @@ foreach ($period as $day) { let materialCode = checkbox.value; let materialName = container.querySelector("label").innerText; - let dropdown = document.getElementById("customizeHeader"); - let newOption = document.createElement("option"); - newOption.value = materialCode; - newOption.text = materialName; - dropdown.appendChild(newOption); - container.remove(); }; @@ -1162,7 +1189,7 @@ foreach ($period as $day) { container.id = materialCode + "_container"; container.innerHTML = `
@@ -1171,7 +1198,6 @@ foreach ($period as $day) { attachDragEvents(container); document.getElementById("sortableList").appendChild(container); - dropdown.removeChild(selectedOption); } }; }); diff --git a/app/Views/stock/trpProductionStockDetails.php b/app/Views/stock/trpProductionStockDetails.php index 670d81c1..fcb5ada9 100644 --- a/app/Views/stock/trpProductionStockDetails.php +++ b/app/Views/stock/trpProductionStockDetails.php @@ -321,7 +321,7 @@ $timeOtions[] = "12:00 AM";
" class="form-control mt-2" data-provide="datepicker" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
@@ -494,6 +494,9 @@ $timeOtions[] = "12:00 AM";
-
- - - - +

Abstract for the month

@@ -1457,7 +1460,7 @@ $timeOtions[] = "12:00 AM";
Accepted
material Material
- + @@ -1466,25 +1469,409 @@ $timeOtions[] = "12:00 AM"; - + + $trpAbstractEach){ + + $particulars = $trpAbstractEach['particulars']; + + switch ($particulars) { + case "Incoming Raw Sand Details": ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParticularsParticulars Running Hours Per Hour Opening StockConsumption Closing Stock Physical StockRemarksRemarks
+ +
+ +
dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy
Incoming Raw Sand Details
ED Details + +
TRP Total Sand
Trp Physical Gas Consumption
Trp Panel Gas Consumption
Water Consumption
Power Consumption
@@ -2014,74 +2401,3 @@ $timeOtions[] = "12:00 AM"; - - \ No newline at end of file diff --git a/app/Views/stock/trpSandUseStockDetails.php b/app/Views/stock/trpSandUseStockDetails.php index ef86e42b..9fe0ee10 100644 --- a/app/Views/stock/trpSandUseStockDetails.php +++ b/app/Views/stock/trpSandUseStockDetails.php @@ -172,12 +172,14 @@ .fht-table thead { position: sticky; top: 0; - z-index: 20; /* Ensure the entire header stays above table rows */ - background-color: #50bbd9; /* Header background color */ + z-index: 20; + /* Ensure the entire header stays above table rows */ + background-color: #50bbd9; + /* Header background color */ } - .dropdown-menu { - z-index :25 ; + .dropdown-menu { + z-index: 25; } @@ -186,14 +188,13 @@ .fht-table thead th { position: sticky; top: 0; - z-index: 11; /* Higher than table rows but lower than first column */ - background-color: #50bbd9; /* Green background */ + z-index: 11; + /* Higher than table rows but lower than first column */ + background-color: #50bbd9; + /* Green background */ color: #ffffff; border: 1px solid #ddd; padding: 10px; - white-space: normal; /* Allows text to wrap */ - word-wrap: break-word; /* Breaks long words if needed */ - text-align: center; /* Centers text for better alignment */ } /* Sticky First Column */ @@ -202,7 +203,8 @@ position: sticky; left: 0; background-color: #50bbd9; - z-index: 15; /* Ensures it stays above other cells */ + z-index: 15; + /* Ensures it stays above other cells */ border-right: 2px solid #ddd; color: #ffffff; } @@ -210,22 +212,16 @@ /* Table Wrapper for Scrolling */ .table-responsive { overflow-x: auto; - overflow-y: auto; - max-height: 500px; /* Adjust as needed */ + overflow-y: auto; + max-height: 500px; + /* Adjust as needed */ position: relative; } - td{ - min-width: 100px; - max-width: 100px; + td { + min-width: 150px; + max-width: 150px; } - - - - - - - @@ -269,7 +265,7 @@
" class="form-control mt-2" data-provide="datepicker" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
@@ -382,7 +378,7 @@ } ?> -
+
@@ -544,6 +540,7 @@ $('#loader').hide(); console.log(data); alert(data); + window.location.reload(); } }, diff --git a/app/Views/supplierListing.php b/app/Views/supplierListing.php index 380c84a8..9fd8c7ee 100755 --- a/app/Views/supplierListing.php +++ b/app/Views/supplierListing.php @@ -82,24 +82,28 @@ - -
-
- - -
- -
+ id="resetButton" title="Reset">
+ +
+
+
+ + style="width: 18px; height: 18px;"> + + +
+ +
+ +
@@ -124,12 +128,7 @@ foreach ($userRecords as $record) { ?> - " - style="IsActive == 0) { - echo "display:none"; - } ?>"> + CreatedOn)) == "30-11--0001") { $cdate = '00-00-0000'; @@ -491,30 +490,16 @@ function formatNumberToIndianCurrency(number) { } }); }); + + + - function showArchiveList() { - let isChecked = $("#showArchiveId").prop('checked'); + \ No newline at end of file diff --git a/app/Views/transporterListing.php b/app/Views/transporterListing.php index bd8c4173..ecc666ee 100755 --- a/app/Views/transporterListing.php +++ b/app/Views/transporterListing.php @@ -121,21 +121,27 @@ -
+
+ + + +
+
style="width: 18px; height: 18px;"> + + +
-
-
@@ -156,11 +162,8 @@ $date = $createdat->format('d-m-Y'); $time = $createdat->format('h:i A'); ?> - " style="isactive == 0) { - echo "display:none"; - } ?>"> + + @@ -423,30 +426,6 @@ } - function showArchiveList() { - let isChecked = $("#showArchiveId").prop('checked'); - - // Show or hide the rows based on checkbox status - $(".deactivatedRow").each(function () { - if (isChecked) { - $(this).show(); - } else { - $(this).hide(); - } - }); - } - - $(document).ready(function () { - let table = $('#transporter_list').DataTable(); - - showArchiveList(); - - table.on('draw', function () { - showArchiveList(); - }); - - }); - @@ -458,4 +437,13 @@ $(document).on('keydown', function(event) { } }); + + + \ No newline at end of file diff --git a/app/Views/userListing.php b/app/Views/userListing.php index 037bc220..f0c28c68 100755 --- a/app/Views/userListing.php +++ b/app/Views/userListing.php @@ -88,22 +88,26 @@ -
-
- - -
- -
-
+ +
+
+
+ + style="width: 18px; height: 18px;"> + + +
+
+ + +
name ?> FirstName ?>
@@ -128,12 +132,7 @@ ?> - " - style="isDeleted == 1) { - echo "display:none"; - } ?>"> + createdDtm)) == "30-11--0001") { $cdate = '00-00-0000'; @@ -295,29 +294,11 @@ }); }); + - function showArchiveList() { - let isChecked = $("#showArchiveId").prop('checked'); - - // Show or hide the rows based on checkbox status - $(".deactivatedRow").each(function () { - if (isChecked) { - $(this).show(); - } else { - $(this).hide(); - } - }); - } - - $(document).ready(function () { - let table = $('#user_list_table').DataTable(); - - showArchiveList(); - - table.on('draw', function () { - showArchiveList(); - }); - + \ No newline at end of file diff --git a/app/Views/viewinwardgateregister.php b/app/Views/viewinwardgateregister.php index 5bf60e71..ee09d429 100755 --- a/app/Views/viewinwardgateregister.php +++ b/app/Views/viewinwardgateregister.php @@ -9,6 +9,13 @@ text-align: right; } + #Inwardgateregistertable1 thead tr th{ + + width: 150px; + word-wrap: break-word; + white-space: normal; + } + th { white-space: nowrap; } @@ -232,7 +239,8 @@ CreatedDate); @@ -242,8 +250,17 @@ - - + @@ -485,7 +502,9 @@ - + + + @@ -632,6 +651,259 @@ + + + + + + + +
- IGRNO ?> + + + + IGRNO ?> + + PONO ?> @@ -340,7 +357,7 @@
# Item CodeItem DescriptionItem Description UOM Ordered Qty Received QtyTaxable Amt Total Amt RemarksCalculate Net Weight
+ + + + + + + + + + + + + + + + + + + + + +
Full Cylinder DateEmpty Cylinder DateInvoice NoCylinder NoGross WeightTare WeightNet WeightActual WeightShortageIDAction
+ + +
+ +
+
+
+ + + + + + + + + + + + + +
' + i + '' + item.MaterialCode + '' + amount + '' + grand_total_amount + '
' + amount + '' + grand_total_amount + '
' + tax_percentage + '' + amount + '' + grand_total_amount + '