parent
94ef2e070a
commit
da9a3b315d
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class CreateIncomeDeduction extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField([
|
||||
'inded_id' => [
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => true,
|
||||
'auto_increment' => true
|
||||
],
|
||||
'payslip_display' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 25,
|
||||
'null' => false
|
||||
],
|
||||
'inded_name' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 255,
|
||||
'null' => false
|
||||
],
|
||||
'coa_code' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 25,
|
||||
'null' => true,
|
||||
],
|
||||
'is_income' => [
|
||||
'type' => 'TINYINT',
|
||||
'constraint' => 1,
|
||||
'null' => false
|
||||
],
|
||||
'is_taxable' => [
|
||||
'type' => 'TINYINT',
|
||||
'constraint' => 1,
|
||||
'null' => false
|
||||
],
|
||||
'include_in_gross' => [
|
||||
'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('inded_id', true);
|
||||
$this->forge->createTable('pay_income_deduction');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable('pay_income_deduction');
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class IncomeDeduction extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
'inded_id' => null,
|
||||
'payslip_display' => null,
|
||||
'inded_name' => null,
|
||||
'coa_code' => null,
|
||||
'is_income' => null,
|
||||
'is_taxable' => null,
|
||||
'include_in_gross' => null,
|
||||
];
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $casts = [];
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class IncomeDeductionModel extends Model
|
||||
{
|
||||
protected $table = 'pay_income_deduction';
|
||||
protected $primaryKey = 'inded_id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = \App\Entities\IncomeDeduction::class;
|
||||
protected $useSoftDeletes = false;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = ['payslip_display',
|
||||
'inded_name',
|
||||
'coa_code',
|
||||
'is_income',
|
||||
'is_taxable',
|
||||
'include_in_gross'];
|
||||
|
||||
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,129 @@
|
||||
<!-- Extend area where template is defined -->
|
||||
<?= $this->extend('templates/adminlte/generalcontent') ?>
|
||||
<!-- .Extend -->
|
||||
|
||||
<!-- Title of the page -->
|
||||
<?= $this->section('title') ?>Income and Deduction<?= $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') ?>Income and Deduction<?= $this->endSection() ?>
|
||||
<!-- .Container title -->
|
||||
|
||||
<!-- Active breadcrumb -->
|
||||
<?= $this->section('activebreadcrumb') ?>Income and Deduction<?= $this->endSection() ?>
|
||||
<!-- .Active breadcrumb -->
|
||||
|
||||
<!-- Main content -->
|
||||
<?= $this->section('main') ?>
|
||||
|
||||
<!-- Modal Add Branch -->
|
||||
<div class="modal fade" id="mdlAddInDed">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="<?= url_to('payroll/addinded') ?>" method="post">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" >New 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="txtInDedName">Income or Deduction Name</label>
|
||||
<input class="form-control" type="text" id="txtInDedName" name="inded_name" values="<?= old('inded_name') ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="txtPayslipDisplay">Display on Payslip</label>
|
||||
<input class="form-control" type="text" id="txtPayslipDisplay" name="payslip_display" value="<?= old('payslip_display') ?>">
|
||||
<p style="font-size: smaller"><i>Short name that will appear in payslip</i></p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="txtCOACode">COA Code</label>
|
||||
<input class="form-control" type="text" id="txtCOACode" name="coa_code" value="<?= old('coa_code') ?>">
|
||||
<p style="font-size: smaller"><i>COA code (Chart of Account) is a code used by accounting department</i></p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" id="chkIsIncome" name="is_income">
|
||||
<label for="chkIsIncome" class="custom-control-label">Is Income? this will be treated as deduction if unchecked</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" id="chkIsTaxable" name="is_taxable">
|
||||
<label for="chkIsTaxable" class="custom-control-label">Is Taxable? this will be treated as non-taxable if unchecked</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" id="chkIncludeInGross" name="include_in_gross">
|
||||
<label for="chkIncludeInGross" class="custom-control-label">Include in Gross?</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 Income and Deduction</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card-body table-responsive p-0">
|
||||
<?= $tblIncomeDeduction ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#mdlAddInDed">Add Income or Deduction</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
<!-- .Main content -->
|
||||
|
||||
<!-- Javascript -->
|
||||
|
||||
<?= $this->section('js') ?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<!-- .Javascript -->
|
Binary file not shown.
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 3.1 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue