employee module changes-1 vadivel J 12-12-2024

This commit is contained in:
vadivelJ96 2024-12-12 10:14:50 +05:30
parent 4f4d2747e9
commit 450c8acd06
5 changed files with 53 additions and 55 deletions

View File

@ -379,7 +379,12 @@ class StockController extends BaseController
->where('id', $id)
->first();
!empty($resultExists) ? $updates[] = $dbData : $inserts[] = $dbData;
if(!empty($resultExists)){
$dbData['id'] = $resultExists['id'];
$updates[] = $dbData ;
}else{
$inserts[] = $dbData;
}
}

View File

@ -771,10 +771,8 @@
<div class="col-md-3"><label>IFSC Code</label></span><span
class="badge">*</span>
<input type="text" id="ifsccode" name="ifsccode"
title="Only letters and numbers are allowed"
onchange="ifscCodeValidation(this.value)"
class="form-control" onkeypress="return alpha(event);"
style="text-transform: uppercase" required>
title="Only letters and numbers are allowed" onkeyup="convertToUpperCase()"
class="form-control" onkeypress="return alpha(event);" required>
</div>
<div class="col-md-3"><label>Bank Address</label>
<input type="text" id="bankaddress" name="bankaddress"
@ -1557,18 +1555,15 @@
);
}
function ifscCodeValidation(value) {
// Define the regex pattern for a valid IFSC code
const ifscPattern = /^[A-Z]{4}0[A-Z0-9]{6}$/;
// Check if the value matches the pattern
if (ifscPattern.test(capitalizeFirstFourLetters(value))) {
return;
} else {
alert("Invalid IFSC Code. Please enter a valid one.");
$('#ifsccode').val('');
return;
}
</script>
<script>
function convertToUpperCase() {
const input = document.getElementById("ifsccode");
input.value = input.value.toUpperCase();
}
</script>

View File

@ -690,8 +690,7 @@ if (!empty($EmpDetails)) {
</div>
<div class="col-md-3">
<label>IFSC Code</label>
<input type="text" id="ifsccode" name="ifsccode"
onchange="ifscCodeValidation(this.value)"
<input type="text" id="ifsccode" name="ifsccode" onkeyup="convertToUpperCase()"
placeholder="IFSC Code" class="form-control"
value="<?php echo $IFSCCode; ?>">
</div>
@ -1169,7 +1168,8 @@ if (!empty($EmpDetails)) {
<input type="text" id="aadharno" name="aadharno"
maxlength="14" onchange="ValidateAadhar();"
class="form-control"
onkeypress="return isNumberKey(event)" required>
onkeypress="return isNumberKey(event)" required
value="<?= $AadharNo ?>">
</div>
<div class="col-md-4">
<label>Aadhar File Name</label>
@ -1190,7 +1190,8 @@ if (!empty($EmpDetails)) {
onchange="validatePAN();" class="form-control"
pattern="([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}"
title=" 5 character,4 Digit Numbers,1 character (ex:ABCDE1234A) "
onkeypress="return alpha(event);">
onkeypress="return alpha(event);"
value="<?= $PANNo ?>" >
</div>
<div class="col-md-4">
<label>PAN File Name</label>
@ -1208,6 +1209,7 @@ if (!empty($EmpDetails)) {
<div class="col-md-4"><label>Passport Number</label>
<input type="text" id="passportno" maxlength="9"
name="passportno" style="text-transform:uppercase"
value="<?= $PassportNo ?>"
class="form-control"
pattern="^[A-Z][1-9]\d\s?\d{4}[1-9]$"
title="
@ -1367,13 +1369,7 @@ if (!empty($EmpDetails)) {
if (aadhar != '') // && aadhar_count != '')
{
//alert('this is aadhar :'+aadhar);
// if(aadhar_count < 14)
// {
// //alert(aadhar1);
// alert('Aadhar card should be in 12 digits');
// }
// else
if (reg.test(aadhar) == false) {
//alert('alskdjsakjf');
alert('Please Enter Valid Aadhar Number');
@ -1383,12 +1379,7 @@ if (!empty($EmpDetails)) {
return true;
}
}
//else
//{
//alert('aadhar is blank');
//alert('please Enter Aadhar number');
//}
}
@ -2065,19 +2056,16 @@ if (!empty($EmpDetails)) {
);
}
function ifscCodeValidation(value) {
// Define the regex pattern for a valid IFSC code
const ifscPattern = /^[A-Z]{4}0[A-Z0-9]{6}$/;
// Check if the value matches the pattern
if (ifscPattern.test(capitalizeFirstFourLetters(value))) {
return;
} else {
alert("Invalid IFSC Code. Please enter a valid one.");
$('#ifsccode').val('');
return;
}
</script>
<script>
function convertToUpperCase() {
const input = document.getElementById("ifsccode");
input.value = input.value.toUpperCase();
}
</script>

View File

@ -116,6 +116,7 @@
<th>Employee Name</th>
<th>Contact Number</th>
<th>Designation</th>
<th>Date Of Joining</th>
<th>Department</th>
<th>Active</th>
</tr>
@ -124,6 +125,9 @@
<?php
if (!empty($userRecords)) {
foreach ($userRecords as $record) {
$dateOfJoining = new DateTime($record->DateofJoining);
$dateOfJoining = $dateOfJoining->format('d-m-Y');
?>
<tr>
<?php if (date('d-m-Y', strtotime($record->Created_date)) == "30-11--0001") {
@ -135,7 +139,9 @@
<td><?php echo $record->FirstName; ?></td>
<td><?php echo $record->ContactNumber ?></td>
<td><?php echo $record->Designation ?></td>
<td><?php echo $dateOfJoining?></td>
<td><?php echo $record->DepartmentName ?></td>
<td><?php echo ($record->IsActive == 1) ? ' Active ' : ' In Active '; ?></td>
</tr>
<?php

View File

@ -699,8 +699,8 @@
let _140Mm = row.find('td:eq(17)').text().trim();
let _200Mm = row.find('td:eq(18)').text().trim();
let _300Mm = row.find('td:eq(19)').text().trim();
let total = row.find('td:eq(20)').text().trim();
let pan = row.find('td:eq(21)').text().trim();
let pan = row.find('td:eq(20)').text().trim();
let total = row.find('td:eq(21)').text().trim();
let plus20loss = row.find('td:eq(24)').text().trim();
let plus30Loss = row.find('td:eq(25)').text().trim();
let moistureSpec = row.find('td:eq(26)').text().trim();
@ -778,20 +778,24 @@
let sieveLossQty = parseFloat($('#sieveLossQty').val().trim());
let salableQty = parseFloat($('#salableQty').val().trim());
let newTotal = _10Mm + _20Mm + _30Mm + _40Mm + _50Mm + _70Mm + _100Mm + _140Mm + _200Mm + _300Mm + pan;
let newTotal = (_10Mm + _20Mm + _30Mm + _40Mm + _50Mm + _70Mm + _100Mm + _140Mm + _200Mm + _300Mm + pan).toFixed(2);
let newPlus20Loss = _10Mm + _20Mm ;
let newPlus20Loss = (_10Mm + _20Mm).toFixed(2) ;
let newPlus30Loss = _10Mm + _20Mm + _30Mm ;
console.log(newPlus20Loss);
let newPlus30Loss =( _10Mm + _20Mm + _30Mm).toFixed(2) ;
console.log(newPlus30Loss);
let newSieveLossQty = Math.floor((qty * newPlus30Loss) / 100);
let newSieveLossQty = ((qty * newPlus30Loss) / 100).toFixed(2);;
let newMoistureLoss = moistureActual - moistureSpec ;
let newMoistureLoss = (moistureActual - moistureSpec).toFixed(2); ;
let newMoistureLossQty = Math.round((qty * newMoistureLoss) / 100 ) ;
let newMoistureLossQty = ((qty * newMoistureLoss) / 100 ).toFixed(2); ;
let newSalableQty = Math.floor(qty - newMoistureLossQty - newSieveLossQty);
let newSalableQty = (qty - newMoistureLossQty - newSieveLossQty).toFixed(2);