From 2066336f501b40d88cc90d87ce3b38340d869e1f Mon Sep 17 00:00:00 2001 From: dfoso Date: Thu, 29 Feb 2024 14:13:16 +0700 Subject: [PATCH] change base to monthly pen --- app/Controllers/Home.php | 9 ++++++++- app/Models/Mpemby.php | 6 +++--- app/Views/ppm/dashboard.php | 6 +++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php index ab69269a..941dfded 100644 --- a/app/Controllers/Home.php +++ b/app/Controllers/Home.php @@ -17,12 +17,19 @@ class Home extends BaseController $model = new Mpemby(); $ptahun = $this->request->getPost('tahun'); + $pbulan = $this->request->getPost('bulan'); if (empty($ptahun)) { $tahun = date('Y'); } else { $tahun = $ptahun; } - $param = array('tahun' => $tahun); + if (empty($pbulan)) { + $bulan = date('m'); + } else { + $bulan = $pbulan; + } + + $param = array('tahun' => $tahun, 'bln' => $bulan); $p['tahunx'] = $tahun; $p['penerimaan'] = $model->getPenn($param)->getResult(); $p['updatex'] = $model->getUpd()->getFirstRow('array'); diff --git a/app/Models/Mpemby.php b/app/Models/Mpemby.php index 7d65d050..477e666a 100644 --- a/app/Models/Mpemby.php +++ b/app/Models/Mpemby.php @@ -10,7 +10,7 @@ class Mpemby extends Model function getPenn($param) { $tahun = $param['tahun']; - $bln = date('m'); + $bln = $param['bln']; $query = $this->db->query("SELECT NM_KANWIL, TARGET, SUM(PENERIMAAN_BERJALAN) PENB, SUM(PENERIMAAN_LALU) PENL, (SUM(PENERIMAAN_BERJALAN)/TARGET)*100 PENCAPAIAN, ((SUM(PENERIMAAN_BERJALAN)-SUM(PENERIMAAN_LALU))/SUM(PENERIMAAN_LALU))*100 PERTUMBUHAN FROM KINERJA_PENERIMAAN @@ -34,7 +34,7 @@ class Mpemby extends Model { $tahun = $param['tahun']; $tahunl = $tahun - 1; - $bln = date('m'); + $bln = $param['bln']; $query = $this->db->query("SELECT CASE WHEN KD_KATEGORI IS NULL THEN '-' ELSE KD_KATEGORI END KODE, CASE WHEN KD_KATEGORI IS NULL THEN 'UNKNOWN' ELSE NM_KATEGORI END NMKAT, SUM(CASE WHEN THNBYR = '" . $tahun . "' AND BLNBYR = '" . $bln . "' THEN WPBAYAR ELSE 0 END)WPBYRN, @@ -53,7 +53,7 @@ class Mpemby extends Model { $tahun = $param['tahun']; $tahunl = $tahun - 1; - $bln = date('m'); + $bln = $param['bln']; $query = $this->db->query("SELECT NM_PAJAK,TOTALN PENERIMAAN, TOTALP PENL, (SELECT ROUND(SUM(TOTAL)) FROM PERJENIS_MV WHERE THNBYR = '" . $tahun . "' AND BLNBYR <= '" . $bln . "') PENERIMAAN_TOT, (SELECT ROUND(SUM(TOTAL)) FROM PERJENIS_MV WHERE THNBYR = '" . $tahunl . "' AND BLNBYR <= '" . $bln . "') PENERIMAAN_TOTL diff --git a/app/Views/ppm/dashboard.php b/app/Views/ppm/dashboard.php index 0757bc38..dad2ee2d 100644 --- a/app/Views/ppm/dashboard.php +++ b/app/Views/ppm/dashboard.php @@ -174,7 +174,7 @@ $datapaycomp = $datapaycomp . "]"; update
-
+
@@ -222,7 +222,7 @@ $datapaycomp = $datapaycomp . "]";
-
Jumlah WP
+
WP Terdaftar
28%
@@ -283,7 +283,7 @@ $datapaycomp = $datapaycomp . "]";
-
Jumlah WP
+
WP Terdaftar
28%