|
|
|
@ -236,7 +236,7 @@
|
|
|
|
|
<div class="input-group mb-3">
|
|
|
|
|
<input class="form-control rounded-0" type="text" id="txtEditMonthlyBasicPay" name="basic_monthly_pay" values="<?= old('basic_monthly_pay') ?>">
|
|
|
|
|
<span class="input-group-append">
|
|
|
|
|
<button type="button" class="btn btn-info btn-flat" onclick="computeBasicPay('fromMonthly')">Compute</button>
|
|
|
|
|
<button type="button" class="btn btn-info btn-flat" onclick="computeBasicPayOnEditMode('fromMonthly')">Compute</button>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<p><small><i>Click compute so other salary field will be filled with computed value</i></small></p>
|
|
|
|
@ -250,7 +250,7 @@
|
|
|
|
|
<div class="input-group mb-3">
|
|
|
|
|
<input class="form-control rounded-0" type="text" id="txtEditDailyBasicPay" name="basic_daily_pay" values="<?= old('basic_daily_pay') ?>">
|
|
|
|
|
<span class="input-group-append">
|
|
|
|
|
<button type="button" class="btn btn-info btn-flat" onclick="computeBasicPay('fromDaily')">Compute</button>
|
|
|
|
|
<button type="button" class="btn btn-info btn-flat" onclick="computeBasicPayOnEditMode('fromDaily')">Compute</button>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<p><small><i>Click compute so other salary field will be filled with computed value</i></small></p>
|
|
|
|
@ -390,6 +390,29 @@ function computeBasicPay(fromSource)
|
|
|
|
|
$("#txtSalaryFormula").html("Formula: Basic Salary x 12 / " + $("#lstWorkDays").val());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function computeBasicPayOnEditMode(fromSource)
|
|
|
|
|
{
|
|
|
|
|
var monthlyBasic = 0;
|
|
|
|
|
|
|
|
|
|
switch(fromSource)
|
|
|
|
|
{
|
|
|
|
|
case 'fromDaily':
|
|
|
|
|
monthlyBasic = Number($("#txtEditDailyBasicPay").val()) * Number($("#cmbEditWorkDays").val()) / 12;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'fromMonthly':
|
|
|
|
|
monthlyBasic = Number($("#txtEditMonthlyBasicPay").val());
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(fromSource != 'fromMonthly') $("#txtEditMonthlyBasicPay").val(monthlyBasic);
|
|
|
|
|
$("#txtEditSemiMonthlyBasicPay").val(monthlyBasic / 2);
|
|
|
|
|
if(fromSource != 'fromDaily') $("#txtEditDailyBasicPay").val(monthlyBasic * 12 / Number($("#cmbEditWorkDays").val()));
|
|
|
|
|
$("#txtEditHourlyBasicPay").val(monthlyBasic * 12 / Number($("#cmbEditWorkDays").val()) / 8);
|
|
|
|
|
|
|
|
|
|
$("#txtEditSalaryFormula").html("Formula: Basic Salary x 12 / " + $("#cmbEditWorkDays").val());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function editEmpPayInfo(element)
|
|
|
|
|
{
|
|
|
|
|
$("#hdnEditEmpPayId").val($(element).data("emppay_id"));
|
|
|
|
|