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