hr dan payroll
This commit is contained in:
@@ -9,13 +9,15 @@ class AccountModel extends CI_Model
|
||||
return array();
|
||||
}
|
||||
|
||||
$rows = $this->db
|
||||
->select('id')
|
||||
$this->db->select('id')
|
||||
->where_in('id', array_values(array_unique($ids)))
|
||||
->where('is_active', 1)
|
||||
->where('allow_posting', 1)
|
||||
->get('accounts')
|
||||
->result_array();
|
||||
->where('allow_posting', 1);
|
||||
if ($this->db->field_exists('company_id', 'accounts')) {
|
||||
$companyId = isset($this->companycontext) ? (int)$this->companycontext->id() : (int)$this->session->userdata('company_id');
|
||||
$this->db->where('company_id', $companyId);
|
||||
}
|
||||
$rows = $this->db->get('accounts')->result_array();
|
||||
return array_map('intval', array_column($rows, 'id'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,11 @@ class JournalModel extends CI_Model
|
||||
}
|
||||
}
|
||||
|
||||
public function referenceExists($reference)
|
||||
public function referenceExists($reference, $excludeId = 0)
|
||||
{
|
||||
return $this->db->where('no_ref', $reference)->count_all_results('journals') > 0;
|
||||
$this->db->where('no_ref', $reference);
|
||||
if ((int) $excludeId > 0) $this->db->where('id !=', (int) $excludeId);
|
||||
return $this->db->count_all_results('journals') > 0;
|
||||
}
|
||||
|
||||
public function sourceExists($type, $id)
|
||||
|
||||
Reference in New Issue
Block a user