Untitled

mail@pastecode.io avatar
unknown
php
a year ago
2.3 kB
0
Indexable
if ( $res->Status == '000' || $res_bbn->Status == '000' ) {
                if (empty($res->sts_blokir)) {
                    $res->sts_blokir = '0';
                }
                // $res->sts_blokir = '0';
                if ($res->sts_blokir == 0 ) {
                    $res->telp_samsat = '-';
                } else {
                    $cek_lokasi_pad = LokasiPAD::get_lokasi_pad($res->id_samsat);
                    $res->telp_samsat = $cek_lokasi_pad->telp;
                }

                $data_rincian = self::get_rincian($res);

                foreach ($data_rincian['rincian'] as $value_rincian) {
                    self::$totPKBPokok += self::pembulatan( str_replace(',', '', $value_rincian['pokok_pkb']) );
                    self::$totPKBDenda += self::pembulatan( str_replace(',', '', $value_rincian['denda_pkb']) );
                    self::$totJRPokok += self::pembulatan( str_replace(',', '', $value_rincian['pokok_jr']) );
                    self::$totJRDenda += self::pembulatan( str_replace(',', '', $value_rincian['denda_jr']) );
                }

                if($res->total_pkb_pokok > 0){
                    $reArray = array_merge(array(
                        "Status" => $res->Status
                    ), $data_rincian);
    
                    $reArray[ 'total_pkb_pokok' ] = number_format( self::$totPKBPokok, 0 );
                    $reArray[ 'total_pkb_denda' ] = number_format( self::$totPKBDenda, 0 );
                    $reArray[ 'jumlah_pkb' ] = number_format( self::$totPKBPokok+self::$totPKBDenda, 0 );
                    $reArray[ 'total_jr_pokok' ] = number_format( self::$totJRPokok, 0 );
                    $reArray[ 'total_jr_denda' ] = number_format( self::$totJRDenda, 0 );
                    $reArray[ 'jumlah_jr' ] = number_format( self::$totJRPokok+self::$totJRDenda, 0 );
                    $reArray[ 'total' ] = number_format( self::$totPKBPokok+self::$totPKBDenda+self::$totJRPokok+self::$totJRDenda+$res->pnbp, 0 );
                    return $reArray;

                } else {
                    return [
                        'Status' => '99999',
                        'Msg' => 'silahkan hubungi PIC NewSakpole! pada nomor WA dibawah ini 08112671600'
                    ];
                }
            }