function t_vat_setllementGrid_cetak_stpd_BeforeShow(&$sender)
{
    $t_vat_setllementGrid_cetak_stpd_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_vat_setllementGrid;
    //Compatibility
    //End t_vat_setllementGrid_cetak_stpd_BeforeShow
    //Custom Code @342-2A29BDB7
    // -------------------------
    // Write your own code here.
    $nilai = $t_vat_setllementGrid->t_vat_setllement_id->GetValue();
    $dbConn = new clsDBConnSIKP();
    $sql = "select count(*)as ada from t_vat_penalty where t_vat_setllement_id = " . $nilai;
    $dbConn->query($sql);
    $dbConn->next_record();
    $ada = $dbConn->f("ada");
    $dbConn->close();
    if ($ada > 0) {
        $t_vat_setllementGrid->cetak_stpd->SetValue("<input type='button' value='CETAK' style='WIDTH: 57px; HEIGHT: 22px' class='Button' onclick=\"" . "cetakStpd(" . $nilai . ")\">");
    } else {
        $t_vat_setllementGrid->cetak_stpd->SetValue("");
    }
    // -------------------------
    //End Custom Code
    //Close t_vat_setllementGrid_cetak_stpd_BeforeShow @341-625FE229
    return $t_vat_setllementGrid_cetak_stpd_BeforeShow;
}
function t_vat_reg_dtl_parkingForm_BeforeSelect(&$sender)
{
    $t_vat_reg_dtl_parkingForm_BeforeSelect = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_vat_reg_dtl_parkingForm;
    //Compatibility
    //End t_vat_reg_dtl_parkingForm_BeforeSelect
    //Custom Code @822-2A29BDB7
    // -------------------------
    // Write your own code here.
    $CustId = $t_vat_reg_dtl_parkingForm->t_cust_account_id->GetValue();
    $dbConn = new clsDBConnSIKP();
    $query = "select a.p_vat_type_dtl_id, b.vat_code as parking_classification_code " . "from t_cust_account a, p_vat_type_dtl b " . "where a.p_vat_type_dtl_id = b.p_vat_type_dtl_id " . "and t_cust_account_id = " . $CustId;
    $dbConn->query($query);
    while ($dbConn->next_record()) {
        $idd = $dbConn->f("p_vat_type_dtl_id");
        $code = $dbConn->f("parking_classification_code");
    }
    $dbConn->close();
    $t_vat_reg_dtl_parkingForm->p_parking_classification_id->SetValue($idd);
    $t_vat_reg_dtl_parkingForm->classification_desc->SetValue($code);
    // -------------------------
    //End Custom Code
    //Close t_vat_reg_dtl_parkingForm_BeforeSelect @94-79EB8A58
    return $t_vat_reg_dtl_parkingForm_BeforeSelect;
}
function t_vat_setllementGrid_BeforeShowRow(&$sender)
{
    $t_vat_setllementGrid_BeforeShowRow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_vat_setllementGrid;
    //Compatibility
    //End t_vat_setllementGrid_BeforeShowRow
    //Set Row Style @315-982C9472
    $styles = array("Row", "AltRow");
    if (count($styles)) {
        $Style = $styles[($Component->RowNumber - 1) % count($styles)];
        if (strlen($Style) && !strpos($Style, "=")) {
            $Style = (strpos($Style, ":") ? 'style="' : 'class="') . $Style . '"';
        }
        $Component->Attributes->SetValue("rowStyle", $Style);
    }
    //End Set Row Style
    // Start Bdr
    global $t_vat_setllementForm;
    global $selected_id;
    global $add_flag;
    global $is_show_form;
    if ($selected_id < 0 && $add_flag != "ADD") {
        $selected_id = $Component->DataSource->t_vat_setllement_id->GetValue();
        $t_vat_setllementForm->DataSource->Parameters["urlt_vat_setllement_id"] = $selected_id;
        $t_vat_setllementForm->DataSource->Prepare();
        $t_vat_setllementForm->EditMode = $t_vat_setllementForm->DataSource->AllParametersSet;
    }
    $flag_delete = CCGetFromGet("flag_delete", "");
    if ($flag_delete == "true") {
        $selected_id = CCGetFromGet("t_vat_setllement_id", $selected_id);
        $dbConn = new clsDBConnSIKP();
        $dbConn->query("select f_del_vat_setllement({$selected_id}, 0, 'x')");
        $dbConn->close();
        header("Location: t_vat_setllement_edit_ro.php");
    }
    // End Bdr
    $styles = array("Row", "AltRow");
    // Start Bdr
    $img_radio = "<img border=\"0\" src=\"../images/radio.gif\">";
    $Style = $styles[0];
    if ($Component->DataSource->t_vat_setllement_id->GetValue() == $selected_id) {
        $img_radio = "<img border=\"0\" src=\"../images/radio_s.gif\">";
        $Style = $styles[1];
        $is_show_form = 1;
    }
    // End Bdr
    if (count($styles)) {
        //$Style = $styles[($Component->RowNumber - 1) % count($styles)];
        if (strlen($Style) && !strpos($Style, "=")) {
            $Style = (strpos($Style, ":") ? 'style="' : 'class="') . $Style . '"';
        }
        $Component->Attributes->SetValue("rowStyle", $Style);
    }
    $Component->DLink->SetValue($img_radio);
    // Bdr
    //Close t_vat_setllementGrid_BeforeShowRow @2-CAEE8B40
    return $t_vat_setllementGrid_BeforeShowRow;
}
Example #4
0
 function PageCetak($data, $user, $tahun, $tgl_penerimaan, $tgl_penerimaan_last, $npwpd)
 {
     $this->AliasNbPages();
     $this->AddPage("L");
     $this->SetFont('Arial', 'B', 12);
     $lheader = $this->lengthCell / 8;
     $lheader1 = $lheader * 1;
     $lheader2 = $lheader - 15;
     $lheader3 = $lheader * 3;
     $lheader4 = $lheader * 4;
     $dbConn = new clsDBConnSIKP();
     $query = "SELECT a.*,\r\n                    c.region_name AS nama_kota,\r\n                    d.region_name AS nama_kecamatan,\r\n                    e.region_name AS nama_kelurahan\r\n                    FROM t_cust_account a\r\n                    LEFT JOIN p_region c ON a.brand_p_region_id = c.p_region_id\r\n                    LEFT JOIN p_region d ON a.brand_p_region_id_kec = d.p_region_id\r\n                    LEFT JOIN p_region e ON a.brand_p_region_id_kel = e.p_region_id\r\n                    where a.npwd = '" . $npwpd . "'";
     $dbConn->query($query);
     $alamat = '';
     while ($dbConn->next_record()) {
         //$alamat = $dbConn->f("brand_address_name")." .No ". $dbConn->f("brand_address_no")." RT/RW: ".$dbConn->f("brand_address_rt")."/".$dbConn->f("brand_address_rw"). ". KEC.".$dbConn->f("nama_kecamatan")." KEL.".$dbConn->f("nama_kelurahan");
         $alamat = $dbConn->f("brand_address_name") . " .No " . $dbConn->f("brand_address_no");
     }
     $dbConn->close();
     $this->Cell($lheader2, $this->height, "NPWPD :");
     $this->Cell($lheader1, $this->height, $npwpd);
     $this->Ln();
     $this->Cell($lheader2, $this->height, "Alamat :");
     $this->Cell($lheader1, $this->height, $alamat);
     $this->SetFont('Arial', '', 10);
     $this->Ln();
     $this->Ln();
     $ltable = $this->lengthCell / 26;
     $ltable1 = $ltable * 1;
     $ltable2 = $ltable * 2;
     $ltable3 = $ltable * 3;
     $ltable4 = $ltable * 4;
     $ltable5 = $ltable * 5;
     $ltable6 = $ltable * 6;
     $ltable7 = $ltable * 7;
     $ltable8 = $ltable * 8;
     $this->Cell($ltable4, $this->height + 2, "NAMA BADAN", "TBLR", 0, 'C');
     $this->Cell($ltable3, $this->height + 2, "JENIS KETETAPAN", "TBLR", 0, 'C');
     $this->Cell($ltable6, $this->height + 2, "PERIODE TRANSAKSI", "TBLR", 0, 'C');
     $this->Cell($ltable3, $this->height + 2, "TGL PELAPORAN", "TBLR", 0, 'C');
     $this->Cell($ltable3, $this->height + 2, "TOTAL PAJAK", "TBLR", 0, 'C');
     $this->Cell($ltable5, $this->height + 2, "NO. KWITANSI", "TBLR", 0, 'C');
     $this->Ln();
     //isi kolom
     $this->SetWidths(array($ltable4, $ltable3, $ltable6, $ltable3, $ltable3, $ltable5));
     $this->SetAligns(array("L", "C", "C", "C", "R", "L"));
     $no = 1;
     $jumlahperayat = array();
     $jumlahperwaktu = array();
     $jumlahtemp = 0;
     $i = 0;
     $total = 0;
     foreach ($data as $item) {
         //print data
         $this->RowMultiBorderWithHeight(array($item["company_name"], $item["type_code"], $item["periode_awal_laporan"] . " s.d " . $item["periode_akhir_laporan"], $item["tgl_pelaporan"], number_format($item["total_pajak"], 0, ',', '.'), $item["kuitansi_pembayaran"]), array('TBLR', 'TBLR', 'TBLR', 'TBLR', 'TBLR', 'TBLR'), $this->height);
         $no++;
     }
 }
function t_vat_setllementGrid_cetak_sptpd_BeforeShow(&$sender)
{
    $t_vat_setllementGrid_cetak_sptpd_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_vat_setllementGrid;
    //Compatibility
    //End t_vat_setllementGrid_cetak_sptpd_BeforeShow
    //Custom Code @301-2A29BDB7
    // -------------------------
    // Write your own code here.
    // -------------------------
    //End Custom Code
    //DEL  // -------------------------
    //DEL      // Write your own code here.
    $nilai = $t_vat_setllementGrid->t_vat_setllement_id->GetValue();
    $dbConn = new clsDBConnSIKP();
    $sql = "select count(*)as ada from t_vat_penalty where t_vat_setllement_id = " . $nilai;
    $dbConn->query($sql);
    $dbConn->next_record();
    $ada = $dbConn->f("ada");
    $dbConn->close();
    if ($ada > 0) {
        //$nilai2 = $t_vat_setllementGrid->p_vat_type_id->GetValue();
        $t_vat_setllementGrid->cetak_sptpd->SetValue("<input type='button' value='CETAK' style='WIDTH: 57px; HEIGHT: 22px' class='Button' onclick=\"" . "cetakStpd(" . $nilai . ",'tgl_tap')\">");
        $t_vat_setllementGrid->cetak_sptpd2->SetValue("<input type='button' value='CETAK' style='WIDTH: 57px; HEIGHT: 22px' class='Button' onclick=\"" . "cetakStpd(" . $nilai . ",'tgl_bayar')\">");
    } else {
        $t_vat_setllementGrid->cetak_sptpd->SetValue("");
        $t_vat_setllementGrid->cetak_sptpd2->SetValue("");
    }
    /*
    $action_button = CCGetFromGet("action_button","");
    $action_button2 = CCGetFromGet("action_button2","");
    if($action_button=='flag_payment' && $action_button2!='cetak_register'){
    	$dbConn = new clsDBConnSIKP();
    	$sql="select sikp.f_payment_manual(".CCGetFromGet('t_customer_order_id').",'".CCGetSession('UserLogin')."')";
    	$dbConn->query($sql);
    	$dbConn->next_record();
    	echo "
    	<script>
    	alert('".$dbConn->f('f_payment_manual')."');
    	</script>
    	";
    	$dbConn->close();	
    }else if($action_button2=='cetak_register'){
    	$dbConn = new clsDBConnSIKP();
    	$sql="select sikp.f_print_register(".CCGetFromGet('t_customer_order_id').",'".CCGetSession('UserLogin')."')";
    	$dbConn->query($sql);
    	$dbConn->next_record();
    	print_laporan($dbConn->f('f_print_register'));
    	$dbConn->close();
    }
    */
    // -------------------------
    //Close t_vat_setllementGrid_cetak_sptpd_BeforeShow @300-BF0BB7F2
    return $t_vat_setllementGrid_cetak_sptpd_BeforeShow;
}
function Page_BeforeShow(&$sender)
{
    $Page_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_wp_registration_list;
    //Compatibility
    //End Page_BeforeShow
    //Custom Code @562-2A29BDB7
    // -------------------------
    // Write your own code here.
    global $Label1;
    $tampil = CCGetFromGet('tampil');
    if ($tampil == 'T') {
        $Label1->SetText("<table border=1><tr><td>tes</td></tr></table>");
        $tgl_penerimaan = CCGetFromGet("tgl_penerimaan", "");
        //'15-12-2013';
        $tgl_penerimaan_last = CCGetFromGet("tgl_penerimaan_last", "");
        //'15-12-2013';
        $jenis_pajak = CCGetFromGet("jenis_pajak", 0);
        // $tgl_penerimaan		= '15-12-2013';
        $user = CCGetUserLogin();
        $data = array();
        $dbConn = new clsDBConnSIKP();
        if ($jenis_pajak == 0 || $jenis_pajak == "") {
            $query = "select a.*, b.vat_code, c.code as account_status from t_vat_registration a\r\n\t\t\tleft join p_vat_type_dtl z on z.p_vat_type_dtl_id = a.p_vat_type_dtl_id\r\n\t\t\tleft join p_vat_type b on b.p_vat_type_id = z.p_vat_type_id\r\n\t\t\tleft join t_customer_order y on y.t_customer_order_id = a.t_customer_order_id\r\n\t\t\tLEFT JOIN p_order_status C ON C .p_order_status_id = y .p_order_status_id\r\n\t\t\twhere trunc(registration_date) >= to_date('{$tgl_penerimaan}')\r\n\t\t\tAND trunc(registration_date) <= to_date('{$tgl_penerimaan_last}')\r\n\t\t\tORDER BY registration_date ASC";
        } else {
            $query = "select a.*, b.vat_code, c.code as account_status from t_vat_registration a\r\n\t\t\tleft join p_vat_type_dtl z on z.p_vat_type_dtl_id = a.p_vat_type_dtl_id\r\n\t\t\tleft join p_vat_type b on b.p_vat_type_id = z.p_vat_type_id\r\n\t\t\tleft join t_customer_order y on y.t_customer_order_id = a.t_customer_order_id\r\n\t\t\tLEFT JOIN p_order_status C ON C .p_order_status_id = y .p_order_status_id\r\n\t\t\twhere trunc(registration_date) >= to_date('{$tgl_penerimaan}')\r\n\t\t\tAND trunc(registration_date) <= to_date('{$tgl_penerimaan_last}')\r\n\t\t\tAND a.p_vat_type_dtl_id in (select p_vat_type_dtl_id from p_vat_type_dtl\r\n\t\t\t\twhere p_vat_type_id = {$jenis_pajak})\r\n\t\t\tORDER BY registration_date ASC";
        }
        //echo $query;
        //exit;
        $tgl_penerimaan = str_replace("'", "", $tgl_penerimaan);
        $dbConn->query($query);
        while ($dbConn->next_record()) {
            $data["t_cust_account_id"][] = $dbConn->f("t_cust_account_id");
            $data["t_customer_id"][] = $dbConn->f("t_customer_id");
            $data["npwd"][] = $dbConn->f("npwpd");
            $data["vat_code"][] = $dbConn->f("vat_code");
            $data["registration_date"][] = $dbConn->f("registration_date");
            $data["wp_name"][] = $dbConn->f("wp_name");
            $data["wp_address_name"][] = $dbConn->f("wp_address_name");
            $data["company_name"][] = $dbConn->f("company_name");
            $data["address_name"][] = $dbConn->f("address_name");
            $data["account_status"][] = $dbConn->f("account_status");
        }
        $dbConn->close();
        $Label1->SetText(PageCetak($data, $user, $tgl_penerimaan, $tgl_penerimaan_last));
    }
    // -------------------------
    //End Custom Code
    //Close Page_BeforeShow @1-4BC230CD
    return $Page_BeforeShow;
}
 function PageCetak($data)
 {
     $this->AddPage();
     // $this->Cell(0, $this->height, $data["f_bphtb_receipt_duplicate"], 0, 0, "L");
     $exp_data = explode("\n", $data["f_bphtb_receipt_duplicate"]);
     //get no kuitansi
     $exp_data1 = explode(":", $exp_data[0]);
     $encImageData = '';
     $dbConn = new clsDBConnSIKP();
     $query = "select f_encrypt_str('" . trim($exp_data1[1]) . "') AS enc_data";
     $dbConn->query($query);
     while ($dbConn->next_record()) {
         $encImageData = $dbConn->f("enc_data");
     }
     $dbConn->close();
     if (empty($encImageData)) {
         $encImageData = "EmptyData";
     }
     $this->Image('../images/logo_pemda.png', 37, 13, 25, 25);
     $this->Image('http://' . $_SERVER['HTTP_HOST'] . '/mpd/include/qrcode/generate-qr.php?param=' . $encImageData, 179, 13, 25, 25, 'PNG');
     //$this->Image('http://172.16.20.2:81/mpd/include/qrcode/generate-qr.php?param='.encImageData,179,13,25,25,'PNG');
     $this->SetFont('Arial', '', 11);
     $this->Cell(40, $this->height, "", "", 0, 'L');
     $this->Cell(101, $this->height, "PEMERINTAH KOTA BANDUNG", "", 0, 'C');
     $this->Cell(40, $this->height, "", "", 0, 'L');
     $this->Ln();
     $this->Cell(40, $this->height, "", "", 0, 'L');
     $this->Cell(101, $this->height, "DINAS PELAYANAN PAJAK", "", 0, 'C');
     $this->Cell(40, $this->height, "", "", 0, 'L');
     $this->Ln();
     $this->Cell(40, $this->height, "", "", 0, 'L');
     $this->Cell(101, $this->height, "Jalan Wastukancana No 2", "", 0, 'C');
     $this->Cell(40, $this->height, "", "", 0, 'L');
     $this->Ln();
     $this->Cell(40, $this->height, "", "", 0, 'L');
     $this->Cell(101, $this->height, "Telp. 022 4235052 - Bandung", "", 0, 'C');
     $this->Cell(40, $this->height, "", "", 0, 'L');
     $this->Ln();
     $this->SetFont('Arial', 'B', 14);
     $this->Cell(40, $this->height + 7, "", "B", 0, 'L');
     $this->Cell(101, $this->height + 7, "Bukti Pembayaran Pajak BPHTB", "B", 0, 'C');
     $this->Cell(40, $this->height + 7, "", "B", 0, 'L');
     $this->Ln(5);
     $this->Ln();
     $this->SetFont('Courier', '', 10);
     $data = explode("\n", $data["f_bphtb_receipt_duplicate"]);
     foreach ($data as $datum) {
         $this->Cell(241.3, $this->height, $datum, 0, 0, "L");
         $this->Ln();
     }
     $this->Cell(180, $this->height, "", "B", 0, "C");
 }
