Merge pull request 'payroll info' (#4) from paulcortezl5 into main

Reviewed-on: #4
pull/5/head
paul 8 months ago
commit 97b470e006

@ -17,4 +17,13 @@ class MiscLib
return $template; return $template;
} }
public static function adminLTEDataTableTemplate($tableID)
{
$template = [
'table_open' => '<table id="'.$tableID.'" class="table table-bordered table-striped">'
];
return $template;
}
} }

@ -38,6 +38,12 @@ $routes->post('payroll/addpaygroup', 'PayrollController::addPayrollGroup');
$routes->get('payroll/inded', 'PayrollController::incomeDeduction'); $routes->get('payroll/inded', 'PayrollController::incomeDeduction');
$routes->post('payroll/addinded', 'PayrollController::addIncomeDeduction'); $routes->post('payroll/addinded', 'PayrollController::addIncomeDeduction');
$routes->get('payroll/paytype', 'PayrollController::payrollType');
$routes->post('payroll/addpaytype', 'PayrollController::addPayrollType');
$routes->get('payroll/emppayinfo', 'PayrollController::employeePayrollInfo');
$routes->post('payroll/addemppayinfo', 'PayrollController::addEmployeePayrollInfo');
// Administrator Routes // Administrator Routes
$routes->get('adminuser', 'AdministratorController::index'); $routes->get('adminuser', 'AdministratorController::index');
$routes->get('adminuser/newuser', 'AdministratorController::newUserView'); $routes->get('adminuser/newuser', 'AdministratorController::newUserView');

@ -8,11 +8,17 @@ use CodeIgniter\HTTP\ResponseInterface;
// Models // Models
use App\Models\PayrollGroupModel; use App\Models\PayrollGroupModel;
use App\Models\IncomeDeductionModel; use App\Models\IncomeDeductionModel;
use App\Models\PayrollTypeModel;
use App\Models\EmployeePayrollInfoModel;
use App\Models\EmployeeModel;
// Entities // Entities
use App\Entities\PayrollGroup; use App\Entities\PayrollGroup;
use App\Entities\IncomeDeduction; use App\Entities\IncomeDeduction;
use App\Entities\PayrollType;
use App\Entities\EmployeePayrollInfo;
use App\Entities\Employee;
// Class Library // Class Library
use App\ClassLib\MiscLib; use App\ClassLib\MiscLib;
@ -113,4 +119,122 @@ class PayrollController extends BaseController
else else
return redirect()->to('/payroll/inded')->with('message', 'Income or Deduction Added'); return redirect()->to('/payroll/inded')->with('message', 'Income or Deduction Added');
} }
public function payrollType()
{
$payrollTypes = (new PayrollTypeModel())->findAll();
$payTypeHTMLTable = new \CodeIgniter\View\Table();
$payTypeHTMLTable->setTemplate(MiscLib::adminLTETableTemplate());
if($payrollTypes == null)
$data['tblPayrollType'] = '<p>No payroll type found.</p>';
else
{
foreach($payrollTypes as $payrollType)
{
$payTypeHTMLTable->setHeading('ID', 'Code', 'Name', 'Monthly', 'Semi-Monthly', 'Daily', 'Hourly', 'Action');
$iconView = '<a href="#" class="ml-3" data-toggle="tooltip" title="View Information"><i class="fas fa-eye "></i></a>';
$payTypeHTMLTable->addRow($payrollType->paytype_id, $payrollType->paytype_code, $payrollType->paytype_name, ($payrollType->is_monthly) ? 'Yes' : 'No', ($payrollType->is_semi_monthly) ? 'Yes' : 'No', ($payrollType->is_daily) ? 'Yes' : 'No', ($payrollType->is_hourly) ? 'Yes' : 'No', $iconView);
}
$data['tblPayrollType'] = $payTypeHTMLTable->generate();
}
return view('payroll/paytypeview', $data);
}
public function addPayrollType()
{
$payrollType = new PayrollType();
$payrollTypeModel = new PayrollTypeModel();
$rawData = $this->request->getPost();
// Initialize all payroll type fields to 0
$rawData['is_monthly'] = 0;
$rawData['is_semi_monthly'] = 0;
$rawData['is_daily'] = 0;
$rawData['is_hourly'] = 0;
// Handle radio button input
if (isset($rawData['paytype_sched'])) {
switch ($rawData['paytype_sched']) {
case 'monthly':
$rawData['is_monthly'] = 1;
break;
case 'semi_monthly':
$rawData['is_semi_monthly'] = 1;
break;
case 'daily':
$rawData['is_daily'] = 1;
break;
case 'hourly':
$rawData['is_hourly'] = 1;
break;
}
}
$payrollType->fill($rawData);
$payrollTypeModel->save($payrollType);
if($payrollTypeModel->getInsertID() == 0)
return redirect()->back()->withInput()->with('error', 'Failed to add payroll type');
else
return redirect()->to('/payroll/paytype')->with('message', 'Payroll Type Added');
}
public function employeePayrollInfo()
{
$empPayInfos = (new EmployeePayrollInfoModel())->findAll();
$data['employees'] = (new EmployeeModel())->findAll();
$data['paytypes'] = (new PayrollTypeModel())->findAll();
$empPayInfoHTMLTable = new \CodeIgniter\View\Table();
$empPayInfoHTMLTable->setTemplate(MiscLib::adminLTETableTemplate());
if($empPayInfos == null)
$data['tblEmpPayInfo'] = '<p>No employee payroll type found.</p>';
else
{
foreach($empPayInfos as $empPayInfo)
{
$empPayInfoHTMLTable->setHeading('ID', 'Payroll Type', 'Employee ID', 'Employee Name', 'Monthly', 'Semi-Monthly', 'Daily', 'Hourly', 'Action');
$iconView = '<a href="#" class="ml-3" data-toggle="tooltip" title="View Information"><i class="fas fa-eye "></i></a>';
$empPayInfoHTMLTable->addRow($empPayInfo->emppay_id, $empPayInfo->paytype_id, $empPayInfo->employee_id, "", $empPayInfo->basic_monthly_pay, $empPayInfo->basic_semi_monthly_pay, $empPayInfo->basic_daily_pay, $empPayInfo->basic_hourly_pay, $iconView);
}
$data['tblEmpPayInfo'] = $empPayInfoHTMLTable->generate();
}
return view('payroll/empinfoview', $data);
}
public function addEmployeePayrollInfo()
{
$empPayInfo = new EmployeePayrollInfo();
$empPayInfoModel = new EmployeePayrollInfoModel();
$rawData = $this->request->getPost();
$rawData['is_ATM'] = isset($rawData['is_ATM']) ? 1 : 0;
$rawData['has_cola'] = isset($rawData['has_cola']) ? 1 : 0;
$rawData['has_philhealth'] = isset($rawData['has_philhealth']) ? 1 : 0;
$rawData['has_hdmf'] = isset($rawData['has_hdmf']) ? 1 : 0;
$rawData['has_sss'] = isset($rawData['has_sss']) ? 1 : 0;
$rawData['has_gsis'] = isset($rawData['has_gsis']) ? 1 : 0;
$empPayInfo->fill($rawData);
$empPayInfoModel->save($empPayInfo);
if($empPayInfoModel->getInsertID() == 0)
return redirect()->back()->withInput()->with('error', 'Failed to add employee payroll type');
else
return redirect()->to('/payroll/emppayinfo')->with('message', 'Employee Payroll Type Added');
}
} }

@ -0,0 +1,83 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreatePayType extends Migration
{
public function up()
{
// Create the payroll_types table
$this->forge->addField([
'paytype_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'auto_increment' => true,
],
'paytype_code' => [
'type' => 'VARCHAR',
'constraint' => 25,
'null' => true,
],
'paytype_name' => [
'type' => 'VARCHAR',
'constraint' => 255,
'null' => false,
],
'is_monthly' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false,
],
'is_semi_monthly' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false,
],
'is_daily' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false,
],
'is_hourly' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false,
],
// Common fields
'created_at' => [
'type' => 'DATETIME',
'null' => true,
],
'created_by' => [
'type' => 'VARCHAR',
'constraint' => '20',
'null' => true
],
'updated_at' => [
'type' => 'DATETIME',
'null' => true,
],
'updated_by' => [
'type' => 'VARCHAR',
'constraint' => '20',
'null' => true
],
'deleted_at' => [
'type' => 'DATETIME',
'null' => true,
],
]);
$this->forge->addKey('paytype_id', true);
$this->forge->createTable('pay_type');
}
public function down()
{
$this->forge->dropTable('pay_type');
}
}

