function t_vat_registrationForm_Button1_OnClick(&$sender)
{
    $t_vat_registrationForm_Button1_OnClick = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_vat_registrationForm;
    //Compatibility
    //End t_vat_registrationForm_Button1_OnClick
    //Custom Code @862-2A29BDB7
    // -------------------------
    // Write your own code here.
    // -------------------------
    //End Custom Code
    // -------------------------
    // Write your own code here.
    $dbConn1 = new clsDBConnSIKP();
    $order = $t_vat_registrationForm->order_no->GetValue();
    $mobile = $t_vat_registrationForm->mobile_no_owner->GetValue();
    $cari = "select t_customer_order_id from t_customer_order where order_no = '" . $order . "'";
    $dbConn1->query($cari);
    while ($dbConn1->next_record()) {
        $kode = $dbConn1->f("t_customer_order_id");
    }
    $sql_url = "select f_send_sms('" . $mobile . "','Kode Verifikasi Anda : " . $kode . "')from dual";
    $dbConn1->query($sql_url);
    /*
    $sql_url = "select value from p_global_param where code = 'SMSG_URL'";
    $dbConn1->query($sql_url);
    while($dbConn1->next_record()){
    	$val = $dbConn1->f("value");
    }
    	
    $ch = curl_init();
    $url = $val."recipient=".$mobile."&messagetype=SMS:TEXT&messagedata=Kode+Verifikasi+Anda:+".$kode."";	
      
    curl_setopt($ch, CURLOPT_URL,$url);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('body' => json_encode($postdata))));
      
      
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      
    $server_output = curl_exec ($ch);
      
    curl_close ($ch);
    */
    $sql = "INSERT INTO verifikasi(id_verifikasi,order_no,code) VALUES " . "(generate_id('sikp','verifikasi','id_verifikasi'),'" . $order . "','" . $kode . "')";
    $dbConn1->query($sql);
    $dbConn1->close;
    $t_vat_registrationForm->pesan->SetValue("Data Telah Terkirim");
    return;
    // -------------------------
    //Close t_vat_registrationForm_Button1_OnClick @851-A9568806
    return $t_vat_registrationForm_Button1_OnClick;
}
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 grafik_pembayaran_form_Button2_OnClick(&$sender)
{
    $grafik_pembayaran_form_Button2_OnClick = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $grafik_pembayaran_form;
    //Compatibility
    //End grafik_pembayaran_form_Button2_OnClick
    //Custom Code @71-2A29BDB7
    // -------------------------
    // Write your own code here.
    $app_user_name = $grafik_pembayaran_form->app_user_name->GetValue();
    $mobile_no = $grafik_pembayaran_form->mobile_no->GetValue();
    $message = $grafik_pembayaran_form->message->GetValue();
    $dbConn = new clsDBConnSIKP();
    $query = "INSERT INTO t_sms_outbox(\r\n\t\t\t            npwpd, mobile_no, message, is_sent, date_added, message_type)\r\n\t\t\t    VALUES ('" . $app_user_name . "', '" . $mobile_no . "', '" . $message . "', 'N', sysdate, 'SMS_BLAST')";
    $dbConn->query($query);
    echo '<script>
				alert ("SMS akan segera dikirim.");
				location.href="t_send_sms_to_app_user.php";
			</script>
			
			';
    return;
    // -------------------------
    //End Custom Code
    //Close grafik_pembayaran_form_Button2_OnClick @20-8AF2D859
    return $grafik_pembayaran_form_Button2_OnClick;
}
function GetSurvey($param_arr)
{
    $output = '';
    $dbConn = new clsDBConnSIKP();
    $query = "select * from p_survey_question WHERE p_survey_question_id=" . $param_arr['p_survey_question_id'];
    //echo $query;exit;
    $dbConn->query($query);
    if ($dbConn->next_record()) {
        $data = $dbConn->Record;
        $query2 = "select * from p_survey_question WHERE p_survey_type_id=" . $data["p_survey_type_id"] . " and sequence_no =" . ($data["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 'location.href="t_survey_kepuasan_pelanggan_pendaftaran_terima_kasih.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>';
    }
    $dbConn->close();
    return $output;
}
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 t_vat_registrationForm_Button4_OnClick(&$sender)
{
    $t_vat_registrationForm_Button4_OnClick = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_vat_registrationForm;
    //Compatibility
    //End t_vat_registrationForm_Button4_OnClick
    //Custom Code @909-2A29BDB7
    // -------------------------
    // Write your own code here.
    $CusId = CCGetFromGet("CURR_DOC_ID", "");
    $dbConn = new clsDBConnSIKP();
    $sql = "select f_gen_npwpd(" . $CusId . ")as npwpd from dual";
    $dbConn->query($sql);
    while ($dbConn->next_record()) {
        $val = $dbConn->f("npwpd");
    }
    $t_vat_registrationForm->npwpd->SetValue($val);
    return;
    // -------------------------
    //End Custom Code
    //Close t_vat_registrationForm_Button4_OnClick @908-D8012444
    return $t_vat_registrationForm_Button4_OnClick;
}
function t_vat_reg_dtl_restaurantForm_BeforeSelect(&$sender)
{
    $t_vat_reg_dtl_restaurantForm_BeforeSelect = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_vat_reg_dtl_restaurantForm;
    //Compatibility
    //End t_vat_reg_dtl_restaurantForm_BeforeSelect
    //Custom Code @819-2A29BDB7
    // -------------------------
    // Write your own code here.
    $idVat = $t_vat_reg_dtl_restaurantForm->t_cust_account_id->GetValue();
    $dbConn = new clsDBConnSIKP();
    $sql = "select a.p_vat_type_dtl_id, b.vat_code as rest_service_type_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 a.t_cust_account_id = " . $idVat;
    $dbConn->query($sql);
    while ($dbConn->next_record()) {
        $restId = $dbConn->f("p_vat_type_dtl_id");
        $restCode = $dbConn->f("rest_service_type_code");
    }
    $t_vat_reg_dtl_restaurantForm->service_type_desc->SetValue($restCode);
    $t_vat_reg_dtl_restaurantForm->p_rest_service_type_id->SetValue($restId);
    // -------------------------
    //End Custom Code
    //Close t_vat_reg_dtl_restaurantForm_BeforeSelect @94-6EBC2391
    return $t_vat_reg_dtl_restaurantForm_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;
}
function LOV_Button1_OnClick(&$sender)
{
    $LOV_Button1_OnClick = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $LOV;
    //Compatibility
    //End LOV_Button1_OnClick
    //Custom Code @24-2A29BDB7
    // -------------------------
    // Write your own code here.
    $t_bphtb_registration_id = CCGetFromGet("t_bphtb_registration_id");
    $alasan = $LOV->alasan->GetValue();
    $user = CCGetUserLogin();
    $dbConn = new clsDBConnSIKP();
    if ($t_bphtb_registration_id != "" && $alasan != "" && $user != "") {
        $query = "select f_delete_bphtb from \r\n\t\t\tf_delete_bphtb(" . $t_bphtb_registration_id . ",'" . $alasan . "','" . $user . "')";
        //echo $query;exit;
        $dbConn->query($query);
        $dbConn->next_record();
        $result = $dbConn->f("f_delete_bphtb");
    } else {
        $result = "id bphtb, alasan atau user login tidak boleh kosong";
    }
    echo "<script> \r\n\t\talert('" . $result . "');\r\n\t\twindow.opener.location.reload();\r\n\t\twindow.close();\r\n\t</script>";
    exit;
    // -------------------------
    //End Custom Code
    //Close LOV_Button1_OnClick @16-408DE5C8
    return $LOV_Button1_OnClick;
}
function LOV_BeforeShow(&$sender)
{
    $LOV_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $LOV;
    //Compatibility
    //End LOV_BeforeShow
    //Custom Code @8-2A29BDB7
    // -------------------------
    // Write your own code here.
    $i_vat_setllement = CCGetFromGet('i_vat_setllement_id');
    $ubah = CCGetFromGet('ubah');
    $in_flag_numeric = CCGetFromGet('in_flag_numeric');
    $is_desc = CCGetFromGet('is_desc');
    if ($ubah == 'T') {
        $user = CCGetUserLogin();
        $data = array();
        $dbConn = new clsDBConnSIKP();
        $query = "select f_update_increasing_amt({$i_vat_setllement},{$in_flag_numeric},'{$is_desc}','{$user}') as msg";
        $dbConn->query($query);
        while ($dbConn->next_record()) {
            echo "<script> \r\n\t\t\talert('" . $dbConn->f('msg') . "');\r\n\t\t\twindow.close();\r\n\t\t</script>";
            exit;
        }
    }
    // -------------------------
    //End Custom Code
    //Close LOV_BeforeShow @3-91C2A156
    return $LOV_BeforeShow;
}
function print_laporan($param_arr)
{
    include "../include/fpdf17/mc_table.php";
    $_BORDER = 0;
    $_FONT = 'Times';
    $_FONTSIZE = 10;
    $pdf = new PDF_MC_Table();
    $size = $pdf->_getpagesize('Legal');
    $pdf->DefPageSize = $size;
    $pdf->CurPageSize = $size;
    $pdf->AddPage('Landscape', 'Legal');
    $pdf->SetFont('helvetica', '', $_FONTSIZE);
    $pdf->SetRightMargin(5);
    $pdf->SetLeftMargin(9);
    $pdf->SetAutoPageBreak(false, 0);
    $pdf->SetFont('helvetica', '', 12);
    $pdf->SetWidths(array(200));
    $pdf->ln(1);
    $pdf->RowMultiBorderWithHeight(array("Laporan pencetakan bulanan penerimaan sptpd"), array('', ''), 6);
    //$pdf->ln(8);
    $pdf->SetWidths(array(40, 200));
    $pdf->ln(4);
    $pdf->RowMultiBorderWithHeight(array("DAFTAR SPTPD", ": "), array('', ''), 6);
    $pdf->RowMultiBorderWithHeight(array("TAHUN", ": " . $param_arr['year_code']), array('', ''), 6);
    $pdf->RowMultiBorderWithHeight(array("TANGGAL", ": " . dateToString($param_arr['date_start']) . " s/d " . dateToString($param_arr['date_end'])), array('', ''), 6);
    $dbConn = new clsDBConnSIKP();
    $query = "select * from sikp.f_laporan_pencetakan_bulanan(1," . $param_arr['year_code'] . ",'" . $param_arr['date_start'] . "', '" . $param_arr['date_end'] . "')";
    //print_r($query);
    //exit;
    $dbConn->query($query);
    $items = array();
    $pdf->SetFont('helvetica', '', 9);
    $pdf->ln(2);
    $pdf->SetWidths(array(10, 24, 20, 15, 40, 18, 22, 25, 20, 61, 61, 27));
    $pdf->SetAligns(array('C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C'));
    $pdf->SetWidths(array(10, 40, 35, 15, 40, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18));
    $pdf->SetFont('arial', '', 7);
    $pdf->RowMultiBorderWithHeight(array("NO", "NAMA", "ALAMAT", "NPWPD", "DESEMBER THN SEBELUMNYA", "JANUARI", "FEBRUARI", "MARET", "APRIL", "MEI", "JUNI", "JULI", "AGUSTUS", "SEPTEMBER", "OKTOBER", "NOVEMBER"), array('LTB', 'LTB', 'LBT', 'LTB', 'LTB', 'LTB', 'LTB', 'LTB', 'LTB', 'TLB', 'TLB', 'TLB', 'TLB', 'TLB', 'TLBR'), 9);
    $pdf->SetFont('arial', '', 8);
    $no = 1;
    $pdf->SetAligns(array('C', 'L', 'L', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C'));
    $jumlah = 0;
    $jumlah = 0;
    while ($dbConn->next_record()) {
        $items[] = $item = array('nama' => $dbConn->f("nama"), 'alamat' => $dbConn->f("alamat"), 'npwpd' => $dbConn->f("npwpd"), 'last_desember' => $dbConn->f("last_desember"), 'januari' => $dbConn->f("januari"), 'februari' => $dbConn->f("februari"), 'maret' => $dbConn->f("maret"), 'april' => $dbConn->f("april"), 'mei' => $dbConn->f("mei"), 'juni' => $dbConn->f("juni"), 'juli' => $dbConn->f("juli"), 'agustus' => $dbConn->f("agustus"), 'september' => $dbConn->f("september"), 'oktober' => $dbConn->f("oktober"), 'november' => $dbConn->f("november"));
        $pdf->RowMultiBorderWithHeight(array($no, $item['nama'], $item['alamat'], $item['npwpd'], $item['last_desember'], $item['januari'], $item['februari'], $item['maret'], $item['april'], $item['mei'], $item['juni'], $item['juli'], $item['agustus'], $item['september'], $item['oktober'], $item['november']), array('LB', 'LB', 'LB', 'LB', 'LB', 'LB', 'LB', 'LB', 'LB', 'LB', 'LB', 'LB', 'LB', 'LB', 'LB', 'LBR'), 6);
        $jumlah += $dbConn->f("amount");
        //	$jumlah_wp+=$dbConn->f("jumlah_wp");
        $no++;
    }
    //print_r($items);
    //exit;
    $pdf->SetWidths(array(250, 70));
    $pdf->ln(8);
    $pdf->RowMultiBorderWithHeight(array("", "KASIE VOP"), array('', '', '', '', '', '', ''), 6);
    $pdf->Output("", "I");
    exit;
}
Beispiel #12
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 deleteAll($t_vat_registration)
{
    $dbConn = new clsDBConnSIKP();
    $sql = "delete from t_license_letter where t_vat_registration_id=" . $t_vat_registration . ";" . "delete from t_vat_reg_employee where t_vat_registration_id=" . $t_vat_registration . ";" . "delete from t_vat_reg_dtl_restaurant where t_vat_registration_id=" . $t_vat_registration . ";" . "delete from t_vat_reg_dtl_entertaintment where t_vat_registration_id=" . $t_vat_registration . ";" . "delete from t_vat_reg_dtl_parking where t_vat_registration_id=" . $t_vat_registration . ";" . "delete from t_vat_reg_dtl_hotel where t_vat_registration_id=" . $t_vat_registration . ";" . "delete from t_vat_registration where t_vat_registration_id=" . $t_vat_registration . ";";
    if ($dbConn->query($sql)) {
    } else {
        //do something here
    }
}
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;
}
Beispiel #15
0
function sendSms()
{
    include 'save_excel_2.php';
    include '../../gammu/send_sms.php';
    $SendSms = new SendSms();
    $dbConn = new clsDBConnSIKP();
    $query = "SELECT * FROM t_sms_outbox where is_sent = 'N'";
    $dbConn->query($query);
    $data = array();
    while ($dbConn->next_record()) {
        $data[] = $item = array('t_sms_outbox_id' => $dbConn->f("t_sms_outbox_id"), 'npwpd' => $dbConn->f("npwpd"), 'mobile_no' => $dbConn->f("mobile_no"), 'message' => $dbConn->f("message"), 'is_sent' => $dbConn->f("is_sent"), 'date_sent' => $dbConn->f("date_sent"), 'date_addded' => $dbConn->f("date_addded"));
        $SendSms->send($item["mobile_no"], $item["message"]);
    }
    for ($counter = 0; $counter < sizeof($data); $counter++) {
        $query = " UPDATE t_sms_outbox\r\n\t   \t\tSET is_sent='Y',date_sent=sysdate\r\n\t \t\tWHERE t_sms_outbox_id=" . $data[$counter]['t_sms_outbox_id'];
        $dbConn->query($query);
    }
}
function GetCetakHTML($param_arr)
{
    $output = '';
    $DBConn = new clsDBConnSIKP();
    $SQL = "select replace(replace(f_monitor_tipro_daftar_v2(1," . $param_arr['nilai'] . "," . $param_arr['p_finance_period_id'] . "," . $param_arr['p_vat_type_id'] . "),'(\"',''),'\")','') from dual";
    //die($SQL);
    $DBConn->query($SQL);
    return create_table_grid($DBConn, "INFORMASI MONITORING", "", $qs, "Y", $arrJml, "2");
}
function GetCetakHTML($param_arr)
{
    $output = '';
    $dbConn = new clsDBConnSIKP();
    $query = "select * from t_payment_receipt where npwd = '" . $param_arr['npwpd'] . "'\r\n\t\tORDER BY payment_date desc limit 1";
    //echo $query;exit;
    $dbConn->query($query);
    if ($dbConn->next_record()) {
        $data = $dbConn->Record;
        $output = '';
        $output .= '<table class="grid-table" cellspacing="0" cellpadding="0" border="0"> 
	                  <tr>
	                    <td class="HeaderLeft"><img border="0" alt="" src="../Styles/sikp/Images/Spacer.gif"></td> 
	                    <td class="th"><strong>INFORMASI PEMBAYARAN</strong></td> 
	                    <td class="HeaderRight"><img border="0" alt="" src="../Styles/sikp/Images/Spacer.gif"></td>
	                  </tr>
	                </table>';
        $output .= '<table class="Record" cellspacing="0" cellpadding="5" style="font-size:15px;padding-left:15px;" border="0">
				<tr> 
					<td colspan="3">Pembayaran Terakhir untuk NPWPD : <b>' . $param_arr['npwpd'] . '</td>
				</tr>
				<tr>
					<td colspan="3">&nbsp;</td>
				</tr>
				<tr>
					<td colspan="3"><u><b>INFO DETAIL : </b></u></td>
				</tr>';
        $output .= '<tr>';
        $output .= '<td width="150"> NPWPD';
        $output .= '</td>';
        $output .= '<td> : ' . $data['npwd'];
        $output .= '</td>';
        $output .= '</tr>';
        $output .= '<tr>';
        $output .= '<td> Periode Pajak';
        $output .= '</td>';
        $output .= '<td> : ' . $data['finance_period_code'];
        $output .= '</td>';
        $output .= '</tr>';
        $output .= '<tr>';
        $output .= '<td> Total Pajak';
        $output .= '</td>';
        $output .= '<td> : Rp. ' . number_format($data['payment_vat_amount'], 2, ',', '.');
        $output .= '</td>';
        $output .= '</tr>';
        $output .= '</table>';
    } 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 t_ppatForm_Button_Insert_OnClick(&$sender)
{
    $t_ppatForm_Button_Insert_OnClick = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_ppatForm;
    //Compatibility
    //End t_ppatForm_Button_Insert_OnClick
    //Custom Code @374-2A29BDB7
    // -------------------------
    // Write your own code here.
    $dbConn = new clsDBConnSIKP();
    $company_brand = $t_ppatForm->company_brand->GetValue();
    $p_rqst_type_id = $t_ppatForm->p_rqst_type_id->GetValue();
    $p_vat_type_dtl_id = $t_ppatForm->p_vat_type_dtl_id->GetValue();
    $brand_address_name = $t_ppatForm->brand_address_name->GetValue();
    $brand_address_no = $t_ppatForm->brand_address_no->GetValue();
    $brand_address_rt = $t_ppatForm->brand_address_rt->GetValue();
    $brand_address_rw = $t_ppatForm->brand_address_rw->GetValue();
    $company_additional_addr = $t_ppatForm->company_additional_addr->GetValue();
    $brand_p_region_id = $t_ppatForm->brand_p_region_id->GetValue();
    $brand_p_region_id_kec = $t_ppatForm->brand_p_region_id_kec->GetValue();
    $brand_p_region_id_kel = $t_ppatForm->brand_p_region_id_kel->GetValue();
    $brand_phone_no = $t_ppatForm->brand_phone_no->GetValue();
    $brand_mobile_no = $t_ppatForm->brand_mobile_no->GetValue();
    $brand_fax_no = $t_ppatForm->brand_fax_no->GetValue();
    $brand_zip_code = $t_ppatForm->brand_zip_code->GetValue();
    $user = $t_ppatForm->created_by->GetValue();
    $sql = "select * from f_insert_vat_reg_npwpd_jabatan(\r\n\t\t\t'{$user}', \r\n\t\t\t'{$company_brand}',\r\n\t\t\t'{$company_additional_addr}',\r\n\t\t\t'{$brand_address_name}',\r\n\t\t\t'{$brand_address_no}',\r\n\t\t\t'{$brand_address_rt}',\r\n\t\t\t'{$brand_address_rw}',\r\n\t\t\t{$brand_p_region_id_kel},\r\n\t\t\t{$brand_p_region_id_kec},\r\n\t\t\t{$brand_p_region_id},\r\n\t\t\t'{$brand_phone_no}',\r\n\t\t\t'{$brand_mobile_no}',\r\n\t\t\t'{$brand_fax_no}',\r\n\t\t\t'{$brand_zip_code}',\r\n\t\t\t{$p_rqst_type_id},\r\n\t\t\t{$p_vat_type_dtl_id}\r\n\t\t\t)";
    //die($sql);
    $dbConn->query($sql);
    $dbConn->next_record();
    $cust_id = $dbConn->f("v_customer_order_id");
    $mess = $dbConn->f("o_result_msg");
    if ($cust_id != 0 && $cust_id != "") {
        echo '<script language="javascript">';
        echo "window.open('../report/cetak_surat_pengukuhan_npwpd_jabatan.php?CURR_DOC_ID={$cust_id}', \r\n\t\t\t\t'pengukuhan', 'height=,width=,left=0,top=0');";
        echo "window.open('../report/cetak_form_pemutakhiran_data_npwpd_jabatan.php?t_customer_order_id={$cust_id}', \r\n\t\t\t\t'pemutakhiran', 'height=,width=,left=0,top=0');";
        echo '</script>';
    } else {
        $mess = str_replace('"', '', $mess);
        echo '<script language="javascript">';
        echo 'alert("' . $mess . '");';
        echo '</script>';
    }
    echo '<script language="javascript">';
    echo "location.href='t_vat_registration_npwpd_jabatan.php';";
    echo '</script>';
    return;
    // -------------------------
    //End Custom Code
    //Close t_ppatForm_Button_Insert_OnClick @24-EE087F7F
    return $t_ppatForm_Button_Insert_OnClick;
}
function create_info_ama()
{
    $DBConn = new clsDBConnSIKP();
    $nilai = CCGetFromGet("nilai", "");
    if (empty($nilai)) {
    } else {
        $SQL = "select replace(replace(f_monitor_tipro_daftar(1," . $nilai . "),'(\"',''),'\")','') from dual";
        //die($SQL);
        $DBConn->query($SQL);
        return create_table_grid($DBConn, "INFORMASI MONITORING", "", $qs, "Y", $arrJml, "2");
    }
}
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_setllementForm_Button1_OnClick(&$sender)
{
    $t_vat_setllementForm_Button1_OnClick = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_vat_setllementForm;
    //Compatibility
    //End t_vat_setllementForm_Button1_OnClick
    //Custom Code @165-2A29BDB7
    // -------------------------
    // Write your own code here.
    // -------------------------
    //End Custom Code
    // -------------------------
    // Write your own code here.
    $dbConn = new clsDBConnSIKP();
    $User = CCGetUserLogin();
    $t_bphtb_registration_id = $t_vat_setllementForm->t_bphtb_registration_id->GetValue();
    $alasan = $t_vat_setllementForm->alasan->GetValue();
    $njop_pbb = $t_vat_setllementForm->njop_pbb->GetValue();
    $bphtb_amt_final = $t_vat_setllementForm->bphtb_amt_final->GetValue();
    $bphtb_amt_final_keberatan = $t_vat_setllementForm->bphtb_amt_final_keberatan->GetValue();
    $errorMsg = '';
    $sql = "select * from f_insert_bphtb_keberatan(" . $t_bphtb_registration_id . ",19," . $bphtb_amt_final_keberatan . "," . $bphtb_amt_final . ",'" . $alasan . "','" . $User . "')";
    //echo $sql;
    //die($sql);
    $dbConn->query($sql);
    $dbConn->next_record();
    $t_bphtb_keberatan_id = $dbConn->f("o_t_bphtb_keberatan_id");
    $t_customer_order_id = $dbConn->f("o_t_customer_order_id");
    $mess = $dbConn->f("o_mess");
    $sql = "select sikp.f_first_submit_engine(511," . $t_customer_order_id . ",'" . CCGetSession('UserLogin') . "')";
    $dbConn->query($sql);
    //modified by wiliam
    echo "<script> \r\n\t\talert('" . $mess . "');\r\n\t\twindow.opener.location.reload();\r\n\t\twindow.close();\r\n\t</script>";
    // -------------------------
    //Close t_vat_setllementForm_Button1_OnClick @164-6DBB2532
    //return $t_vat_setllementForm_Button1_OnClick;
}
function t_message_inboxGrid_BeforeSelect(&$sender)
{
    $t_message_inboxGrid_BeforeSelect = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_message_inboxGrid;
    //Compatibility
    //End t_message_inboxGrid_BeforeSelect
    //Custom Code @226-2A29BDB7
    // -------------------------
    // Write your own code here.
    // -------------------------
    //End Custom Code
    //Custom Code @289-2A29BDB7
    // -------------------------
    // Write your own code here.
    // -------------------------
    //End Custom Code
    $t_message_inbox_id = CCGetFromGet('t_message_inbox_bphtb_id');
    if (!empty($t_message_inbox_id)) {
        $dbConn1 = new clsDBConnSIKP();
        $cari = "select message_status from t_message_inbox_bphtb where t_message_inbox_bphtb_id = " . $t_message_inbox_id;
        $dbConn1->query($cari);
        while ($dbConn1->next_record()) {
            $message_status = $dbConn1->f("message_status");
        }
        if ($message_status == 'U') {
            $query = "update t_message_inbox_bphtb set message_status = 'V' where t_message_inbox_id = " . $t_message_inbox_id;
            $dbConn1->query($query);
        }
    }
    // -------------------------
    // Write your own code here.
    $Component->DataSource->Parameters["urls_keyword"] = strtoupper(CCGetFromGet("s_keyword", NULL));
    // -------------------------
    //Close t_message_inboxGrid_BeforeSelect @2-E3E1E9CD
    return $t_message_inboxGrid_BeforeSelect;
}
function print_excel($param_arr)
{
    $dbConn = new clsDBConnSIKP();
    $query = "select upper(vat_code)as vat_code from p_vat_type where p_vat_type_id = " . $param_arr['p_vat_type_id'];
    $vat_code = '';
    $dbConn->query($query);
    while ($dbConn->next_record()) {
        $vat_code = $dbConn->f("vat_code");
    }
    $query = "select 'SURAT_TEGURAN_'||sequence_no||'_'||replace('" . $vat_code . "',' ','_')||'_PERIODE_'||replace(code,' ','_') AS judul\r\n\t\tfrom t_debt_letter a\r\n\t\tleft join p_finance_period x on a.p_finance_period_id=x.p_finance_period_id\r\n\t\twhere t_customer_order_id=" . $param_arr['t_customer_order_id'];
    $judul = '';
    $dbConn->query($query);
    while ($dbConn->next_record()) {
        $judul = $dbConn->f("judul");
    }
    startExcel("LAPORAN_" . $judul . ".xls");
    echo "<div><h3> DAFTAR SURAT TEGURAN PAJAK " . $vat_code . " </h3></div>";
    echo "<div><b>Tanggal cetak : " . date('d-M-Y') . "</b></div><br/>";
    $no = 1;
    echo "<table border='1'>";
    echo "<tr>\r\n\t\t<th>NO</th>\r\n\t\t<th>NPWPD</th>\t\r\n\t\t<th>NAMA</th>\r\n\t\t<th>ALAMAT</th>\r\n\t\t<th>JATUH TEMPO</th>\r\n\t\t<th>MASA PAJAK</th>\r\n\t\t<th>BESARNYA</th>\r\n\t\t<th>KETERANGAN</th>\r\n\t</tr>";
    $query = "select * from f_debt_letter_list(" . $param_arr['t_customer_order_id'] . ") as a \r\n\t\t  LEFT JOIN t_cust_account as b ON a.t_cust_account_id = b.t_cust_account_id\r\n\t\t  WHERE a.p_vat_type_id = " . $param_arr['p_vat_type_id'] . " AND b.p_vat_type_dtl_id NOT IN (11, 15, 17, 21, 27, 30, 41, 42, 43)";
    $dbConn->query($query);
    while ($dbConn->next_record()) {
        $items[] = $item = array('npwd' => $dbConn->f("npwd"), 'company_name' => $dbConn->f("company_name"), 'wp_name' => $dbConn->f("wp_name"), 'address_name' => $dbConn->f("address_name"), 'wp_address_name' => $dbConn->f("wp_address_name"), 'wp_address_no' => $dbConn->f("wp_address_no"), 'vat_code' => $dbConn->f("vat_code"), 'due_date' => $dbConn->f("due_date"), 'start_date' => $dbConn->f("start_date"), 'end_date' => $dbConn->f("end_date"), 'debt_amount' => $dbConn->f("debt_amount"), 'description' => $dbConn->f("description"));
        if ($item['company_name'] == '-' || empty($item['company_name'])) {
            $item['company_name'] = $item['wp_name'];
        }
        if ($item['address_name'] == '-' || empty($item['address_name'])) {
            $item['address_name'] = $item['wp_address_name'] . ' ' . $item['wp_address_no'];
        }
        echo "<tr>\r\n\t\t\t<td>" . $no . "</td>\r\n\t\t\t<td>" . $item['npwd'] . "</td>\r\n\t\t\t<td>" . $item['company_name'] . "</td>\r\n\t\t\t<td>" . $item['address_name'] . "</td>\r\n\t\t\t<td>" . $item['due_date'] . "</td>\r\n\t\t\t<td>" . $item['start_date'] . " s.d. " . $item['end_date'] . "</td>\r\n\t\t\t<td align='right'>" . number_format($item['debt_amount'], 2, ',', '.') . "</td>\r\n\t\t\t<td>" . $item['description'] . "</td>\r\n\t\t</tr>";
        $no++;
    }
    echo "</table>";
    exit;
}
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 != '') {
        $p_vat_type_id = CCGetFromGet("p_vat_type_id", "");
        $p_year_period_id = CCGetFromGet("p_year_period_id", "");
        $tgl_penerimaan = CCGetFromGet("tgl_penerimaan", "");
        $tgl_penerimaan_last = CCGetFromGet("tgl_penerimaan_last", "");
        $year_code = CCGetFromGet("year_code", "");
        $kode_wilayah = CCGetFromGet("kode_wilayah", "");
        $tgl_penerimaan = "'" . $tgl_penerimaan . "'";
        $tgl_penerimaan_last = "'" . $tgl_penerimaan_last . "'";
        $kode_wilayah = "'" . $kode_wilayah . "'";
        $date_start = str_replace("'", "", $year_code);
        $year_date = $year_code;
        $user = CCGetUserLogin();
        $data = array();
        $dbConn = new clsDBConnSIKP();
        $jenis_laporan = CCGetFromGet("jenis_laporan", "all");
        $query = "select to_char(active_date,'dd-mm-yyyy') as active_date2,*,\r\n\t\t\tcase \r\n\t\t\t\twhen payment_date is not null then to_char(payment_date,'dd-mm-yyyy')\r\n\t\t\t\telse ''\r\n\t\t\tend as payment_date \r\n\t\tfrom f_rep_bpps_piutang2new_mod_2_per_wilayah({$p_vat_type_id}, {$p_year_period_id}, {$tgl_penerimaan}, {$tgl_penerimaan_last}, 1,{$kode_wilayah}) a\r\n\t\tleft join t_cust_account x on a.npwpd = x.npwd \r\n\t\torder by kode_ayat, npwpd, masa_pajak";
        //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("company_brand"), "wp_address_name" => $dbConn->f("brand_address_name"), "wp_address_no" => $dbConn->f("brand_address_no"), "active_date2" => $dbConn->f("active_date2"), "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"));
        }
    }
    if ($doAction == 'view_html2') {
        $Label1->SetText(GetCetakHTML2($data));
    }
    if ($doAction == 'view_excel') {
        GetCetakHTML2($data);
    }
    // -------------------------
    //Close Page_BeforeShow @1-4BC230CD
    return $Page_BeforeShow;
}
function t_vat_setllementForm_Button1_OnClick(&$sender)
{
    $t_vat_setllementForm_Button1_OnClick = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_vat_setllementForm;
    //Compatibility
    //End t_vat_setllementForm_Button1_OnClick
    //Custom Code @165-2A29BDB7
    // -------------------------
    // Write your own code here.
    // -------------------------
    //End Custom Code
    // -------------------------
    // Write your own code here.
    $dbConn = new clsDBConnSIKP();
    $cusAccId = $t_vat_setllementForm->t_cust_account_id->GetValue();
    $User = CCGetUserLogin();
    $p_account_status_id = $t_vat_setllementForm->p_account_status_id->GetValue();
    $reason_status_id = $t_vat_setllementForm->reason_status_id->GetValue();
    $reason_description = $t_vat_setllementForm->reason_description->GetValue();
    $errorMsg = '';
    //new fix
    if (!isset($p_vat_type_dtl_cls_id) || $p_vat_type_dtl_cls_id == '') {
        $p_vat_type_dtl_cls_id = 'NULL';
    }
    if (empty($kamar)) {
        $kamar = 0;
    }
    //cek alasan lainnya
    if ($reason_status_id == 4 and !isset($reason_description) || $reason_description == '') {
        echo "<script> \r\n\t\t\talert('Keterangan harus diisi jika memilih alasan Lainnya');\r\n\t\t</script>";
    } else {
        $sql = "select * from f_entry_mutasi_status_wp(" . $cusAccId . ",15," . $p_account_status_id . "," . $reason_status_id . ",'" . $reason_description . "','" . $User . "')";
        //echo $sql;
        //die($sql);
        $dbConn->query($sql);
        $dbConn->next_record();
        $cust_id = $dbConn->f("o_cust_order_id");
        $mess = $dbConn->f("o_mess");
        //modified by wiliam
        echo "<script> \r\n\t\t\talert('" . $mess . "');\r\n\t\t\twindow.opener.location.reload();\r\n\t\t\twindow.close();\r\n\t\t</script>";
        exit;
    }
    // -------------------------
    //Close t_vat_setllementForm_Button1_OnClick @164-6DBB2532
    //return $t_vat_setllementForm_Button1_OnClick;
}
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 GetCetakHTML($param_arr)
{
    $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 class="HeaderLeft"><img border="0" alt="" src="../Styles/sikp/Images/Spacer.gif"></td> 
                  		<td class="th"><strong>DAFTAR PENDAFTARAN WP</strong></td> 
                  		<td class="HeaderRight"><img border="0" alt="" src="../Styles/sikp/Images/Spacer.gif"></td>
                	</tr>
              		</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" >NPWPD</th>';
    $output .= '<th align="center" >NAMA WP</th>';
    $output .= '<th align="center" >MERK DAGANG</th>';
    $output .= '<th align="center" >ALAMAT MERK DAGANG</th>';
    $output .= '<th align="center" >KARTU NPWPD</th>';
    $output .= '</tr>';
    $dbConn = new clsDBConnSIKP();
    $query = "select * from t_cust_account where \r\n\tnpwd ilike '%" . $param_arr['search'] . "%'\r\n\tor wp_name ilike '%" . $param_arr['search'] . "%'\r\n\tor company_brand ilike '%" . $param_arr['search'] . "%'\r\n\tORDER BY wp_name";
    //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]['npwd'] . '</td>';
        $output .= '<td align="left" >' . $data[$i]['wp_name'] . '</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="center" ><input id="cetak_kartu_npwpd_v2" class="btn_tambah" onclick="cetak_kartu_npwpd_v2(' . $data[$i]['t_cust_account_id'] . '); return false;" value="cetak_kartu_npwpd_v2" type="button"></td>';
        $output .= '</tr>';
    }
    $output .= '</table>';
    return $output;
}
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;
}