parent
2a68e8e9d2
commit
5f547147a2
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class CreatePaySchedule extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField([
|
||||
'payschedule_id' => [
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => true,
|
||||
'auto_increment' => true
|
||||
],
|
||||
'sched_code' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 25,
|
||||
'null' => false
|
||||
],
|
||||
'sched_name' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 255,
|
||||
'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('payschedule_id', true);
|
||||
$this->forge->createTable('pay_schedule');
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable('pay_schedule');
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class PayrollSchedule extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
'sched_code' => null,
|
||||
'sched_name' => null,
|
||||
];
|
||||
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $casts = [];
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class Settings extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
'id' => null,
|
||||
'class' => null,
|
||||
'key' => null,
|
||||
'value' => null,
|
||||
'type' => null,
|
||||
'context' => null,
|
||||
];
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $casts = [];
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class PayrollScheduleModel extends Model
|
||||
{
|
||||
protected $table = 'pay_schedule';
|
||||
protected $primaryKey = 'payschedule_id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = \App\Entities\PayrollSchedule::class;
|
||||
protected $useSoftDeletes = false;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = ['sched_code', 'sched_name'];
|
||||
|
||||
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_by'] = auth()->user()->employee_id;
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function assignUpdatedAt(array $data)
|
||||
{
|
||||
$data['data']['updated_by'] = auth()->user()->employee_id;
|
||||
return $data;
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class SettingsModel extends Model
|
||||
{
|
||||
protected $table = 'settings';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = \App\Entities\Settings::class;
|
||||
protected $useSoftDeletes = false;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = ['class', 'key', 'value', 'type', 'context'];
|
||||
|
||||
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');
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function assignUpdatedAt(array $data)
|
||||
{
|
||||
$data['data']['updated_at'] = date('Y-m-d H:i:s');
|
||||
return $data;
|
||||
}
|
||||
}
|
@ -0,0 +1,207 @@
|
||||
<!-- Extend area where template is defined -->
|
||||
<?= $this->extend('templates/adminlte/generalcontent') ?>
|
||||
<!-- .Extend -->
|
||||
|
||||
<!-- Title of the page -->
|
||||
<?= $this->section('title') ?>Payroll Settings<?= $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 Settings<?= $this->endSection() ?>
|
||||
<!-- .Container title -->
|
||||
|
||||
<!-- Active breadcrumb -->
|
||||
<?= $this->section('activebreadcrumb') ?>Payroll Settings<?= $this->endSection() ?>
|
||||
<!-- .Active breadcrumb -->
|
||||
|
||||
<!-- Main content -->
|
||||
<?= $this->section('main') ?>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">List of Payroll Settings</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>Assign proper value to each payroll settings for proper payroll computation during payroll processing.</p>
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Setting</th>
|
||||
<th>Value</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Save Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<form action="/payroll/paysettings" method="POST">
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<?php if($basicSalVal != null): ?>
|
||||
<input type="hidden" name="id" value="<?= $basicSalVal->id ?>">
|
||||
<?php endif ?>
|
||||
<input type="hidden" name="class" value="Payroll">
|
||||
<input type="text" class="form-control" name="key" value="BasicSalary" readonly>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" style="width: 100%;" name="value">
|
||||
<?php foreach($indedList as $inded): ?>
|
||||
<?php $selected = ($basicSalVal != null && $basicSalVal->value == $inded->inded_id) ? 'selected' : ''; ?>
|
||||
<?= '<option value="'.$inded->inded_id.'" '.$selected.'>'.$inded->inded_name.'</option>' ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" class="form-control" name="type" value="int" readonly></td>
|
||||
<td><input type="text" class="form-control" name="context" value="Basic Salary" readonly></td>
|
||||
<td><input type="submit" class="btn btn-primary" value="Save"></td>
|
||||
</tr>
|
||||
</form>
|
||||
<form action="/payroll/paysettings" method="POST">
|
||||
<tr>
|
||||
<td>
|
||||
<?php if($COLAVal != null): ?>
|
||||
<input type="hidden" name="id" value="<?= $COLAVal->id ?>">
|
||||
<?php endif ?>
|
||||
<input type="hidden" name="class" value="Payroll">
|
||||
<input type="text" class="form-control" name="key" value="COLA" readonly>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" style="width: 100%;" name="value">
|
||||
<?php foreach($indedList as $inded): ?>
|
||||
<?php $selected = ($COLAVal != null && $COLAVal->value == $inded->inded_id) ? 'selected' : ''; ?>
|
||||
<?= '<option value="'.$inded->inded_id.'" '.$selected.'>'.$inded->inded_name.'</option>' ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" class="form-control" name="type" value="int" readonly></td>
|
||||
<td><input type="text" class="form-control" name="context" value="Cost of Living Allowance" readonly></td>
|
||||
<td><input type="submit" class="btn btn-primary" value="Save"></td>
|
||||
</tr>
|
||||
</form>
|
||||
<form action="/payroll/paysettings" method="POST">
|
||||
<tr>
|
||||
<td>
|
||||
<?php if($PhilhealthVal != null): ?>
|
||||
<input type="hidden" name="id" value="<?= $PhilhealthVal->id ?>">
|
||||
<?php endif ?>
|
||||
<input type="hidden" name="class" value="Payroll">
|
||||
<input type="text" class="form-control" name="key" value="Philhealth" readonly>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" style="width: 100%;" name="value">
|
||||
<?php foreach($indedList as $inded): ?>
|
||||
<?php $selected = ($PhilhealthVal != null && $PhilhealthVal->value == $inded->inded_id) ? 'selected' : ''; ?>
|
||||
<?= '<option value="'.$inded->inded_id.'" '.$selected.'>'.$inded->inded_name.'</option>' ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" class="form-control" name="type" value="int" readonly></td>
|
||||
<td><input type="text" class="form-control" name="context" value="Philhealth Contribution" readonly></td>
|
||||
<td><input type="submit" class="btn btn-primary" value="Save"></td>
|
||||
</tr>
|
||||
</form>
|
||||
<form action="/payroll/paysettings" method="POST">
|
||||
<tr>
|
||||
<td>
|
||||
<?php if($HDMFVal != null): ?>
|
||||
<input type="hidden" name="id" value="<?= $HDMFVal->id ?>">
|
||||
<?php endif ?>
|
||||
<input type="hidden" name="class" value="Payroll">
|
||||
<input type="text" class="form-control" name="key" value="HDMF" readonly>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" style="width: 100%;" name="value">
|
||||
<?php foreach($indedList as $inded): ?>
|
||||
<?php $selected = ($HDMFVal != null && $HDMFVal->value == $inded->inded_id) ? 'selected' : ''; ?>
|
||||
<?= '<option value="'.$inded->inded_id.'" '.$selected.'>'.$inded->inded_name.'</option>' ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" class="form-control" name="type" value="int" readonly></td>
|
||||
<td><input type="text" class="form-control" name="context" value="Pag-IBIG Contribution" readonly></td>
|
||||
<td><input type="submit" class="btn btn-primary" value="Save"></td>
|
||||
</tr>
|
||||
</form>
|
||||
<form action="/payroll/paysettings" method="POST">
|
||||
<tr>
|
||||
<td>
|
||||
<?php if($SSSVal != null): ?>
|
||||
<input type="hidden" name="id" value="<?= $SSSVal->id ?>">
|
||||
<?php endif ?>
|
||||
<input type="hidden" name="class" value="Payroll">
|
||||
<input type="text" class="form-control" name="key" value="SSS" readonly>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" style="width: 100%;" name="value">
|
||||
<?php foreach($indedList as $inded): ?>
|
||||
<?php $selected = ($SSSVal != null && $SSSVal->value == $inded->inded_id) ? 'selected' : ''; ?>
|
||||
<?= '<option value="'.$inded->inded_id.'" '.$selected.'>'.$inded->inded_name.'</option>' ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" class="form-control" name="type" value="int" readonly></td>
|
||||
<td><input type="text" class="form-control" name="context" value="SSS Contribution" readonly></td>
|
||||
<td><input type="submit" class="btn btn-primary" value="Save"></td>
|
||||
</tr>
|
||||
</form>
|
||||
<form action="/payroll/paysettings" method="POST">
|
||||
<tr>
|
||||
<td>
|
||||
<?php if($GSISVal != null): ?>
|
||||
<input type="hidden" name="id" value="<?= $GSISVal->id ?>">
|
||||
<?php endif ?>
|
||||
<input type="hidden" name="class" value="Payroll">
|
||||
<input type="text" class="form-control" name="key" value="GSIS" readonly>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" style="width: 100%;" name="value">
|
||||
<?php foreach($indedList as $inded): ?>
|
||||
<?php $selected = ($GSISVal != null && $GSISVal->value == $inded->inded_id) ? 'selected' : ''; ?>
|
||||
<?= '<option value="'.$inded->inded_id.'" '.$selected.'>'.$inded->inded_name.'</option>' ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" class="form-control" name="type" value="int" readonly></td>
|
||||
<td><input type="text" class="form-control" name="context" value="GSIS Contribution" readonly></td>
|
||||
<td><input type="submit" class="btn btn-primary" value="Save"></td>
|
||||
</tr>
|
||||
</form>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
<!-- .Main content -->
|
||||
|
||||
<!-- Javascript -->
|
||||
|
||||
<?= $this->section('js') ?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<!-- .Javascript -->
|
Loading…
Reference in New Issue