added schedule on income and deduction

added schedule on income and deduction
pull/10/head
paulcortez 8 months ago
parent 5f547147a2
commit ca2c3072a6

@ -259,10 +259,18 @@ class PayrollController extends BaseController
if($this->request->getGet('empid') != null)
{
$settingsModel = new SettingsModel();
$iconView = '<a href="#" class="ml-3" data-toggle="tooltip" title="View Employee Information" ><i class="fas fa-eye "></i></a>';
$iconEdit = '<a href="#" class="ml-3" data-toggle="tooltip" title="Edit Employee Information" ><i class="fas fa-edit "></i></a>';
$iconDelete = '<a href="#" class="ml-3" data-toggle="tooltip" title="Delete Employee Information"><i class="fas fa-trash "></i></a>';
$data['empLoaded'] = true;
$data['selectedEmployee'] = $empPayInfoModel->getEmpPayInfoJoinedEmpPayTypeByEmpID($this->request->getGet('empid'));
$data['empPayIncomeList'] = $empPayInDedModel->getEmpPayInDedByEmpPayId($data['selectedEmployee']->emppay_id, $this->request->getGet('payschedid'), true);
$data['empPayDeductionList'] = $empPayInDedModel->getEmpPayInDedByEmpPayId($data['selectedEmployee']->emppay_id, $this->request->getGet('payschedid'),false);
$data['empPayIncomeList'] = $empPayInDedModel->getEmpPayInDedByEmpPayIdSchedId($data['selectedEmployee']->emppay_id, $this->request->getGet('payschedid'), true);
$data['empPayDeductionList'] = $empPayInDedModel->getEmpPayInDedByEmpPayIdSchedId($data['selectedEmployee']->emppay_id, $this->request->getGet('payschedid'),false);
print_r($data['empPayDeductionList']);
}
return view('payroll/compensationbenefitsview', $data);

@ -22,7 +22,7 @@ class CompanyBranchModel extends Model
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
@ -36,25 +36,23 @@ class CompanyBranchModel extends Model
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = ['assignCreatedAt'];
protected $beforeInsert = ['assignCreatedBy'];
protected $afterInsert = [];
protected $beforeUpdate = ['assignUpdatedAt'];
protected $beforeUpdate = ['assignUpdatedBy'];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function assignCreatedAt(array $data)
public function assignCreatedBy(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)
public function assignUpdatedBy(array $data)
{
$data['data']['updated_at'] = date('Y-m-d H:i:s');
$data['data']['updated_by'] = auth()->user()->employee_id;
return $data;
}

@ -20,7 +20,7 @@ class CompanyDepartmentModel extends Model
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
@ -34,9 +34,9 @@ class CompanyDepartmentModel extends Model
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = ['assignCreatedAt'];
protected $beforeInsert = ['assignCreatedBy'];
protected $afterInsert = [];
protected $beforeUpdate = ['assignUpdatedAt'];
protected $beforeUpdate = ['assignUpdatedBy'];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
@ -44,16 +44,14 @@ class CompanyDepartmentModel extends Model
protected $afterDelete = [];
public function assignCreatedAt(array $data)
public function assignCreatedBy(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)
public function assignUpdatedBy(array $data)
{
$data['data']['updated_at'] = date('Y-m-d H:i:s');
$data['data']['updated_by'] = auth()->user()->employee_id;
return $data;
}

@ -24,7 +24,7 @@ class CompanyInfoModel extends Model
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
@ -38,25 +38,23 @@ class CompanyInfoModel extends Model
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = ['assignCreatedAt'];
protected $beforeInsert = ['assignCreatedBy'];
protected $afterInsert = [];
protected $beforeUpdate = ['assignUpdatedAt'];
protected $beforeUpdate = ['assignUpdatedBy'];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function assignCreatedAt(array $data)
public function assignCreatedBy(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)
public function assignUpdatedBy(array $data)
{
$data['data']['updated_at'] = date('Y-m-d H:i:s');
$data['data']['updated_by'] = auth()->user()->employee_id;
return $data;
}

