Merge pull request 'fix income deduction update' (#32) from paulcortezl5 into main

Reviewed-on: #32
pull/33/head
paul 5 months ago
commit 38725a7796

@ -226,12 +226,12 @@ class PayrollController extends BaseController
$incomeDeduction = (new IncomeDeductionModel())->find($indedid);
$empPayTransInDeds = $empPayTransInDedModel->getEmpPayTransInDedxEmPayTransByPayTransIdInDedId($paytransid, $indedid);
$empPayTransInDed = new EmpPayTransIncomeDeduction();
$empPayTransIncomeDeduction = new EmpPayTransIncomeDeduction();
$updateCount = 0;
foreach($empPayTransInDeds as $empPayTransInDed)
{
$empPayTransInDed->fill([
$empPayTransIncomeDeduction->fill([
'emppaytransinded_id' => $empPayTransInDed->emppaytransinded_id,
'emppaytrans_id' => $empPayTransInDed->emppaytrans_id,
'inded_id' => $empPayTransInDed->inded_id,
@ -873,25 +873,23 @@ class PayrollController extends BaseController
$payCompute = new PayrollComputation();
$amount = $payCompute->computeIncomeDeductionByComputationType($rawData, $empPayTrans);
$empPayTransInDed->fill(
[
'emppaytransinded_id' => (isset($rawData['emppaytransinded_id'])) ? $rawData['emppaytransinded_id'] : null,
'emppaytrans_id' => $rawData['emppaytrans_id'],
'inded_id' => $rawData['inded_id'],
'payslip_display' => $incomeDeduction->payslip_display,
'inded_name' => $incomeDeduction->inded_name,
'coa_code' => $incomeDeduction->coa_code,
'is_income' => $incomeDeduction->is_income,
'is_taxable' => $incomeDeduction->is_taxable,
'include_in_gross' => $incomeDeduction->include_in_gross,
'is_fixed_amt' => $rawData['is_fixed_amt'],
'is_percent_amt' => $rawData['is_percent_amt'],
'worked_days_based' => $rawData['worked_days_based'],
'amount' => $amount,
'base_amount' => $rawData['amount'],
'is_override' => $rawData['is_override']
]
);
$empPayTransInDed->fill([
'emppaytransinded_id' => (isset($rawData['emppaytransinded_id'])) ? $rawData['emppaytransinded_id'] : null,
'emppaytrans_id' => $rawData['emppaytrans_id'],
'inded_id' => $rawData['inded_id'],
'payslip_display' => $incomeDeduction->payslip_display,
'inded_name' => $incomeDeduction->inded_name,
'coa_code' => $incomeDeduction->coa_code,
'is_income' => $incomeDeduction->is_income,
'is_taxable' => $incomeDeduction->is_taxable,
'include_in_gross' => $incomeDeduction->include_in_gross,
'is_fixed_amt' => $rawData['is_fixed_amt'],
'is_percent_amt' => $rawData['is_percent_amt'],
'worked_days_based' => $rawData['worked_days_based'],
'amount' => $amount,
'base_amount' => $rawData['amount'],
'is_override' => $rawData['is_override']
]);
if ($empPayTransInDedModel->save($empPayTransInDed)) {
$this->computeEmployeePayroll($rawData['emppaytrans_id'], true, $empPayTransactionModel, $empPayTransInDedModel);

@ -1,199 +0,0 @@
<!-- Extend area where template is defined -->
<?= $this->extend('templates/adminlte/generalcontent') ?>
<!-- .Extend -->
<!-- Title of the page -->
<?= $this->section('title') ?>Compensation and Benefits<?= $this->endSection() ?>
<!-- .Title -->
<!-- CSS of the page -->
<?= $this->section('css') ?>
<!-- DataTables -->
<link rel="stylesheet" href="/adminlte/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
<link rel="stylesheet" href="/adminlte/plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
<link rel="stylesheet" href="/adminlte/plugins/datatables-buttons/css/buttons.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 Compensation and Benefits<?= $this->endSection() ?>
<!-- .Container title -->
<!-- Active breadcrumb -->
<?= $this->section('activebreadcrumb') ?>Compensation and Benefits<?= $this->endSection() ?>
<!-- .Active breadcrumb -->
<!-- Main content -->
<?= $this->section('main') ?>
<!-- Modal Add Branch -->
<div class="modal fade" id="mdlAddBranch">
<div class="modal-dialog">
<div class="modal-content">
<form action="<?= url_to('payroll/addpaytype') ?>" method="post">
<div class="modal-header">
<h4 class="modal-title" >New Payroll Type</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-12">
<p class="lead">Payroll Type Information</p>
<div class="row">
<div class="col-12">
<div class="form-group">
<label for="txtPayName">Payroll Type Name</label>
<input class="form-control" type="text" id="txtPayName" name="paytype_name" value="<?= old('paytype_name') ?>">
</div>
<div class="form-group">
<label for="txtPayCode">Payroll Type Code</label>
<input class="form-control" type="text" id="txtPayCode" name="paytype_code" values="<?= old('paytype_code') ?>">
</div>
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="radio" id="rdoIsMonthly" name="paytype_sched" value="monthly">
<label for="rdoIsMonthly" class="form-check-label">Computation is based on monthly salary.</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" id="rdoIsSemiMonthly" name="paytype_sched" value="semi_monthly" checked>
<label for="rdoIsSemiMonthly" class="form-check-label">Computation is based on semi-monthly salary.</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" id="rdoIsDaily" name="paytype_sched" value="daily">
<label for="rdoIsDaily" class="form-check-label">Computation is based on daily salary.</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" id="rdoIsHourly" name="paytype_sched" value="hourly">
<label for="rdoIsHourly" class="form-check-label">Computation is based on daily salary.</label>
</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">List of Payroll Type</h3>
</div>
<div class="card-body">
<div class="card-body table-responsive p-0">
<?php /*$tblPayrollType*/ ?>
<form action="">
<div class="input-group mb-3">
<input type="text" class="form-control rounded-0">
<span class="input-group-append">
<button type="button" class="btn btn-info btn-flat">Search</button>
</span>
</div>
</form>
</div>
</div>
<div class="card-footer">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#mdlAddBranch">Add Payroll Type</button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card card-primary card-outline card-tabs">
<div class="card-header p-0 pt-1 border-bottom-0">
<ul class="nav nav-tabs" id="custom-tabs-three-tab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="custom-tabs-three-home-tab" data-toggle="pill" href="#custom-tabs-three-home" role="tab" aria-controls="custom-tabs-three-home" aria-selected="true">Assigned Employee</a>
</li>
<li class="nav-item">
<a class="nav-link" id="custom-tabs-three-profile-tab" data-toggle="pill" href="#custom-tabs-three-profile" role="tab" aria-controls="custom-tabs-three-profile" aria-selected="false">Unassigned Employee</a>
</li>
</ul>
</div>
<div class="card-body">
<div class="tab-content" id="custom-tabs-three-tabContent">
<div class="tab-pane fade show active" id="custom-tabs-three-home" role="tabpanel" aria-labelledby="custom-tabs-three-home-tab">
<h4>Employee with assigned Compensation and Benefits</h4>
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>Rendering engine</th>
<th>Browser</th>
<th>Platform(s)</th>
<th>Engine version</th>
<th>CSS grade</th>
</tr>
</thead>
<tbody>
<tr>
<td>Trident</td>
<td>Internet
Explorer 4.0
</td>
<td>Win 95+</td>
<td> 4</td>
<td>X</td>
</tr>
</table>
</div>
<div class="tab-pane fade" id="custom-tabs-three-profile" role="tabpanel" aria-labelledby="custom-tabs-three-profile-tab">
<h4>Employee with unassigned Compensation and Benefits</h4>
</div>
</div>
</div>
<!-- /.card -->
</div>
</div>
</div>
<?= $this->endSection() ?>
<!-- .Main content -->
<!-- Javascript -->
<?= $this->section('js') ?>
<!-- DataTables & Plugins -->
<script src="/adminlte/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="/adminlte/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
<script src="/adminlte/plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
<script src="/adminlte/plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
<script src="/adminlte/plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
<script src="/adminlte/plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>
<script src="/adminlte/plugins/jszip/jszip.min.js"></script>
<script src="/adminlte/plugins/pdfmake/pdfmake.min.js"></script>
<script src="/adminlte/plugins/pdfmake/vfs_fonts.js"></script>
<script src="/adminlte/plugins/datatables-buttons/js/buttons.html5.min.js"></script>
<script src="/adminlte/plugins/datatables-buttons/js/buttons.print.min.js"></script>
<script src="/adminlte/plugins/datatables-buttons/js/buttons.colVis.min.js"></script>
<script>
$(document).ready(function() {
$("#example1").DataTable({
"responsive": true, "lengthChange": false, "autoWidth": false
});
});
</script>
<?= $this->endSection() ?>
<!-- .Javascript -->

@ -37,7 +37,7 @@
<h3 class="card-title"><?= $incomeDeduction->inded_name ?></h3>
</div>
<div class="card-body">
<p>Here are the list of payroll transaction and the number of affected transactions when we update this Income or Deduction item.</p>
<p>Here are the list of payroll transaction and the number of affected transactions when we update this Income or Deduction item. These are <strong>OPEN</strong> transaction and should you re-run computation on each employee after an update.</p>
<table class="table table-bordered">
<thead>
<tr>
@ -59,6 +59,9 @@
</tbody>
</table>
</div>
<div class="card-footer">
<a href="/payroll/inded" class="btn btn-default">Back to Income and Deduction List</a>
</div>
</div>
</div>
</div>

Loading…
Cancel
Save