You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
3.9 KiB
89 lines
3.9 KiB
<?php |
|
|
|
namespace App\Models; |
|
|
|
use CodeIgniter\Model; |
|
|
|
class Mrapor extends Model |
|
{ |
|
|
|
|
|
function getRatKwl($param) |
|
{ |
|
$tahun = $param['tahun']; |
|
$bln = $param['bln']; |
|
$query = $this->db->query(" SELECT B.NM_PDK nama, |
|
B.NAMA NM_PANJANG, |
|
a.KWLADM, |
|
SUM (wp_bayar) wpbyr, |
|
SUM (wp_bayar_teratur) wpbyrteratur, |
|
sum(jml_wp) jmlwp |
|
FROM GENAPP.RAPOR_WP_BAYAR a |
|
LEFT JOIN GENAPP.REF_KANWIL b ON a.KWLADM = b.KODE |
|
WHERE THN_BYR = '" . $tahun . "' and b.NM_PDK IS NOT NULL and bln_byr = to_number('" . $bln . "') |
|
group by b.NM_PDK, a.KWLADM, B.NAMA |
|
"); |
|
return $query; |
|
} |
|
|
|
public function getRatKpp($param) |
|
{ |
|
$tahun = $param['tahun']; |
|
$bln = $param['bln']; |
|
$query = $this->db->query("SELECT SUBSTR(b.NM_KANTOR, 5) nama, |
|
a.KWLADM, |
|
a.KPPADM, |
|
SUM(wp_bayar) wpbyr, |
|
SUM(wp_bayar_teratur) wpbyrteratur, |
|
SUM(jml_wp) jmlwp |
|
FROM GENAPP.RAPOR_WP_BAYAR a |
|
LEFT JOIN GENAPP.REF_KPP b ON a.KPPADM = b.KD_KPP |
|
WHERE THN_BYR = '{$tahun}' AND b.NM_KANTOR IS NOT NULL AND BLN_BYR = TO_NUMBER('{$bln}') |
|
GROUP BY b.NM_KANTOR, a.KWLADM, a.KPPADM"); |
|
return $query; |
|
} |
|
|
|
public function getRatSie($param) |
|
{ |
|
$tahun = $param['tahun']; |
|
$bln = $param['bln']; |
|
$query = $this->db->query("SELECT SUBSTR(b.NAMA_UNIT_ES4, 7) nama, a.KWLADM, a.KPPADM, a.KODESIE, SUM(wp_bayar) wpbyr, SUM(wp_bayar_teratur) wpbyrteratur, SUM(jml_wp) jmlwp |
|
FROM GENAPP.RAPOR_WP_BAYAR a |
|
LEFT JOIN GENAPP.REF_SEKSI b ON a.KODESIE = b.KODESIE |
|
WHERE THN_BYR = '{$tahun}' AND b.NAMA_UNIT_ES4 IS NOT NULL AND BLN_BYR = TO_NUMBER('{$bln}') |
|
GROUP BY b.NAMA_UNIT_ES4, a.KWLADM, a.KPPADM, a.KODESIE"); |
|
return $query; |
|
} |
|
|
|
public function getRatPeg($param) |
|
{ |
|
$tahun = $param['tahun']; |
|
$bln = $param['bln']; |
|
$query = $this->db->query("SELECT B.NAMA, a.KWLADM, a.KPPADM, a.KODESIE, a.NIP, SUM(wp_bayar) wpbyr, SUM(wp_bayar_teratur) wpbyrteratur, SUM(jml_wp) jmlwp |
|
FROM GENAPP.RAPOR_WP_BAYAR a |
|
LEFT JOIN GENAPP.REF_AR b ON a.NIP = b.NIP |
|
WHERE THN_BYR = '{$tahun}' AND b.NAMA IS NOT NULL AND BLN_BYR = TO_NUMBER('{$bln}') |
|
GROUP BY b.nama, a.KWLADM, a.KPPADM, a.KODESIE, a.NIP"); |
|
return $query; |
|
} |
|
|
|
// public function getLapKwl($param) |
|
// { |
|
// $tahun = $param['tahun']; |
|
// $bln = $param['bln']; |
|
// $query = $this->db->query(" SELECT B.NM_PDK nama, |
|
// B.NAMA NM_PANJANG, |
|
// a.KWLADM, |
|
// SUM (wp_bayar) wpbyr, |
|
// SUM (wp_bayar_teratur) wpbyrteratur, |
|
// sum(jml_wp) jmlwp |
|
// FROM GENAPP.RAPOR_WP_LAPOR_V3 a |
|
// LEFT JOIN GENAPP.REF_KANWIL b ON a.KWLADM = b.KODE |
|
// WHERE THN_BYR = '" . $tahun . "' and b.NM_PDK IS NOT NULL and bln_byr = to_number('" . $bln . "') |
|
// group by b.NM_PDK, a.KWLADM, B.NAMA |
|
// "); |
|
// return $query; |
|
// } |
|
|
|
|
|
}
|
|
|