application/modules/payroll/models/Rpt_slip_gaji_model.php
// fungsi ini dipanggi di helper detail_lembur_helper untuk digunakan pemanggilan komponen gaji di laporan slip gaji karyawan
fungsi ini dipanggi di helper detail_lembur_helper untuk digunakan pemanggilan komponen gaji di laporan slip gaji karyawan
fungsi ini dipanggi di helper detail_lembur_helper untuk digunakan pemanggilan komponen gaji di laporan slip gaji karyawan
function detail_lembur($id)
    {
$query = $this->db->query('select 
  COALESCE(a.empcode, "Grand Total") AS empcode,
  COALESCE(b.empname, "Sub Total") AS empname,
  COALESCE(a.attd_date, "Sub Total") AS attd_date,
  c.upah,
  a.total_jam_lembur,
  a.attd_code,
  ROUND((a.total_jam_lembur * 1 / 173 * c.upah)) AS lembur,
  COALESCE(
    ROUND((1 / 173 * c.upah) * SUM(a.total_jam_lembur)),
    0
  ) AS total,
  CASE
    WHEN a.work_hour > 0 THEN c.kehadiran_pagi
  END AS kehadiran,
  a.remarks 
FROM
  gang_activity a,
  emp_master b,
  hr_hist_status c 
WHERE a.empcode = b.empcode 
  AND a.empcode = c.empcode 
  AND a.empcode = "'.$id.'" 
  AND a.attd_date BETWEEN "2018-08-26" 
  AND "2018-09-25" 
GROUP BY a.attd_date WITH ROLLUP');
        return $query->result_array();
    }
function detail_lembur ( $ id ) { $ query = $ this -> db -> query ( 'select 
  COALESCE(a.empcode, "Grand Total") AS empcode,
  COALESCE(b.empname, "Sub Total") AS empname,
  COALESCE(a.attd_date, "Sub Total") AS attd_date,
  c.upah,
  a.total_jam_lembur,
  a.attd_code,
  ROUND((a.total_jam_lembur * 1 / 173 * c.upah)) AS lembur,
  COALESCE(
    ROUND((1 / 173 * c.upah) * SUM(a.total_jam_lembur)),
    0
  ) AS total,
  CASE
    WHEN a.work_hour > 0 THEN c.kehadiran_pagi
  END AS kehadiran,
  a.remarks 
FROM
  gang_activity a,
  emp_master b,
  hr_hist_status c 
WHERE a.empcode = b.empcode 
  AND a.empcode = c.empcode 
  AND a.empcode = "' . $ id . '" 
  AND a.attd_date BETWEEN "2018-08-26" 
  AND "2018-09-25" 
GROUP BY a.attd_date WITH ROLLUP' ) ; return $ query -> result_array ( ) ; }
fungsi ini dipanggi di helper detail_lembur_helper untuk digunakan pemanggilan komponen gaji di laporan slip gaji karyawan
fungsi ini dipanggi di helper detail_lembur_helper untuk digunakan pemanggilan komponen gaji di laporan slip gaji karyawan
/*$query = $this->db->query('
select COALESCE(a.empcode,"Grand Total") as empcode, COALESCE(b.empname,"Sub Total") as empname, COALESCE(a.attd_date,"Sub Total") as attd_date,c.upah, a.overtime, a.attd_code,
round((a.overtime * 1 / 173 * c.upah)) as lembur
, coalesce(ROUND((1/173*c.upah) * SUM(a.overtime)),0) as total,a.remarks
from gang_activity a, emp_master b, hr_hist_status c
where a.empcode = b.empcode
and a.empcode = c.empcode
and a.empcode = "'.$id.'"
and a.attd_date BETWEEN "'.$filter_start_date.'" AND "'.$filter_end_date.'" 
GROUP BY  a.attd_date
WITH ROLLUP');*/