diff --git a/app/Http/Controllers/Admin/MappingDbhSkpdController.php b/app/Http/Controllers/Admin/MappingDbhSkpdController.php index 638786b..bf0720f 100644 --- a/app/Http/Controllers/Admin/MappingDbhSkpdController.php +++ b/app/Http/Controllers/Admin/MappingDbhSkpdController.php @@ -109,6 +109,7 @@ class MappingDbhSkpdController extends Controller $srcTA = $post["srcTA"]; $select = DB::raw("ID, KODE_REKENING, NAMA_REKENING"); $sqlstr = VwRekeningPendapatan::select($select); + $sqlstr->whereRaw("TAHUN_BERLAKU<=".getTA()." AND TAHUN_BERAKHIR>=".getTA()); $dataTotal = $sqlstr->count(); $data = $sqlstr->orderBy("KODE_REKENING"); if (!empty($src)){ diff --git a/app/Http/Controllers/ItemSearchController.php b/app/Http/Controllers/ItemSearchController.php index 6dc888c..df3787b 100644 --- a/app/Http/Controllers/ItemSearchController.php +++ b/app/Http/Controllers/ItemSearchController.php @@ -151,11 +151,13 @@ class ItemSearchController extends Controller $sps = DB::select(DB::raw("SELECT x.KODE_REKENING as IDX,x.KODE_REKENING||' | '||z.NAMA_REKENING as name FROM SAMASA.MAPPING_DBH_SKPD x LEFT JOIN SAMASA.VW_REKENING_PENDAPATAN z ON x.ID_REKENING = z.ID - WHERE x.kode_skpd='".Auth::user()->nrk."' $filter")); + WHERE x.kode_skpd='".Auth::user()->nrk."' AND (TAHUN_BERLAKU<=".getTA()." AND TAHUN_BERAKHIR>=".getTA().") $filter")); }else{ $select = DB::raw("KODE_REKENING AS IDX,KODE_REKENING||' | '||NAMA_REKENING as name"); $sps = VwRekeningPendapatan::select($select); + $sps->whereRaw("TAHUN_BERLAKU<=".getTA()." AND TAHUN_BERAKHIR>=".getTA()); + if (!empty($search)){ $sps->whereRaw(" (LOWER(KODE_REKENING) LIKE '%$search%' OR LOWER(NAMA_REKENING) LIKE '%$search%') "); } @@ -180,6 +182,7 @@ class ItemSearchController extends Controller $sts = Siesetpembayaran::select($select) ->join("NEWSIPKD.TRBAS","SI_ESET_PEMBAYARAN.KODE_BAS","=","TRBAS.C_AKUN") ->where("NO_SKPRD", $no_skprd) + ->whereRaw("C_TAHUN_BERLAKU<=".getTA()." AND C_TAHUN_BERAKHIR>=".getTA()) ->first(); if ($sts){ $sts["tgl_validasi"] = date("Y-m-d",strtotime($sts["tgl_validasi"])); diff --git a/app/Http/Controllers/RealisasiBelanjaController.php b/app/Http/Controllers/RealisasiBelanjaController.php index 413fa7b..24560a5 100644 --- a/app/Http/Controllers/RealisasiBelanjaController.php +++ b/app/Http/Controllers/RealisasiBelanjaController.php @@ -133,7 +133,7 @@ class RealisasiBelanjaController extends Controller if (isset($req["id_sps"])) { - $sps = Trbas::where("C_AKUN", $req["id_sps"])->firstorNew(); + $sps = Trbas::where("C_AKUN", $req["id_sps"])->whereRaw("C_TAHUN_BERLAKU<=".getTA()." AND C_TAHUN_BERAKHIR>=".getTA())->firstorNew(); if ($sps){ $input["kode_rekening"] = $sps["c_akun"];