diff --git a/app/Controllers/Assetdetails.php b/app/Controllers/Assetdetails.php index ddd3a208..d1b2977a 100755 --- a/app/Controllers/Assetdetails.php +++ b/app/Controllers/Assetdetails.php @@ -346,9 +346,12 @@ class Assetdetails extends BaseController function checkAssetName(){ $data = $this->request->getPost(); + $assetId = $data['assetId']??''; $assetName = str_replace(" ","",$data['assetName']) ; + $result = $this->assetdetails_model->checkAssetName($assetId,$assetName); + return $this->response->setJSON($result); } diff --git a/app/Controllers/CostCenter.php b/app/Controllers/CostCenter.php index c5825f51..d23a4a2d 100755 --- a/app/Controllers/CostCenter.php +++ b/app/Controllers/CostCenter.php @@ -140,6 +140,8 @@ class CostCenter extends BaseController $CostCenterId = $data['CostCenterId']; $CostCenterName = $data['CostCenterName']; + $CostCenterName = str_replace(' ', '', $CostCenterName); + $result = $this->costcenter_model->checkCostCenter( $CostCenterId,$CostCenterName); return $this->response->setJSON($result); diff --git a/app/Controllers/Department.php b/app/Controllers/Department.php index 0c2daa07..79d4d956 100755 --- a/app/Controllers/Department.php +++ b/app/Controllers/Department.php @@ -251,9 +251,18 @@ class Department extends BaseController $data = $this->request->getPost(); $departmentName = str_replace(" ","",$data['departmentName']); - $depCode =$data['depCode']; + + $depCode = $data['depCode']; + + $headDepCode =$data['headDepCode']; + $departmentName = $data['departmentName']; - $result = $this->department_model->checkDepartmentName($depCode,$departmentName); + + $departmentName = str_replace(" ","",$departmentName); + + $result = $this->department_model->checkDepartmentName($departmentName , $headDepCode , $depCode); + + return $this->response->setJSON($result); } diff --git a/app/Controllers/Rawmaterialdetails.php b/app/Controllers/Rawmaterialdetails.php index e8e6744b..e99a8683 100755 --- a/app/Controllers/Rawmaterialdetails.php +++ b/app/Controllers/Rawmaterialdetails.php @@ -190,7 +190,7 @@ class Rawmaterialdetails extends BaseController function addNewRawMaterial() { - //echo "HI";die(); + $TempArr = []; $MaterialName = $this->request->getPost('MaterialName'); @@ -251,7 +251,7 @@ class Rawmaterialdetails extends BaseController $RawMaterial = array('MaterialName' => $MaterialName, 'MaterialType' => $MaterialType, 'UOM' => $UOM, 'Category' => $MaterialCategory, 'CreatedBy' => $CreatedBy, 'Remarks' => $Remarks, 'HSNCODE' => $HSNcode, 'stock' => $stock, 'stockdate' => $stockdate, 'reorder' => $reorder, 'Current_stock' => $currentstock); - //print_r($RawMaterial);die(); + //print_r($RawMaterial);die(); $result = $this->rawmaterialdetails_model->addNewRawMaterial($RawMaterial); if ($result > 0) { diff --git a/app/Controllers/Supplier.php b/app/Controllers/Supplier.php index 2e0a5441..2dc8337f 100755 --- a/app/Controllers/Supplier.php +++ b/app/Controllers/Supplier.php @@ -478,6 +478,7 @@ class Supplier extends BaseController $data = $this->request->getPost(); $transporterId = $data['transporterid']??''; $transporterName = $data['transportername']; + $transporterName = str_replace(' ', '', $transporterName); $message = $this->supplier_model->checkTransporter($transporterId,$transporterName); return $this->response->setJSON($message); diff --git a/app/Models/Assetdetails_model.php b/app/Models/Assetdetails_model.php index 4cd4dee9..db2b81cf 100755 --- a/app/Models/Assetdetails_model.php +++ b/app/Models/Assetdetails_model.php @@ -278,7 +278,7 @@ class Assetdetails_model extends Model $builder = $builder->where('AssetCode !=', $assetId); } - $builder = $builder->where('REPLACE(AssetName , " ", "") ',$assetName); + $builder = $builder->where('REPLACE(AssetName, " ", "")',$assetName); $query = $builder->get(); diff --git a/app/Models/Costcenter_model.php b/app/Models/Costcenter_model.php index c23a0f47..01c6d783 100755 --- a/app/Models/Costcenter_model.php +++ b/app/Models/Costcenter_model.php @@ -429,18 +429,18 @@ where Dept.DEPCode not in return "Cost center $CostCenterCode deactivated successfully."; } - function checkCostCenter($CostCenterId,$CostCenterName){ + function checkCostCenter($CostCenterId,$CostCenterName){ $builder = $this->db->table('t_costcenter_master') ->select('CostCenterName,IsActive'); if(!empty($CostCenterId)){ $builder = $builder -> where('id !=' ,$CostCenterId); } - $builder = $builder->where('REPLACE(CostCenterName , " ", "") ',$CostCenterName); + $builder = $builder->where('REPLACE(CostCenterName," ", "")',$CostCenterName); $query = $builder->get(); return $query->getResult(); - + } diff --git a/app/Models/Department_model.php b/app/Models/Department_model.php index c5d87d7d..50730b21 100755 --- a/app/Models/Department_model.php +++ b/app/Models/Department_model.php @@ -1,4 +1,5 @@ -select('BaseT.DepartmentID, BaseT.SupplierName, BaseT.Address, BaseT.ContactNumber, BaseT.AlternateContactNumber,BaseT.EmailAddress,BaseT.Exiseregistration,BaseT.TIN,BaseT.PAN,BaseT.GSTNO,BaseT.GSTRange,BaseT.CollectrateAddress,BaseT.UANumber,BaseT.PaymentTerms,BaseT.PaymentDays,BaseT.PayableAT'); - // $builder = $this->db->table('t_departmentdetails as BaseT'); - // //->join('tbl_users as users', 'users.userId = BaseT.userId','left'); - // //->join('T_SupplierDetails as ID', 'ID.DepartmentID = BaseT.DepartmentID','left'); - // if(!empty($searchText)) { - // $likeCriteria = "(BaseT.DepartmentID LIKE '%".$searchText."%' - // OR BaseT.SupplierName LIKE '%".$searchText."%' - // OR BaseT.Address LIKE '%".$searchText."%' - // OR BaseT.ContactNumber LIKE '%".$searchText."%' - // OR BaseT.AlternateContactNumber LIKE '%".$searchText."%' - // OR BaseT.EmailAddress LIKE '%".$searchText."%' - // OR BaseT.Exiseregistration LIKE '%".$searchText."%' - // OR BaseT.TIN LIKE '%".$searchText."%' - // OR BaseT.PAN LIKE '%".$searchText."%' - // OR BaseT.GSTNO LIKE '%".$searchText."%' - // OR BaseT.GSTRange LIKE '%".$searchText."%' - // OR BaseT.CollectrateAddress LIKE '%".$searchText."%' - // OR BaseT.UANumber LIKE '%".$searchText."%' - // OR BaseT.PaymentTerms LIKE '%".$searchText."%' - // OR BaseT.PaymentDays LIKE '%".$searchText."%' - // OR BaseT.PayableAT LIKE '%".$searchText."%')"; - // $this->db->where($likeCriteria); - // } - // //$this->db->where('BaseT.isDeleted', 0); - // //$this->db->where('BaseT.userId !=', 1); - // $query =$builder->get(); - - // return count($query-getResult()); - // } - /** + // function departmentListingCount($searchText = '') + // { + // ->select('BaseT.DepartmentID, BaseT.SupplierName, BaseT.Address, BaseT.ContactNumber, BaseT.AlternateContactNumber,BaseT.EmailAddress,BaseT.Exiseregistration,BaseT.TIN,BaseT.PAN,BaseT.GSTNO,BaseT.GSTRange,BaseT.CollectrateAddress,BaseT.UANumber,BaseT.PaymentTerms,BaseT.PaymentDays,BaseT.PayableAT'); + // $builder = $this->db->table('t_departmentdetails as BaseT'); + // //->join('tbl_users as users', 'users.userId = BaseT.userId','left'); + // //->join('T_SupplierDetails as ID', 'ID.DepartmentID = BaseT.DepartmentID','left'); + // if(!empty($searchText)) { + // $likeCriteria = "(BaseT.DepartmentID LIKE '%".$searchText."%' + // OR BaseT.SupplierName LIKE '%".$searchText."%' + // OR BaseT.Address LIKE '%".$searchText."%' + // OR BaseT.ContactNumber LIKE '%".$searchText."%' + // OR BaseT.AlternateContactNumber LIKE '%".$searchText."%' + // OR BaseT.EmailAddress LIKE '%".$searchText."%' + // OR BaseT.Exiseregistration LIKE '%".$searchText."%' + // OR BaseT.TIN LIKE '%".$searchText."%' + // OR BaseT.PAN LIKE '%".$searchText."%' + // OR BaseT.GSTNO LIKE '%".$searchText."%' + // OR BaseT.GSTRange LIKE '%".$searchText."%' + // OR BaseT.CollectrateAddress LIKE '%".$searchText."%' + // OR BaseT.UANumber LIKE '%".$searchText."%' + // OR BaseT.PaymentTerms LIKE '%".$searchText."%' + // OR BaseT.PaymentDays LIKE '%".$searchText."%' + // OR BaseT.PayableAT LIKE '%".$searchText."%')"; + // $this->db->where($likeCriteria); + // } + // //$this->db->where('BaseT.isDeleted', 0); + // //$this->db->where('BaseT.userId !=', 1); + // $query =$builder->get(); + + // return count($query-getResult()); + // } + /** * This function is used to get the user listing count * @param string $searchText : This is optional search text * @param number $page : This is pagination offset @@ -51,13 +52,13 @@ class Department_model extends Model function departmentListing() { $builder = $this->db->table('t_departmentdetails as BaseT') - ->select('BaseT.CreatedDt,BaseT.DepartmentName, BaseT.DEPCode, BaseT.HeadDept, BaseT.IsActive') - ->orderBy("BaseT.DEPCode", "desc"); - $query =$builder->get(); - $result = $query->getResult(); + ->select('BaseT.CreatedDt,BaseT.DepartmentName, BaseT.DEPCode, BaseT.HeadDept, BaseT.IsActive') + ->orderBy("BaseT.DEPCode", "desc"); + $query = $builder->get(); + $result = $query->getResult(); return $result; } - + // function ($searchText = '') // { // if(!empty($searchText)) { @@ -71,99 +72,141 @@ class Department_model extends Model // //$this->db->where('BaseT.userId !=', 1); // // $this->db->limit($page, $segment); // $query =$builder->get(); - + // $result = $query->getResult(); // return $result; // } - /** - * This function used to get user information by id - * @param number $userId : This is user id - * @return array $result : This is user information - */ - -function savedepartment($department) - { - - $builder = $this->db->table('t_departmentdetails'); - $builder->insert($department); - - $SID = $this->db->affectedRows(); - - return $SID; - - } - -function getdepcode() -{ - //$limit = 12; - $builder = $this->db->table('t_departmentdetails') - ->distinct() - ->select('DEPCode, DepartmentName') - ->where('IsActive =', 1); - //$this->db->limit($limit); - $query =$builder->get(); - - return $query->getResult(); -} - /** * This function used to get user information by id * @param number $userId : This is user id * @return array $result : This is user information */ - function getDeptInfo($DEPCode='') + + function savedepartment($department) { + + $builder = $this->db->table('t_departmentdetails'); + $builder->insert($department); + + $SID = $this->db->affectedRows(); + + return $SID; + } + + function getdepcode() + { + //$limit = 12; $builder = $this->db->table('t_departmentdetails') - ->select('*') - ->where('DEPCode', $DEPCode); - $query =$builder->get(); - + ->distinct() + ->select('DEPCode, DepartmentName') + ->where('IsActive =', 1); + //$this->db->limit($limit); + $query = $builder->get(); + return $query->getResult(); } - /* This function to get the Supplier Address on respective Supplier ID */ - - function Updatedepartment($department, $DEPCode) + + /** + * This function used to get user information by id + * @param number $userId : This is user id + * @return array $result : This is user information + */ + function getDeptInfo($DEPCode = '') + { + $builder = $this->db->table('t_departmentdetails') + ->select('*') + ->where('DEPCode', $DEPCode); + $query = $builder->get(); + + return $query->getResult(); + } + /* This function to get the Supplier Address on respective Supplier ID */ + + function Updatedepartment($department, $DEPCode) { $this->db->table('t_departmentdetails') - ->where('DEPCode', $DEPCode) - ->update($department); - $res = $this->db->affectedRows(); - return $res; - + ->where('DEPCode', $DEPCode) + ->update($department); + $res = $this->db->affectedRows(); + return $res; } - function reActivateDepartment($depCode , $updateInfo){ + function reActivateDepartment($depCode, $updateInfo) + { $this->db->table('t_departmentdetails') - ->where('DEPCode', $depCode) - ->update($updateInfo); - $res = $this->db->affectedRows(); - return $res; + ->where('DEPCode', $depCode) + ->update($updateInfo); + $res = $this->db->affectedRows(); + return $res; } - function deleteDepartment($depCode , $updateInfo){ + function deleteDepartment($depCode, $updateInfo) + { $this->db->table('t_departmentdetails') - ->where('DEPCode', $depCode) - ->update($updateInfo); - $res = $this->db->affectedRows(); - return $res; + ->where('DEPCode', $depCode) + ->update($updateInfo); + $res = $this->db->affectedRows(); + return $res; } - function checkDepartmentName($depCode ,$departmentName){ - $builder = $this->db->table('t_departmentdetails'); + function checkDepartmentName($departmentName, $headDepCode, $depCode) + { - if(!empty($depCode)){ - $builder = $builder -> where(' DEPCode !=', $depCode); - } + $builder = $this->db->table('t_departmentdetails'); - $builder = $builder->where('REPLACE(DepartmentName , " ", "") ',$departmentName); - $query = $builder->get(); - $result =$query->getResultArray(); - return $result; + //post + if(empty($depCode)) { + $builder = $builder->where(' HeadDept =', $headDepCode); + } + //put + if(!empty($depCode)){ + + //allowing current department name to be changed + //but not other department to get same name + + $builder = $builder->where(' DEPCode !=', $depCode); + $builder = $builder->where(' HeadDept =', $headDepCode); + } + + $builder = $builder->where('REPLACE(DepartmentName , " ", "") ', $departmentName); + + $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 f55d0740..bafa376a 100755 --- a/app/Models/Rawmaterialdetails_model.php +++ b/app/Models/Rawmaterialdetails_model.php @@ -323,6 +323,7 @@ class Rawmaterialdetails_model extends Model $builder->where('REPLACE(MaterialName, " ", "")' , $materialName); $query = $builder->get(); + if ($query->getNumRows() > 0) { return $query->getResultArray(); } else { diff --git a/app/Views/CoatingMachineDetail.php b/app/Views/CoatingMachineDetail.php index be3771dc..95647f77 100644 --- a/app/Views/CoatingMachineDetail.php +++ b/app/Views/CoatingMachineDetail.php @@ -1,9 +1,22 @@ -
@@ -186,10 +198,17 @@
- +
+ + +
+ @@ -209,27 +228,27 @@
-
+
-
-
+
+
- - + + + + +
+ +
+ +
-
- -
- -
- -
- +
@@ -258,18 +277,19 @@ if (!empty($coatingMachineDetails)) { foreach ($coatingMachineDetails as $record) { - ?> + ?> format('d-m-Y'); - if ($dateInMonthDmYFormat === $currentDate) { echo 'style="background: #cef0ad;"';} - ?> - > + $dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $record['date'])->format('d-m-Y'); + if ($dateInMonthDmYFormat === $currentDate) { + echo 'style="background: #cef0ad;"'; + } + ?>> - format('d-m-Y'); - ?> + format('d-m-Y'); + ?> @@ -286,16 +306,16 @@ -     - -     @@ -305,7 +325,7 @@ - @@ -316,20 +336,20 @@
- -
- No Coating Machine Details present in this month -
- + +
+ No Coating Machine Details present in this month +
+ - - - - + + + - - + + + @@ -350,7 +370,7 @@ - + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
logoresico name
one one
one one
one one
one one
Production Batch Card
Customer NameDR Axion India Pvt.Ltd (PCS ROUGH) P.Batch NoMI | 12 | 19 | C
Date19/12/2024ShiftIIIBatch No123
OperatorKUMARANHelpersMURUGESAN
S.NoSandResin SolidHexamineWaterCatalyst Calcium StearatResin Mixing TimeHexamine Mixing TimeCatalyst Mixing TimeTS
SPEC200KG-300KG3KG-6KG450G-900G900G-1800G150G-300G60-120 SEC60-120 SEC180-300 SEC50-60 KG/CM2
13005.0007.301500230606018054.2
23005.0007.301500230606018052.4
+ +
+
+ + +
+
+
- + + + + + + + + + + + + + + + + @@ -702,20 +872,22 @@ function confirmDelete(event) { let result = confirm(` Do you Confirm to Delete the Coating Machine Detail?`); - if (result) { return result; } else { event.preventDefault(); } + if (result) { + return result; + } else { + event.preventDefault(); + } } - - @@ -723,16 +895,16 @@ \ No newline at end of file diff --git a/app/Views/addRawMaterial.php b/app/Views/addRawMaterial.php index 89c0ed44..44def64f 100755 --- a/app/Views/addRawMaterial.php +++ b/app/Views/addRawMaterial.php @@ -42,14 +42,14 @@
-
+
- +
@@ -137,7 +137,7 @@
- +
@@ -291,9 +291,18 @@ - $('#MaterialName').change(function() { + $('#addMaterialBtnId').click(function() { - var materialName = $('#MaterialName').val(); + + //validate + + let validation = Validate(); + + if(!validation){ + return false; + } + + var materialName = $('#MaterialName').val().trim(); var materialCode = ''; if(materialName == ''){ @@ -311,28 +320,35 @@ type: "POST", url: "materialExist", success: function(data) { - var count = data.length; - if (count >= 1) { + + if (data && data.length >= 1) { $('#loader').hide(); - if(data[0].IsActive == 1){ + + if(data[0]?.IsActive == 1){ alert('Material name already existed ! '); + $('#MaterialName').val(''); }else{ alert('Material name already existing in the deleted section.!!'); - } - + $('#MaterialName').val(''); + } - var related_name = ""; + var related_name = "" ; $.each(data, function(i, obj) { related_name += obj.MaterialCode + " - " + obj.MaterialName + " - " + obj.MaterialType + " - " + obj.Category + "\n"; }); - alert("'" + materialname + "' - related materials are , " + " \n \n" + related_name); - $("#MaterialName").val(''); - $("#MaterialName").focus(); - } else { + alert("'" + materialName + "' - related materials are , " + " \n \n" + related_name); + $("#MaterialName").val(''); + $("#MaterialName").focus(); + + + } else{ + console.log("Material name is unique"); $('#loader').hide(); + + $('#addMaterialForm').submit(); } }, @@ -348,6 +364,7 @@ }); function Validate() { + if ($("#MaterialName").val().length < 1) { alert('Please Enter MaterialName'); $("#MaterialName").focus(); @@ -369,6 +386,8 @@ $("#MaterialType").focus(); return false; } + + return true; } @@ -432,4 +451,15 @@ } + + + + \ No newline at end of file diff --git a/app/Views/addSupplier.php b/app/Views/addSupplier.php index 077ebcf9..7b7721ab 100755 --- a/app/Views/addSupplier.php +++ b/app/Views/addSupplier.php @@ -199,7 +199,7 @@
- +
@@ -237,6 +237,7 @@ return false; } if (!getContactNumberValidation) { + alert('Please Enter Valid Contact Number'); $("#ContactNumber").focus(); return false; } @@ -252,13 +253,17 @@ } if (!validateEmail()) { + alert('Please Enter Valid Email Address'); $('#emailid').focus(); return false; } + return true; + } - $('#supplierName').change(function() { + $('#addSupplierBtnId').click(function() { + var supplierName = $('#supplierName').val().trim(); var supplierId = $('#SupplierID').val(); @@ -274,7 +279,7 @@ var count = data?data.length:0; if (count >= 1) { $('#loader').hide(); - if(data[0].IsActive == 1){ + if(data[0]?.IsActive == 1){ alert('supplier already existed ! '); }else{ alert('supplier already existing in the deleted section..!! '); @@ -284,21 +289,17 @@ $.each(data, function(i, obj) { related_supplier += obj.SupplierID + " - " + obj.SupplierName + " - " + obj.Address + "\n"; }); - alert("'" + suppliername + "' - related supplier are , " + " \n \n" + related_supplier); - $("#supplierName").val(''); + alert("'" + supplierName + "' - related supplier are , " + " \n \n" + related_supplier); $("#supplierName").focus(); - } else { + } else { $('#loader').hide(); - //4Debug - // alert('This is New Supplier! '); + if (Validate()) { + $('#addsupplier').submit(); + } } - //4Debug - //console.log(data); }, error: function(error) { - //4Debug - // alert("Error Occur"); $('#loader').hide(); console.error("Error" , error); } diff --git a/app/Views/addasset.php b/app/Views/addasset.php index 5a6c2770..4458c5e9 100755 --- a/app/Views/addasset.php +++ b/app/Views/addasset.php @@ -158,7 +158,7 @@
- +
@@ -383,8 +383,7 @@ } - - + return true; } @@ -431,43 +430,68 @@ return true; } - $('#AssetName').on('change',function(){ + $('#addAssetBtnId').on('click',function(){ -let assetName = $(this).val().trim(); -let assetId = $('#AssetCode').val() ?? ''; + let validation = validate(); -$('#loader').show(); + if(validation){ + + let assetName = $('#AssetName').val().trim(); + let assetId = $('#AssetCode').val() ?? ''; + + $('#loader').show(); + + $.ajax({ + type:'POST', + url:'assetdetails/checkAssetName', + data:{assetId,assetName}, + success: function(data){ + if(data && data.length>0){ + let IsActive = data[0]?.IsActive; + if(IsActive == 1){ + alert("Asset Name Exists..!!"); + $('#AssetName').val(''); + $('#AssetName').focus(); + }else{ + alert("Asset Name Existing in deleted section..!!"); + $('#AssetName').val(''); + $('#AssetName').focus(); + } + }else{ + $('#addAsset').submit(); + } + + + + }, + error: function(error){ + //error + console.error('error ocurred' + error); + }, + complete :function (){ + $('#loader').hide(); + console.log('ajax call completed..!!'); + } + }) -$.ajax({ - type:'POST', - url:'assetdetails/checkAssetName', - data:{assetId,assetName}, - success: function(data){ - if(data && data.length>0){ - let IsActive = data[0].IsActive; - if(IsActive == 1){ - alert("Asset Name Exists..!!"); - $('#AssetName').val(''); - $('#AssetName').focus(); - }else{ - alert("Asset Name Existing in deleted section..!!"); - $('#AssetName').val(''); - $('#AssetName').focus(); } - } - }, - error: function(error){ - //error - console.error('error ocurred' + error); - }, - complete :function (){ - $('#loader').hide(); - console.log('ajax call completed..!!'); - } -}) + else{ + return false; + } + + }); + + + + + + \ No newline at end of file diff --git a/app/Views/addconfig.php b/app/Views/addconfig.php index b61ae06f..a77a1c03 100755 --- a/app/Views/addconfig.php +++ b/app/Views/addconfig.php @@ -92,7 +92,7 @@
Cancel - +
@@ -388,7 +388,7 @@ + + + + \ No newline at end of file diff --git a/app/Views/adddepartment.php b/app/Views/adddepartment.php index 707b24e4..2004f0f3 100755 --- a/app/Views/adddepartment.php +++ b/app/Views/adddepartment.php @@ -29,7 +29,7 @@
-
+
@@ -64,7 +64,7 @@
- +
@@ -107,71 +107,30 @@
- + + + \ No newline at end of file diff --git a/app/Views/editOldasset.php b/app/Views/editOldasset.php index f0cc7847..35c903af 100755 --- a/app/Views/editOldasset.php +++ b/app/Views/editOldasset.php @@ -156,7 +156,7 @@ if (!empty($assetList)) {
-
+
@@ -272,7 +272,7 @@ if (!empty($assetList)) {
Cancel - +
@@ -426,7 +426,7 @@ if (!empty($assetList)) { - $('#AssetName').on('change',function(){ +$('#editAssetBtnId').on('click',function(){ let assetId = $('#AssetCode').val(); let assetName = $(this).val().trim(); @@ -438,18 +438,22 @@ if (!empty($assetList)) { url:'assetdetails/checkAssetName', data:{assetId,assetName}, success: function(data){ - if(data && data.length>0){ - let IsActive = data[0].IsActive; - if(IsActive == 1){ - alert("Asset Name Exists..!!"); - $('#AssetName').val(''); - $('#AssetName').focus(); + if(data && data.length>0){ + let IsActive = data[0]?.IsActive; + if(IsActive == 1){ + alert("Asset Name Exists..!!"); + $('#AssetName').val(''); + $('#AssetName').focus(); + }else{ + alert("Asset Name Existing in deleted section..!!"); + $('#AssetName').val(''); + $('#AssetName').focus(); + } }else{ - alert("Asset Name Existing in deleted section..!!"); - $('#AssetName').val(''); - $('#AssetName').focus(); + + $('#editAsset').submit(); + } - } }, error: function(error){ //error @@ -465,4 +469,15 @@ if (!empty($assetList)) { + + + + \ No newline at end of file diff --git a/app/Views/editRawmaterial.php b/app/Views/editRawmaterial.php index abf8f109..7e92c24d 100755 --- a/app/Views/editRawmaterial.php +++ b/app/Views/editRawmaterial.php @@ -289,7 +289,7 @@ if ($total <= $reorder) { - +
@@ -438,7 +438,7 @@ if ($total <= $reorder) { return true; } - $('#MaterialName').change(function() { + $('#editRawMaterialBtnId').click(function(){ var materialName = $('#MaterialName').val(); var materialCode = $('#RMcode').val(); @@ -458,14 +458,15 @@ if ($total <= $reorder) { type: "POST", url: "materialExist", success: function(data) { - var count = data.length; - if (count >= 1) { + if (data && data.length >= 1) { $('#loader').hide(); - if(data[0].IsActive == 1){ + if(data[0]?.IsActive == 1){ alert('Material name already existed ! '); + $('#MaterialName').val(''); }else{ alert('Material name already existing in the deleted section.!!'); + $('#MaterialName').val(''); } var related_name = ""; $.each(data, function(i, obj) { @@ -474,12 +475,13 @@ if ($total <= $reorder) { }); - alert("'" + materialname + "' - related materials are , " + " \n \n" + related_name); + alert("'" + materialName + "' - related materials are , " + " \n \n" + related_name); $("#MaterialName").val(''); $("#MaterialName").focus(); } else { $('#loader').hide(); - // alert("empty data"); + console.log("working") + $('#editRawmaterial').submit(); } }, @@ -555,4 +557,15 @@ if ($total <= $reorder) { } - \ No newline at end of file + + + + \ No newline at end of file diff --git a/app/Views/editSupplier.php b/app/Views/editSupplier.php index 9d71f04b..8e3ccb4b 100755 --- a/app/Views/editSupplier.php +++ b/app/Views/editSupplier.php @@ -296,6 +296,7 @@ if (!empty($supplier)) {
+
@@ -530,7 +531,7 @@ if (!empty($supplier)) { - +
@@ -560,11 +561,7 @@ if (!empty($supplier)) { } function Validate() { - // if(!validatePAN()) - // { - // return false; - // $('#panno').focus(); - // } + if ($("#supplierName").val().length < 1) { alert('Please Enter Supplier Name'); $("#supplierName").focus(); @@ -585,17 +582,12 @@ if (!empty($supplier)) { return false; } - /* - if(!validateGST()) - { - $('#GSTNo').focus(); - return false; - }*/ + return true; } //Call to ajax existing PAN - $('#supplierName').change(function () { + $('#updateSupplierBtnId').click(function () { var supplierName = $('#supplierName').val().trim(); var supplierId = $('#SupplierID').val(); @@ -612,7 +604,7 @@ if (!empty($supplier)) { var count = data.length; if (count >= 1) { $('#loader').hide(); - if(data[0].IsActive == 1){ + if(data[0]?.IsActive == 1){ alert('supplier already existed ! '); }else{ alert('supplier already existing in the deleted section..!! '); @@ -622,10 +614,12 @@ if (!empty($supplier)) { related_supplier += obj.SupplierID + " - " + obj.SupplierName + " - " + obj.Address + "\n"; }); alert("'" + supplierName + "' - supplier details are , " + " \n \n" + related_supplier); - $("#supplierName").val(''); $("#supplierName").focus(); } else { $('#loader').hide(); + if (Validate()) { + $('#UpdateSupplier').submit(); + } } }, diff --git a/app/Views/editconfig.php b/app/Views/editconfig.php index b68609fe..ffbd6771 100755 --- a/app/Views/editconfig.php +++ b/app/Views/editconfig.php @@ -37,7 +37,7 @@ if (!empty($master)) { helper('form'); $error = session()->getFlashdata('error'); if ($error) { - ?> + ?>
getFlashdata('error'); ?> @@ -47,7 +47,7 @@ if (!empty($master)) { getFlashdata('success'); if ($success) { - ?> + ?>
getFlashdata('success'); ?> @@ -77,13 +77,13 @@ if (!empty($master)) { * 'ConfigName', 'value' => set_value('ConfigName', $ConfigName), 'id' => 'ConfigName', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '20'); + $data = array('name' => 'ConfigName', 'value' => set_value('ConfigName', $ConfigName), 'id' => 'ConfigName', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '30'); echo form_input($data); ?>
- + * 'Remarks', 'value' => set_value('Remarks', $Comments), 'id' => 'Remarks', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '20'); @@ -95,8 +95,8 @@ if (!empty($master)) {
  Add - Configuration + class="btn btn-success">   + Configuration Value
@@ -134,7 +134,7 @@ if (!empty($master)) { $index = 0; foreach ($child as $con) { $index++; - ?> + ?> @@ -143,10 +143,10 @@ if (!empty($master)) { value="ConfigValue ?>"> " style="isActive == 0) { - echo "display:none"; - } ?>"> + echo "deactivatedRow"; + } ?>" style="isActive == 0) { + echo "display:none"; + } ?>"> ConfigValue; ?> @@ -168,8 +168,8 @@ if (!empty($master)) { title="Click here to Edit Config Value"> -       - +       + @@ -182,7 +182,7 @@ if (!empty($master)) { - @@ -194,7 +194,7 @@ if (!empty($master)) {
@@ -234,8 +234,7 @@ if (!empty($master)) {
@@ -330,13 +329,14 @@ if (!empty($master)) { + @@ -553,14 +556,14 @@ if (!empty($master)) { let headers = []; // Get table headers - $(`#configtable thead tr th`).each(function () { + $(`#configtable thead tr th`).each(function() { headers.push($(this).text().trim()); }); // Get table rows including hidden ones - $(`#configtable tbody tr`).each(function () { + $(`#configtable tbody tr`).each(function() { let row = {}; - $(this).find('td').each(function (index) { + $(this).find('td').each(function(index) { // Use the headers as keys for JSON let header = headers[index]; row[header] = $(this).text().trim(); @@ -570,19 +573,17 @@ if (!empty($master)) { } }); - return rows; + return rows; } + + + \ No newline at end of file diff --git a/app/Views/editdepartment.php b/app/Views/editdepartment.php index d9449a6b..da283800 100755 --- a/app/Views/editdepartment.php +++ b/app/Views/editdepartment.php @@ -104,7 +104,7 @@
- +
Department Information @@ -136,7 +136,7 @@
- +
@@ -173,13 +173,15 @@ + + + + + \ No newline at end of file diff --git a/app/Views/includes/new_header.php b/app/Views/includes/new_header.php index f9b7d9fd..09edf7c9 100755 --- a/app/Views/includes/new_header.php +++ b/app/Views/includes/new_header.php @@ -634,7 +634,7 @@ - get('roleText') == 'System Administrator' || session()->get('roleText') == 'Auditor'){?> + get('roleText') == 'System Administrator' || session()->get('roleText') == 'Auditor' || session()->get('roleText') == 'Security'){?>
getFlashdata('error'); if ($error) { $type = "error"; diff --git a/app/Views/transporterListing.php b/app/Views/transporterListing.php index ec1bf08b..581d51ee 100755 --- a/app/Views/transporterListing.php +++ b/app/Views/transporterListing.php @@ -251,10 +251,11 @@ $('#tempClick').click(function () { //loader is initiated $('#loader').show(); - - if ($('#transportername').val() === '') { + + if ($('#transportername').val().trim() === '') { alert('Please Enter the Transporter Name'); - return; + $('#loader').hide(); + return false; } var formData = { @@ -275,7 +276,7 @@ success: function (data) { if (data && data.length > 0) { - let isactive = data[0].isactive; + let isactive = data[0]?.isactive; if (isactive == 1 ) { alert(" Transporter with this Name Exists..!!"); } else { alert(" Transporter with this Name Existing in deleted section ..!!"); } @@ -448,4 +449,15 @@ }); + + + + \ No newline at end of file