@ -0,0 +1,118 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateEmployeePayInfo extends Migration
{
public function up()
{
$this->forge->addField([
'emppay_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'auto_increment' => true
],
'employee_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true
],
'paytype_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true
],
'is_ATM' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false
],
'savings_account' => [
'type' => 'VARCHAR',
'constraint' => 50,
'null' => true
],
'basic_monthly_pay' => [
'type' => 'DECIMAL',
'constraint' => '12,4',
'null' => false
],
'basic_semi_monthly_pay' => [
'type' => 'DECIMAL',
'constraint' => '12,4',
'null' => false
],
'basic_daily_pay' => [
'type' => 'DECIMAL',
'constraint' => '12,4',
'null' => false
],
'basic_hourly_pay' => [
'type' => 'DECIMAL',
'constraint' => '12,4',
'null' => false
],
'has_cola' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false
],
'has_philhealth' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false
],
'has_hdmf' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false
],
'has_sss' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false
],
'has_gsis' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false
],
// Common fields
'created_at' => [
'type' => 'DATETIME',
'null' => true,
],
'created_by' => [
'type' => 'VARCHAR',
'constraint' => '20',
'null' => true
],
'updated_at' => [
'type' => 'DATETIME',
'null' => true,
],
'updated_by' => [
'type' => 'VARCHAR',
'constraint' => '20',
'null' => true
],
'deleted_at' => [
'type' => 'DATETIME',
'null' => true,
],
]);
$this->forge->addKey('emppay_id', true);
$this->forge->createTable('emp_pay_info');
}
public function down()
{
$this->forge->dropTable('emp_pay_info');
}
}

@ -0,0 +1,28 @@
<?php
namespace App\Entities;
use CodeIgniter\Entity\Entity;
class EmployeePayrollInfo extends Entity
{
protected $attributes = [
'emppay_id' => null,
'employee_id' => null,
'paytype_id' => null,
'is_ATM' => null,
'savings_account' => null,
'basic_monthly_pay' => null,
'basic_semi_monthly_pay' => null,
'basic_daily_pay' => null,
'basic_hourly_pay' => null,
'has_cola' => null,
'has_philhealth' => null,
'has_hdmf' => null,
'has_sss' => null,
'has_gsis' => null,
];
protected $datamap = [];
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
protected $casts = [];
}

@ -0,0 +1,21 @@
<?php
namespace App\Entities;
use CodeIgniter\Entity\Entity;
class PayrollType extends Entity
{
protected $attributes = [
'paytype_id' => null,
'paytype_code' => null,
'paytype_name' => null,
'is_monthly' => null,
'is_semi_monthly' => null,
'is_daily' => null,
'is_hourly' => null,
];
protected $datamap = [];
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
protected $casts = [];
}

@ -0,0 +1,69 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class EmployeePayrollInfoModel extends Model
{
protected $table = 'emp_pay_info';
protected $primaryKey = 'emppay_id';
protected $useAutoIncrement = true;
protected $returnType = \App\Entities\EmployeePayrollInfo::class;
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = ['employee_id',
'paytype_id',
'is_ATM',
'savings_account',
'basic_monthly_pay',
'basic_semi_monthly_pay',
'basic_daily_pay',
'basic_hourly_pay',
'has_cola',
'has_philhealth',
'has_hdmf',
'has_sss',
'has_gsis'];
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
// Validation
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $cleanValidationRules = true;
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = ['assignCreatedAt'];
protected $afterInsert = [];
protected $beforeUpdate = ['assignUpdatedAt'];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function assignCreatedAt(array $data)
{
$data['data']['created_at'] = date('Y-m-d H:i:s');
$data['data']['created_by'] = auth()->user()->employee_id;
return $data;
}
public function assignUpdatedAt(array $data)
{
$data['data']['updated_at'] = date('Y-m-d H:i:s');
$data['data']['updated_by'] = auth()->user()->employee_id;
return $data;
}
}

