You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
440 lines
22 KiB
PHP
440 lines
22 KiB
PHP
<!-- Extend area where template is defined -->
|
|
<?= $this->extend('templates/adminlte/generalcontent') ?>
|
|
<!-- .Extend -->
|
|
|
|
<!-- Title of the page -->
|
|
<?= $this->section('title') ?>Employee Payroll Transaction<?= $this->endSection() ?>
|
|
<!-- .Title -->
|
|
|
|
<!-- CSS of the page -->
|
|
<?= $this->section('css') ?>
|
|
|
|
<!-- Select2 -->
|
|
<link rel="stylesheet" href="<?= base_url() ?>adminlte/plugins/select2/css/select2.min.css">
|
|
<link rel="stylesheet" href="<?= base_url() ?>adminlte/plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">
|
|
|
|
<?= $this->endSection() ?>
|
|
<!-- .CSS -->
|
|
|
|
<!-- body attribute - class definition -->
|
|
<?= $this->section('bodyclass') ?>sidebar-mini<?= $this->endSection() ?>
|
|
<!-- .body attribute -->
|
|
|
|
<!-- Container title -->
|
|
<?= $this->section('containertitle') ?>Employee Payroll Transaction<?= $this->endSection() ?>
|
|
<!-- .Container title -->
|
|
|
|
<!-- Active breadcrumb -->
|
|
<?= $this->section('activebreadcrumb') ?><a href="/payroll/paytrans">Payroll Transaction</a> / Employee Payroll Transaction<?= $this->endSection() ?>
|
|
<!-- .Active breadcrumb -->
|
|
|
|
<!-- Main content -->
|
|
<?= $this->section('main') ?>
|
|
|
|
<!-- Modal Add Income -->
|
|
<div class="modal fade" id="mdlAddIncome">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<form action="<?= url_to('payroll/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">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<p class="lead">Payroll Group Information</p>
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="form-group">
|
|
<label>Select Income to Assign</label>
|
|
<select class="form-control" style="width: 100%;" name="inded_id">
|
|
<?php foreach($incomeList as $income): ?>
|
|
<option value="<?= $income->inded_id ?>"><?= $income->inded_name ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<input type="hidden" name="emppaytrans_id" id="txtInEmpPayTransId" >
|
|
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="radio" id="rdoInFixedAmount" name="amount_type" value="fixed" checked>
|
|
<label for="rdoInFixedAmount" 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>
|
|
</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') ?>">
|
|
</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>
|
|
<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 Add Deduction -->
|
|
<div class="modal fade" id="mdlAddDeduction">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<form action="<?= url_to('payroll/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">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<p class="lead">Payroll Group Information</p>
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="form-group">
|
|
<label>Select Deduciton to Assign</label>
|
|
<select class="form-control" style="width: 100%;" name="inded_id">
|
|
<?php foreach($deductionList as $deduction): ?>
|
|
<option value="<?= $deduction->inded_id ?>"><?= $deduction->inded_name ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<input type="hidden" name="emppaytrans_id" id="txtDedEmpPayTransId" >
|
|
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="radio" id="rdoInFixedAmount" name="amount_type" value="fixed" checked>
|
|
<label for="rdoInFixedAmount" 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>
|
|
</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') ?>">
|
|
</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>
|
|
<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>
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h3 class="card-title">Select Payroll Group to Process</h3>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<form action="/payroll/emppaytrans/<?= $paytransid ?>" method="get">
|
|
<div class="form-group">
|
|
<label>Payroll Group</label>
|
|
<div class="input-group mb-3">
|
|
<select class="form-control select2 rounded-0" name="grpid">
|
|
<option value="-1">-- Select --</option>
|
|
<?php foreach($paygroups as $paygroup): ?>
|
|
<?php $selected = ($paygroupid != null && $paygroupid == $paygroup->pay_group_id) ? 'selected' : ''; ?>
|
|
<option value="<?= $paygroup->pay_group_id ?>" <?= $selected ?>><?= '['.$paygroup->pay_group_code.'] '.$paygroup->pay_group_name ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<span class="input-group-append">
|
|
<button type="submit" class="btn btn-info btn-flat">Select this Group</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Employee Income And Transaction Adjustment -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<?php if(isset($emppaytrans)): foreach($emppaytrans as $empPayTransaction): ?>
|
|
<div id="payrollTabInfo<?= $empPayTransaction['empPayTrans']->emppaytrans_id ?>" class="card card-primary card-outline card-tabs" style="display:none;">
|
|
<div class="card-header p-0 pt-1 border-bottom-0">
|
|
<ul class="nav nav-tabs" id="payroll-tab" role="tablist">
|
|
<li class="nav-item">
|
|
<a class="nav-link active" id="payroll-tab-PayInfo-tab<?= $empPayTransaction['empPayTrans']->emppaytrans_id ?>" data-toggle="pill"
|
|
href="#payroll-tab-PayInfo<?= $empPayTransaction['empPayTrans']->emppaytrans_id ?>" role="tab" aria-controls="custom-tabs-three-home" aria-selected="true">Payroll Information of <strong><?= $empPayTransaction['empPayTrans']->last_name.', '.$empPayTransaction['empPayTrans']->first_name ?></strong></a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" id="payroll-tab-PayInDed-tab<?= $empPayTransaction['empPayTrans']->emppaytrans_id ?>" data-toggle="pill"
|
|
href="#payroll-tab-PayInDed<?= $empPayTransaction['empPayTrans']->emppaytrans_id ?>" role="tab" aria-controls="custom-tabs-three-profile" aria-selected="false">Income and Deduction</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="tab-content" id="payroll-tabContent">
|
|
<div class="tab-pane fade show active" id="payroll-tab-PayInfo<?= $empPayTransaction['empPayTrans']->emppaytrans_id ?>" role="tabpanel"
|
|
aria-labelledby="payroll-tab-PayInfo-tab<?= $empPayTransaction['empPayTrans']->emppaytrans_id ?>">
|
|
|
|
<form action="/payroll/emppaytransupdateworkdays" method="post">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-12 col-sm-4">
|
|
<div class="form-group">
|
|
<label>Daily Rate</label>
|
|
<input type="text" class="form-control" value="<?= number_format($empPayTransaction['empPayTrans']->basic_daily_pay, 2) ?>" readonly>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-sm-4">
|
|
<div class="form-group">
|
|
<label>Work Days</label>
|
|
<input type="number" step="0.05" class="form-control" name="actual_work_days" value="<?= number_format($empPayTransaction['empPayTrans']->actual_work_days, 2) ?>">
|
|
<input type="hidden" name="emppaytrans_id" value="<?= $empPayTransaction['empPayTrans']->emppaytrans_id ?>">
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-sm-4">
|
|
<div class="form-group">
|
|
<label>Salary</label>
|
|
<input type="text" class="form-control" value="<?= number_format($empPayTransaction['empPayTrans']->basic_pay, 2) ?>" readonly>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-12 col-sm-4">
|
|
<div class="form-group">
|
|
<label>Taxable Income</label>
|
|
<input type="text" class="form-control" value="<?= number_format($empPayTransaction['empPayTrans']->taxable_income, 2) ?>" readonly>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-sm-4">
|
|
<div class="form-group">
|
|
<label>Nontaxable Income</label>
|
|
<input type="text" class="form-control" value="<?= number_format($empPayTransaction['empPayTrans']->nontaxable_income, 2) ?>" readonly>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-sm-4">
|
|
<div class="form-group">
|
|
<label>Gross Salary</label>
|
|
<input type="text" class="form-control" value="<?= number_format($empPayTransaction['empPayTrans']->gross_income, 2) ?>" readonly>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-12 col-sm-4">
|
|
<div class="form-group">
|
|
<label>Taxable Deductions</label>
|
|
<input type="text" class="form-control" value="<?= number_format($empPayTransaction['empPayTrans']->taxable_deduction, 2) ?>" readonly>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-sm-4">
|
|
<div class="form-group">
|
|
<label>Nontaxable Deductions</label>
|
|
<input type="text" class="form-control" value="<?= number_format($empPayTransaction['empPayTrans']->nontaxable_deduction, 2) ?>" readonly>
|
|
<p><i class="small">(this will be deducted to taxable income)</i></p>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-sm-4">
|
|
<div class="form-group">
|
|
<label>Total Deduction</label>
|
|
<input type="text" class="form-control" value="<?= number_format($empPayTransaction['empPayTrans']->total_deduction, 2) ?>" readonly>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-12 col-sm-6">
|
|
<div class="form-group">
|
|
<label>Income Tax</label>
|
|
<input type="text" class="form-control" value="<?= number_format($empPayTransaction['empPayTrans']->income_tax, 2) ?>" readonly>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-sm-6">
|
|
<div class="form-group">
|
|
<label>Net Income</label>
|
|
<input type="text" class="form-control" value="<?= number_format($empPayTransaction['empPayTrans']->net_pay, 2) ?>" readonly>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-footer">
|
|
<button type="submit" class="btn btn-primary">Save Changes</button>
|
|
<button type="button" class="btn btn-secondary" onclick="$('#payrollTabInfo<?= $empPayTransaction['empPayTrans']->emppaytrans_id ?>').toggle()">Close</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
<div class="tab-pane fade" id="payroll-tab-PayInDed<?= $empPayTransaction['empPayTrans']->emppaytrans_id ?>" role="tabpanel"
|
|
aria-labelledby="payroll-tab-PayInDed-tab<?= $empPayTransaction['empPayTrans']->emppaytrans_id ?>">
|
|
|
|
<form action="" method="post">
|
|
<div class="car">
|
|
<div class="card-body">
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<th>
|
|
Description
|
|
</th>
|
|
<th>
|
|
Deduction
|
|
</th>
|
|
<th>
|
|
Income
|
|
</th>
|
|
<th>
|
|
Action
|
|
</th>
|
|
</thead>
|
|
<tr>
|
|
<td>
|
|
Basic Pay
|
|
</td>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
<?= number_format($empPayTransaction['empPayTrans']->basic_pay, 2, ".", ",") ?>
|
|
</td>
|
|
<td>
|
|
|
|
</td>
|
|
</tr>
|
|
<?php foreach($empPayTransaction['empPayTransInDed'] as $empPayTransInDed): ?>
|
|
<tr>
|
|
<td>
|
|
<?= $empPayTransInDed->inded_name ?>
|
|
</td>
|
|
<td>
|
|
<?php if(!$empPayTransInDed->is_income) echo "-".number_format($empPayTransInDed->amount, 2, ".", ","); else echo " "; ?>
|
|
</td>
|
|
<td>
|
|
<?php if($empPayTransInDed->is_income) echo number_format($empPayTransInDed->amount, 2, ".", ","); else echo " "; ?>
|
|
</td>
|
|
<td>
|
|
<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>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
</div>
|
|
<div class="card-footer">
|
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#mdlAddIncome">Add Income</button>
|
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#mdlAddDeduction">Add Deduction</button>
|
|
<button type="button" class="btn btn-secondary" onclick="$('#payrollTabInfo<?= $empPayTransaction['empPayTrans']->emppaytrans_id ?>').toggle()">Close</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- /.card -->
|
|
</div>
|
|
<?php endforeach; endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- List of Employee for Payroll -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h3 class="card-title">List of Employee for Payroll</h3>
|
|
</div>
|
|
<div class="card-body">
|
|
<?php if($paygroupid == null || $paygroupid == -1): ?>
|
|
<p>Please select payroll group.</p>
|
|
<?php else: ?>
|
|
<div class="card-body table-responsive p-0">
|
|
<?php if($showInitBtn): ?>
|
|
<p>You may change the working days for this payroll cutoff. Deduct days off or absences on <strong>working days</strong> field.</p>
|
|
<?php else: ?>
|
|
<p>Adjust entry of each employee by clicking on <strong>Edit</strong> icon</p>
|
|
<?php endif; ?>
|
|
|
|
<?= $tblEmpPayTrans ?>
|
|
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
<div class="card-footer">
|
|
<?php if($showInitBtn && !($paygroupid == null || $paygroupid == -1)): ?>
|
|
<a class="btn btn-warning" href="/payroll/emppaytransinit/<?= $initURL ?>">Initialize Payroll</a>
|
|
<?php elseif($paygroupid == null || $paygroupid == -1): ?>
|
|
<button type="button" class="btn btn-warning" disabled>Initialize Payroll</button>
|
|
<?php else: ?>
|
|
<button type="button" class="btn btn-primary">Generate Payslip</button>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?= $this->endSection() ?>
|
|
<!-- .Main content -->
|
|
|
|
<!-- Javascript -->
|
|
|
|
<?= $this->section('js') ?>
|
|
|
|
<!-- Select2 -->
|
|
<script src="<?= base_url() ?>adminlte/plugins/select2/js/select2.full.min.js"></script>
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
|
|
//Initialize Select2 Elements
|
|
$('.select2').select2();
|
|
|
|
});
|
|
|
|
function showEmpPayTransDetails(emppaytransid)
|
|
{
|
|
$("div[id^='payrollTabInfo']" ).hide();
|
|
$("#payrollTabInfo"+emppaytransid).toggle();
|
|
|
|
$("#txtInEmpPayTransId").val(emppaytransid);
|
|
$("#txtDedEmpPayTransId").val(emppaytransid);
|
|
}
|
|
|
|
</script>
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
<!-- .Javascript -->
|