Update Rekening Tamsil dan TPG

This commit is contained in:
izuddin
2025-08-07 11:00:53 +07:00
parent 69cef8c178
commit 26dca172ea
2 changed files with 23 additions and 23 deletions
+17 -17
View File
@@ -183,14 +183,14 @@ class ItemSearchController extends Controller
public function sts(Request $request)
{
$sts = array();
$no_skprd = $request->no_skprd;
$kode_akun = $request->kode_akun;
$arrTPG = ['4.2.01.01.04.0004','4.2.01.01.04.0005','4.2.01.09.02.0004','4.2.01.09.02.0005'];
if (in_array($kode_akun,$arrTPG)){
$sts = array();
$cek = PendapatanRealisasiSts::where("rkud_no_sts",$no_skprd)->count();
if ($cek==0){
$cek = PendapatanRealisasiSts::where("rkud_no_sts",$no_skprd)->count();
if ($cek==0){
$arrTPG = ['4.2.01.01.04.0004','4.2.01.01.04.0005','4.2.01.09.02.0004','4.2.01.09.02.0005'];
if (in_array($kode_akun,$arrTPG)){
$urlAPI = "http://10.15.34.90:8820/api/tpg-tamsil/cek-sp2t";
$httpSTS = Http::withHeaders([
'Accept' => 'application/json',
@@ -206,18 +206,18 @@ class ItemSearchController extends Controller
$sts["n_akun"] = $httpSTS["data"]["nam_rekening"];
$sts["nilai_bayar"] = separateNumberIndo($httpSTS["data"]["jumlah"]);
}
}
}else{
$select = DB::raw("NO_SKPRD,TGL_VALIDASI,KODE_BAS,NILAI_BAYAR,TRBAS.N_AKUN");
$sts = Siesetpembayaran::select($select)
->join("NEWSIPKD.TRBAS", "SI_ESET_PEMBAYARAN.KODE_BAS", "=", "TRBAS.C_AKUN")
->where("NO_SKPRD", $no_skprd)
->where("SI_ESET_PEMBAYARAN.KODE_BAS", $kode_akun)
->whereRaw("C_TAHUN_BERLAKU<=" . getTA() . " AND C_TAHUN_BERAKHIR>=" . getTA())
->first();
if ($sts) {
$sts["tgl_validasi"] = date("Y-m-d", strtotime($sts["tgl_validasi"]));
$sts["nilai_bayar"] = separateNumberIndo($sts["nilai_bayar"]);
}else{
$select = DB::raw("NO_SKPRD,TGL_VALIDASI,KODE_BAS,NILAI_BAYAR,TRBAS.N_AKUN");
$sts = Siesetpembayaran::select($select)
->join("NEWSIPKD.TRBAS", "SI_ESET_PEMBAYARAN.KODE_BAS", "=", "TRBAS.C_AKUN")
->where("NO_SKPRD", $no_skprd)
->where("SI_ESET_PEMBAYARAN.KODE_BAS", $kode_akun)
->whereRaw("C_TAHUN_BERLAKU<=" . getTA() . " AND C_TAHUN_BERAKHIR>=" . getTA())
->first();
if ($sts) {
$sts["tgl_validasi"] = date("Y-m-d", strtotime($sts["tgl_validasi"]));
$sts["nilai_bayar"] = separateNumberIndo($sts["nilai_bayar"]);
}
}
}
return response()->json($sts);