diff --git a/app/Controllers/Emergencypurchaseorder.php b/app/Controllers/Emergencypurchaseorder.php index 4cecdeb2..971bfd1b 100755 --- a/app/Controllers/Emergencypurchaseorder.php +++ b/app/Controllers/Emergencypurchaseorder.php @@ -372,7 +372,9 @@ class Emergencypurchaseorder extends BaseController // redirect('purchaseorder/PurchaseOrderList', 'refresh'); // } if ($POStatus == REQ_DRAFT) { + echo ""; $this->session->setFlashdata('success', 'You Have Successfully Saved the Purchase order! '.$PONO); + } else { $this->session->setFlashdata('success', 'You Have Successfully Created the Purchase order! '.$PONO); } diff --git a/app/Controllers/Payslip.php b/app/Controllers/Payslip.php index edaec602..5de14363 100755 --- a/app/Controllers/Payslip.php +++ b/app/Controllers/Payslip.php @@ -67,7 +67,7 @@ class Payslip extends BaseController $PayOn = $this->request->getPost('payon'); $EmpId = $this->request->getPost('employee'); - + $res = $this->payroll_model->getMonthlyPayDetails($EmpId, $PayOn); $result = $res[0]; @@ -83,10 +83,13 @@ class Payslip extends BaseController { $loan_id = $result->Loan_ID; + if($result->Remaining_Due - 1 == 0){ $is_Active = 0; }else{ $is_Active = 1; } + $loan = [ 'Paid_Due' => $result->Paid_Due + 1, 'Remaining_Due' => $result->Remaining_Due - 1, 'Paid_Amount' => $result->Paid_Amount + $result->Loan_Recovered, + 'is_Active' => $is_Active ]; $loanHistory = [ @@ -130,11 +133,16 @@ class Payslip extends BaseController 'ESINumber' => $result->ESINO, 'UANNO' => $result->PFNO, ]; + + // print_r($result); // print_r($loan); // print_r($loanHistory); // print_r($data); // die; + + + $insert = $this->payroll_model->insertPayroll($data); if($insert){ if(count($loan)){ @@ -703,7 +711,7 @@ class Payslip extends BaseController $data['pf'] = $pf; $data['over_time'] = $ot; -// dd($data); + $this->global['pageTitle'] = 'Payroll Monthly Inputs'; $this->loadViews("monthlypayinputs", $this->global, $data, NULL); } diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index cba0bdc7..fba5c928 100755 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -3259,13 +3259,21 @@ if (!empty($getlogpodtl)) { tinyMCE.get('EdittxtSpcialInstruction').setContent($('#ItemDescription' + userid).val()); RequistQuantity = $('#quantity' + userid).val(); - + $("#EditMaterialCode").empty(); - var Material = ; - // For Binding Material list center for the selected Requistion Number + $("#EditMaterialCode").append($('') + .val($('#materialCode' + userid).val()) + .html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()) + .prop('selected', true) + ); + // Make the select element read-only (disable it) + $("#EditMaterialCode").prop('disabled', true); - // $("#EditMaterialCode").append($('').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val())); + + + // For Binding Material list center for the selected Requistion Number + var Material = ; var isAdded = "0"; for (i = 0; i < Material.length; i++) { @@ -3302,6 +3310,11 @@ if (!empty($getlogpodtl)) { } }); + + + + + $("#VIEWSERVICE").on("shown.bs.modal", function(e) { userid = $(e.relatedTarget).data('userid'); diff --git a/app/Views/alterpurchaseorder.php b/app/Views/alterpurchaseorder.php index f5d159c7..41b16547 100755 --- a/app/Views/alterpurchaseorder.php +++ b/app/Views/alterpurchaseorder.php @@ -36,12 +36,14 @@ if (!empty($INRSYMBOL)) { '; - // print_r($month); - // print_r($fresh); - // print_r($sample); - // echo '
';
- // foreach ($sample as $s) {
- // if (!empty($s->Key)) {
- // $show_hide_column_value = false;
- // } else {
- // $show_hide_column_value = true;
- // }
- // break;
- // }
$sample = $fresh;
$ex = explode('-', $dropdownvalue);
@@ -173,42 +169,35 @@
+ style="background-color:#fff;font-size:12px;white-space: nowrap;">
- S.No
- Emp ID
- Employee
- DOJ
- Designation
- Total Days
- Days Worked
- LOP Days
- Paid Leave
- OT Hrs
-
- Basic Salary
- Pre Day Salary
- Worked Salary
- Pre hr Salary
- Earned Salary
- Basic Salary(0.7)
- HRA Salary(0.3)
- Gross Salary
- ESI
- PF
- Over Time
-
-
-
- Auto Loan Due ₹
-
-
- TDS Deductions in ₹
- Festival Bonus in ₹
-
- Estimate in ₹
+ S.No
+ Emp ID
+ Employee
+ DOJ
+ Designation
+ Total Days
+ Days Worked
+ LOP Days
+ Paid Leave
+ OT Hrs
+ Total Salary
+ Per Day Salary
+ Worked Salary
+ Per hr Salary
+ Earned Salary
+ Basic Salary(0.7)
+ HRA Salary(0.3)
+ Gross Salary
+ ESI
+ PF
+ Over Time
+ Auto Loan Due ₹
+ TDS Deductions in ₹
+ Festival Bonus in ₹
+ Estimate in ₹
@@ -231,69 +220,78 @@
$index--;
} else {
array_push($testarray, $record->EmpID);
- ?>
+ ?>
EmpID; ?>
- FirstName; ?>
-
+ is_management_team == 1){ ?> style="max-width:150px;background-color: #d8d8ea;" style="max-width:150px;" >
+ FirstName; ?>
+
+
DateofJoining;
- // $date = DateTime::createFromFormat('Y-m-d H:i:s', $record->DateofJoining);
- // $newDateFormat = $date->format('d-m-Y');
- // echo $newDateFormat;
+ $date = DateTime::createFromFormat('Y-m-d H:i:s', $record->DateofJoining);
+ $newDateFormat = $date->format('d-m-Y');
+ echo $newDateFormat;
?>
- Designation; ?>
- NoofDays; ?>
+
+
+
+ NoofDays; ?>
+
Key)) {
echo "contenteditable='false';";
} ?>
Key)) { ?> title="Payslip Calculated"
- style="text-align:right;color:blue;"
- style="text-align:right;" >
+ style="text-align:center;color:blue;"
+ style="text-align:center;" >
Days_worked)) {
echo $record->Days_worked + $record->sunday_count;
} else {
echo "0.00";
} ?>
+
Key)) {
echo "contenteditable='false';";
} ?>
Key)) { ?> title="Payslip Calculated"
- style="text-align:right;color:blue;"
- style="text-align:right;" >
+ style="text-align:center;color:blue;"
+ style="text-align:center;" >
LOP_Days)) {
echo $record->LOP_Days;
} else {
echo "0.00";
} ?>
+
Key)) {
echo "contenteditable='false';";
} ?>
Key)) { ?> title="Payslip Calculated"
- style="text-align:right;color:blue;"
- style="text-align:right;" >
+ style="text-align:center;color:blue;"
+ style="text-align:center;" >
Paid_leave)) {
echo number_format($record->Paid_leave, 2, '.', '');
} else {
echo number_format(0.00, 2, '.', '');
} ?>
+
Key)) {
echo "contenteditable='false';";
} ?>
Key)) { ?> title="Payslip Calculated"
- style="text-align:right;color:blue;"
- style="text-align:right;" >
+ style="text-align:center;color:blue;"
+ style="text-align:center;" >
OT_Hrs_Worked)) {
echo $record->OT_Hrs_Worked;
} else {
@@ -301,60 +299,47 @@
} ?>
- TotalSalary; ?>
-
+ TotalSalary; ?>
+
+
TotalSalary / $record->NoofDays;
echo number_format($perDaySalary, 2, '.', ''); ?>
-
+
+
Days_worked + $record->sunday_count);
echo number_format($workedSalary, 2, '.', ''); ?>
-
+
+
-
-
+
+
+
+
-
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
Key)) {
- echo "contenteditable='true';";
- } ?>
+ Key)) { echo "contenteditable='true';"; } ?>
Key)) { ?> title="Payslip Calculated"
style="text-align:right;color:blue;"
style="text-align:right;" >
@@ -368,7 +353,6 @@
-
Key)) {
echo "contenteditable='true';";
@@ -410,7 +394,7 @@
echo "contenteditable='false';";
} ?>
Key)) { ?> title="Payslip Calculated"
- style="text-align:right;color:blue;" >
+ style="text-align:right;color:blue;" style="text-align:right;" >
Estimate)) {
echo $record->Estimate;
$estTotal[] = $record->Estimate;
@@ -478,20 +462,19 @@
-
-
Total
-
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -530,21 +513,21 @@
var totalmonthloan = [];
- $(function() {
- var i = 0;
- $('tr.lastvalue').each(function() {
- i = i + 1;
- estTotal[i] = $(this).find('td').eq(11).text();
- });
+ // $(function() {
+ // var i = 0;
+ // $('tr.lastvalue').each(function() {
+ // i = i + 1;
+ // estTotal[i] = $(this).find('td').eq(11).text();
+ // });
- var i = 0;
- $('tr.lastvalue').each(function() {
- i = i + 1;
- totalotherDet[i] = $(this).find('td').eq(9).text();
- });
+ // var i = 0;
+ // $('tr.lastvalue').each(function() {
+ // i = i + 1;
+ // totalotherDet[i] = $(this).find('td').eq(9).text();
+ // });
@@ -553,29 +536,29 @@
- var i = 0;
- $('tr.lastvalue').each(function() {
- i = i + 1;
- totalmonthloan[i] = $(this).find('td').eq(7).text();
- });
+ // var i = 0;
+ // $('tr.lastvalue').each(function() {
+ // i = i + 1;
+ // totalmonthloan[i] = $(this).find('td').eq(7).text();
+ // });
- t.on('order.dt search.dt', function() {
- t.column(0, {
- search: 'applied',
- order: 'applied'
- }).nodes().each(function(cell, i) {
- cell.innerHTML = i + 1;
- });
- }).draw();
+ // t.on('order.dt search.dt', function() {
+ // t.column(0, {
+ // search: 'applied',
+ // order: 'applied'
+ // }).nodes().each(function(cell, i) {
+ // cell.innerHTML = i + 1;
+ // });
+ // }).draw();
- var s = "";
- $('#monthyear').val(s);
+ // var s = "";
+ // $('#monthyear').val(s);
- savebuttonvalidation();
+ // savebuttonvalidation();
- });
+ // });
function isNumber(evt) {
@@ -606,7 +589,7 @@
alldata = JSON.stringify(alldata)
// Parse the JSON string back into an array of objects
alldata = JSON.parse(alldata);
-console.log(alldata);
+
// Filter out objects where "Emp ID" is empty
alldata = alldata.filter(function(item) {
return item["Emp ID"].trim() !== "";
@@ -626,15 +609,11 @@ console.log(alldata);
type: "POST",
url: "payslip/saveMonthlyData",
success: function(data) {
- console.log(data);
-
+
if (data) {
-
$('#loader').hide();
alert(data);
- //console.log(data);
-
-
+
}
}
@@ -703,14 +682,8 @@ console.log(alldata);
var grandtotal = [];
function changeInput(event, k) {
-
-
-
-
var str = event.target.id;
var sno = str.substr(8);
-
-
var dayWorks = parseFloat(document.getElementById('dayWork' + sno).textContent);
var lopDay = parseFloat(document.getElementById('lopDay' + sno).textContent);
var paidLeave = parseFloat(document.getElementById('paidLeave' + sno).textContent);
@@ -766,18 +739,18 @@ console.log(alldata);
var dayWorkPaid = dayWorks + paidLeave;
}
- console.log("day" + dayWorkPaid);
+
var NoofDays = dayWorks + paidLeave + lopDay;
- console.log("monthday" + NoofDays);
+
var Food_Allowances = fAllow * dayWorks;
- // console.log("workedFA"+Food_Allowances);
+
var daySalary = bpay / NoofDays;
- console.log("1daysalary " + daySalary);
+
var dayHra = hraAmt / NoofDays;
- console.log("1dayHRA" + dayHra);
+
var onehoursSalary = (daySalary + dayHra) / 8;
- console.log("onehours " + onehoursSalary);
+
var totSalayOT = 0;
@@ -786,21 +759,23 @@ console.log(alldata);
} else {
totSalayOT = 0;
}
- console.log(totSalayOT);
+
var currentDaySalary = daySalary * dayWorkPaid;
- console.log("11days salary" + currentDaySalary);
+
var currentDayHra = dayHra * dayWorkPaid;
- console.log("11days hra" + currentDayHra);
+
var current_loan_amt = 0;
var autoLoan = parseFloat(monthDue);
+
var Balance_Amount = loanamt - paidamt;
+
if (autoLoan > Balance_Amount) {
if (duedate <= finalpaydate) {
current_loan_amt = Balance_Amount;
@@ -808,19 +783,19 @@ console.log(alldata);
} else {
current_loan_amt = autoLoan;
}
-
+
if (parseFloat(Festival) == parseFloat(Festival)) {
var Festivals = parseFloat(Festival);
- //console.log("Festivals"+Festivals);
+
}
if (parseFloat(otherDet) == parseFloat(otherDet)) {
var otherDets = parseFloat(otherDet);
- //console.log("otherDets"+ otherDets);
+
}
@@ -845,12 +820,9 @@ console.log(alldata);
var empSalaryAdd = currentDaySalary + totSalayOT + currentDayHra + Festivals;
- console.log("empSalaryAdd " + empSalaryAdd);
+
var empSalarySub = current_loan_amt + esiAmount + pfAmount + otherDets;
- console.log("current_loan_amt " + current_loan_amt);
- console.log("esiAmount " + esiAmount);
- console.log("pfAmount " + pfAmount);
- console.log("otherDets " + otherDets);
+
var empMonthSalary = empSalaryAdd - empSalarySub
@@ -864,19 +836,16 @@ console.log(alldata);
document.getElementById("empsal" + sno).innerHTML = cals;
- $.each(estTotal, function(i, value) {
- if (sno == i) {
- estTotal[i] = cals;
- }
- });
-
-
- $.each(totalotherDet, function(i, value) {
- if (sno == i) {
- totalotherDet[i] = otherDet;
- }
- });
-
+ // $.each(estTotal, function(i, value) {
+ // if (sno == i) {
+ // estTotal[i] = cals;
+ // }
+ // });
+ // $.each(totalotherDet, function(i, value) {
+ // if (sno == i) {
+ // totalotherDet[i] = otherDet;
+ // }
+ // });
// $.each(totalmonthloan, function(i, value) {
// if (sno == i) {
// totalmonthloan[i] = loanRecd;
@@ -887,85 +856,47 @@ console.log(alldata);
calculategrandtotal();
}
- var tempTotal = [];
+
+ function calculategrandtotal()
+ {
+ var AutoLoanDueIndex = 21;
+ var AutoLoanDue = 0;
+ $('#monthlylistings tbody tr').each(function() {
+ var value = $(this).find('td').eq(AutoLoanDueIndex).text();
+ AutoLoanDue += parseFloat(value) || 0;
+ });
+ $('#monthloan').text(AutoLoanDue);
- function calculategrandtotal() {
-
-
-
- var sum = 0;
-
- for (var i = 0; i < tempTotal.length; i++) {
- sum += tempTotal[i] << 0;
- }
-
- $('#inst').text(parseFloat(sum).toFixed(2));
-
- $.each(totalotherDet, function(index, value) {
- //var res2 = value.split('-');
- tempTotal[index] = parseFloat(value);
- });
-
- var sum = 0;
-
- for (var i = 0; i < tempTotal.length; i++) {
- sum += tempTotal[i] << 0;
- }
- $('#other').text(parseFloat(sum).toFixed(2));
-
- $.each(totalfestival, function(index, value) {
- //var res2 = value.split('-');
- tempTotal[index] = parseFloat(value);
- });
-
- var sum = 0;
-
- for (var i = 0; i < tempTotal.length; i++) {
- sum += tempTotal[i] << 0;
- }
- $('#fest').text(parseFloat(sum).toFixed(2));
-
-
-
- $.each(estTotal, function(index, value) {
- //var res2 = value.split('-');
- tempTotal[index] = parseFloat(value);
- });
-
- var sum = 0;
-
- for (var i = 0; i < tempTotal.length; i++) {
- sum += tempTotal[i] << 0;
- }
- $('#estsal').text(parseFloat(sum).toFixed(2));
-
-
-
-
- $.each(totalmonthloan, function(index, value) {
- tempTotal[index] = parseFloat(value);
- });
-
- var sum = 0;
-
- for (var i = 0; i < tempTotal.length; i++) {
- sum += tempTotal[i] << 0;
- }
- $('#monthloan').text(parseFloat(sum).toFixed(2));
+ var TDSDeductionsIndex = 22;
+ var TDSDeductions = 0;
+ $('#monthlylistings tbody tr').each(function() {
+ var value = $(this).find('td').eq(TDSDeductionsIndex).text();
+ TDSDeductions += parseFloat(value) || 0;
+ });
+ $('#other').text(TDSDeductions);
+ var FestivalBonusIndex = 23;
+ var FestivalBonus = 0;
+ $('#monthlylistings tbody tr').each(function() {
+ var value = $(this).find('td').eq(FestivalBonusIndex).text();
+ FestivalBonus += parseFloat(value) || 0;
+ });
+ $('#fest').text(FestivalBonus);
+ var EstimateIndex = 24;
+ var Estimate = 0;
+ $('#monthlylistings tbody tr').each(function() {
+ var value = $(this).find('td').eq(EstimateIndex).text();
+ Estimate += parseFloat(value) || 0;
+ });
+ $('#estsal').text(Estimate);
+
}
+
- function show_hide_column(col_no, do_show) {
- var rows = document.getElementById('monthlylistings').rows;
- for (var row = 0; row < rows.length; row++) {
- var cols = rows[row].cells;
- if (col_no >= 0 && col_no < cols.length) {
- cols[col_no].style.display = do_show ? '' : 'none';
- }
- }
- }
+
+
\ No newline at end of file