@ -24,7 +24,7 @@ class EmpPayIncomeDeductionModel extends Model
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
@ -38,31 +38,28 @@ class EmpPayIncomeDeductionModel extends Model
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = ['assignCreatedAt'];
protected $beforeInsert = ['assignCreatedBy'];
protected $afterInsert = [];
protected $beforeUpdate = ['assignUpdatedAt'];
protected $beforeUpdate = ['assignUpdatedBy'];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function assignCreatedAt(array $data)
public function assignCreatedBy(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)
public function assignUpdatedBy(array $data)
{
$data['data']['updated_at'] = date('Y-m-d H:i:s');
$data['data']['updated_by'] = auth()->user()->employee_id;
return $data;
}
public function getEmpPayInDedByEmpPayId($empPayId, $paySchedId, $isIncome)
public function getEmpPayInDedByEmpPayIdSchedId($empPayId, $paySchedId, $isIncome)
{
$builder = $this->db->table('emp_pay_inded');
$builder->select('*');

@ -29,7 +29,7 @@ class EmployeeModel extends Model
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
@ -43,26 +43,23 @@ class EmployeeModel extends Model
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = ['assignCreatedAt'];
protected $beforeInsert = ['assignCreatedBy'];
protected $afterInsert = [];
protected $beforeUpdate = ['assignUpdatedAt'];
protected $beforeUpdate = ['assignUpdatedBy'];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function assignCreatedAt(array $data)
public function assignCreatedBy(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)
public function assignUpdatedBy(array $data)
{
$data['data']['updated_at'] = date('Y-m-d H:i:s');
$data['data']['updated_by'] = auth()->user()->employee_id;
return $data;
}

@ -17,7 +17,7 @@ class EmploymentStatusModel extends Model
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
@ -31,25 +31,23 @@ class EmploymentStatusModel extends Model
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = ['assignCreatedAt'];
protected $beforeInsert = ['assignCreatedBy'];
protected $afterInsert = [];
protected $beforeUpdate = ['assignUpdatedAt'];
protected $beforeUpdate = ['assignUpdatedBy'];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function assignCreatedAt(array $data)
public function assignCreatedBy(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)
public function assignUpdatedBy(array $data)
{
$data['data']['updated_at'] = date('Y-m-d H:i:s');
$data['data']['updated_by'] = auth()->user()->employee_id;
return $data;
}

@ -22,7 +22,7 @@ class IncomeDeductionModel extends Model
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
@ -36,26 +36,23 @@ class IncomeDeductionModel extends Model
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = ['assignCreatedAt'];
protected $beforeInsert = ['assignCreatedBy'];
protected $afterInsert = [];
protected $beforeUpdate = ['assignUpdatedAt'];
protected $beforeUpdate = ['assignUpdatedBy'];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function assignCreatedAt(array $data)
public function assignCreatedBy(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)
public function assignUpdatedBy(array $data)
{
$data['data']['updated_at'] = date('Y-m-d H:i:s');
$data['data']['updated_by'] = auth()->user()->employee_id;
return $data;
}

@ -17,7 +17,7 @@ class JobTitleModel extends Model
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
@ -31,25 +31,23 @@ class JobTitleModel extends Model
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = ['assignCreatedAt'];
protected $beforeInsert = ['assignCreatedBy'];
protected $afterInsert = [];
protected $beforeUpdate = ['assignUpdatedAt'];
protected $beforeUpdate = ['assignUpdatedBy'];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function assignCreatedAt(array $data)
public function assignCreatedBy(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)
public function assignUpdatedBy(array $data)
{
$data['data']['updated_at'] = date('Y-m-d H:i:s');
$data['data']['updated_by'] = auth()->user()->employee_id;
return $data;
}

@ -17,7 +17,7 @@ class PayrollGroupModel extends Model
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
@ -31,25 +31,23 @@ class PayrollGroupModel extends Model
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = ['assignCreatedAt'];
protected $beforeInsert = ['assignCreatedBy'];
protected $afterInsert = [];
protected $beforeUpdate = ['assignUpdatedAt'];
protected $beforeUpdate = ['assignUpdatedBy'];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function assignCreatedAt(array $data)
public function assignCreatedBy(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)
public function assignUpdatedBy(array $data)
{
$data['data']['updated_at'] = date('Y-m-d H:i:s');
$data['data']['updated_by'] = auth()->user()->employee_id;
return $data;
}

@ -17,7 +17,7 @@ class PayrollScheduleModel extends Model
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
@ -31,22 +31,22 @@ class PayrollScheduleModel extends Model
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = ['assignCreatedAt'];
protected $beforeInsert = ['assignCreatedBy'];
protected $afterInsert = [];
protected $beforeUpdate = ['assignUpdatedAt'];
protected $beforeUpdate = ['assignUpdatedBy'];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function assignCreatedAt(array $data)
public function assignCreatedBy(array $data)
{
$data['data']['created_by'] = auth()->user()->employee_id;
return $data;
}
public function assignUpdatedAt(array $data)
public function assignUpdatedBy(array $data)
{
$data['data']['updated_by'] = auth()->user()->employee_id;
return $data;

@ -22,7 +22,7 @@ class PayrollTypeModel extends Model
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
@ -36,25 +36,23 @@ class PayrollTypeModel extends Model
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = ['assignCreatedAt'];
protected $beforeInsert = ['assignCreatedBy'];
protected $afterInsert = [];
protected $beforeUpdate = ['assignUpdatedAt'];
protected $beforeUpdate = ['assignUpdatedBy'];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function assignCreatedAt(array $data)
public function assignCreatedBy(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)
public function assignUpdatedBy(array $data)
{
$data['data']['updated_at'] = date('Y-m-d H:i:s');
$data['data']['updated_by'] = auth()->user()->employee_id;
return $data;
}

@ -234,46 +234,63 @@
</tr>
</thead>
<tbody>
<tr>
<td><span class="pl-3">Basic Salary</span></td>
<td>&nbsp;</td>
<td class="text-right"><?= number_format($selectedEmployee->basic_semi_monthly_pay, 2, ".", ",") ?></td>
<td>&nbsp;</td>
</tr>
<?php
$grossTotal = 0;
$deductionTotal = 0;
$netTotal = 0;
foreach($empPayIncomeList as $empPayIncome):?>
<tr>
<td><span class="pl-3"><?= $empPayIncome->inded_name ?></span></td>
<td>&nbsp;</td>
<td><?= $empPayIncome->amount ?></td>
<td>&nbsp;</td>
<td><span class="pl-3"><?= $empPayIncome->inded_name ?></span></td>
<td>&nbsp;</td>
<td class="text-right"><?= number_format($empPayIncome->amount, 2, ".", ",") ?></td>
<td>&nbsp;</td>
</tr>
<?php endforeach; ?>
<?php
$grossTotal += $empPayIncome->amount;
endforeach; ?>
<tr>
<td><strong>Gross Total</strong></td>
<td>&nbsp;</td>
<td><strong>$500.00</strong></td>
<td>&nbsp;</td>
<td><strong>Gross Total</strong></td>
<td>&nbsp;</td>
<td class="text-right"><strong>Php <?= number_format($grossTotal, 2, ".", ","); ?></strong></td>
<td>&nbsp;</td>
</tr>
<?php foreach($empPayDeductionList as $empPayDeduction):?>
<tr>
<td><span class="pl-3"><?= $empPayDeduction->inded_name ?></span></td>
<td>-<?= $empPayDeduction->amount ?></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><span class="pl-3"><?= $empPayDeduction->inded_name ?></span></td>
<td class="text-right">-<?= number_format($empPayDeduction->amount, 2, ".", ",") ?></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<?php endforeach; ?>
<?php
$deductionTotal += $empPayDeduction->amount;
endforeach;
?>
<tr>
<td><strong>Total Deductions</strong></td>
<td><strong>$500.00</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><strong>Total Deductions</strong></td>
<td class="text-right"><strong>Php <?= number_format($deductionTotal, 2, ".", ","); ?></strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
<tfoot>
<tr>
<th><span class="text-uppercase">Net Income</span></th>
<td>&nbsp;</td>
<th>$3300.00</th>
<td>&nbsp;</td>
<th><span class="text-uppercase">Net Income</span></th>
<td>&nbsp;</td>
<th class="text-right">Php <?= number_format($grossTotal - $deductionTotal, 2, ".", ",") ?></th>
<td>&nbsp;</td>
</tr>
</tfoot>
</table>

Loading…
Cancel
Save