@ -0,0 +1,61 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class PayrollTypeModel extends Model
{
protected $table = 'pay_type';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = \App\Entities\PayrollType::class;
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = ['paytype_code',
'paytype_name',
'is_monthly',
'is_semi_monthly',
'is_daily',
'is_hourly'];
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
// Validation
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $cleanValidationRules = true;
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = ['assignCreatedAt'];
protected $afterInsert = [];
protected $beforeUpdate = ['assignUpdatedAt'];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function assignCreatedAt(array $data)
{
$data['data']['created_at'] = date('Y-m-d H:i:s');
$data['data']['created_by'] = auth()->user()->employee_id;
return $data;
}
public function assignUpdatedAt(array $data)
{
$data['data']['updated_at'] = date('Y-m-d H:i:s');
$data['data']['updated_by'] = auth()->user()->employee_id;
return $data;
}
}

@ -0,0 +1,199 @@
<!-- 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 -->

@ -0,0 +1,131 @@
<!-- 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') ?>
<?= $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>
<?= $this->endSection() ?>
<!-- .Main content -->
<!-- Javascript -->
<?= $this->section('js') ?>
<script>
$(document).ready(function() {
});
</script>
<?= $this->endSection() ?>
<!-- .Javascript -->

@ -0,0 +1,208 @@
<!-- Extend area where template is defined -->
<?= $this->extend('templates/adminlte/generalcontent') ?>
<!-- .Extend -->
<!-- Title of the page -->
<?= $this->section('title') ?>Employee Payroll Info<?= $this->endSection() ?>
<!-- .Title -->
<!-- CSS of the page -->
<?= $this->section('css') ?>
<!-- Select2 -->
<link rel="stylesheet" href="/adminlte/plugins/select2/css/select2.min.css">
<link rel="stylesheet" href="/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 Info<?= $this->endSection() ?>
<!-- .Container title -->
<!-- Active breadcrumb -->
<?= $this->section('activebreadcrumb') ?>Employee Payroll Info<?= $this->endSection() ?>
<!-- .Active breadcrumb -->
<!-- Main content -->
<?= $this->section('main') ?>
<!-- Modal Add Branch -->
<div class="modal fade" id="mdlEmpPayInfo">
<div class="modal-dialog">
<div class="modal-content">
<form action="<?= url_to('payroll/addemppayinfo') ?>" method="post">
<div class="modal-header">
<h4 class="modal-title" >New Employee Payroll Information</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">Employee Payroll Information</p>
<div class="row">
<div class="col-12">
<div class="form-group">
<label>Select Employee</label>
<select class="form-control select2" style="width: 100%;" name="employee_id">
<?php foreach($employees as $employee): ?>
<?php $selected = (old('employee_id') == $employee->employee_id) ? 'selected' : ''; ?>
<?= '<option value="'.$employee->employee_id.'" '.$selected.'>'.$employee->last_name.'</option>' ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label>Select Payroll Type</label>
<select class="form-control" style="width: 100%;" name="paytype_id">
<?php foreach($paytypes as $paytype): ?>
<?php $selected = (old('paytype_id') == $paytype->paytype_id) ? 'selected' : ''; ?>
<?= '<option value="'.$paytype->paytype_id.'" '.$selected.'>['.$paytype->paytype_code.'] '.$paytype->paytype_name.'</option>' ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="chkIsATM" name="is_ATM">
<label for="chkIsATM" class="custom-control-label">Salary is through ATM.</label>
</div>
</div>
<div class="form-group">
<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 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') ?>">
<span class="input-group-append">
<button type="button" class="btn btn-info btn-flat" onclick="computeBasicPay()">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') ?>">
</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') ?>">
</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') ?>">
</div>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="chkHasCola" name="has_cola">
<label for="chkHasCola" class="custom-control-label">Has COLA</label>
</div>
</div>
<h4>Government Required Contributions</h4>
<p>Define statutory deduction below which applies to an employee.</p>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="chkHasPhilhealth" name="has_philhealth">
<label for="chkHasPhilhealth" class="custom-control-label">Has PhilHealth</label>
</div>
</div>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="chkHasHDMF" name="has_hdmf">
<label for="chkHasHDMF" class="custom-control-label">Has Pag-IBIG</label>
</div>
</div>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="chkHasSSS" name="has_sss">
<label for="chkHasSSS" class="custom-control-label">Has SSS</label>
</div>
</div>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="chkHasGSIS" name="has_gsis">
<label for="chkHasGSIS" class="custom-control-label">Has GSIS</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 Employee Payroll Information</h3>
</div>
<div class="card-body">
<div class="card-body table-responsive p-0">
<?= $tblEmpPayInfo ?>
<!-- <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="#mdlEmpPayInfo">Add Employee Payroll Information</button>
</div>
</div>
</div>
</div>
<?= $this->endSection() ?>
<!-- .Main content -->
<!-- Javascript -->
<?= $this->section('js') ?>
<!-- Select2 -->
<script src="/adminlte/plugins/select2/js/select2.full.min.js"></script>
<script>
$(document).ready(function() {
//Initialize Select2 Elements
$('.select2').select2();
//Initialize Select2 Elements
$('.select2bs4').select2({
theme: 'bootstrap4'
});
});
function computeBasicPay()
{
$("#txtSemiMonthlyBasicPay").val($("#txtMonthlyBasicPay").val() / 2);
$("#txtDailyBasicPay").val($("#txtMonthlyBasicPay").val() * 12 / 313);
$("#txtHourlyBasicPay").val($("#txtMonthlyBasicPay").val() * 12 / 313 / 8);
}
</script>
<?= $this->endSection() ?>
<!-- .Javascript -->

@ -0,0 +1,123 @@
<!-- Extend area where template is defined -->
<?= $this->extend('templates/adminlte/generalcontent') ?>
<!-- .Extend -->
<!-- Title of the page -->
<?= $this->section('title') ?>Payroll Type<?= $this->endSection() ?>
<!-- .Title -->
<!-- CSS of the page -->
<?= $this->section('css') ?>
<?= $this->endSection() ?>
<!-- .CSS -->
<!-- body attribute - class definition -->
<?= $this->section('bodyclass') ?>sidebar-mini<?= $this->endSection() ?>
<!-- .body attribute -->
<!-- Container title -->
<?= $this->section('containertitle') ?>Payroll Type<?= $this->endSection() ?>
<!-- .Container title -->
<!-- Active breadcrumb -->
<?= $this->section('activebreadcrumb') ?>Payroll Type<?= $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">
<?= $tblPayrollType ?>
</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>
<?= $this->endSection() ?>
<!-- .Main content -->
<!-- Javascript -->
<?= $this->section('js') ?>
<script>
$(document).ready(function() {
});
</script>
<?= $this->endSection() ?>
<!-- .Javascript -->

@ -212,7 +212,7 @@
<ul class="nav nav-treeview"> <ul class="nav nav-treeview">
<li class="nav-item"> <li class="nav-item">
<a href="/payroll/paygroup" class="nav-link"> <a href="/payroll/paygroup" class="nav-link">
<i class="nav-icon fas fa-calendar-alt"></i> <i class="far fa-circle nav-icon"></i>
<p> <p>
Payroll Group Payroll Group
</p> </p>
@ -220,12 +220,47 @@
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="/payroll/inded" class="nav-link"> <a href="/payroll/inded" class="nav-link">
<i class="nav-icon fas fa-calendar-alt"></i> <i class="far fa-circle nav-icon"></i>
<p> <p>
Income and Deductions Income and Deductions
</p> </p>
</a> </a>
</li> </li>
<li class="nav-item">
<a href="/payroll/paytype" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>
Payroll Type
</p>
</a>
</li>
</ul>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-calendar-alt"></i>
<p>
Employee Payroll
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="/payroll/emppayinfo" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>
Employee Pay Info
</p>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>
Deductions
</p>
</a>
</li>
</ul> </ul>
</li> </li>
<li class="nav-item"> <li class="nav-item">

Loading…
Cancel
Save