Merge branch 'dev' of https://github.com/updidev/bpkd-sidata into dev
This commit is contained in:
@@ -187,39 +187,44 @@ class ItemSearchController extends Controller
|
|||||||
$no_skprd = $request->no_skprd;
|
$no_skprd = $request->no_skprd;
|
||||||
$kode_akun = $request->kode_akun;
|
$kode_akun = $request->kode_akun;
|
||||||
|
|
||||||
$cek = PendapatanRealisasiSts::where("rkud_no_sts",$no_skprd)->count();
|
$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 ($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)) {
|
||||||
if (in_array($kode_akun,$arrTPG)){
|
$cek = PendapatanRealisasiSts::where("rkud_no_sts", $no_skprd)
|
||||||
|
->where("rkud_kode_akun", $kode_akun)
|
||||||
|
->count();
|
||||||
|
|
||||||
|
if ($cek > 0) {
|
||||||
$urlAPI = "http://10.15.34.90:8820/api/tpg-tamsil/cek-sp2t";
|
$urlAPI = "http://10.15.34.90:8820/api/tpg-tamsil/cek-sp2t";
|
||||||
$httpSTS = Http::withHeaders([
|
$httpSTS = Http::withHeaders([
|
||||||
'Accept' => 'application/json',
|
'Accept' => 'application/json',
|
||||||
])->withBasicAuth('sidata_tpgtamsil_dev', 'sidataAp!TpgT4ms1lD3v')
|
])->withBasicAuth('sidata_tpgtamsil_dev', 'sidataAp!TpgT4ms1lD3v')
|
||||||
->post($urlAPI, [
|
->post($urlAPI, [
|
||||||
"no_sp2t"=>$no_skprd,
|
"no_sp2t" => $no_skprd,
|
||||||
"kode_rekening"=>$kode_akun
|
"kode_rekening" => $kode_akun
|
||||||
]);
|
]);
|
||||||
if(isset($httpSTS["data"])){
|
if (isset($httpSTS["data"])) {
|
||||||
$sts["no_skprd"] = $httpSTS["data"]["no_sp2t"];
|
$sts["no_skprd"] = $httpSTS["data"]["no_sp2t"];
|
||||||
$sts["tgl_validasi"] = date("Y-m-d", strtotime($httpSTS["data"]["tanggal_pengesahan"]));
|
$sts["tgl_validasi"] = date("Y-m-d", strtotime($httpSTS["data"]["tanggal_pengesahan"]));
|
||||||
$sts["kode_bas"] = $httpSTS["data"]["kode_rekening"];
|
$sts["kode_bas"] = $httpSTS["data"]["kode_rekening"];
|
||||||
$sts["n_akun"] = $httpSTS["data"]["nam_rekening"];
|
$sts["n_akun"] = $httpSTS["data"]["nam_rekening"];
|
||||||
$sts["nilai_bayar"] = separateNumberIndo($httpSTS["data"]["jumlah"]);
|
$sts["nilai_bayar"] = separateNumberIndo($httpSTS["data"]["jumlah"]);
|
||||||
}
|
}
|
||||||
}else{
|
}
|
||||||
$select = DB::raw("NO_SKPRD,TGL_VALIDASI,KODE_BAS,NILAI_BAYAR,TRBAS.N_AKUN");
|
} else {
|
||||||
$sts = Siesetpembayaran::select($select)
|
$select = DB::raw("NO_SKPRD,TGL_VALIDASI,KODE_BAS,NILAI_BAYAR,TRBAS.N_AKUN");
|
||||||
->join("NEWSIPKD.TRBAS", "SI_ESET_PEMBAYARAN.KODE_BAS", "=", "TRBAS.C_AKUN")
|
$sts = Siesetpembayaran::select($select)
|
||||||
->where("NO_SKPRD", $no_skprd)
|
->join("NEWSIPKD.TRBAS", "SI_ESET_PEMBAYARAN.KODE_BAS", "=", "TRBAS.C_AKUN")
|
||||||
->where("SI_ESET_PEMBAYARAN.KODE_BAS", $kode_akun)
|
->where("NO_SKPRD", $no_skprd)
|
||||||
->whereRaw("C_TAHUN_BERLAKU<=" . getTA() . " AND C_TAHUN_BERAKHIR>=" . getTA())
|
->where("SI_ESET_PEMBAYARAN.KODE_BAS", $kode_akun)
|
||||||
->first();
|
->whereRaw("C_TAHUN_BERLAKU<=" . getTA() . " AND C_TAHUN_BERAKHIR>=" . getTA())
|
||||||
if ($sts) {
|
->first();
|
||||||
$sts["tgl_validasi"] = date("Y-m-d", strtotime($sts["tgl_validasi"]));
|
if ($sts) {
|
||||||
$sts["nilai_bayar"] = separateNumberIndo($sts["nilai_bayar"]);
|
$sts["tgl_validasi"] = date("Y-m-d", strtotime($sts["tgl_validasi"]));
|
||||||
}
|
$sts["nilai_bayar"] = separateNumberIndo($sts["nilai_bayar"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json($sts);
|
return response()->json($sts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user