|
|
|
@ -76,28 +76,42 @@
|
|
|
|
|
<label for="txtSavingsAccount">Savings Account Number</label>
|
|
|
|
|
<input class="form-control" type="text" id="txtSavingsAccount" name="savings_account" value="<?= old('savings_account') ?>">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label>Select Work Days</label>
|
|
|
|
|
<select class="form-control" style="width: 100%;" name="work_days" id="lstWorkDays">
|
|
|
|
|
<option value="261">No work and not paid on Sat and Sun or Rest Day</option>
|
|
|
|
|
<option value="313">No work and not paid on Sun or Rest Day</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="txtMonthlyBasicPay">Monthly Basic Salary</label>
|
|
|
|
|
<div class="input-group mb-3">
|
|
|
|
|
<input class="form-control rounded-0" type="text" id="txtMonthlyBasicPay" name="basic_monthly_pay" values="<?= old('basic_monthly_pay') ?>">
|
|
|
|
|
<input class="form-control rounded-0" type="number" id="txtMonthlyBasicPay" 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()">Compute</button>
|
|
|
|
|
<button type="button" class="btn btn-info btn-flat" onclick="computeBasicPay('fromMonthly')">Compute</button>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<p><small><i>Click compute so other salary field will be filled with computed value</i></small></p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="txtSemiMonthlyBasicPay">Semi-monthly Basic Salary</label>
|
|
|
|
|
<input class="form-control" type="text" id="txtSemiMonthlyBasicPay" name="basic_semi_monthly_pay" value="<?= old('basic_semi_monthly_pay') ?>">
|
|
|
|
|
<input class="form-control" type="number" id="txtSemiMonthlyBasicPay" name="basic_semi_monthly_pay" value="<?= old('basic_semi_monthly_pay') ?>">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="txtDailyBasicPay">Daily Basic Salary</label>
|
|
|
|
|
<input class="form-control" type="text" id="txtDailyBasicPay" name="basic_daily_pay" value="<?= old('basic_daily_pay') ?>">
|
|
|
|
|
<label for="txtDailyBasicPay">Daily Basic Salary</label>
|
|
|
|
|
<div class="input-group mb-3">
|
|
|
|
|
<input class="form-control rounded-0" type="number" id="txtDailyBasicPay" 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>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<p><small><i>Click compute so other salary field will be filled with computed value</i></small></p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="txtHourlyBasicPay">Hourly Basic Salary</label>
|
|
|
|
|
<input class="form-control" type="text" id="txtHourlyBasicPay" name="basic_hourly_pay" value="<?= old('basic_hourly_pay') ?>">
|
|
|
|
|
<input class="form-control" type="number" id="txtHourlyBasicPay" name="basic_hourly_pay" value="<?= old('basic_hourly_pay') ?>">
|
|
|
|
|
</div>
|
|
|
|
|
<p id="txtSalaryFormula"></p>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<div class="custom-control custom-checkbox">
|
|
|
|
|
<input class="custom-control-input" type="checkbox" id="chkHasCola" name="has_cola">
|
|
|
|
@ -194,11 +208,27 @@ $(document).ready(function() {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function computeBasicPay()
|
|
|
|
|
function computeBasicPay(fromSource)
|
|
|
|
|
{
|
|
|
|
|
$("#txtSemiMonthlyBasicPay").val($("#txtMonthlyBasicPay").val() / 2);
|
|
|
|
|
$("#txtDailyBasicPay").val($("#txtMonthlyBasicPay").val() * 12 / 313);
|
|
|
|
|
$("#txtHourlyBasicPay").val($("#txtMonthlyBasicPay").val() * 12 / 313 / 8);
|
|
|
|
|
var monthlyBasic = 0;
|
|
|
|
|
|
|
|
|
|
switch(fromSource)
|
|
|
|
|
{
|
|
|
|
|
case 'fromDaily':
|
|
|
|
|
monthlyBasic = Number($("#txtDailyBasicPay").val()) * Number($("#lstWorkDays").val()) / 12;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'fromMonthly':
|
|
|
|
|
monthlyBasic = Number($("#txtMonthlyBasicPay").val());
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(fromSource != 'fromMonthly') $("#txtMonthlyBasicPay").val(monthlyBasic);
|
|
|
|
|
$("#txtSemiMonthlyBasicPay").val(monthlyBasic / 2);
|
|
|
|
|
if(fromSource != 'fromDaily') $("#txtDailyBasicPay").val(monthlyBasic * 12 / Number($("#lstWorkDays").val()));
|
|
|
|
|
$("#txtHourlyBasicPay").val(monthlyBasic * 12 / Number($("#lstWorkDays").val()) / 8);
|
|
|
|
|
|
|
|
|
|
$("#txtSalaryFormula").html("Formula: Basic Salary x 12 x " + $("#lstWorkDays").val());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|