function t_vat_setllementGrid_cetak_sptpd_BeforeShow(&$sender)
{
    $t_vat_setllementGrid_cetak_sptpd_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_vat_setllementGrid;
    //Compatibility
    //End t_vat_setllementGrid_cetak_sptpd_BeforeShow
    // -------------------------
    // Write your own code here.
    $pajak = $t_vat_setllementGrid->total_vat_amount->GetValue();
    $denda = $t_vat_setllementGrid->total_penalty_amount->GetValue();
    $totaltotal = $pajak + $denda;
    $t_vat_setllementGrid->total_total->SetValue($totaltotal);
    $nilai = $t_vat_setllementGrid->t_vat_setllement_id->GetValue();
    $nilai2 = $t_vat_setllementGrid->p_vat_type_id->GetValue();
    $t_vat_setllementGrid->cetak_sptpd->SetValue("<input type='button' style='display:none;' value='CETAK' style='WIDTH: 57px; HEIGHT: 22px' class='Button' onclick=\"" . "cetakSptpd(" . $nilai . "," . $nilai2 . ")\">");
    $action_button = CCGetFromGet("action_button", "");
    $action_button2 = CCGetFromGet("action_button2", "");
    if ($action_button == 'flag_payment' && $action_button2 != 'cetak_register') {
        $dbConn = new clsDBConnSIKP();
        $sql = "select sikp.f_payment_manual(" . CCGetFromGet('t_customer_order_id') . ",'" . CCGetSession('UserLogin') . "')";
        $dbConn->query($sql);
        $dbConn->next_record();
        echo "\r\n  \t\t<script>\r\n  \t\talert('" . $dbConn->f('f_payment_manual') . "');\r\n  \t\t</script>\r\n  \t\t";
        $dbConn->close();
    } else {
        if ($action_button2 == 'cetak_register') {
            $dbConn = new clsDBConnSIKP();
            $sql = "select sikp.f_print_register(" . CCGetFromGet('t_customer_order_id') . ",'" . CCGetSession('UserLogin') . "')";
            $dbConn->query($sql);
            $dbConn->next_record();
            print_laporan($dbConn->f('f_print_register'));
            /*echo "
            			<script>
            				window.open('../services/print_string.php?input_number=".$dbConn->f('f_print_register')."', '_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes');
            			</script>
            		";*/
            $dbConn->close();
            exit;
        }
    }
    // -------------------------
    //Close t_vat_setllementGrid_cetak_sptpd_BeforeShow @300-BF0BB7F2
    return $t_vat_setllementGrid_cetak_sptpd_BeforeShow;
}
function Page_BeforeShow(&$sender)
{
    $Page_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_rep_lap_bpps_piutang2;
    //Compatibility
    //End Page_BeforeShow
    global $Label1;
    // -------------------------
    // Write your own code here.
    $doAction = CCGetFromGet('doAction');
    if ($doAction == 'view_html') {
        $p_vat_type_id = CCGetFromGet("p_vat_type_id", "");
        //$year_code = CCGetFromGet("year_code", "");
        $tgl_penerimaan = "'01-01-2010'";
        $tgl_penerimaan_last = "'31-12-2014'";
        $i_flag_setoran = 1;
        $p_year_period_id = 4;
        //year_period_id 4 = 2013
        //year_period_id 16 = 2014
        $date_start = str_replace("'", "", $year_code);
        //$year_date = DateTime::createFromFormat('d-m-Y', $date_start)->format('Y');
        $year_date = $year_code;
        $user = CCGetUserLogin();
        $data = array();
        $dbConn = new clsDBConnSIKP();
        $jenis_laporan = "all";
        $query = "select *,trunc(payment_date) \r\n\t\t\tfrom f_rep_bpps_piutang2new_rm_masuk_resto({$p_vat_type_id}, {$p_year_period_id}, {$tgl_penerimaan}, to_char(sysdate,'dd-mm-yyyy'), {$i_flag_setoran}) \r\n\t\t\torder by p_vat_type_dtl_id, wp_name,npwpd, payment_date";
        //echo $query; exit;
        $dbConn->query($query);
        $tgl_penerimaan = str_replace("'", "", $tgl_penerimaan);
        $tgl_penerimaan_last = str_replace("'", "", $tgl_penerimaan_last);
        $tahun = date("Y", strtotime($tgl_penerimaan));
        while ($dbConn->next_record()) {
            $data[] = array("address" => $dbConn->f("address"), "company_name" => $dbConn->f("company_name"), "kode_jns_trans" => $dbConn->f("kode_jns_trans"), "jns_trans" => $dbConn->f("jns_trans"), "kode_jns_pajak" => $dbConn->f("kode_jns_pajak"), "kode_ayat" => $dbConn->f("kode_ayat"), "jns_pajak" => $dbConn->f("jns_pajak"), "jns_ayat" => $dbConn->f("jns_ayat"), "nama_ayat" => $dbConn->f("nama_ayat"), "no_kohir" => $dbConn->f("no_kohir"), "wp_name" => $dbConn->f("wp_name"), "wp_address_name" => $dbConn->f("wp_address_name"), "wp_address_no" => $dbConn->f("wp_address_no"), "npwpd" => $dbConn->f("npwpd"), "jumlah_terima" => $dbConn->f("jumlah_terima"), "masa_pajak" => $dbConn->f("masa_pajak"), "kd_tap" => $dbConn->f("kd_tap"), "keterangan" => $dbConn->f("keterangan"), "payment_date" => $dbConn->f("payment_date"), "jam" => $dbConn->f("jam"));
        }
        $dbConn->close();
        $Label1->SetText(GetCetakHTML($data));
    }
    // -------------------------
    //Close Page_BeforeShow @1-4BC230CD
    return $Page_BeforeShow;
}
function Page_BeforeShow(&$sender)
{
    $Page_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_rep_lap_harian_v2;
    //Compatibility
    //End Page_BeforeShow
    //Custom Code @562-2A29BDB7
    // -------------------------
    // Write your own code here.
    global $Label1;
    $tampil = CCGetFromGet('tampil');
    if ($tampil == 'T') {
        $Label1->SetText("<table border=1><tr><td>tes</td></tr></table>");
        $tgl_penerimaan = CCGetFromGet("tgl_penerimaan", "");
        //'15-12-2013';
        // $tgl_penerimaan		= '15-12-2013';
        $user = CCGetUserLogin();
        $data = array();
        $dbConn = new clsDBConnSIKP();
        $tgl_penerimaan = str_replace("'", "", $tgl_penerimaan);
        $query = " \r\n\t\t\t\tselect\r\n\t\t\t\t\tnama_jns_pajak,sum(jml_sd_hari_ini) as realisasi,p_vat_type_id \r\n\t\t\t\tfrom f_rep_lap_harian_bdhr_mod_1('" . $tgl_penerimaan . "') \r\n\t\t\t\twhere p_vat_type_id in (1,2,3,4,5,6)\r\n\t\t\t\tGROUP BY nama_jns_pajak,p_vat_type_id\r\n\t\t\t\tORDER BY p_vat_type_id";
        //echo $query;exit;
        $tgl_penerimaan = str_replace("'", "", $tgl_penerimaan);
        $dbConn->query($query);
        while ($dbConn->next_record()) {
            $data['nama_jns_pajak'][] = $dbConn->f('nama_jns_pajak');
            $data['realisasi'][] = $dbConn->f('realisasi');
            $data['p_vat_type_id'][] = $dbConn->f('p_vat_type_id');
        }
        $dbConn->close();
        $excel = CCGetFromGet('excel');
        if ($excel == 'T') {
            GetCetakExcel($data, $user, $tgl_penerimaan);
        } else {
            $Label1->SetText(PageCetak($data, $user, $tgl_penerimaan));
        }
    }
    // -------------------------
    //End Custom Code
    //Close Page_BeforeShow @1-4BC230CD
    return $Page_BeforeShow;
}
function Page_BeforeShow(&$sender)
{
    $Page_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_bphtb_registration_list_check_date;
    //Compatibility
    //End Page_BeforeShow
    //Custom Code @703-2A29BDB7
    // -------------------------
    // Write your own code here.
    global $Label1;
    if (CCGetFromGet("doAction") == "html") {
        $s_keyword = CCGetFromGet("s_keyword", "");
        $date_start_laporan = CCGetFromGet("date_start_laporan", "");
        $date_end_laporan = CCGetFromGet("date_end_laporan", "");
        $user = CCGetUserLogin();
        $data = array();
        $dbConn = new clsDBConnSIKP();
        $query = "SELECT * FROM t_payment_receipt_bphtb x\r\n\t\t\tLEFT JOIN t_bphtb_registration y ON y.t_bphtb_registration_id = x.t_bphtb_registration_id\r\n\t\t\tLEFT JOIN t_customer_order z ON y.t_customer_order_id = z.t_customer_order_id\r\n\t\t\tWHERE\r\n\t\t\t\tcheck_date IS NOT NULL\r\n\t\t\tAND wp_name ILIKE '%{$s_keyword}%'";
        if ($date_end_laporan != "" && $date_start_laporan != "") {
            $query .= "AND(check_date BETWEEN to_date ('{$date_start_laporan}') AND ('{$date_end_laporan}'))";
        } else {
            if ($date_end_laporan != "") {
                $query .= "AND(check_date <= to_date ('{$date_end_laporan}') )";
            }
            if ($date_start_laporan != "") {
                $query .= "AND(check_date >= to_date ('{$date_start_laporan}') )";
            }
        }
        $dbConn->query($query);
        while ($dbConn->next_record()) {
            $data[] = array("wp_name" => $dbConn->f("wp_name"), "order_no" => $dbConn->f("order_no"), "receipt_no" => $dbConn->f("receipt_no"), "check_date" => $dbConn->f("check_date"), "wp_address_name" => $dbConn->f("wp_address_name"), "t_payment_receipt_id" => $dbConn->f("t_payment_receipt_id"), "t_bphtb_registration_id" => $dbConn->f("t_bphtb_registration_id"), "bphtb_registration_no" => $dbConn->f("bphtb_registration_no"), "t_customer_order_id" => $dbConn->f("t_customer_order_id"), "payment_date" => $dbConn->f("payment_date"), "payment_vat_amount" => $dbConn->f("payment_vat_amount"));
        }
        $dbConn->close();
        $Label1->SetText(GetCetakHTML($data));
    }
    // -------------------------
    //End Custom Code
    //Close Page_BeforeShow @1-4BC230CD
    return $Page_BeforeShow;
}
function t_vat_registrationForm_BeforeSelect(&$sender)
{
    $t_vat_registrationForm_BeforeSelect = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_vat_registrationForm;
    //Compatibility
    //End t_vat_registrationForm_BeforeSelect
    //Custom Code @686-2A29BDB7
    // -------------------------
    // Write your own code here.
    $CustId = CCGetFromGet("CURR_DOC_ID", "");
    $dbConn = new clsDBConnSIKP();
    $sql = "select p_settlement_type_id from t_vat_setllement where t_customer_order_id = " . $CustId;
    $dbConn->query($sql);
    $dbConn->next_record();
    $nilai = $dbConn->f("p_settlement_type_id");
    $dbConn->close();
    $t_vat_registrationForm->Hidden1->SetValue($nilai);
    // -------------------------
    //End Custom Code
    //Close t_vat_registrationForm_BeforeSelect @629-D64E68A4
    return $t_vat_registrationForm_BeforeSelect;
}
function p_pass_byadminForm_Button_Ubah_OnClick(&$sender)
{
    $p_pass_byadminForm_Button_Ubah_OnClick = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $p_pass_byadminForm;
    //Compatibility
    //End p_pass_byadminForm_Button_Ubah_OnClick
    //Custom Code @104-2A29BDB7
    // -------------------------
    // Write your own code here.
    global $FileName;
    global $PathToCurrentPage;
    $param = CCGetQueryString("QueryString", "");
    $dbConn = new clsDBConnSIKP();
    $old_pwd = $p_pass_byadminForm->o_user_pwd->GetValue();
    $new_pwd1 = $p_pass_byadminForm->n_user_pwd1->GetValue();
    $new_pwd2 = $p_pass_byadminForm->n_user_pwd2->GetValue();
    $idUser = $p_pass_byadminForm->p_app_user_id->GetValue();
    $sql = "select * from f_change_pass(" . $idUser . ",'" . $old_pwd . "','" . $new_pwd1 . "','" . $new_pwd2 . "')";
    $dbConn->query($sql);
    $dbConn->next_record();
    $mess = $dbConn->f("f_change_pass");
    $dbConn->close();
    echo '<script language="javascript">';
    echo 'alert("' . $mess . '");';
    echo '</script>';
    $p_pass_byadminForm->o_user_pwd->SetValue("");
    $p_pass_byadminForm->n_user_pwd1->SetValue("");
    $p_pass_byadminForm->n_user_pwd2->SetValue("");
    return;
    // -------------------------
    //End Custom Code
    //Close p_pass_byadminForm_Button_Ubah_OnClick @26-C74BD412
    return $p_pass_byadminForm_Button_Ubah_OnClick;
}
    }
    //barcode
    $bcr = "select f_gen_barcode('test')";
    $dbConn->query($bcr);
    while ($dbConn->next_record()) {
        $data["barcode"] = $dbConn->f("f_gen_barcode");
    }
    //nip & nama
    $ttd = "SELECT value as nama_kadin, value_2 as nip_kadin " . "FROM p_global_param " . "WHERE code = 'TTD KADIN'";
    $dbConn->query($ttd);
    while ($dbConn->next_record()) {
        $data["nama_kadin"] = $dbConn->f("nama_kadin");
        $data["nip_kadin"] = $dbConn->f("nip_kadin");
    }
    //end barcode
    $dbConn->close();
}
class FormCetak extends FPDF
{
    var $fontSize = 10;
    var $fontFam = 'Arial';
    var $yearId = 0;
    var $yearCode = "";
    var $paperWSize = 210;
    var $paperHSize = 297;
    var $height = 5;
    var $currX;
    var $currY;
    var $widths;
    var $aligns;
    function FormCetak()
function GetCetakExcel($param_arr)
{
    startExcel("rekap_skpdkb_jabatan.xls");
    $output = '';
    $output .= '<table id="table-piutang" class="grid-table-container" border="0" cellspacing="0" cellpadding="0">
          		<tr>
            		<td valign="top">';
    $output .= '<table class="grid-table" border="0" cellspacing="0" cellpadding="0" width="900">
                	<tr>
                  		<td colspan=5 class="th"><strong>LAPORAN REKAP SURAT TEGURAN PERBULAN</strong></td> 
                	</tr>
					<tr>
              		</table>';
    $output .= '<table id="table-piutang-detil" class="Grid" border="1" cellspacing="0" cellpadding="3px" width="100%">
                <tr >';
    $output .= '<th rowspan=2 align="center" >NO</th>';
    $output .= '<th rowspan=2 align="center" >BULAN</th>';
    $output .= '<th colspan=3 align="center" >JUMLAH TEGURAN KE</th></tr>';
    $output .= '<tr><th align="center" >1</th>';
    $output .= '<th align="center" >2</th>';
    $output .= '<th align="center" >3</th>';
    $output .= '</tr>';
    $dbConn = new clsDBConnSIKP();
    $query = "select t_debt_letter_id,t_customer_order_id,letter_date, sequence_no, code, \r\n\t\t\t\t\t(select count(*)\r\n\t\t\t\t\tfrom f_debt_letter_list(a.t_customer_order_id) x\r\n\t\t\t\t\tLEFT JOIN t_cust_account as y ON x.t_cust_account_id = y.t_cust_account_id\r\n\t\t\t\t\twhere y.p_vat_type_dtl_id NOT IN (11, 15, 17, 21, 27, 30, 41, 42, 43)) as jml\r\n\t\t\tfrom t_debt_letter a\r\n\t\t\tLEFT JOIN p_finance_period b on a.p_finance_period_id=b.p_finance_period_id\r\n\t\t\t where \r\n\t\t\t\ta.p_finance_period_id in (select p_finance_period_id \r\n\t\t\t\t\tfrom p_finance_period where p_year_period_id = " . $param_arr['p_year_period_id'] . ")\r\n\t\t\tORDER BY letter_date";
    //echo $query;exit;
    $data = array();
    $dbConn->query($query);
    while ($dbConn->next_record()) {
        $data[] = $dbConn->Record;
    }
    $dbConn->close();
    $no = 1;
    for ($i = 0; $i < count($data); $i++) {
        if ($data[$i]['code'] == $data[$i - 1]['code'] && $i != 0) {
            $output .= '<td align="left" >' . $data[$i]['jml'] . '</td>';
        } else {
            $output .= '<tr><td align="center" >' . $no . '</td>';
            $output .= '<td align="left" >' . $data[$i]['code'] . '</td>';
            $output .= '<td align="left" >' . $data[$i]['jml'] . '</td>';
            $no++;
        }
    }
    $output .= '</table>';
    echo $output;
    exit;
}
function Page_BeforeShow(&$sender)
{
    $Page_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_customer_create_uname;
    //Compatibility
    //End Page_BeforeShow
    //Custom Code @529-2A29BDB7
    // -------------------------
    $generate = CCGetFromGet("generate");
    $t_customer_id = CCGetFromGet("t_customer_id");
    $result = '';
    if ($generate == "yes" and !empty($t_customer_id)) {
        $dbConn = new clsDBConnSIKP();
        $query = "SELECT * FROM f_create_uname_password_wp(" . $t_customer_id . ") as hasil";
        $dbConn->query($query);
        while ($dbConn->next_record()) {
            $result = $dbConn->f("hasil");
        }
        $dbConn->close();
        print_r($result);
        exit;
    }
    // -------------------------
    //End Custom Code
    //Close Page_BeforeShow @1-4BC230CD
    return $Page_BeforeShow;
}
 function PageCetak($data, $no_urut, $start_year, $end_year)
 {
     $this->AliasNbPages();
     $this->SetLeftMargin(10);
     $this->SetTopMargin(2);
     $this->AddPage("P");
     $this->AddFont('BKANT');
     $this->SetFont('BKANT', '', 12);
     $lheader = $this->lengthCell / 8;
     $lheader1 = $lheader * 1;
     $lheader2 = $lheader * 2;
     $lheader3 = $lheader * 3;
     $lheader4 = $lheader * 4;
     $lheader7 = $lheader * 7;
     //header
     $this->Image('../images/logo_pemda.png', 25, 3, 25, 25);
     $this->Cell($lheader1, $this->height, "", "LT", 0, 'L');
     $this->Cell($lheader7, $this->height, "", "TR", 0, 'C');
     $this->Ln();
     $this->SetFont('Arial', 'B', 12);
     $this->Cell($lheader1, 8, "", "L", 0, 'L');
     $this->Cell($lheader7, 8, "PEMERINTAH KOTA BANDUNG", "R", 0, 'C');
     $this->Ln(8);
     $this->SetFont('Arial', 'B', 16);
     $this->Cell($lheader1, $this->height, "", "L", 0, 'L');
     $this->Cell($lheader7, $this->height, "DINAS PELAYANAN PAJAK", "R", 0, 'C');
     $this->Ln();
     $this->SetFont('Arial', '', 10);
     $this->Cell($lheader1, $this->height + 3, "", "L", 0, 'L');
     $this->Cell($lheader7, $this->height + 3, "Jalan Wastukancana No. 2 Telp. 022. 4235052 - Bandung", "R", 0, 'C');
     $this->Ln();
     $this->Cell($lheader1, $this->height, "", "LB", 0, 'L');
     $this->Cell($lheader7, $this->height, "", "RB", 0, 'C');
     $this->Ln();
     //end header
     /*
     // header kosong
     $this->Cell($lheader1, $this->height, "", "", 0, 'L');
     $this->Cell($lheader7, $this->height, "", "", 0, 'C');
     $this->Ln();
     
     $this->SetFont('Arial', 'B', 12);
     $this->Cell($lheader1, 8, "", "", 0, 'L');
     $this->Cell($lheader7, 8, "", "", 0, 'C');
     $this->Ln(8);
     
     $this->SetFont('Arial', 'B', 16);
     $this->Cell($lheader1, $this->height, "", "", 0, 'L');
     $this->Cell($lheader7, $this->height, "", "", 0, 'C');
     $this->Ln();
     
     $this->SetFont('Arial', '', 10);
     $this->Cell($lheader1, $this->height + 3, "", "", 0, 'L');
     $this->Cell($lheader7, $this->height + 3, "", "", 0, 'C');
     $this->Ln();
     
     $this->Cell($lheader1, $this->height, "", "", 0, 'L');
     $this->Cell($lheader7, $this->height, "", "", 0, 'C');
     $this->Ln();
     //end header kosong
     */
     $this->Cell($lheader1, $this->height, "", "", 0, 'L');
     $this->Cell($lheader7, $this->height, "", "", 0, 'C');
     $this->Ln(1);
     $this->Cell($this->lengthCell, $this->height, "", "TLR", 0, 'L');
     $this->Ln();
     $this->SetFont('BKANT', '', 10);
     $lbody = $this->lengthCell / 4;
     $lbody1 = $lbody * 1;
     $lbody2 = $lbody * 2;
     $lbody3 = $lbody * 3;
     $this->Cell(10, $this->height + 2, "", "L", 0, 'L');
     $this->Cell($lbody1 - 10, $this->height + 2, "NPWPD", "", 0, 'L');
     $this->Cell($lbody1, $this->height + 2, "", "", 0, 'L');
     $this->Cell($lbody2, $this->height + 2, "", "R", 0, 'L');
     $this->Ln($this->height - 4);
     $this->Cell($lbody1 + 3, $this->height, ":", "L", 0, 'R');
     $rep_npwd = str_replace(".", "", $data["npwd"]);
     $arr1 = str_split($rep_npwd);
     $this->kotak(1, 34, 1, $arr1[0]);
     $this->kotakKosong(1, 34, 1);
     $this->kotak(1, 34, 1, $arr1[1]);
     $this->kotakKosong(1, 34, 1);
     $this->kotak(1, 34, 1, $arr1[2]);
     $this->kotak(1, 34, 1, $arr1[3]);
     $this->kotak(1, 34, 1, $arr1[4]);
     $this->kotak(1, 34, 1, $arr1[5]);
     $this->kotak(1, 34, 1, $arr1[6]);
     $this->kotak(1, 34, 1, $arr1[7]);
     $this->kotak(1, 34, 1, $arr1[8]);
     $this->kotakKosong(1, 34, 1);
     $this->kotak(1, 34, 1, $arr1[9]);
     $this->kotak(1, 34, 1, $arr1[10]);
     $this->kotakKosong(1, 34, 1);
     $this->kotak(1, 34, 1, $arr1[11]);
     $this->kotak(1, 34, 1, $arr1[12]);
     $this->Ln(9);
     $this->SetWidths(array(20, 2, $this->lengthCell - 22));
     $this->SetAligns(array("L", "L", "L"));
     $posy = $this->getY();
     $this->setY($posy - 3);
     $today = getdate();
     $lkepada = $this->lengthCell / 5;
     $lkepada2 = $lkepada * 2;
     $lkepada3 = $lkepada * 3;
     $this->Cell($lkepada3, $this->height, "", "L", 0, 'L');
     //$this->Cell($lkepada2, $this->height, "Bandung, ".$data['letter_date_txt'], "R", 0, 'L');
     $this->Cell($lkepada2, $this->height, "", "R", 0, 'L');
     $this->Ln();
     $this->Cell($lkepada3, $this->height, "", "L", 0, 'L');
     $this->Cell($lkepada2, $this->height, "Kepada Yth,", "R", 0, 'L');
     $this->Ln();
     $this->SetAligns(array("L", "L", "L", "L"));
     $this->SetWidths(array($lkepada3, 22, 2, 63.7));
     $this->RowMultiBorderWithHeight(array("", "Pimpinan", ":", $data['company_name']), array("L", "", "", "R"), $this->height);
     /*$this->SetAligns(array("L","L","L","L"));
     		$this->SetWidths(array($lkepada3,22,2,63.7));
     		$this->RowMultiBorderWithHeight(
     			array("",
     				"NPWPD",
     				":",
     				$data['npwd']
     			),
     			array("L",
     				"",
     				"",
     				"R"
     			),
     			$this->height/2
     		);*/
     $this->SetWidths(array($lkepada3, $lkepada2));
     $this->SetAligns(array("L", "L"));
     $this->RowMultiBorderWithHeight(array("", $data["address"]), array("L", "R"), $this->height);
     $this->Cell($lkepada3, $this->height, "", "L", 0, 'L');
     $this->Cell($lkepada2, $this->height, "Di ", "R", 0, 'L');
     $this->Ln();
     $this->Cell($lkepada3, $this->height, "", "L", 0, 'L');
     //$this->Cell($lkepada2, $this->height, $data['kota'], "R", 0, 'L');
     $this->Cell($lkepada2, $this->height, "BANDUNG", "R", 0, 'L');
     $this->Ln();
     // $this->Cell($lkepada3, $this->height, "", "L", 0, 'L');
     // $this->Cell($lkepada2, $this->height, "", "R", 0, 'C');
     // $this->Ln();
     $this->Cell($lkepada3, $this->height, "", "L", 0, 'L');
     $this->Cell($lkepada2, $this->height, "", "R", 0, 'C');
     $this->Ln();
     $this->SetFont('BKANT', 'U', 10);
     // $this->Cell($this->lengthCell, $this->height, "", "LR", 0, 'C');
     // $this->newLine();
     $teg_ke = CCGetFromGet("teg_ke", 1);
     $this->Cell($this->lengthCell, $this->height, "SURAT TEGURAN " . numberToRoman($teg_ke), "LR", 0, 'C');
     $this->Ln();
     $this->SetFont('BKANT', '', 10);
     $data["letter_no"] = trim($data["letter_no"]);
     //echo $data["letter_no"];exit;
     if ($data["letter_no"] == "") {
         $this->Cell($this->lengthCell, $this->height, "Nomor : ..........................................", "LR", 0, 'C');
     } else {
         $this->Cell($this->lengthCell, $this->height, "Nomor : " . $data["letter_no"], "LR", 0, 'C');
     }
     $this->newLine();
     $this->SetFont('BKANT', '', 10);
     /*$this->Cell($this->lengthCell, $this->height, "Nomor: ".$data["letter_no"], "LR", 0, 'C');
     		$this->newLine();*/
     $this->SetWidths(array(10, 204.3, 5));
     $this->RowMultiBorderWithHeight(array("", "Menurut pembukuan kami hingga saat ini Saudara masih mempunyai tunggakan Pajak sebagai berikut:", ""), array("L", "", "R"), $this->height);
     //$this->newLine();
     // Tabel
     $ltable = ($this->lengthCell - 15) / 14;
     $ltable1 = $ltable * 1;
     $ltable2 = $ltable * 2;
     $ltable3 = $ltable * 3;
     $ltable6 = $ltable * 6;
     $ltable4 = $ltable * 4;
     $p_year_period_id = CCGetFromGet("p_year_period_id", 27);
     $p_settlement_type_id = CCGetFromGet("p_settlement_type_id", 4);
     $p_vat_type_id = CCGetFromGet("p_vat_type_id", "");
     $dbConn = new clsDBConnSIKP();
     $query = "select to_char(start_period,'dd-mm-yyyy') ||' s.d. '||to_char(end_period,'dd-mm-yyyy') as masa_pajak,  \r\n\t\t\t\tc.code,to_char(a.due_date,'dd-mm-yyyy') as due_date_short, \r\n\t\t\t\tround(nvl(total_vat_amount,0) + nvl(total_penalty_amount,0)) as piutang,\r\n\t\t\t\td.order_no,\r\n\t\t\t\tto_char(a.settlement_date,'dd-mm-yyyy') as tgl_ketetapan\r\n\t\t\t\tfrom t_vat_setllement a \r\n\t\t\t\tleft join t_payment_receipt b on a.t_vat_setllement_id = b.t_vat_setllement_id\r\n\t\t\t\tleft join p_settlement_type c on c.p_settlement_type_id = a.p_settlement_type_id\r\n\t\t\t\tleft join t_customer_order d on d.t_customer_order_id = a.t_customer_order_id\r\n\t\t\t\twhere a.t_cust_account_id = " . $data["t_cust_account_id"] . " \r\n\t\t\t\tand b.t_payment_receipt_id is NULL\r\n\t\t\t\tand a.p_settlement_type_id = " . $p_settlement_type_id . "\r\n\t\t\t\tand trunc(settlement_date) \r\n\t\t\t\t\tBETWEEN (select start_date from p_year_period where p_year_period_id = " . $p_year_period_id . ")\r\n\t\t\t\t\tand (select end_date from p_year_period where p_year_period_id = " . $p_year_period_id . ")\r\n\t\t\t\tORDER BY start_period ";
     //echo $query;exit;
     $dbConn->query($query);
     $data_piutang = array();
     while ($dbConn->next_record()) {
         $data_piutang[] = array('masa_pajak' => $dbConn->f("masa_pajak"), 'code' => $dbConn->f("code"), 'due_date' => $dbConn->f("due_date_short"), 'order_no' => $dbConn->f("order_no"), 'tgl_ketetapan' => $dbConn->f("tgl_ketetapan"), 'piutang' => $dbConn->f("piutang"));
     }
     $dbConn->close();
     $this->SetWidths(array(10, $ltable2 + 5, $ltable4 - 5, $ltable3, $ltable2, $ltable3, 5));
     $this->SetAligns(array("L", "C", "C", "C", "C", "C", "L"));
     //$title_kolom4 = 'SPTPD';
     //$title_kolom5 = 'Tgl. Setor';
     //if( $data["sequence_no"] == 3) {
     $title_kolom4 = 'No dan Tanggal SKPDKB';
     $title_kolom5 = 'Jumlah Tunggakan';
     //}
     $this->RowMultiBorderWithHeight(array("", "Jenis Pajak", "Masa Pajak", $title_kolom4, "Tanggal Jatuh Tempo", $title_kolom5, ""), array("LR", "TBLR", "TBLR", "TBLR", "TBLR", "TBLR", "LR"), $this->height);
     //$this->SetWidths(array(10, $ltable4, $ltable2+ $ltable2, $ltable3, 5));
     $this->SetAligns(array("L", "C", "C", "C", "C", "R", "L"));
     $tahun = explode(" ", $data["periode"]);
     $bulan_periode = explode(",", $data['debt_period_code']);
     $bulan_string = '';
     $i = 0;
     foreach ($bulan_periode as $item) {
         $bulan = explode(" ", $item);
         $bulan_string .= $bulan[0];
         $i++;
         if (!empty($bulan_periode[$i])) {
             $bulan_string .= "\n";
         }
     }
     $total_piutang = 0;
     foreach ($data_piutang as $item) {
         $this->RowMultiBorderWithHeight(array("", $data["vat_code"], $item["masa_pajak"], $item["order_no"] . ' - ' . $item["tgl_ketetapan"], $item["due_date"], number_format($item["piutang"], 0, ",", "."), ""), array("LR", "TBLR", "TBLR", "TBLR", "TBLR", "TBLR", "LR"), $this->height);
         $total_piutang += $item["piutang"];
     }
     $this->RowMultiBorderWithHeight(array("", "", "", "", "", number_format($total_piutang, 0, ",", "."), ""), array("LR", "TBLR", "TBLR", "TBLR", "TBLR", "TBLR", "LR"), $this->height);
     $lbody = $this->lengthCell / 4;
     $lbody1 = $lbody * 1;
     $lbody2 = $lbody * 2;
     $lbody3 = $lbody * 3;
     $data["terbilang"] = trim($data["terbilang"]);
     $this->Cell(20, $this->height, "", "L", 0, 'L');
     $this->Cell($lbody1 - 20, "", "", 0, 'L');
     $this->Cell($lbody3, $this->height, "", "R", 0, 'L');
     $this->Ln();
     $dbConn = new clsDBConnSIKP();
     $query = "select trim(f_terbilang) as terbilang \r\n\t\t\t\tfrom f_terbilang('" . $total_piutang . "','') ";
     //echo $query;exit;
     $dbConn->query($query);
     $dbConn->next_record();
     $terbilang = $dbConn->f("terbilang");
     $dbConn->close();
     if ($total_piutang != 0) {
         $this->SetWidths(array(10, $this->lengthCell - 20, 10));
         $this->SetAligns(array("L", "J", "L"));
         $this->RowMultiBorderWithHeight(array("", "Dengan huruf : (" . $terbilang . ")", ""), array("L", "", "R"), $this->height);
     }
     $teg_ke = CCGetFromGet("teg_ke", 1);
     $this->SetWidths(array(10, $this->lengthCell - 20, 10));
     $this->SetAligns(array("L", "J", "L"));
     if ($teg_ke == 1) {
         $this->RowMultiBorderWithHeight(array("", "\nUntuk mencegah tindakan penagihan dengan Surat Paksa berdasarkan Undang - Undang Nomor 28 " . "Tahun 2009 dan Peraturan Daerah Nomor 20 Tahun 2011 Ps 70, maka diminta kepada Saudara agar melunasi jumlah tunggakan " . "dalam waktu 7 (tujuh) hari sejak diterima Surat Teguran ini. Setelah batas waktu tersebut tindakan penagihan akan ditindaklanjuti " . "dengan penyerahan Surat Teguran II yang dapat diikuti dengan pemasangan Media Peringatan.", ""), array("L", "", "R"), $this->height);
     }
     if ($teg_ke == 2) {
         $this->RowMultiBorderWithHeight(array("", "\nUntuk mencegah tindakan penagihan dengan Surat Paksa berdasarkan Undang - Undang Nomor 28 " . "Tahun 2009 dan Peraturan Daerah Nomor 20 Tahun 2011 Ps 70, maka diminta kepada Saudara agar melunasi jumlah tunggakan " . "dalam waktu 7 (tujuh) hari sejak diterima Surat Teguran ini. Setelah batas waktu tersebut tindakan penagihan akan ditindaklanjuti " . "dengan penyerahan Surat Teguran III yang dapat dikenakan sanksi administrasi sesuai dengan ketentuan perundang-undangan.", ""), array("L", "", "R"), $this->height);
     }
     if ($teg_ke == 3) {
         $this->RowMultiBorderWithHeight(array("", "\nUntuk mencegah tindakan penagihan dengan Surat Paksa berdasarkan Undang - Undang Nomor 28 " . "Tahun 2009 dan Peraturan Daerah Nomor 20 Tahun 2011 Ps 70, maka diminta kepada Saudara agar melunasi jumlah tunggakan " . "dalam waktu 7 (tujuh) hari sejak diterima Surat Teguran ini. Setelah batas waktu tersebut tindakan penagihan akan ditindaklanjuti " . "dengan penyerahan Surat Paksa.", ""), array("L", "", "R"), $this->height);
     }
     $this->RowMultiBorderWithHeight(array("", "\nDalam hal saudara telah melunasi Tunggakan di atas, diminta agat Saudara segera melapor kepada Seksi Penyelesaian " . "Piutang pada Bidang Pajak Pendaftaran Dinas Pelayanan Pajak Kota Bandung (dengan membawa bukti pembayaran).", ""), array("L", "", "R"), $this->height);
     /*$this->tulis("Untuk mencegah tindakan penagihan dengan Surat Paksa berdasarkan Peraturan Daerah Kota Bandung", "FJ");
     		$this->tulis("2009 dan Peraturan Daerah Nomor 20 Tahun 2011 Ps 70, maka diminta kepada Saudara agar melunasi", "FJ");
     		$this->tulis("jumlah tunggakan dalam waktu 7 (tujuh) hari setelah Surat Teguran ini. Setelah batas waktu tersebut", "FJ");
     		$this->tulis("tindakan penagihan akan ditindaklanjuti dengan penyerahan Surat Paksa.", "L");
     		$this->tulis("", "L");
     		$this->tulis("Apabila saudara telah melaksanakan pembayaran pajak tersebut, kami mohon untuk dapat memperlihatkan", "FJ");
     		$this->tulis("SSPD yang telah divalidasi dengan melampirkan photo copy dokumen yang dimaksud.", "L");
     		$this->tulis("", "L");
     		$this->tulis("Demikian agar menjadi maklum, atas perhatian dan kerjasamanya kami ucapkan terima kasih.", "L");
     		*/
     // $this->Cell($this->lengthCell, $this->height, "", "LR", 0, 'L');
     // $this->Ln();
     // $this->Cell($this->lengthCell, $this->height, "", "LR", 0, 'L');
     // $this->Ln();
     $this->Cell($this->lengthCell, $this->height, "", "LR", 0, 'L');
     $this->Ln();
     $lbody = $this->lengthCell / 16;
     $lbody2 = $lbody * 2;
     $lbody4 = $lbody * 4;
     //setting ttd
     $ttd = CCGetFromGet("ttd", 1);
     if ($ttd == 1) {
         $this->Image('http://' . $_SERVER['HTTP_HOST'] . '/mpd/include/qrcode/generate-qr.php?param=' . str_replace(" ", "_", $data['company_name']) . "-" . $data["npwd"], 160, 153 + sizeof($data_piutang) * 4, 25, 25, 'PNG');
     }
     $this->Cell($this->lengthCell, $this->height, "", "LR", 0, 'L');
     $this->Ln();
     $this->Cell($lbody2, $this->height, "", "L", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     //$this->Cell($lbody4, $this->height, "Bandung, " .$data['letter_date_txt'] /*. $data["tanggal"]*/, "", 0, 'C');
     $tgl_cetak = CCGetFromGet("tgl_cetak", 1);
     if ($tgl_cetak == 1) {
         $this->Cell($lbody4, $this->height, "Bandung, " . date('d-m-Y'), "", 0, 'C');
     } else {
         $this->Cell($lbody4, $this->height, "Bandung, .......................................", "", 0, 'C');
     }
     $this->Cell($lbody2, $this->height, "", "R", 0, 'C');
     $this->Ln();
     $this->Cell($lbody2, $this->height, "", "L", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "KEPALA DINAS PELAYANAN PAJAK", "", 0, 'C');
     $this->Cell($lbody2, $this->height, "", "R", 0, 'C');
     $this->Ln();
     /*		$this->Cell($lbody2, $this->height, "", "L", 0, 'C');
     		$this->Cell($lbody4, $this->height, "", "", 0, 'C');
     		$this->Cell($lbody4, $this->height, "", "", 0, 'C');
     		$this->Cell($lbody4, $this->height, "Kepala Bidang Pajak Pendaftaran", "", 0, 'C');
     		$this->Cell($lbody2, $this->height, "", "R", 0, 'C');
     		$this->Ln();*/
     $this->Cell($this->lengthCell, $this->height, "", "LR", 0, 'L');
     $this->Ln();
     $this->Cell($this->lengthCell, $this->height, "", "LR", 0, 'L');
     $this->Ln();
     //$this->Image('../images/ttd_pa_gun_gun.jpg',$lbody2+$lbody4+$lbody4-20,168,$lbody4+48,20);
     //$this->Image('../images/ttd_pa_soni.jpg',$lbody2+$lbody4+$lbody4-20,168,$lbody4+48,20);
     $this->Cell($lbody2, $this->height, "", "L", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'L');
     $this->Cell($lbody4 - 5, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4 + 10, $this->height, "", "", 0, 'C');
     $this->Cell($lbody2 - 5, $this->height, "", "R", 0, 'C');
     $this->Ln();
     $this->Cell($this->lengthCell, $this->height, "", "LR", 0, 'L');
     $this->Ln();
     $this->Cell($this->lengthCell, $this->height, "", "LR", 0, 'L');
     $this->Ln();
     $this->Cell($lbody2, $this->height, "", "L", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'L');
     $this->Cell($lbody4 - 5, $this->height, "", "", 0, 'C');
     //$this->Cell($lbody4+10, $this->height, "Drs. PRIANA WIRASAPUTRA, MM.", "B", 0, 'C');
     //$this->Cell($lbody4+10, $this->height, "H. SONI BAKHTIAR, S.Sos, M.Si.", "B", 0, 'C');
     $this->Cell($lbody4 + 10, $this->height, "Drs. H. EMA SUMARNA, M. Si", "B", 0, 'C');
     $this->Cell($lbody2 - 5, $this->height, "", "R", 0, 'C');
     $this->Ln();
     $this->Cell($lbody2, $this->height, "", "L", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'L');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     //$this->Cell($lbody4 - 2, $this->height, "NIP. 19600308 198503 1 007", "", 0, 'C'); //isi nip
     //$this->Cell($lbody4 - 2, $this->height, "NIP. 19750625 199403 1 001", "", 0, 'C'); //isi nip
     $this->Cell($lbody4 - 2, $this->height, "NIP. 19661207 198603 1 006", "", 0, 'C');
     //isi nip
     $this->Cell(2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody2, $this->height, "", "R", 0, 'C');
     $this->Ln();
     $this->Cell(10, $this->height, "", "BL", 0, 'L');
     //$this->Cell($this->lengthCell - 10, $this->height, "*) Coret yang tidak perlu", "BR", 0, 'L');
     $this->Cell($this->lengthCell - 10, $this->height, "", "BR", 0, 'L');
 }
function GetSurvey($param_arr)
{
    $output = '';
    $dbConn = new clsDBConnSIKP();
    $query = "select * from t_vat_registration where npwpd = '" . $param_arr['npwpd'] . "'";
    //echo $query;exit;
    $dbConn->query($query);
    if ($dbConn->next_record()) {
        $data = $dbConn->Record;
        $query2 = "select * from p_survey_question WHERE p_survey_type_id=1 and sequence_no =1";
        $dbConn2 = new clsDBConnSIKP();
        $dbConn2->query($query2);
        if ($dbConn2->next_record()) {
            $data2 = $dbConn2->Record;
            echo '<script language="javascript">';
            echo 'location.href="t_survey_kepuasan_pelanggan_pendaftaran_pertanyaan.php?t_vat_registration_id=' . $data["t_vat_registration_id"] . '&p_survey_question_id=' . $data2["p_survey_question_id"] . '"';
            echo '</script>';
        } else {
            echo '<script language="javascript">';
            echo 'alert("Pertanyaan tidak ditemukan.")';
            echo '</script>';
        }
    } else {
        $output = '<table class="Record" cellspacing="0" cellpadding="5" style="font-size:15px;padding-left:15px;" border="0">
		<tr>
			<td colspan="3">NPWPD : <b>' . $param_arr['npwpd'] . '</b> <b style="color:#FF0000;">TIDAK DITEMUKAN</b></td>
		</tr>
		</table>';
    }
    $dbConn->close();
    return $output;
}
function getDataPerJenis($p_vat_type_id, $start_date)
{
    $param_arr['npwpd_jabatan'] = CCGetFromGet('npwpd_jabatan');
    $param_arr['tgl_penerimaan'] = CCGetFromGet('tgl_penerimaan');
    $param_arr['tgl_penerimaan_last'] = CCGetFromGet('tgl_penerimaan_last');
    $param_arr['kode_wilayah'] = CCGetFromGet('kode_wilayah');
    $dbConn = new clsDBConnSIKP();
    $data = array();
    $query = "select \r\n\t\t\t\t(select count(*) from t_cust_account where p_account_status_id = 1 \r\n\t\t\t\tand trunc(last_satatus_date) <= (select end_date from p_finance_period where start_date = to_date('" . $start_date . "','dd-mm-yyyy'))\r\n\t\t\t\tand p_vat_type_id = " . $p_vat_type_id . "\r\n\t\t\t\tand case when '" . $param_arr['kode_wilayah'] . "' = 'semua' then true \r\n\t\t\t\t\twhen '" . $param_arr['kode_wilayah'] . "' = 'lainnya' then f_get_wilayah(npwd)='-' \r\n\t\t\t\t\telse '" . $param_arr['kode_wilayah'] . "' = f_get_wilayah(npwd) end\r\n\t\t\t\tand case when " . $param_arr['npwpd_jabatan'] . " = 1 then true else npwpd_jabatan='Y' end) as aktif,\r\n\t\t\t\tcount(DISTINCT a.t_cust_account_id) as bayar,sum(payment_amount) as nilai\r\n\t\t\tfrom t_vat_setllement a\r\n\t\t\t\tleft join t_cust_account b on a.t_cust_account_id=b.t_cust_account_id\r\n\t\t\t\tleft join t_payment_receipt c on c.t_vat_setllement_id=a.t_vat_setllement_id\r\n\t\t\twhere p_account_status_id = 1 \r\n\t\t\t\tand trunc(last_satatus_date) <= (select end_date from p_finance_period where start_date = to_date('" . $start_date . "','dd-mm-yyyy'))\r\n\t\t\t\tand b.p_vat_type_id = " . $p_vat_type_id . "\r\n\t\t\t\tand c.t_payment_receipt_id is not null\r\n\t\t\t\tand trunc(payment_date) between to_date('" . $param_arr['tgl_penerimaan'] . "','dd-mm-yyyy') and to_date('" . $param_arr['tgl_penerimaan_last'] . "','dd-mm-yyyy')\r\n\t\t\t\tand case when " . $param_arr['npwpd_jabatan'] . " = 1 then true else npwpd_jabatan='Y' end\r\n\t\t\t\tand case when '" . $param_arr['kode_wilayah'] . "' = 'semua' then true \r\n\t\t\t\t\twhen '" . $param_arr['kode_wilayah'] . "' = 'lainnya' then f_get_wilayah(b.npwd)='-' \r\n\t\t\t\t\telse '" . $param_arr['kode_wilayah'] . "' = f_get_wilayah(b.npwd) end\r\n\t\t\t\tand a.p_finance_period_id = (select p_finance_period_id from p_finance_period where start_date = to_date('" . $start_date . "','dd-mm-yyyy'))";
    //echo $query;exit;
    $dbConn->query($query);
    $dbConn->next_record();
    $data = $dbConn->Record;
    $dbConn->close();
    return $data;
}
 function PageCetak($data)
 {
     $this->AliasNbPages();
     $this->AddPage("P");
     $this->SetFont('Arial', '', 10);
     $this->Image('../images/logo_pemda.png', 25, 12, 25, 25);
     $lheader = $this->lengthCell / 8;
     $lheader1 = $lheader * 1;
     $lheader2 = $lheader * 2;
     $lheader3 = $lheader * 3;
     $lheader4 = $lheader * 4;
     $lheader7 = $lheader * 7;
     $this->Cell($lheader1, $this->height, "", "", 0, 'L');
     $this->Cell($lheader7, $this->height, "", "", 0, 'C');
     $this->Ln();
     $this->SetFont('Arial', 'B', 12);
     $this->Cell($lheader1, $this->height, "", "", 0, 'L');
     $this->Cell($lheader7, $this->height, "PEMERINTAH KOTA BANDUNG", "", 0, 'C');
     $this->Ln();
     $this->SetFont('Arial', 'B', 16);
     $this->Cell($lheader1, $this->height, "", "", 0, 'L');
     $this->Cell($lheader7, $this->height, "DINAS PELAYANAN PAJAK", "", 0, 'C');
     $this->Ln();
     $this->SetFont('Arial', '', 10);
     $this->Cell($lheader1, $this->height + 3, "", "", 0, 'L');
     $this->Cell($lheader7, $this->height + 3, "Jalan Wastukancana No. 2 Telp. 022. 4235052 - Bandung", "", 0, 'C');
     $this->Ln();
     $this->Cell($lheader1, $this->height, "", "B", 0, 'L');
     $this->Cell($lheader7, $this->height, "", "B", 0, 'C');
     $this->Ln();
     $this->Cell($this->lengthCell, $this->height, "", "", 0, 'L');
     $this->Ln();
     $this->SetFont('Arial', 'UB', 12);
     $this->Cell($this->lengthCell, $this->height, "BERITA ACARA PENELITIAN LAPANGAN", "", 0, 'C');
     $this->newLine();
     $this->newLine();
     $this->SetFont('Arial', '', 10);
     $this->tulis("Pada hari ini .......... Tanggal ..... Bulan .................... Tahun .........., kami yang bertanda tangan di bawah ini:", "L");
     $lbody = $this->lengthCell / 4;
     $lbody1 = $lbody * 1;
     $lbody2 = $lbody * 2;
     $lbody3 = $lbody * 3;
     $this->SetFont('Arial', '', 10);
     $this->Cell($this->lengthCell, $this->height, "", "", 0, 'L');
     $this->Ln();
     // Nama Petugas
     $titik = "........................................................................................................";
     $nama_1 = $data["bap_employee_name_1"] == "" ? $titik : $data["bap_employee_name_1"];
     $nama_2 = $data["bap_employee_name_2"] == "" ? $titik : $data["bap_employee_name_2"];
     $no_1 = $data["bap_employee_no_1"] == "" ? $titik : $data["bap_employee_no_1"];
     $no_2 = $data["bap_employee_no_2"] == "" ? $titik : $data["bap_employee_no_2"];
     $job_1 = $data["bap_employee_job_pos_1"] == "" ? $titik : $data["bap_employee_job_pos_1"];
     $job_2 = $data["bap_employee_job_pos_2"] == "" ? $titik : $data["bap_employee_job_pos_2"];
     $this->isi("1.", "Nama", ": " . $nama_1);
     $this->isi("", "NIP", ": " . $no_1);
     $this->isi("", "Jabatan", ": " . $job_1);
     $this->isi("2.", "Nama", ": " . $nama_2);
     $this->isi("", "NIP", ": " . $no_2);
     $this->isi("", "Jabatan", ": " . $job_2);
     // Body
     $this->newLine();
     $this->Cell(10, $this->height, "", "", 0, 'L');
     $this->Cell(5, $this->height, "", "", 0, 'L');
     $this->Cell($lbody2 * 2 - 25, $this->height, "Telah melakukan penelitian lapangan atas:", "", 0, 'L');
     $this->Cell(10, $this->height, "", "", 0, 'L');
     $this->Ln();
     $this->isi("1", "Nama Pemohon NPWPD", ": " . $data["wp_name"]);
     //alamat wp
     $this->SetWidths(array(10, 5, $lbody1, $lbody3 - 25, 10));
     $this->SetAligns(array("L", "L", "L", "L", "L"));
     $this->RowMultiBorderWithHeight(array("", "2.", "Alamat Pemohon NPWPD", ": " . $data["wp_address_name"], ""), array("", "", "", "", ""), $this->height);
     $this->isi("3.", "Nama Perusahaan", ": " . $data["company_name"]);
     //alamat perusahaan
     $this->SetWidths(array(10, 5, $lbody1, $lbody3 - 25, 10));
     $this->SetAligns(array("L", "L", "L", "L", "L"));
     $this->RowMultiBorderWithHeight(array("", "4.", "Alamat Perusahaan", ": " . $data["address_name"], ""), array("", "", "", "", ""), $this->height);
     $this->RowMultiBorderWithHeight(array("", "5.", "Nama Merek Dagang", ": " . $data["company_brand"], ""), array("", "", "", "", ""), $this->height);
     $this->RowMultiBorderWithHeight(array("", "6.", "Alamat Lokasi Usaha", ": " . $data["brand_address_name"] . " " . $data["brand_address_no"], ""), array("", "", "", "", ""), $this->height);
     $this->newLine();
     $this->isi_full("Dalam penelitian lapangan tersebut di atas telah ditemukan hal-hal sebagai berikut:");
     $data_pajak = array();
     $dbConn = new clsDBConnSIKP();
     $query = "select * from p_rqst_type where p_rqst_type_id =  " . $data["p_rqst_type_id"];
     $dbConn->query($query);
     while ($dbConn->next_record()) {
         $data_pajak["p_vat_type_id"] = $dbConn->f("p_vat_type_id");
     }
     $dbConn->close();
     if ($data_pajak["p_vat_type_id"] == 1) {
         $sePerLima = ($this->lengthCell - 20) / 5;
         $this->SetWidths(array(10, $sePerLima, $sePerLima, $sePerLima, $sePerLima, $sePerLima));
         $this->SetAligns(array("C", "C", "C", "C", "C", "C"));
         //$this->SetvAligns(array("M", "M", "M", "M", "M","M"));
         $this->RowMultiBorderWithHeight(array("", "Kelas Hotel", "Golongan Kamar", "Jumlah Kamar", "Frekuensi Pengguna Layanan", "Tarif kamar"), array("", "BLTR", "BLTR", "BLTR", "BLTR", "BLTR"), $this->height);
         /*$data_detail = array();
         			$dbConn = new clsDBConnSIKP();
         			$query = 	"select code,room_qty,service_qty,service_charge_wd,service_charge_we from t_vat_reg_dtl_hotel a
         					left join p_room_type x on a.p_room_type_id=x.p_room_type_id
         					where t_vat_registration_id = ".$data["t_vat_registration_id"];
         
         			$dbConn->query($query);
         			while ($dbConn->next_record()) {
         				$data_detail["code"]		= $dbConn->f("code");
         				$data_detail["room_qty"]		= $dbConn->f("room_qty");
         				$data_detail["service_qty"]		= $dbConn->f("service_qty");
         				$data_detail["service_charge_wd"]		= $dbConn->f("service_charge_wd");
         				$data_detail["service_charge_we"]		= $dbConn->f("service_charge_we");
         				
         				$this->RowMultiBorderWithHeight(array(
         					"",
         					ucwords(strtolower($data["vat_code"])),
         					ucwords(strtolower($data_detail["code"])),
         					$data_detail["room_qty"],
         					$data_detail["service_qty"],
         					number_format($data_detail["service_charge_wd"],2,",",".")." (weekday), ".number_format($data_detail["service_charge_we"],2,",",".")." (weekend)"
         					)
         					,
         					array(
         					"",
         					"LR",
         					"LR",
         					"LR",
         					"LR",
         					"LR"
         					)
         					,
         					$this->height);
         			}*/
         $this->RowMultiBorderWithHeight(array("", "", "", "", "", ""), array("", "LR", "LR", "LR", "LR", "LR"), 25);
         $this->RowMultiBorderWithHeight(array("", "", "", "", "", ""), array("", "T", "T", "T", "T", "T"), $this->height);
         $dbConn->close();
         $this->SetWidths(array(10, 40, $this->lengthCell - 60));
         $this->SetAligns(array("L", "L", "L"));
         $this->RowMultiBorderWithHeight(array("", "Tanggal Operasional", ""), array("", "BLTR", "BLTR"), $this->height);
     }
     if ($data_pajak["p_vat_type_id"] == 2) {
         $sePerEnam = ($this->lengthCell - 20) / 6;
         $this->SetWidths(array(10, $sePerEnam, $sePerEnam, $sePerEnam, $sePerEnam, $sePerEnam, $sePerEnam));
         $this->SetAligns(array("C", "C", "C", "C", "C", "C", "C"));
         $this->RowMultiBorderWithHeight(array("", "Jenis Pelayanan Restoran", "Jumlah Meja dan Kursi", "Harga Makanan Terendah & Tertinggi", "Harga Minuman Terendah & Tertinggi", "Daya Tampung", "Jumlah Pengunjung Rata-rata Perbulan"), array("", "BLTR", "BLTR", "BLTR", "BLTR", "BLTR"), $this->height);
         /*$data_detail = array();
         			$dbConn = new clsDBConnSIKP();
         			$query = 	"select * from t_vat_reg_dtl_restaurant
         					where t_vat_registration_id = ".$data["t_vat_registration_id"];
         
         			$dbConn->query($query);
         			while ($dbConn->next_record()) {
         				$data_detail["seat_qty"]		= $dbConn->f("seat_qty");
         				$data_detail["table_qty"]		= $dbConn->f("table_qty");
         				$data_detail["max_service_qty"]		= $dbConn->f("max_service_qty");
         				$data_detail["avg_subscription"]		= $dbConn->f("avg_subscription");
         				$data_detail["service_type_desc"]		= $dbConn->f("service_type_desc");
         				
         				$this->RowMultiBorderWithHeight(array(
         					"",
         					ucwords(strtolower($data_detail["service_type_desc"])),
         					$data_detail["table_qty"]	." meja dan ".$data_detail["seat_qty"]." kursi",
         					"",
         					"",
         					$data_detail["max_service_qty"],
         					number_format($data_detail["avg_subscription"],0,",",".")
         					)
         					,
         					array(
         					"",
         					"LR",
         					"LR",
         					"LR",
         					"LR",
         					"LR",
         					"LR"
         					)
         					,
         					$this->height);
         			}*/
         $this->RowMultiBorderWithHeight(array("", "", "", "", "", "", ""), array("", "LR", "LR", "LR", "LR", "LR", "LR"), 25);
         $this->RowMultiBorderWithHeight(array("", "", "", "", "", "", ""), array("", "T", "T", "T", "T", "T", "T"), $this->height);
         $dbConn->close();
         $this->SetWidths(array(10, 40, $this->lengthCell - 60));
         $this->SetAligns(array("L", "L", "L"));
         $this->RowMultiBorderWithHeight(array("", "Tanggal Operasional", ""), array("", "BLTR", "BLTR"), $this->height);
     }
     if ($data_pajak["p_vat_type_id"] == 3) {
         $sePerDelapan = ($this->lengthCell - 20) / 8;
         $this->SetWidths(array(10, $sePerDelapan, $sePerDelapan, $sePerDelapan + 5, $sePerDelapan - 5, $sePerDelapan, $sePerDelapan, $sePerDelapan, $sePerDelapan));
         $this->SetAligns(array("C", "C", "C", "C", "C", "C", "C", "C", "C"));
         $this->RowMultiBorderWithHeight(array("", "Jenis Hiburan", "Cover Charge / HTM / Tarif", "Jumlah Lembar Meja / Kursi", "Jumlah Room", "Jumlah PL Pramuria / Pemijat", "Booking / Jam", "F / B", "Porsi / Orang"), array("", "BLTR", "BLTR", "BLTR", "BLTR", "BLTR", "BLTR", "BLTR"), $this->height);
         /*$data_detail = array();
         			$dbConn = new clsDBConnSIKP();
         			$query = 	"select * from t_vat_reg_dtl_entertaintment
         					where t_vat_registration_id = ".$data["t_vat_registration_id"];
         
         			$dbConn->query($query);
         			while ($dbConn->next_record()) {
         				$data_detail["seat_qty"]		= $dbConn->f("seat_qty");
         				$data_detail["room_qty"]		= $dbConn->f("room_qty");
         				$data_detail["clerk_qty"]		= $dbConn->f("clerk_qty");
         				$data_detail["booking_hour"]		= $dbConn->f("booking_hour");
         				$data_detail["f_and_b"]		= $dbConn->f("f_and_b");
         				$data_detail["portion_person"]		= $dbConn->f("portion_person");
         				$data_detail["entertainment_desc"]		= $dbConn->f("entertainment_desc");
         				$data_detail["service_charge_wd"]		= $dbConn->f("service_charge_wd");
         				$data_detail["service_charge_we"]		= $dbConn->f("service_charge_we");
         				
         				$this->RowMultiBorderWithHeight(array(
         					"",
         					ucwords(strtolower($data_detail["entertainment_desc"])),
         					number_format($data_detail["service_charge_wd"],2,",",".")." (weekday), ".number_format($data_detail["service_charge_we"],2,",",".")." (weekend)",
         					$data_detail["seat_qty"],
         					$data_detail["room_qty"],
         					$data_detail["clerk_qty"],
         					$data_detail["booking_hour"],
         					$data_detail["f_and_b"],
         					$data_detail["portion_person"]
         					)
         					,
         					array(
         					"",
         					"LR",
         					"LR",
         					"LR",
         					"LR",
         					"LR",
         					"LR",
         					"LR",
         					"LR"
         					)
         					,
         					$this->height);
         			}*/
         $this->RowMultiBorderWithHeight(array("", "", "", "", "", "", "", "", ""), array("", "LR", "LR", "LR", "LR", "LR", "LR", "LR", "LR"), 25);
         $this->RowMultiBorderWithHeight(array("", "", "", "", "", "", "", "", ""), array("", "T", "T", "T", "T", "T", "T", "T", "T"), $this->height);
         $dbConn->close();
         $this->SetWidths(array(10, 40, $this->lengthCell - 60));
         $this->SetAligns(array("L", "L", "L"));
         $this->RowMultiBorderWithHeight(array("", "Tanggal Operasional", ""), array("", "BLTR", "BLTR"), $this->height);
     }
     if ($data_pajak["p_vat_type_id"] == 4) {
         $sePerEmpat = ($this->lengthCell - 20) / 4;
         $this->SetWidths(array(10, $sePerEmpat, $sePerEmpat, $sePerEmpat, $sePerEmpat));
         $this->SetAligns(array("C", "C", "C", "C", "C"));
         //$this->SetvAligns(array("M", "M", "M", "M", "M","M"));
         $this->RowMultiBorderWithHeight(array("", "Klasifikasi Tempat Parkir", "Luas Lahan Parkir", "Daya Tampung Kendaraan Bermotor", "Frekuensi Kendaraan Bermotor"), array("", "BLTR", "BLTR", "BLTR", "BLTR"), $this->height);
         /*$data_detail = array();
         			$dbConn = new clsDBConnSIKP();
         			$query = 	"select * from t_vat_reg_dtl_parking
         					where t_vat_registration_id = ".$data["t_vat_registration_id"];
         
         			$dbConn->query($query);
         			while ($dbConn->next_record()) {
         				$data_detail["classification_desc"]		= $dbConn->f("classification_desc");
         				$data_detail["parking_size"]		= $dbConn->f("parking_size");
         				$data_detail["max_load_qty"]		= $dbConn->f("max_load_qty");
         				$data_detail["avg_subscription_qty"]		= $dbConn->f("avg_subscription_qty");
         				
         				$this->SetAligns(array("C", "C", "C", "C", "R"));
         				$this->RowMultiBorderWithHeight(array(
         					"",
         					ucwords(strtolower($data_detail["classification_desc"])),
         					$data_detail["parking_size"],
         					$data_detail["max_load_qty"],
         					$data_detail["avg_subscription_qty"]
         					)
         					,
         					array(
         					"",
         					"LR",
         					"LR",
         					"LR",
         					"LR"
         					)
         					,
         					$this->height);
         			}*/
         $this->RowMultiBorderWithHeight(array("", "", "", "", ""), array("", "LR", "LR", "LR", "LR"), 25);
         $this->RowMultiBorderWithHeight(array("", "", "", "", ""), array("", "T", "T", "T", "T"), $this->height);
         $dbConn->close();
         $this->SetWidths(array(10, 40, $this->lengthCell - 60));
         $this->SetAligns(array("L", "L", "L"));
         $this->RowMultiBorderWithHeight(array("", "Tanggal Operasional", ""), array("", "BLTR", "BLTR"), $this->height);
     }
     $this->Ln();
     $this->isi_full("Demikian Berita Acara Penelitian Lapangan ini dibuat dengan sebenar-benarnya.");
     $lbody = $this->lengthCell / 16;
     $lbody2 = $lbody * 2;
     $lbody4 = $lbody * 4;
     $this->Cell($this->lengthCell, $this->height, "", "", 0, 'L');
     //$this->Ln();
     $this->Cell($lbody2, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "Bandung, " . date("d F Y"), "", 0, 'C');
     $this->Cell($lbody2, $this->height, "", "", 0, 'C');
     $this->Ln();
     $this->Cell($lbody2, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "Menyetujui,", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody2, $this->height, "", "", 0, 'C');
     $this->Ln();
     $this->Cell($lbody2, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "Pemohon NPWPD", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "Petugas Pendata 1,", "", 0, 'C');
     $this->Cell($lbody2, $this->height, "", "", 0, 'C');
     $this->Ln();
     $this->newLine();
     $this->newLine();
     $this->newLine();
     $this->Cell($lbody2, $this->height, "Nama Jelas:", "", 0, 'L');
     $this->ln(4);
     $this->Cell($lbody2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody4 - 2, $this->height, $data["wp_name"], "", 0, 'C');
     $this->Cell(2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4 - 2, $this->height, $data["bap_employee_name_1"], "", 0, 'C');
     $this->Cell(2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody2, $this->height, "", "", 0, 'C');
     $this->Ln();
     $this->Cell($lbody2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody4 - 2, $this->height, "", "T", 0, 'L');
     $this->Cell(2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4 - 2, $this->height, "NIP. " . $data["bap_employee_no_1"], "T", 0, 'L');
     $this->Cell(2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody2, $this->height, "", "", 0, 'C');
     $this->Ln();
     $this->Cell($lbody2, $this->height, "Jabatan:", "", 0, 'L');
     $this->ln(4);
     $this->Cell($lbody2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody4 - 2, $this->height, $data["job_name"], "", 0, 'C');
     $this->Cell(2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4 - 2, $this->height, "", "", 0, 'L');
     $this->Cell(2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody2, $this->height, "", "", 0, 'C');
     $this->Ln();
     $this->Cell($lbody2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody4 - 2, $this->height, "(Tanda Tangan dan Cap Perusahaan)", "T", 0, 'C');
     $this->Cell(2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4 - 2, $this->height, "", "", 0, 'L');
     $this->Cell(2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody2, $this->height, "", "", 0, 'C');
     $this->Ln();
     $this->Cell($lbody2, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "Petugas Pendata 2,", "", 0, 'C');
     $this->Cell($lbody2, $this->height, "", "", 0, 'C');
     $this->Ln();
     $this->newLine();
     $this->newLine();
     $this->newLine();
     $this->Cell($lbody2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody4 - 2, $this->height, "", "", 0, 'C');
     $this->Cell(2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4 - 2, $this->height, $data["bap_employee_name_2"], "", 0, 'C');
     $this->Cell(2, $this->height, "", "", 0, 'L');
     $this->Cell($lbody2, $this->height, "", "", 0, 'C');
     $this->Ln();
     $this->Cell($lbody2, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4, $this->height, "", "", 0, 'L');
     $this->Cell($lbody4, $this->height, "", "", 0, 'C');
     $this->Cell($lbody4 - 2, $this->height, "NIP. " . $data["bap_employee_no_2"], "T", 0, 'L');
     $this->Cell(2, $this->height, "", "", 0, 'L');
     /*$this->Cell($lbody2, $this->height, "", "", 0, 'C');
     		$this->Ln();
     		
     		$this->Cell($this->lengthCell, $this->height, "", "", 0, 'L');*/
 }
function GetCetakExcel($param_arr)
{
    startExcel("pendaftaran_wp.xls");
    $output = '';
    $output .= '<table id="table-piutang" class="grid-table-container" border="0" cellspacing="0" cellpadding="0">
          		<tr>
            		<td valign="top">';
    $output .= '<table>';
    //$output .= '<tr><td class="th" align="center" colspan=7><h1><strong>KARTU LAPORAN</strong></td> </tr>';
    //$output .= '<tr><td class="th" align="center" colspan=7><h1><strong>REKAPITULASI TARGET/SASARAN MUTU</strong></td> </tr>';
    $output .= '<tr><td class="th" align="center" colspan=4><h1><strong>DAFTAR PENGUKUHAN NPWPD JABATAN</strong></td></tr>';
    //$output .= '<tr><td class="th" align="center" colspan=4><h1><strong>PENDAFTARAN WAJIB PAJAK DAERAH</strong></td></tr>';
    $output .= '</table></br>';
    $output .= '<table>';
    $output .= '<tr></tr>';
    $output .= '<tr></tr>';
    //$output .= '<tr><td colspan=2>JENIS PAJAK </td><td>: '.$param_arr['vat_code'].'</td></tr>';
    $output .= '<tr><td colspan=2>TANGGAL </td><td>: ' . $param_arr['date_start_laporan'] . ' s.d. ' . $param_arr['date_end_laporan'] . ' </td></tr>';
    //$output .= '<tr><td colspan=2>JENIS TARGET </td><td>: PENERBITAN NPWPD 7 HARI KERJA</td></tr>';
    $output .= '<tr></tr>';
    $output .= '</table></br>';
    $tanggal = CCGetFromGet('date_end_laporan', '31-12-2014');
    $output .= '<table id="table-piutang-detil" class="Grid" border="1" cellspacing="0" cellpadding="3px" width="100%">
                <tr >';
    $output .= '<th align="center" >NO</th>';
    $output .= '<th align="center" >NAMA OBJEK PAJAK</th>';
    $output .= '<th align="center" >ALAMAT OBJEK PAJAK</th>';
    $output .= '<th align="center" >NPWPD</th>';
    $output .= '</tr>';
    $dbConn = new clsDBConnSIKP();
    $query = "SELECT * \r\n\t\t\tFROM t_vat_registration a \r\n\t\t\tleft join p_vat_type_dtl b on a.p_vat_type_dtl_id=b.p_vat_type_dtl_id  \r\n\t\t\tleft join t_customer_order c on a.t_customer_order_id = c. t_customer_order_id\r\n\t\t\twhere a.npwpd_jabatan = 'Y' and \r\n\t\t\t\ttrunc(a.creation_date) BETWEEN to_date('" . $param_arr['date_start_laporan'] . "','dd-mm-yyyy') \r\n\t\t\t\tand to_date('" . $param_arr['date_end_laporan'] . "','dd-mm-yyyy')\r\n\t\t\tand case when " . $param_arr['p_vat_type_id'] . "=0 then true\r\n\t\t\t\t\telse a.p_vat_type_dtl_id in (select p_vat_type_dtl_id from p_vat_type_dtl where p_vat_type_id =" . $param_arr['p_vat_type_id'] . ")\r\n\t\t\t\tend \r\n\t\t\tand case when " . $param_arr['nilai'] . "=0 then true\r\n\t\t\t\t\telse c.p_order_status_id = " . $param_arr['nilai'] . "\r\n\t\t\t\tend \r\n\t\t\torder by company_brand";
    //echo $query;exit;
    $data = array();
    $dbConn->query($query);
    while ($dbConn->next_record()) {
        $data[] = $dbConn->Record;
    }
    $dbConn->close();
    for ($i = 0; $i < count($data); $i++) {
        $output .= '<tr><td align="center" >' . ($i + 1) . '</td>';
        $output .= '<td align="left" >' . $data[$i]['company_brand'] . '</td>';
        $output .= '<td align="left" >' . $data[$i]['brand_address_name'] . ' ' . $data[$i]['brand_address_no'] . '</td>';
        $output .= '<td align="left" >' . $data[$i]['npwpd'] . '</td></tr>';
    }
    $output .= '</table>';
    $output .= '<table width=100% border=0>';
    $output .= '<tr></tr>';
    $output .= '<tr></tr>';
    $output .= '<tr >
					<td width=50% align="center" colspan=3>
						 
					</td>
					<td width=50% align="center">
						KEPALA BIDANG 
					</td>
				</tr>';
    $output .= '<tr >
					<td width=50% align="center" colspan=3>
						
					</td>
					<td width=50% align="center">
						PAJAK PENDAFTARAN,
					</td>
				</tr>';
    $output .= '<tr >
					<td width=50% align="center" colspan=3>
						 
					</td>
					<td width=50% align="center">
						 
					</td>
				</tr>';
    $output .= '<tr >
					<td width=50% align="center" colspan=3>
						
					</td>
					<td width=50% align="center">
						
					</td>
				</tr>';
    $output .= '<tr >
					<td width=50% align="center" colspan=3>
						
					</td>
					<td width=50% align="center">
						Drs. H. GUN GUN SUMARYANA
					</td>
				</tr>';
    $output .= '<tr >
					<td width=50% align="center" colspan=3>
						
					</td>
					<td width=50% align="center">
						Pembina
					</td>
				</tr>';
    $output .= '<tr >
					<td width=50% align="center" colspan=3>
						
					</td>
					<td width=50% align="center">
						NIP. 19700806 199101 1 001
					</td>
				</tr>';
    $output .= '</table>';
    echo $output;
    exit;
}
function Page_BeforeShow(&$sender)
{
    $Page_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_bphtb_registration_list_update;
    //Compatibility
    //End Page_BeforeShow
    //Custom Code @703-2A29BDB7
    // -------------------------
    // Write your own code here.
    if (CCGetFromGet("submit_bphtb") == 1) {
        $dbConn = new clsDBConnSIKP();
        $sql = "select count(*) as jml from t_product_order_control where doc_id = " . CCGetFromGet('t_customer_order_id') . "and and p_w_doc_type_id = 505";
        $dbConn->query($sql);
        $jumlah_data;
        if ($dbConn->next_record()) {
            $jumlah_data = $dbConn->f('jml');
        }
        if ($jumlah_data == 0) {
            $sql = "select sikp.f_first_submit_engine(505," . CCGetFromGet('t_customer_order_id') . ",'" . CCGetSession('UserLogin') . "')";
            $dbConn->query($sql);
        } else {
            echo "\r\n\t\t\t\t<script>\r\n\t\t\t\t\talert('Data BPHTB Sudah Tersubmit');\r\n\t\t\t\t</script>\r\n\t\t\t";
            //exit;
        }
        $dbConn->close();
        header('Location:t_bphtb_registration_list.php');
        exit;
    }
    // -------------------------
    //End Custom Code
    //Close Page_BeforeShow @1-4BC230CD
    return $Page_BeforeShow;
}
function Page_OnInitializeView(&$sender)
{
    $Page_OnInitializeView = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_bphtb_restitution_list;
    //Compatibility
    //End Page_OnInitializeView
    //Custom Code @66-2A29BDB7
    // -------------------------
    // Write your own code here.
    $submitted = CCGetFromGet('submit');
    $url = CCGetQueryString('QueryString', '');
    if ($submitted) {
        $dbConn = new clsDBConnSIKP();
        $sql = "select count(*) as jml from t_product_order_control where doc_id = " . CCGetFromGet('t_customer_order_id') . "and p_w_doc_type_id = 510";
        $dbConn->query($sql);
        $jumlah_data;
        if ($dbConn->next_record()) {
            $jumlah_data = $dbConn->f('jml');
        }
        if ($jumlah_data == 0) {
            $sql = "select sikp.f_first_submit_engine(510," . CCGetFromGet('t_customer_order_id') . ",'" . CCGetSession('UserLogin') . "')";
            $dbConn->query($sql);
            if ($dbConn->next_record()) {
                $hasil = $dbConn->f('f_first_submit_engine');
                echo "\r\n\t\t\t\t\t<script>\r\n\t\t\t\t\t\talert('" . $hasil . "');\r\n\t\t\t\t\t</script>\r\n\t\t\t\t";
            }
        } else {
            echo "\r\n\t\t\t\t<script>\r\n\t\t\t\t\talert('Data Restitusi Sudah Tersubmit');\r\n\t\t\t\t</script>\r\n\t\t\t";
        }
        $dbConn->close();
        $url = CCRemoveParam($url, 'submit');
        $url = CCRemoveParam($url, 't_bphtb_restitusi_id');
        $url = CCRemoveParam($url, 't_customer_order_id');
        echo "\r\n\t\t\t\t<script>\r\n\t\t\t\t\tlocation.href='t_bphtb_restitution_list.php?" . $url . "';\r\n\t\t\t\t</script>\r\n\t\t\t";
        exit;
    }
    global $selected_id;
    $selected_id = -1;
    $selected_id = CCGetFromGet("t_bphtb_registration_id", $selected_id);
    // -------------------------
    //End Custom Code
    //Close Page_OnInitializeView @1-81DF8332
    return $Page_OnInitializeView;
}
function t_customer_orderGrid_BeforeShowRow(&$sender)
{
    $t_customer_orderGrid_BeforeShowRow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_customer_orderGrid;
    //Compatibility
    //End t_customer_orderGrid_BeforeShowRow
    // Start Bdr
    global $t_customer_orderForm;
    global $selected_id;
    global $add_flag;
    global $is_show_form;
    if ($selected_id < 0 && $add_flag != "ADD") {
        $selected_id = $Component->DataSource->t_customer_order_id->GetValue();
        $t_customer_orderForm->DataSource->Parameters["urlt_customer_order_id"] = $selected_id;
        $t_customer_orderForm->DataSource->Prepare();
        $t_customer_orderForm->EditMode = $t_customer_orderForm->DataSource->AllParametersSet;
    }
    // End Bdr
    //Set Row Style @10-982C9472
    $styles = array("Row", "AltRow");
    // Start Bdr
    $img_radio = "<img border='0' src='../images/radio.gif'>";
    $Style = $styles[0];
    if ($Component->DataSource->t_customer_order_id->GetValue() == $selected_id) {
        $img_radio = "<img border='0' src='../images/radio_s.gif'>";
        $Style = $styles[1];
        $is_show_form = 1;
    }
    // End Bdr
    if (count($styles)) {
        //        $Style = $styles[($Component->RowNumber - 1) % count($styles)];
        if (strlen($Style) && !strpos($Style, "=")) {
            $Style = (strpos($Style, ":") ? 'style="' : 'class="') . $Style . '"';
        }
        $Component->Attributes->SetValue("rowStyle", $Style);
    }
    //End Set Row Style
    $Component->DLink->SetValue($img_radio);
    // Bdr
    //Custom Code @622-2A29BDB7
    // -------------------------
    // Write your own code here.
    $CusId = $t_customer_orderGrid->t_customer_order_id->GetValue();
    $VatId = $t_customer_orderGrid->t_vat_registration_id->GetValue();
    $ReqId = $t_customer_orderGrid->p_rqst_type_id->GetValue();
    $dbConn = new clsDBConnSIKP();
    $sql = "select f_check_wp(" . $CusId . "," . $ReqId . "," . $VatId . ")as btn_cetak, " . "f_check_wp_doc(" . $CusId . ")as btn_submit from dual;";
    $dbConn->query($sql);
    $dbConn->next_record();
    $btn_cetak = $dbConn->f("btn_cetak");
    $btn_submit = $dbConn->f("btn_submit");
    $dbConn->close();
    if ($btn_cetak > 0) {
        $t_customer_orderGrid->cetak->Visible = true;
    } else {
        $t_customer_orderGrid->cetak->Visible = false;
    }
    // -------------------------
    //End Custom Code
    //Close t_customer_orderGrid_BeforeShowRow @2-B7EA7255
    return $t_customer_orderGrid_BeforeShowRow;
}
function print_excel($param_arr)
{
    $date_start = str_replace("'", "", $param_arr['tgl_penerimaan']);
    $date_end = str_replace("'", "", $param_arr['tgl_penerimaan_last']);
    $date_arr = explode("-", $date_start);
    $year_date = $date_arr[2];
    startExcel("laporan_realisasi_harian_dan_piutang");
    echo "<div><h3> LAPORAN REALISASI HARIAN PER JENIS PAJAK</h3></div>";
    echo "<b>TAHUN " . $year_date . "<b/> <br/>";
    echo "<b>Tanggal Penerimaan : " . $date_start . " s.d " . $date_end . " </b><br/>";
    echo '<table width="100%" border="1">';
    echo '<tr>
		<th>NO</th>
		<th>NO.AYAT</th>
		<th>NAMA AYAT</th>
		<th>NO.KOHIR</th>
		<th>NAMA WP</th>
		<th>NPWPD</th>
		<th>JUMLAH</th>
		<th>MASA PAJAK</th>
		<th>TGL TAP</th>
		<th>TGL BAYAR</th>
	</tr>';
    $dbConn = new clsDBConnSIKP();
    $query = '';
    $jenis_laporan = $param_arr['jenis_laporan'];
    $tgl_penerimaan = $param_arr['tgl_penerimaan'];
    $p_year_period_id = $param_arr['p_year_period_id'];
    $p_vat_type_id = $param_arr['p_vat_type_id'];
    $i_flag_setoran = $param_arr['i_flag_setoran'];
    $tgl_penerimaan_last = $param_arr['tgl_penerimaan_last'];
    $date_start = str_replace("'", "", $tgl_penerimaan);
    $year_date = DateTime::createFromFormat('d-m-Y', $date_start)->format('Y');
    $border = $year_date - 1;
    if ($jenis_laporan == 'all') {
        $query = "select *,trunc(payment_date) from f_rep_bpps_piutang2new({$p_vat_type_id}, {$p_year_period_id}, {$tgl_penerimaan}, {$tgl_penerimaan_last}, {$i_flag_setoran}) order by kode_jns_trans, kode_jns_pajak, kode_ayat";
    } else {
        if ($jenis_laporan == 'piutang') {
            $query = "select *,trunc(payment_date) \r\n\t\tfrom f_rep_bpps_piutang({$p_vat_type_id}, {$p_year_period_id}, {$tgl_penerimaan}, {$tgl_penerimaan_last}, {$i_flag_setoran}) rep\r\n\t\tWHERE\r\n\t\t(\tSUBSTRING(rep.masa_pajak,22,4) < {$year_date}\r\n\t\t\tAND \r\n\t\t\t(NOT (SUBSTRING(rep.masa_pajak,22,4) = {$border}\r\n\t\t\tAND SUBSTRING(rep.masa_pajak,19,2) = 12))\r\n\t\t)\r\n\t\tOR\r\n\t\t(\r\n\t\t\t(SUBSTRING(rep.masa_pajak,22,4) = {$year_date}\r\n\t\t\tAND SUBSTRING(rep.masa_pajak,19,2) = 12)\r\n\t\t)\r\n\t\tOR\r\n\t\t(\r\n\t\t\tSUBSTRING(rep.masa_pajak,22,4) > {$year_date}\r\n\t\t)\r\n\t\torder by kode_ayat, npwpd, masa_pajak";
        } else {
            if ($jenis_laporan == 'murni') {
                $query = "select *,trunc(payment_date) \r\n\t\tfrom f_rep_bpps_piutang3new({$p_vat_type_id}, {$p_year_period_id}, {$tgl_penerimaan}, {$tgl_penerimaan_last}, {$i_flag_setoran}) rep\r\n\t\tWHERE\r\n\t\tEXTRACT (YEAR FROM rep.settlement_date) = {$year_date}\r\n\t\torder by kode_ayat, npwpd, masa_pajak";
            }
        }
    }
    $dbConn->query($query);
    $tgl_penerimaan = str_replace("'", "", $tgl_penerimaan);
    $tgl_penerimaan_last = str_replace("'", "", $tgl_penerimaan_last);
    $tahun = date("Y", strtotime($tgl_penerimaan));
    while ($dbConn->next_record()) {
        $data[] = array("kode_jns_trans" => $dbConn->f("kode_jns_trans"), "jns_trans" => $dbConn->f("jns_trans"), "kode_jns_pajak" => $dbConn->f("kode_jns_pajak"), "kode_ayat" => $dbConn->f("kode_ayat"), "jns_pajak" => $dbConn->f("jns_pajak"), "jns_ayat" => $dbConn->f("jns_ayat"), "nama_ayat" => $dbConn->f("nama_ayat"), "no_kohir" => $dbConn->f("no_kohir"), "wp_name" => $dbConn->f("wp_name"), "wp_address_name" => $dbConn->f("wp_address_name"), "wp_address_no" => $dbConn->f("wp_address_no"), "npwpd" => $dbConn->f("npwpd"), "jumlah_terima" => $dbConn->f("jumlah_terima"), "masa_pajak" => $dbConn->f("masa_pajak"), "kd_tap" => $dbConn->f("kd_tap"), "keterangan" => $dbConn->f("keterangan"), "payment_date" => $dbConn->f("payment_date"), "jam" => $dbConn->f("jam"));
    }
    $dbConn->close();
    $no = 1;
    $jumlahtemp = 0;
    $jumlahperayat = array();
    $jumlahperwaktu = array();
    $i = 0;
    $total = 0;
    foreach ($data as $item) {
        echo '<tr>';
        echo '<td align="center">' . $no . '</td>';
        echo '<td align="left">' . $item["kode_jns_pajak"] . ' ' . $item["kode_ayat"] . '</td>';
        echo '<td align="left">' . $item["nama_ayat"] . '</td>';
        echo '<td align="left">' . $item["no_kohir"] . '</td>';
        echo '<td align="left">' . $item["wp_name"] . '</td>';
        echo '<td align="left">' . $item["npwpd"] . '</td>';
        echo '<td align="right">' . number_format($item["jumlah_terima"], 0, ",", ".") . '</td>';
        echo '<td align="left">' . $item["masa_pajak"] . '</td>';
        echo '<td align="left">' . $item["kd_tap"] . '</td>';
        echo '<td align="left">' . $item["payment_date"] . '</td>';
        echo '</tr>';
        $no++;
        //hitung jumlahperayat sampai baris ini
        $jumlahtemp += $item["jumlah_terima"];
        $total += $item["jumlah_terima"];
        //cek apakah perlu bikin baris jumlah
        //jika iya, simpan jumlahtemp ke jumlahperayat, print jumlahtemp, reset jumlahtemp
        $ayat = $item["kode_ayat"];
        $ayatsesudah = $data[$i + 1]["kode_ayat"];
        if ($ayat != $ayatsesudah && count($data) > 1 || empty($data[$i + 1])) {
            $jumlahperayat[] = $jumlahtemp;
            echo '<tr>
				<td align="center" colspan="9"> <b> JUMLAH ' . strtoupper($item["jns_pajak"]) . " " . $item["nama_ayat"] . ' </b></td>
				<td align="right"><b>' . number_format($jumlahtemp, 0, ",", ".") . '</b></td>
			</tr>';
            $jumlahtemp = 0;
        }
        $i++;
    }
    echo '<tr>
		<td align="center" colspan="9"> <b>TOTAL ' . strtoupper($item["jns_pajak"]) . '</b></td>
		<td align="right"><b>' . number_format($total, 0, ",", ".") . '</b></td>
	</tr>';
    echo '</table>';
    exit;
}
function getDataRowReklame($year_period_id, $date_awal, $date_akhir)
{
    $dbConn = new clsDBConnSIKP();
    $query = "SELECT SUM(target_amount) AS target, SUM(realisasi_amt) AS realisasi,\r\n\t\t\t\tSUM(debt_amt) AS piutang\r\n\t\t\t\tFROM f_target_vs_real_monthly_new(" . $year_period_id . ",9)\r\n\t\t\t\tWHERE trunc(start_date) >= '" . $date_awal . "'\r\n\t\t\t\tAND trunc(end_date) <= '" . $date_akhir . "'";
    $dbConn->query($query);
    $result = array();
    while ($dbConn->next_record()) {
        $result['target'] = $dbConn->f("target");
        $result['piutang'] = $dbConn->f("piutang");
        $result['realisasi'] = $dbConn->f("realisasi");
        $result['selisih'] = $dbConn->f("realisasi") + $dbConn->f("piutang") - $dbConn->f("target");
        $result['realisasiDanPiutang'] = $dbConn->f("realisasi") + $dbConn->f("piutang");
    }
    $dbConn->close();
    return $result;
}
function t_vat_setllementSearch_button_submit_OnClick(&$sender)
{
    $t_vat_setllementSearch_button_submit_OnClick = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_vat_setllementSearch;
    //Compatibility
    //End t_vat_setllementSearch_button_submit_OnClick
    // -------------------------
    // Write your own code here.
    $dbConn = new clsDBConnSIKP();
    $cusAccId = $t_vat_setllementSearch->t_cust_account_id->GetValue();
    $Period = $t_vat_setllementSearch->p_finance_period_id->GetValue();
    //$ReqId = $t_vat_setllementSearch->p_rqst_type_id->GetValue();
    $npwd = $t_vat_setllementSearch->npwd->GetValue();
    $User = CCGetUserLogin();
    $sql = "select * from f_vat_settlement(" . $cusAccId . "," . "null," . $Period . ",'" . $npwd . "','" . $User . "')";
    $dbConn->query($sql);
    $dbConn->next_record();
    $vatId = $dbConn->f("o_vat_setllement_id");
    $mess = $dbConn->f("o_mess");
    $dbConn->close();
    echo '<script language="javascript">';
    echo 'alert("' . $mess . '");';
    echo '</script>';
    $PeriodCode = $t_vat_setllementSearch->finance_period_code->GetValue();
    $typeCode = $t_vat_setllementSearch->year_code->GetValue();
    $YearId = $t_vat_setllementSearch->p_year_period_id->GetValue();
    $param = "t_vat_setllement.php?t_cust_account_id=" . $cusAccId . "&p_finance_period_id=" . $Period . "&finance_period_code=" . $PeriodCode . "&year_code=" . $typeCode . "&p_year_period_id=" . $YearId . "&npwd=" . $npwd;
    echo "<meta http-equiv='refresh' content='0;URL=" . $param . "' >";
    return;
    // -------------------------
    //Close t_vat_setllementSearch_button_submit_OnClick @174-36FC9291
    return $t_vat_setllementSearch_button_submit_OnClick;
}
function Page_BeforeShow(&$sender)
{
    $Page_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_laporan_pembayaran_dan_perkembangan_jml_wp;
    //Compatibility
    //End Page_BeforeShow
    //Custom Code @572-2A29BDB7
    // -------------------------
    // Write your own code here.
    $doAction = CCGetFromGet('doAction');
    global $Label1;
    if ($doAction == 'view_excel') {
        startExcel("pembayaran_dan_perkembangan_jumlah_wp_baru.xls");
    }
    $dbConn = new clsDBConnSIKP();
    $query = "select * from f_perkembangan_jumlah_wp_all()";
    //echo $query;exit;
    $data = array();
    $dbConn->query($query);
    while ($dbConn->next_record()) {
        $data[] = $dbConn->Record;
    }
    $dbConn->close();
    $output = '';
    $output .= '<table border=0 class="Grid">';
    $output .= '<tr border=0><th colspan = 14 align="center">PERKEMBANGAN JUMLAH WAJIB PAJAK</th></tr>';
    $output .= '<tr border=0><th colspan = 14 align="center">HOTEL, RESTORAN, HIBURAN DAN PARKIR</th></tr>';
    $output .= '<tr border=0><th colspan = 14 align="center"></th></tr>';
    $output .= '</table>';
    $output .= '<table id="table-piutang-detil" class="Grid" border="1" cellspacing="0" cellpadding="3px" width="100%">
                <tr >';
    $output .= '<th align="center" rowspan=2>NO</th>';
    $output .= '<th align="center" rowspan=2>JENIS PAJAK</th>';
    $output .= '<th align="center" colspan=3>PER 31-12-' . (date("Y") - 1) . '</th>';
    $output .= '<th align="center" colspan=3>DAFTAR 01-01-' . date("Y") . ' s.d. ' . date("d-m-Y") . '</th>';
    $output .= '<th align="center" colspan=3>NON AKTIF 01-01-' . date("Y") . ' s.d. ' . date("d-m-Y") . '</th>';
    $output .= '<th align="center" colspan=3>PER ' . date("d-m-Y") . '</th></tr>';
    $output .= '<tr><th align="center">NPWPD</th>';
    $output .= '<th align="center">NPWPD JABATAN</th>';
    $output .= '<th align="center">JUMLAH</th>';
    $output .= '<th align="center">NPWPD</th>';
    $output .= '<th align="center">NPWPD JABATAN</th>';
    $output .= '<th align="center">JUMLAH</th>';
    $output .= '<th align="center">NPWPD</th>';
    $output .= '<th align="center">NPWPD JABATAN</th>';
    $output .= '<th align="center">JUMLAH</th>';
    $output .= '<th align="center">NPWPD</th>';
    $output .= '<th align="center">NPWPD JABATAN</th>';
    $output .= '<th align="center">JUMLAH</th></tr>';
    $total_o_jml_wp_daftar_akhir_tahun_kemarin = 0;
    $total_o_jml_wp_jabatan_akhir_tahun_kemarin = 0;
    $total_o_jml_wp_total_akhir_tahun_kemarin = 0;
    $total_o_jml_wp_daftar_awal_tahun_hingga_sekarang = 0;
    $total_o_jml_wp_jabatan_awal_tahun_hingga_sekarang = 0;
    $total_o_jml_wp_total_awal_tahun_hingga_sekarang = 0;
    $total_o_jml_wp_daftar_non_aktif_awal_tahun_hingga_sekarang = 0;
    $total_o_jml_wp_jabatan_non_aktif_awal_tahun_hingga_sekarang = 0;
    $total_o_jml_wp_total_non_aktif_awal_tahun_hingga_sekarang = 0;
    $total_o_jml_wp_daftar_hingga_sekarang = 0;
    $total_o_jml_wp_jabatan_hingga_sekarang = 0;
    $total_o_jml_wp_total_hingga_sekarang = 0;
    for ($i = 0; $i < count($data); $i++) {
        $output .= '<tr>';
        if ($data[$i]['kategori'] == 'jenis') {
            $output .= '<td align="center" >' . $data[$i]['p_vat_type_id'] . '</th>';
        } else {
            $output .= '<td align="center" ></th>';
        }
        $output .= '<td align="left" >' . $data[$i]['vat_code'] . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_daftar_akhir_tahun_kemarin'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_jabatan_akhir_tahun_kemarin'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_total_akhir_tahun_kemarin'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_daftar_awal_tahun_hingga_sekarang'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_jabatan_awal_tahun_hingga_sekarang'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_total_awal_tahun_hingga_sekarang'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_daftar_non_aktif_awal_tahun_hingga_sekarang'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_jabatan_non_aktif_awal_tahun_hingga_sekarang'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_total_non_aktif_awal_tahun_hingga_sekarang'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_daftar_hingga_sekarang'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_jabatan_hingga_sekarang'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_total_hingga_sekarang'], 0, ',', '.') . '</th></tr>';
        if ($data[$i]['kategori'] == 'jenis') {
            $total_o_jml_wp_daftar_akhir_tahun_kemarin += $data[$i]['o_jml_wp_daftar_akhir_tahun_kemarin'];
            $total_o_jml_wp_jabatan_akhir_tahun_kemarin += $data[$i]['o_jml_wp_jabatan_akhir_tahun_kemarin'];
            $total_o_jml_wp_total_akhir_tahun_kemarin += $data[$i]['o_jml_wp_total_akhir_tahun_kemarin'];
            $total_o_jml_wp_daftar_awal_tahun_hingga_sekarang += $data[$i]['o_jml_wp_daftar_awal_tahun_hingga_sekarang'];
            $total_o_jml_wp_jabatan_awal_tahun_hingga_sekarang += $data[$i]['o_jml_wp_jabatan_awal_tahun_hingga_sekarang'];
            $total_o_jml_wp_total_awal_tahun_hingga_sekarang += $data[$i]['o_jml_wp_total_awal_tahun_hingga_sekarang'];
            $total_o_jml_wp_daftar_non_aktif_awal_tahun_hingga_sekarang += $data[$i]['o_jml_wp_daftar_non_aktif_awal_tahun_hingga_sekarang'];
            $total_o_jml_wp_jabatan_non_aktif_awal_tahun_hingga_sekarang += $data[$i]['o_jml_wp_jabatan_non_aktif_awal_tahun_hingga_sekarang'];
            $total_o_jml_wp_total_non_aktif_awal_tahun_hingga_sekarang += $data[$i]['o_jml_wp_total_non_aktif_awal_tahun_hingga_sekarang'];
            $total_o_jml_wp_daftar_hingga_sekarang += $data[$i]['o_jml_wp_daftar_hingga_sekarang'];
            $total_o_jml_wp_jabatan_hingga_sekarang += $data[$i]['o_jml_wp_jabatan_hingga_sekarang'];
            $total_o_jml_wp_total_hingga_sekarang += $data[$i]['o_jml_wp_total_hingga_sekarang'];
        }
    }
    $output .= '<td align="center" colspan=2>JUMLAH</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_daftar_akhir_tahun_kemarin, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_jabatan_akhir_tahun_kemarin, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_total_akhir_tahun_kemarin, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_daftar_awal_tahun_hingga_sekarang, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_jabatan_awal_tahun_hingga_sekarang, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_total_awal_tahun_hingga_sekarang, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_daftar_non_aktif_awal_tahun_hingga_sekarang, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_jabatan_non_aktif_awal_tahun_hingga_sekarang, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_total_non_aktif_awal_tahun_hingga_sekarang, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_daftar_hingga_sekarang, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_jabatan_hingga_sekarang, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_total_hingga_sekarang, 0, ',', '.') . '</th></tr></table>';
    $output .= '</br></br>';
    $dbConn = new clsDBConnSIKP();
    $query = "SELECT * FROM f_pembayaran_wp_baru_all()";
    //echo $query;exit;
    $data = array();
    $dbConn->query($query);
    while ($dbConn->next_record()) {
        $data[] = $dbConn->Record;
    }
    $dbConn->close();
    $output .= '<table border=0 class="Grid">';
    $output .= '<tr border=0><th colspan = 8 align="center"></th></tr>';
    $output .= '<tr border=0><th colspan = 8 align="center"></th></tr>';
    $output .= '<tr border=0><th colspan = 8 align="center">RINCIAN PEMBAYARAN WAJIB PAJAK BARU PENGUKUHAN TAHUN ' . date("Y") . '</th></tr>';
    $output .= '<tr border=0><th colspan = 8 align="center"></th></tr>';
    $output .= '</table>';
    $output .= '<table id="table-piutang-detil" class="Grid" border="1" cellspacing="0" cellpadding="3px" width="100%">
                <tr >';
    $output .= '<th align="center" rowspan=2>NO</th>';
    $output .= '<th align="center" rowspan=2>JENIS PAJAK</th>';
    $output .= '<th align="center" colspan=2>MENDAFTAR SENDIRI</th>';
    $output .= '<th align="center" colspan=2>NPWPD JABATAN</th>';
    $output .= '<th align="center" colspan=2>JUMLAH</th></tr>';
    $output .= '<tr><th align="center">JUMLAH WP</th>';
    $output .= '<th align="center">PEMBAYRAN</th>';
    $output .= '<th align="center">JUMLAH WP</th>';
    $output .= '<th align="center">PEMBAYRAN</th>';
    $output .= '<th align="center">JUMLAH WP</th>';
    $output .= '<th align="center">PEMBAYARAN</th></tr>';
    $total_o_realisasi_non_npwpd_jabatan = 0;
    $total_o_jml_wp_non_npwpd_jabatan = 0;
    $total_o_realisasi_npwpd_jabatan = 0;
    $total_o_jml_wp_npwpd_jabatan = 0;
    for ($i = 0; $i < count($data); $i++) {
        $output .= '<tr>';
        if ($data[$i]['kategori'] == 'jenis') {
            $output .= '<td align="center" >' . $data[$i]['p_vat_type_id'] . '</th>';
        } else {
            $output .= '<td align="center" ></th>';
        }
        $output .= '<td align="left" >' . $data[$i]['vat_code'] . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_non_npwpd_jabatan'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_realisasi_non_npwpd_jabatan'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_npwpd_jabatan'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_realisasi_npwpd_jabatan'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_npwpd_jabatan'] + $data[$i]['o_jml_wp_non_npwpd_jabatan'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_realisasi_npwpd_jabatan'] + $data[$i]['o_realisasi_non_npwpd_jabatan'], 0, ',', '.') . '</th></tr>';
        if ($data[$i]['kategori'] == 'jenis') {
            $total_o_realisasi_non_npwpd_jabatan += $data[$i]['o_realisasi_non_npwpd_jabatan'];
            $total_o_jml_wp_non_npwpd_jabatan += $data[$i]['o_jml_wp_non_npwpd_jabatan'];
            $total_o_realisasi_npwpd_jabatan += $data[$i]['o_realisasi_npwpd_jabatan'];
            $total_o_jml_wp_npwpd_jabatan += $data[$i]['o_jml_wp_npwpd_jabatan'];
        }
    }
    $output .= '<td align="center" colspan=2>JUMLAH</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_non_npwpd_jabatan, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_realisasi_non_npwpd_jabatan, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_npwpd_jabatan, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_realisasi_npwpd_jabatan, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_npwpd_jabatan + $total_o_jml_wp_non_npwpd_jabatan, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_realisasi_npwpd_jabatan + $total_o_realisasi_non_npwpd_jabatan, 0, ',', '.') . '</th></tr></table>';
    $output .= '</br></br>';
    $dbConn = new clsDBConnSIKP();
    $query = "SELECT * FROM f_jumlah_wp_belum_bayar_all()";
    //echo $query;exit;
    $data = array();
    $dbConn->query($query);
    while ($dbConn->next_record()) {
        $data[] = $dbConn->Record;
    }
    $dbConn->close();
    $output .= '<table border=0 class="Grid">';
    $output .= '<tr border=0><th colspan = 5 align="center"></th></tr>';
    $output .= '<tr border=0><th colspan = 5 align="center"></th></tr>';
    $output .= '<tr border=0><th colspan = 5 align="center">RINCIAN JUMLAH WAJIB PAJAK BARU PENGUKUHAN TAHUN ' . date("Y") . ' YANG BELUM BAYAR</th></tr>';
    $output .= '<tr border=0><th colspan = 5 align="center"></th></tr>';
    $output .= '</table>';
    $output .= '<table id="table-piutang-detil" class="Grid" border="1" cellspacing="0" cellpadding="3px" width="100%">
                <tr >';
    $output .= '<th align="center" >NO</th>';
    $output .= '<th align="center" >JENIS PAJAK</th>';
    $output .= '<th align="center" >SELURUHNYA</th>';
    $output .= '<th align="center" >YANG SUDAH BAYAR</th>';
    $output .= '<th align="center" >PERSENTASE</th></tr>';
    $total_o_jml_wp_blum_bayar = 0;
    $total_o_jml_wp_seluruhnya = 0;
    for ($i = 0; $i < count($data); $i++) {
        $output .= '<tr>';
        if ($data[$i]['kategori'] == 'jenis') {
            $output .= '<td align="center" >' . $data[$i]['p_vat_type_id'] . '</th>';
        } else {
            $output .= '<td align="center" ></th>';
        }
        $output .= '<td align="left" >' . $data[$i]['vat_code'] . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_blum_bayar'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_seluruhnya'], 0, ',', '.') . '</th>';
        $output .= '<td align="right" >' . number_format($data[$i]['o_jml_wp_blum_bayar'] / $data[$i]['o_jml_wp_seluruhnya'] * 100, 2, ',', '.') . ' %</th></tr>';
        if ($data[$i]['kategori'] == 'jenis') {
            $total_o_jml_wp_blum_bayar += $data[$i]['o_jml_wp_blum_bayar'];
            $total_o_jml_wp_seluruhnya += $data[$i]['o_jml_wp_seluruhnya'];
        }
    }
    $output .= '<td align="center" colspan=2>JUMLAH</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_blum_bayar, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_seluruhnya, 0, ',', '.') . '</th>';
    $output .= '<td align="right" >' . number_format($total_o_jml_wp_blum_bayar / $total_o_jml_wp_seluruhnya * 100, 2, ',', '.') . ' %</th></tr></table>';
    if ($doAction == 'view_excel') {
        echo $output;
        exit;
    }
    $Label1->SetText($output);
    // -------------------------
    //End Custom Code
    //Close Page_BeforeShow @1-4BC230CD
    return $Page_BeforeShow;
}
//Initialize HTML Template @1-52F9C312
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage);
$Tpl = new clsTemplate($FileEncoding, $TemplateEncoding);
$Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "CP1252");
$Tpl->block_path = "/{$BlockToParse}";
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage);
$Attributes->SetValue("pathToRoot", "../");
$Attributes->Show();
//End Initialize HTML Template
//Execute Components @1-067C5593
$t_order_log_kronologisForm->Operation();
//End Execute Components
//Go to destination page @1-E75D8FC8
if ($Redirect) {
    $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
    $DBConnSIKP->close();
    header("Location: " . $Redirect);
    unset($t_order_log_kronologisForm);
    unset($Tpl);
    exit;
}
//End Go to destination page
//Show Page @1-8C176825
$t_order_log_kronologisForm->Show();
$Tpl->block_path = "";
$Tpl->Parse($BlockToParse, false);
if (!isset($main_block)) {
    $main_block = $Tpl->GetVar($BlockToParse);
}
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage);
if ($CCSEventResult) {
function Page_BeforeShow(&$sender)
{
    $Page_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_rep_lap_tingkat_kepatuhan_wp;
    //Compatibility
    //End Page_BeforeShow
    global $Label1;
    global $t_rep_sisa_piutangSearch;
    //Custom Code @566-2A29BDB7
    // -------------------------
    // Write your own code here.
    // -------------------------
    //End Custom Code
    $doAction = CCGetFromGet('doAction');
    if ($doAction == 'view_html') {
        $data = array();
        $param_arr = array();
        $param_arr['p_year_period_id'] = CCGetFromGet('p_year_period_id');
        $param_arr['p_finance_period_id'] = CCGetFromGet('p_finance_period_id');
        $param_arr['p_vat_type_id'] = CCGetFromGet('p_vat_type_id');
        $param_arr['tahun_periode'] = CCGetFromGet('tahun_periode');
        $param_arr['pajak_periode'] = CCGetFromGet('pajak_periode');
        $param_arr['jenis_pajak'] = CCGetFromGet('jenis_pajak');
        $param_arr['status'] = CCGetFromGet('status');
        $t_rep_sisa_piutangSearch->p_year_period_id->SetValue($param_arr['p_year_period_id']);
        $t_rep_sisa_piutangSearch->p_finance_period_id->SetValue($param_arr['p_finance_period_id']);
        $t_rep_sisa_piutangSearch->p_vat_type_id->SetValue($param_arr['p_vat_type_id']);
        $t_rep_sisa_piutangSearch->year_code->SetValue($param_arr['tahun_periode']);
        $t_rep_sisa_piutangSearch->code->SetValue($param_arr['pajak_periode']);
        $t_rep_sisa_piutangSearch->vat_code->SetValue($param_arr['jenis_pajak']);
        $t_rep_sisa_piutangSearch->ListBox1->SetValue($param_arr['status']);
        if (!empty($param_arr['p_finance_period_id']) and !empty($param_arr['p_vat_type_id'])) {
            $dbConn = new clsDBConnSIKP();
            if (empty($param_arr['status'])) {
                /* GLOBAL */
                $query = "SELECT * FROM f_rep_status_piutang (" . $param_arr['p_vat_type_id'] . ", " . $param_arr['p_finance_period_id'] . ", 1)";
            } else {
                if ($param_arr['status'] == '1') {
                    /* BELUM BAYAR */
                    $query = "SELECT * FROM f_rep_status_piutang (" . $param_arr['p_vat_type_id'] . ", " . $param_arr['p_finance_period_id'] . ", 1)\r\n\t\t\t\t\t\tWHERE ((f_teg1_amount is null) OR (f_teg1_amount < 1)) AND\r\n\t\t\t\t\t\t\t  ((f_teg2_amount is null) OR (f_teg2_amount < 1)) AND\r\n\t\t\t\t\t\t\t  ((f_teg3_amount is null) OR (f_teg3_amount < 1))\r\n\t\t\t\t\t\t\t  AND NOT textregexeq(f_action_sts,'^[[:digit:]]+(\\.[[:digit:]]+)?\$')\r\n\t\t\t\t\t\t\t  ";
                } else {
                    if ($param_arr['status'] == '2') {
                        /* SUDAH BAYAR */
                        $query = "SELECT *, (f_amount IS NULL AND f_teg1_amount IS NULL AND f_teg2_amount IS NULL AND f_teg3_amount IS NULL AND f_action_sts > 0) AS bayar_setelah\r\n\t\t\t\t\t\tFROM f_rep_status_piutang (" . $param_arr['p_vat_type_id'] . ", " . $param_arr['p_finance_period_id'] . ", 1)\r\n\t\t\t\t\t\tWHERE (f_teg1_amount > 0) OR \r\n\t\t\t\t\t\t\t  (f_teg2_amount > 0) OR \r\n\t\t\t\t\t\t\t  (f_teg3_amount > 0) \r\n\t\t\t\t\t\t\t  OR textregexeq(f_action_sts,'^[[:digit:]]+(\\.[[:digit:]]+)?\$')\r\n\t\t\t\t\t\t\t  ";
                    }
                }
            }
            $data = array();
            $dbConn->query($query);
            while ($dbConn->next_record()) {
                $data[] = $dbConn->Record;
            }
            $dbConn->close();
            // ----- AMBIL JATUH TEMPO ------
            $dbConn2 = new clsDBConnSIKP();
            $tgl_jatuh_tempo = '';
            $qJatuhTempo = "SELECT to_char((trunc(end_date) + due_in_day), 'yyyy-mm-dd') AS jatuh_tempo \r\n\t\t\t\t\t\t\tFROM p_finance_period \r\n\t\t\t\t\t\t\tWHERE p_finance_period_id = " . $param_arr['p_finance_period_id'];
            $dbConn2->query($qJatuhTempo);
            while ($dbConn2->next_record()) {
                $tgl_jatuh_tempo = $dbConn2->f('jatuh_tempo');
            }
            $dbConn2->close();
            $Label1->SetText(GetCetakHTML($data, $param_arr['pajak_periode'], $param_arr['jenis_pajak'], $tgl_jatuh_tempo, $param_arr['status']));
        } else {
            /* Tampilkan Alert */
            echo '<script> alert("Semua Filter Harus Diisi"); </script>';
        }
    }
    if ($doAction == 'cetak_excel') {
        $data = array();
        $param_arr = array();
        $param_arr['p_year_period_id'] = CCGetFromGet('p_year_period_id');
        $param_arr['p_finance_period_id'] = CCGetFromGet('p_finance_period_id');
        $param_arr['p_vat_type_id'] = CCGetFromGet('p_vat_type_id');
        $param_arr['tahun_periode'] = CCGetFromGet('tahun_periode');
        $param_arr['pajak_periode'] = CCGetFromGet('pajak_periode');
        $param_arr['jenis_pajak'] = CCGetFromGet('jenis_pajak');
        $param_arr['status'] = CCGetFromGet('status');
        $t_rep_sisa_piutangSearch->p_year_period_id->SetValue($param_arr['p_year_period_id']);
        $t_rep_sisa_piutangSearch->p_finance_period_id->SetValue($param_arr['p_finance_period_id']);
        $t_rep_sisa_piutangSearch->p_vat_type_id->SetValue($param_arr['p_vat_type_id']);
        $t_rep_sisa_piutangSearch->year_code->SetValue($param_arr['tahun_periode']);
        $t_rep_sisa_piutangSearch->code->SetValue($param_arr['pajak_periode']);
        $t_rep_sisa_piutangSearch->vat_code->SetValue($param_arr['jenis_pajak']);
        $t_rep_sisa_piutangSearch->ListBox1->SetValue($param_arr['status']);
        if (!empty($param_arr['p_finance_period_id']) and !empty($param_arr['p_vat_type_id'])) {
            $dbConn = new clsDBConnSIKP();
            if (empty($param_arr['status'])) {
                /* GLOBAL */
                $query = "SELECT * FROM f_rep_status_piutang (" . $param_arr['p_vat_type_id'] . ", " . $param_arr['p_finance_period_id'] . ", 1)";
            } else {
                if ($param_arr['status'] == '1') {
                    /* BELUM BAYAR */
                    $query = "SELECT * FROM f_rep_status_piutang (" . $param_arr['p_vat_type_id'] . ", " . $param_arr['p_finance_period_id'] . ", 1)\r\n\t\t\t\t\t\tWHERE ((f_teg1_amount is null) OR (f_teg1_amount < 1)) AND\r\n\t\t\t\t\t\t\t  ((f_teg2_amount is null) OR (f_teg2_amount < 1)) AND\r\n\t\t\t\t\t\t\t  ((f_teg3_amount is null) OR (f_teg3_amount < 1))\r\n\t\t\t\t\t\t\t  AND NOT textregexeq(f_action_sts,'^[[:digit:]]+(\\.[[:digit:]]+)?\$')\r\n\t\t\t\t\t\t\t  ";
                } else {
                    if ($param_arr['status'] == '2') {
                        /* SUDAH BAYAR */
                        $query = "SELECT *, (f_amount IS NULL AND f_teg1_amount IS NULL AND f_teg2_amount IS NULL AND f_teg3_amount IS NULL AND f_action_sts > 0) AS bayar_setelah\r\n\t\t\t\t\t\tFROM f_rep_status_piutang (" . $param_arr['p_vat_type_id'] . ", " . $param_arr['p_finance_period_id'] . ", 1)\r\n\t\t\t\t\t\tWHERE (f_teg1_amount > 0) OR \r\n\t\t\t\t\t\t\t  (f_teg2_amount > 0) OR \r\n\t\t\t\t\t\t\t  (f_teg3_amount > 0) \r\n\t\t\t\t\t\t\t  OR textregexeq(f_action_sts,'^[[:digit:]]+(\\.[[:digit:]]+)?\$')\r\n\t\t\t\t\t\t\t  ";
                    }
                }
            }
            $data = array();
            $dbConn->query($query);
            while ($dbConn->next_record()) {
                $data[] = $dbConn->Record;
            }
            $dbConn->close();
            // ----- AMBIL JATUH TEMPO ------
            $dbConn2 = new clsDBConnSIKP();
            $tgl_jatuh_tempo = '';
            $qJatuhTempo = "SELECT to_char((trunc(end_date) + due_in_day), 'yyyy-mm-dd') AS jatuh_tempo \r\n\t\t\t\t\t\t\tFROM p_finance_period \r\n\t\t\t\t\t\t\tWHERE p_finance_period_id = " . $param_arr['p_finance_period_id'];
            $dbConn2->query($qJatuhTempo);
            while ($dbConn2->next_record()) {
                $tgl_jatuh_tempo = $dbConn2->f('jatuh_tempo');
            }
            $dbConn2->close();
            $Label1->SetText(GetCetakHTML($data, $param_arr['pajak_periode'], $param_arr['jenis_pajak'], $tgl_jatuh_tempo, $param_arr['status']));
        } else {
            /* Tampilkan Alert */
            echo '<script> alert("Semua Filter Harus Diisi"); </script>';
        }
    } else {
        //do nothing
    }
    //Close Page_BeforeShow @1-4BC230CD
    return $Page_BeforeShow;
}