@ -35,7 +35,7 @@
< div class = "modal fade" id = "mdlAddIncome" >
< div class = "modal-dialog" >
< div class = "modal-content" >
< form action = " <? = url_to ( 'payroll/ emppaytransaddinded') ?> " method = "post" >
< form action = " <? = url_to ( 'payroll/ save emppaytransaddinded') ?> " method = "post" >
< div class = "modal-header" >
< h4 class = "modal-title" > New Payroll Transaction< / h4 >
< button type = "button" class = "close" data-dismiss = "modal" aria-label = "Close" >
@ -67,6 +67,11 @@
< input class = "form-check-input" type = "radio" id = "rdoInPercentageAmount" name = "amount_type" value = "perc" >
< label for = "rdoInPercentageAmount" class = "form-check-label" > Amount is in percentage.< / label >
< / div >
< div class = "form-check" >
< input class = "form-check-input" type = "radio" id = "rdoInDaysBasedAmount" name = "amount_type" value = "daysbased" >
< label for = "rdoInDaysBasedAmount" class = "form-check-label" > Daily based amount.< / label >
< p class = "text-muted" > < small > < i > Your amount entered multiplied by number of days< / i > < / small > < / p >
< / div >
< / div >
< div class = "form-group" >
< label for = "txtInAmount" > Amount< / label >
@ -97,7 +102,7 @@
< div class = "modal fade" id = "mdlAddDeduction" >
< div class = "modal-dialog" >
< div class = "modal-content" >
< form action = " <? = url_to ( 'payroll/ emppaytransaddinded') ?> " method = "post" >
< form action = " <? = url_to ( 'payroll/ save emppaytransaddinded') ?> " method = "post" >
< div class = "modal-header" >
< h4 class = "modal-title" > New Payroll Transaction< / h4 >
< button type = "button" class = "close" data-dismiss = "modal" aria-label = "Close" >
@ -122,22 +127,93 @@
< / div >
< div class = "form-group" >
< div class = "form-check" >
< input class = "form-check-input" type = "radio" id = "rdo In FixedAmount" name = "amount_type" value = "fixed" checked >
< label for = "rdo In FixedAmount" class = "form-check-label" > Fixed amount.< / label >
< input class = "form-check-input" type = "radio" id = "rdo Ded FixedAmount" name = "amount_type" value = "fixed" checked >
< label for = "rdo Ded FixedAmount" class = "form-check-label" > Fixed amount.< / label >
< / div >
< div class = "form-check" >
< input class = "form-check-input" type = "radio" id = "rdoInPercentageAmount" name = "amount_type" value = "perc" >
< label for = "rdoInPercentageAmount" class = "form-check-label" > Amount is in percentage.< / label >
< input class = "form-check-input" type = "radio" id = "rdoDedPercentageAmount" name = "amount_type" value = "perc" >
< label for = "rdoDedPercentageAmount" class = "form-check-label" > Amount is in percentage.< / label >
< / div >
< div class = "form-check" >
< input class = "form-check-input" type = "radio" id = "rdoDedDaysBasedAmount" name = "amount_type" value = "daysbased" >
< label for = "rdoDedDaysBasedAmount" class = "form-check-label" > Daily based amount.< / label >
< p class = "text-muted" > < small > < i > Your amount entered multiplied by number of days< / i > < / small > < / p >
< / div >
< / div >
< div class = "form-group" >
< label for = "txtInAmount" > Amount< / label >
< input class = "form-control" type = "text" id = "txtInAmount" name = "amount" step = "0.01" values = " <? = old ( 'amount' ) ?> " >
< label for = "txt Ded Amount"> Amount< / label >
< input class = "form-control" type = "text" id = "txt Ded Amount" name = "amount" step = "0.01" values = " <? = old ( 'amount' ) ?> " >
< / div >
< div class = "form-group" >
< div class = "custom-control custom-checkbox" >
< input class = "custom-control-input" type = "checkbox" id = "chkInIsOverride" name = "is_override" >
< label for = "chkInIsOverride" class = "custom-control-label" > Override computations if there are any.< / label >
< input class = "custom-control-input" type = "checkbox" id = "chkDedIsOverride" name = "is_override" >
< label for = "chkDedIsOverride" class = "custom-control-label" > Override computations if there are any.< / label >
< p > < small > < i > Override will implement this amount and not the computational amount made like in SSS, Philhealth, Pag-IBIG and taxastion< / i > < / small > < / p >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< div class = "modal-footer" >
< button type = "submit" class = "btn btn-primary" > Save changes< / button >
< button type = "button" class = "btn btn-secondary" data-dismiss = "modal" > Close< / button >
< / div >
< / form >
< / div >
< / div >
< / div >
<!-- Modal Edit Income Deduction -->
< div class = "modal fade" id = "mdlEditIncomeDeduction" >
< div class = "modal-dialog" >
< div class = "modal-content" >
< form action = " <? = url_to ( 'payroll/saveemppaytransaddinded' ) ?> " method = "post" >
< div class = "modal-header bg-warning" >
< h4 class = "modal-title" > Edit Income or Deduction< / h4 >
< button type = "button" class = "close" data-dismiss = "modal" aria-label = "Close" >
< span aria-hidden = "true" > × < / span >
< / button >
< / div >
< div class = "modal-body" >
< div class = "row" >
< div class = "col-12" >
< p class = "lead" > Income or Deduction Information< / p >
< div class = "row" >
< div class = "col-12" >
< div class = "form-group" >
< label for = "txtEditInDedName" > Income Name< / label >
< input class = "form-control" type = "text" readonly id = "txtEditInDedName" name = "inded_name" >
< input type = "hidden" name = "emppaytransinded_id" id = "hdnEditInDedEmpPayTransInDedId" >
< input type = "hidden" name = "emppaytrans_id" id = "hdnEditInDedEmpPayTransId" >
< input type = "hidden" name = "inded_id" id = "hdnEditInDedInDedId" >
< / div >
< div class = "form-group" >
< div class = "form-check" >
< input class = "form-check-input" type = "radio" id = "rdoEditInDedFixedAmount" name = "amount_type" value = "fixed" checked >
< label for = "rdoEditInDedFixedAmount" class = "form-check-label" > Fixed amount.< / label >
< / div >
< div class = "form-check" >
< input class = "form-check-input" type = "radio" id = "rdoEditInDedPercentageAmount" name = "amount_type" value = "perc" >
< label for = "rdoEditInDedPercentageAmount" class = "form-check-label" > Amount is in percentage.< / label >
< / div >
< div class = "form-check" >
< input class = "form-check-input" type = "radio" id = "rdoEditInDedDaysBasedAmount" name = "amount_type" value = "daysbased" >
< label for = "rdoEditInDedDaysBasedAmount" class = "form-check-label" > Daily based amount.< / label >
< p class = "text-muted" > < small > < i > Your amount entered multiplied by number of days< / i > < / small > < / p >
< / div >
< / div >
< div class = "form-group" >
< label for = "txtEditInDedAmount" > Amount< / label >
< input class = "form-control" type = "text" id = "txtEditInDedAmount" name = "amount" step = "0.01" values = " <? = old ( 'amount' ) ?> " >
< p id = "lblEditInDed_daysbased" > < / p >
< / div >
< div class = "form-group" >
< div class = "custom-control custom-checkbox" >
< input class = "custom-control-input" type = "checkbox" id = "chkEditInDedIsOverride" name = "is_override" >
< label for = "chkEditInDedIsOverride" class = "custom-control-label" > Override computations if there are any.< / label >
< p > < small > < i > Override will implement this amount and not the computational amount made like in SSS, Philhealth, Pag-IBIG and taxastion< / i > < / small > < / p >
< / div >
< / div >
@ -347,6 +423,18 @@
<?php if ( $empPayTransInDed -> is_income ) echo number_format ( $empPayTransInDed -> amount , 2 , "." , "," ); else echo " " ; ?>
< / td >
< td >
< a href = "#" class = "ml-3" data-toggle = "tooltip" title = "Edit Income or Deduction"
data-emppaytransinded_id="<? = $empPayTransInDed -> emppaytransinded_id ?> "
data-emppaytrans_id="<? = $empPayTransInDed -> emppaytrans_id ?> "
data-inded_id="<? = $empPayTransInDed -> inded_id ?> "
data-inded_name="<? = $empPayTransInDed -> inded_name ?> "
data-is_fixed_amt="<? = $empPayTransInDed -> is_fixed_amt ?> "
data-is_percent_amt="<? = $empPayTransInDed -> is_percent_amt ?> "
data-worked_days_based="<? = $empPayTransInDed -> worked_days_based ?> "
data-amount="<? = $empPayTransInDed -> amount ?> "
data-base_amount="<? = $empPayTransInDed -> base_amount ?> "
data-is_override="<? = $empPayTransInDed -> is_override ?> "
onclick="editIncomeDeduction(this)">< i class = "fas fa-edit " > < / i > < / a >
< a href = "/payroll/emppaytransdelinded/ <? = $empPayTransInDed -> emppaytransinded_id . '/' . $empPayTransInDed -> emppaytrans_id ?> " onclick = "return confirm('Are you sure you want to delete this item?')" class = "ml-3" data-toggle = "tooltip" title = "Delete Employee Information" >< i class = "fas fa-trash " ></ i ></ a >
< / td >
< / tr >
@ -434,6 +522,32 @@ function showEmpPayTransDetails(emppaytransid)
$("#txtDedEmpPayTransId").val(emppaytransid);
}
function editIncomeDeduction(element)
{
$('#hdnEditInDedEmpPayTransInDedId').val($(element).data("emppaytransinded_id"));
$('#hdnEditInDedEmpPayTransId').val($(element).data("emppaytrans_id"));
$('#hdnEditInDedInDedId').val($(element).data("inded_id"));
$('#txtEditInDedName').val($(element).data('inded_name'));
$('[name="amount_type"][value="' + ($(element).data('is_fixed_amt') ? 'fixed' : ($(element).data('is_percent_amt') ? 'perc' : 'daysbased')) + '"]').prop('checked', true);
if($(element).data('worked_days_based'))
{
$('#txtEditInDedAmount').val($(element).data('base_amount'));
$('#lblEditInDed_daysbased').html('Computed amount is ' + $(element).data('amount'))
}
else
{
$('#txtEditInDedAmount').val($(element).data('amount'));
$('#lblEditInDed_daysbased').html('');
}
$('#chkEditInDedIsOverride').prop('checked', $(element).data('is_override'));
$('#mdlEditIncomeDeduction').modal('show');
}
< / script >
<? = $this -> endSection () ?>