Update Rekening Tamsil dan TPG
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user