示例#1
0
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (SELECT a.p_finance_period_id, a.p_year_period_id, a.code, to_char(a.start_date,'DD-MON-YYYY') start_date,\n" . "to_char(a.end_date,'DD-MON-YYYY') end_date, a.description,\n" . "to_char(a.updated_date,'DD-MON-YYYY') updated_date,\n" . "a.updated_by,to_char(a.creation_date,'DD-MON-YYYY') creation_date, a.created_by,\n" . "b.code status_code, a.p_status_list_id,\n" . "nvl(a.due_in_day,0) as due_in_day, nvl(a.debt_letter_1,0) as debt_letter_1, nvl(a.debt_letter_2,0) as debt_letter_2, nvl(a.debt_letter_3,0) as debt_letter_3\n" . "FROM p_finance_period a, p_status_list b, p_year_period c \n" . "WHERE a.p_status_list_id = b.p_status_list_id AND \n" . "a.p_year_period_id = c.p_year_period_id AND\n" . "a.p_year_period_id = " . $this->SQLValue($this->wp->GetDBValue("2"), ccsFloat) . " AND\n" . "(upper(a.code) LIKE upper('%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%')\n" . "OR upper(b.code) LIKE upper('%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%') )) cnt";
     $this->SQL = "SELECT a.p_finance_period_id, a.p_year_period_id, a.code, to_char(a.start_date,'DD-MON-YYYY') start_date,\n" . "to_char(a.end_date,'DD-MON-YYYY') end_date, a.description,\n" . "to_char(a.updated_date,'DD-MON-YYYY') updated_date,\n" . "a.updated_by,to_char(a.creation_date,'DD-MON-YYYY') creation_date, a.created_by,\n" . "b.code status_code, a.p_status_list_id,\n" . "nvl(a.due_in_day,0) as due_in_day, nvl(a.debt_letter_1,0) as debt_letter_1, nvl(a.debt_letter_2,0) as debt_letter_2, nvl(a.debt_letter_3,0) as debt_letter_3\n" . "FROM p_finance_period a, p_status_list b, p_year_period c \n" . "WHERE a.p_status_list_id = b.p_status_list_id AND \n" . "a.p_year_period_id = c.p_year_period_id AND\n" . "a.p_year_period_id = " . $this->SQLValue($this->wp->GetDBValue("2"), ccsFloat) . " AND\n" . "(upper(a.code) LIKE upper('%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%')\n" . "OR upper(b.code) LIKE upper('%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%') ){SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
示例#2
0
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*)\n\n" . "FROM p_order_status";
     $this->SQL = "SELECT updated_by, to_char(updated_date,'DD-MON-YYYY') AS updated_date, p_order_status_id, code, description \n\n" . "FROM p_order_status {SQL_Where} {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
示例#3
0
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (SELECT display_name, description, decode(is_active,'Y','YA','TIDAK') AS is_active, p_procedure_id \n" . "FROM p_procedure\n" . "WHERE upper(display_name) LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%') cnt";
     $this->SQL = "SELECT display_name, description, decode(is_active,'Y','YA','TIDAK') AS is_active, p_procedure_id \n" . "FROM p_procedure\n" . "WHERE upper(display_name) LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%'  {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
示例#4
0
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*)\n\n" . "FROM title";
     $this->SQL = "SELECT * \n\n" . "FROM title {SQL_Where} {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query(CCBuildSQL($this->SQL, $this->Where, $this->Order));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
     $this->MoveToPage($this->AbsolutePage);
 }
示例#5
0
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*)\n\n" . "FROM (p_role_menu INNER JOIN p_menu ON\n\n" . "p_role_menu.p_menu_id = p_menu.p_menu_id) INNER JOIN p_role ON\n\n" . "p_role_menu.p_role_id = p_role.p_role_id";
     $this->SQL = "SELECT p_role.code AS role_name, p_role_menu.*, p_menu.code AS menu_name \n\n" . "FROM (p_role_menu INNER JOIN p_menu ON\n\n" . "p_role_menu.p_menu_id = p_menu.p_menu_id) INNER JOIN p_role ON\n\n" . "p_role_menu.p_role_id = p_role.p_role_id {SQL_Where} {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (SELECT p_debt_letter_type_id, leter_type, sequnce_no, \n" . "description, to_char(creation_date,'DD-MON-YYYY')as creation_date, created_by, \n" . "to_char(updated_date,'DD-MON-YYYY')as updated_date, updated_by \n" . "FROM p_debt_letter_type\n" . "WHERE upper(leter_type) LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%'\n" . "OR upper(description) LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%') cnt";
     $this->SQL = "SELECT p_debt_letter_type_id, leter_type, sequnce_no, \n" . "description, to_char(creation_date,'DD-MON-YYYY')as creation_date, created_by, \n" . "to_char(updated_date,'DD-MON-YYYY')as updated_date, updated_by \n" . "FROM p_debt_letter_type\n" . "WHERE upper(leter_type) LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%'\n" . "OR upper(description) LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%'  {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
示例#7
0
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (SELECT * FROM p_module WHERE upper(code) LIKE upper('%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%') OR description LIKE upper('%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%')) cnt";
     $this->SQL = "SELECT * FROM p_module WHERE upper(code) LIKE upper('%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%') OR description LIKE upper('%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%') {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (select a.mobile_no as hp,a.*, a.npwd, d.vat_code as nama_ayat\n" . "FROM t_cust_account a\n" . "LEFT JOIN p_vat_type_dtl d ON a.p_vat_type_dtl_id = d.p_vat_type_dtl_id\n" . "\n" . "WHERE upper(a.wp_address_name) like upper('%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%')\n" . "       and upper(a.npwd) like upper('%" . $this->SQLValue($this->wp->GetDBValue("2"), ccsText) . "%')\n" . "       and upper(a.wp_name) like upper('%" . $this->SQLValue($this->wp->GetDBValue("3"), ccsText) . "%')\n" . "       and upper(a.company_name) like upper('%" . $this->SQLValue($this->wp->GetDBValue("4"), ccsText) . "%')\n" . "       and upper(a.company_brand) like upper('%" . $this->SQLValue($this->wp->GetDBValue("5"), ccsText) . "%')) cnt";
     $this->SQL = "select a.mobile_no as hp,a.*, a.npwd, d.vat_code as nama_ayat\n" . "FROM t_cust_account a\n" . "LEFT JOIN p_vat_type_dtl d ON a.p_vat_type_dtl_id = d.p_vat_type_dtl_id\n" . "\n" . "WHERE upper(a.wp_address_name) like upper('%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%')\n" . "       and upper(a.npwd) like upper('%" . $this->SQLValue($this->wp->GetDBValue("2"), ccsText) . "%')\n" . "       and upper(a.wp_name) like upper('%" . $this->SQLValue($this->wp->GetDBValue("3"), ccsText) . "%')\n" . "       and upper(a.company_name) like upper('%" . $this->SQLValue($this->wp->GetDBValue("4"), ccsText) . "%')\n" . "       and upper(a.company_brand) like upper('%" . $this->SQLValue($this->wp->GetDBValue("5"), ccsText) . "%')";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
示例#9
0
function CCDLookUp($field_name, $table_name, $where_condition, &$db)
{
    $sql = "SELECT " . $field_name . ($table_name ? " FROM " . $table_name : "") . ($where_condition ? " WHERE " . $where_condition : "");
    return CCGetDBValue($sql, $db);
}
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (select t_cust_acc_dtl_trans_id, t_cust_account_id, bill_no, service_desc, service_charge, vat_charge, description\n" . "from f_get_cust_acc_dtl_trans(" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . ",'" . $this->SQLValue($this->wp->GetDBValue("2"), ccsText) . "')AS tbl (t_cust_acc_dtl_trans_id)) cnt";
     $this->SQL = "select t_cust_acc_dtl_trans_id, t_cust_account_id, bill_no, service_desc, service_charge, vat_charge, description\n" . "from f_get_cust_acc_dtl_trans(" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . ",'" . $this->SQLValue($this->wp->GetDBValue("2"), ccsText) . "')AS tbl (t_cust_acc_dtl_trans_id)";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (select STATUS_LAPOR , JML\n" . "from \n" . "(\n" . "select 'SUDAH LAPOR TRANSAKSI' as STATUS_LAPOR , count(*) as JML\n" . "from t_cust_account a\n" . "where exists (select 1 \n" . "  from t_cust_acc_dtl_trans x\n" . "  where x.t_cust_account_id = a.t_cust_account_id\n" . "\t\tand exists (select 1 from p_finance_period y where (trunc(x.trans_date) between trunc(y.start_date) and y.end_date) and y.p_finance_period_id = " . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . " --:periode_id dari pilihan\n" . "\t\t\t\t   ) \n" . "  )\n" . "UNION ALL\n" . "select 'BELUM LAPOR TRANSAKSI' as STATUS_LAPOR , count(*) as JML\n" . "from t_cust_account a\n" . "where not exists (select 1 \n" . "  from t_cust_acc_dtl_trans x\n" . "  where x.t_cust_account_id = a.t_cust_account_id\n" . "\t\tand exists (select 1 from p_finance_period y where (trunc(x.trans_date) between trunc(y.start_date) and y.end_date) and y.p_finance_period_id = " . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . " --:periode_id dari pilihan\n" . "\t\t\t\t   )\n" . "  )\n" . ")\n" . ") cnt";
     $this->SQL = "select STATUS_LAPOR , JML\n" . "from \n" . "(\n" . "select 'SUDAH LAPOR TRANSAKSI' as STATUS_LAPOR , count(*) as JML\n" . "from t_cust_account a\n" . "where exists (select 1 \n" . "  from t_cust_acc_dtl_trans x\n" . "  where x.t_cust_account_id = a.t_cust_account_id\n" . "\t\tand exists (select 1 from p_finance_period y where (trunc(x.trans_date) between trunc(y.start_date) and y.end_date) and y.p_finance_period_id = " . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . " --:periode_id dari pilihan\n" . "\t\t\t\t   ) \n" . "  )\n" . "UNION ALL\n" . "select 'BELUM LAPOR TRANSAKSI' as STATUS_LAPOR , count(*) as JML\n" . "from t_cust_account a\n" . "where not exists (select 1 \n" . "  from t_cust_acc_dtl_trans x\n" . "  where x.t_cust_account_id = a.t_cust_account_id\n" . "\t\tand exists (select 1 from p_finance_period y where (trunc(x.trans_date) between trunc(y.start_date) and y.end_date) and y.p_finance_period_id = " . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . " --:periode_id dari pilihan\n" . "\t\t\t\t   )\n" . "  )\n" . ")\n" . "";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
示例#12
0
 function Open()
 {
     global $Tpl;
     global $terms;
     global $savedresults;
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
     $this->CountSQL = "SELECT COUNT(*)  " . "FROM items";
     $this->SQL = "SELECT *  " . "FROM items";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect");
     $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     $this->query(CCBuildSQL($this->SQL, $this->Where, $this->Order));
     //print CCBuildSQL($this->SQL, $this->Where, $this->Order);
     if ($terms && !$savedresults || $terms && $_GET["refreshresults"]) {
         $db = new clsDBNetConnect();
         $db->query(CCBuildSQL($this->SQL, $this->Where, $this->Order));
         $resultstring = "";
         while ($db->next_record()) {
             $resultstring .= $db->f("ItemNum") . " ::!:!: " . $db->f("title") . " :!:!:: ";
         }
         $db->query("update search_history set `results` = '" . mysql_escape_string($resultstring) . "' where `id` = '" . $_GET["search_id"] . "'");
     }
     $Tpl->SetVar("Results", $this->nf());
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect");
     $this->MoveToPage($this->AbsolutePage);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (select p_account_status_id, code, description \n" . "from p_account_status\n" . "where p_account_status_id not in (1,5) and\n" . "upper(code) like '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%'\n" . ") cnt";
     $this->SQL = "select p_account_status_id, code, description \n" . "from p_account_status\n" . "where p_account_status_id not in (1,5) and\n" . "upper(code) like '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%'\n" . "";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (SELECT a.no_kohir,d.wp_name, a.t_vat_setllement_id, a.t_customer_order_id, \n" . "a.settlement_date, a.p_finance_period_id, \n" . "a.t_cust_account_id, a.npwd, a.total_trans_amount, a.total_penalty_amount,\n" . "a.total_vat_amount, b.code as finance_period_code, c.order_no, c.p_rqst_type_id, e.code as rqst_type_code, d.p_vat_type_id\n" . "FROM t_vat_setllement a, p_finance_period b, t_customer_order c, t_cust_account d, p_rqst_type e\n" . "WHERE a.p_finance_period_id = b.p_finance_period_id AND\n" . "a.t_customer_order_id = c.t_customer_order_id AND\n" . "a.t_cust_account_id = d.t_cust_account_id AND\n" . "c.p_rqst_type_id = e.p_rqst_type_id AND\n" . "a.t_customer_order_id = " . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . ") cnt";
     $this->SQL = "SELECT a.no_kohir,d.wp_name, a.t_vat_setllement_id, a.t_customer_order_id, \n" . "a.settlement_date, a.p_finance_period_id, \n" . "a.t_cust_account_id, a.npwd, a.total_trans_amount, a.total_penalty_amount,\n" . "a.total_vat_amount, b.code as finance_period_code, c.order_no, c.p_rqst_type_id, e.code as rqst_type_code, d.p_vat_type_id\n" . "FROM t_vat_setllement a, p_finance_period b, t_customer_order c, t_cust_account d, p_rqst_type e\n" . "WHERE a.p_finance_period_id = b.p_finance_period_id AND\n" . "a.t_customer_order_id = c.t_customer_order_id AND\n" . "a.t_cust_account_id = d.t_cust_account_id AND\n" . "c.p_rqst_type_id = e.p_rqst_type_id AND\n" . "a.t_customer_order_id = " . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . "";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
示例#15
0
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (SELECT to_char(a.updated_date,'DD-MON-YYYY') AS updated_date, b.vat_code, a.p_vat_penalty_id, \n" . "a.month_qty,\n" . "a.penalty_pct,\n" . "a.penalty_amt,\n" . "a.description,\n" . "a.updated_by\n" . "FROM p_vat_penalty a INNER JOIN p_vat_type b ON\n" . "a.p_vat_type_id = b.p_vat_type_id\n" . "WHERE upper(b.vat_code) LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%'\n" . "OR upper(a.description) LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%') cnt";
     $this->SQL = "SELECT to_char(a.updated_date,'DD-MON-YYYY') AS updated_date, b.vat_code, a.p_vat_penalty_id, \n" . "a.month_qty,\n" . "a.penalty_pct,\n" . "a.penalty_amt,\n" . "a.description,\n" . "a.updated_by\n" . "FROM p_vat_penalty a INNER JOIN p_vat_type b ON\n" . "a.p_vat_type_id = b.p_vat_type_id\n" . "WHERE upper(b.vat_code) LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%'\n" . "OR upper(a.description) LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%'  {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
示例#16
0
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (SELECT a.p_district_id, a.code, a.district_name, a.p_state_id, a.listing_no, \n" . "to_char(a.creation_date,'DD-MON-YYYY')as creation_date, a.description, a.created_by, to_char(a.updated_date,'DD-MON-YYYY')as updated_date, a.updated_by\n" . "FROM p_district a, p_state b\n" . "WHERE a.p_state_id = b.p_state_id AND\n" . "a.p_state_id = " . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . " AND\n" . "(upper(a.code) like '%" . $this->SQLValue($this->wp->GetDBValue("2"), ccsText) . "%' OR\n" . "upper(a.district_name) like '%" . $this->SQLValue($this->wp->GetDBValue("2"), ccsText) . "%')) cnt";
     $this->SQL = "SELECT a.p_district_id, a.code, a.district_name, a.p_state_id, a.listing_no, \n" . "to_char(a.creation_date,'DD-MON-YYYY')as creation_date, a.description, a.created_by, to_char(a.updated_date,'DD-MON-YYYY')as updated_date, a.updated_by\n" . "FROM p_district a, p_state b\n" . "WHERE a.p_state_id = b.p_state_id AND\n" . "a.p_state_id = " . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . " AND\n" . "(upper(a.code) like '%" . $this->SQLValue($this->wp->GetDBValue("2"), ccsText) . "%' OR\n" . "upper(a.district_name) like '%" . $this->SQLValue($this->wp->GetDBValue("2"), ccsText) . "%') {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (SELECT p_settlement_due_date_id, a.p_vat_type_id AS a_p_vat_type_id, due_in_day, debt_letter1_in_day, debt_letter2_in_day, debt_letter3_in_day,\n" . "a.description AS a_description, a.updated_by AS a_updated_by, vat_code, to_char(valid_from, 'DD-MON-YYYY') AS valid_from,\n" . "to_char(valid_to, 'DD-MON-YYYY') AS valid_to, to_char(a.updated_date, 'DD-MON-YYYY') AS a_updated_date \n" . "FROM p_settlement_due_date a INNER JOIN p_vat_type b ON\n" . "a.p_vat_type_id = b.p_vat_type_id\n" . "WHERE ( vat_code LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%'\n" . "OR a.description LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%' )) cnt";
     $this->SQL = "SELECT p_settlement_due_date_id, a.p_vat_type_id AS a_p_vat_type_id, due_in_day, debt_letter1_in_day, debt_letter2_in_day, debt_letter3_in_day,\n" . "a.description AS a_description, a.updated_by AS a_updated_by, vat_code, to_char(valid_from, 'DD-MON-YYYY') AS valid_from,\n" . "to_char(valid_to, 'DD-MON-YYYY') AS valid_to, to_char(a.updated_date, 'DD-MON-YYYY') AS a_updated_date \n" . "FROM p_settlement_due_date a INNER JOIN p_vat_type b ON\n" . "a.p_vat_type_id = b.p_vat_type_id\n" . "WHERE ( vat_code LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%'\n" . "OR a.description LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%' )  {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (SELECT\n" . "\tx.ppat_name,\n" . "\t\tinbox.*, to_char(\n" . "\t\tinbox.creation_date,\n" . "\t\t'yyyy-mm-dd HH24:MI:SS AM'\n" . "\t) AS creation_date,\n" . "\tto_char(\n" . "\t\tinbox.creation_date,\n" . "\t\t'HH24:MI:SS PM'\n" . "\t) AS creation_time,\n" . "\tto_char(\n" . "\t\tinbox.update_date,\n" . "\t\t'yyyy-mm-dd'\n" . "\t) AS update_date,\n" . "\tmtype.message_type\n" . "FROM\n" . "\tt_message_inbox_bphtb inbox\n" . "LEFT JOIN sikp.p_message_type mtype ON mtype.p_message_type_id = inbox.p_message_type_id\n" . "LEFT JOIN t_ppat x on x.t_ppat_id = inbox.t_ppat_id\n" . "where p_app_role_id_to = 27) cnt";
     $this->SQL = "SELECT\n" . "\tx.ppat_name,\n" . "\t\tinbox.*, to_char(\n" . "\t\tinbox.creation_date,\n" . "\t\t'yyyy-mm-dd HH24:MI:SS AM'\n" . "\t) AS creation_date,\n" . "\tto_char(\n" . "\t\tinbox.creation_date,\n" . "\t\t'HH24:MI:SS PM'\n" . "\t) AS creation_time,\n" . "\tto_char(\n" . "\t\tinbox.update_date,\n" . "\t\t'yyyy-mm-dd'\n" . "\t) AS update_date,\n" . "\tmtype.message_type\n" . "FROM\n" . "\tt_message_inbox_bphtb inbox\n" . "LEFT JOIN sikp.p_message_type mtype ON mtype.p_message_type_id = inbox.p_message_type_id\n" . "LEFT JOIN t_ppat x on x.t_ppat_id = inbox.t_ppat_id\n" . "where p_app_role_id_to = 27 {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (select * from p_survey_question \n" . "WHERE p_survey_type_id=2) cnt";
     $this->SQL = "select * from p_survey_question \n" . "WHERE p_survey_type_id=2 {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
示例#20
0
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (SELECT a.*, b.vat_code\n" . "FROM sikp.p_vat_type_group a\n" . "LEFT JOIN sikp.p_vat_type b \n" . "ON a.p_vat_type_id = b.p_vat_type_id\n" . "WHERE a.p_vat_group_id = " . $this->SQLValue($this->wp->GetDBValue("2"), ccsFloat) . "\n" . "AND upper(b.vat_code) LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%') cnt";
     $this->SQL = "SELECT a.*, b.vat_code\n" . "FROM sikp.p_vat_type_group a\n" . "LEFT JOIN sikp.p_vat_type b \n" . "ON a.p_vat_type_id = b.p_vat_type_id\n" . "WHERE a.p_vat_group_id = " . $this->SQLValue($this->wp->GetDBValue("2"), ccsFloat) . "\n" . "AND upper(b.vat_code) LIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%'  {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM ((SELECT t_revenue_target_id, p_year_period_id, p_vat_type_id, vat_code, year_code, target_amount, realisasi_amt\n" . "FROM v_revenue_target_vs_realisasi\n" . "WHERE p_year_period_id = " . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . "\n" . "and p_vat_group_id=" . $this->SQLValue($this->wp->GetDBValue("2"), ccsInteger) . "\n" . "ORDER BY p_vat_type_id)\n" . "UNION\n" . "(SELECT\n" . "\t'999',\n" . "\t" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . "\n" . "\t,\n" . "\tMAX (p_vat_type_id),\n" . "\t'DENDA',\n" . "\t'',\n" . "\t0,\n" . "\tSUM (round(jml_sd_hari_ini))\n" . "FROM\n" . "\tsikp.f_rep_lap_harian_bdhr_baru (" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . ")\n" . "where nomor_ayat IN('140701','140702','140703','140707')\n" . "and p_vat_group_id = " . $this->SQLValue($this->wp->GetDBValue("2"), ccsInteger) . ")) cnt";
     $this->SQL = "(SELECT t_revenue_target_id, p_year_period_id, p_vat_type_id, vat_code, year_code, target_amount, realisasi_amt\n" . "FROM v_revenue_target_vs_realisasi\n" . "WHERE p_year_period_id = " . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . "\n" . "and p_vat_group_id=" . $this->SQLValue($this->wp->GetDBValue("2"), ccsInteger) . "\n" . "ORDER BY p_vat_type_id)\n" . "UNION\n" . "(SELECT\n" . "\t'999',\n" . "\t" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . "\n" . "\t,\n" . "\tMAX (p_vat_type_id),\n" . "\t'DENDA',\n" . "\t'',\n" . "\t0,\n" . "\tSUM (round(jml_sd_hari_ini))\n" . "FROM\n" . "\tsikp.f_rep_lap_harian_bdhr_baru (" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . ")\n" . "where nomor_ayat IN('140701','140702','140703','140707')\n" . "and p_vat_group_id = " . $this->SQLValue($this->wp->GetDBValue("2"), ccsInteger) . ")";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (select left(no_spt,length(no_spt)-3) as no_spt_2,\n" . "left(no_kohir,length(no_kohir)-3) as no_kohir_2,\n" . "left(no_bukti_set,length(no_bukti_set)-3) as no_bukti_set_2,\n" . "* from tuuset98 where npwpd_set = '" . $this->SQLValue($this->wp->GetDBValue("2"), ccsText) . "') cnt";
     $this->SQL = "select left(no_spt,length(no_spt)-3) as no_spt_2,\n" . "left(no_kohir,length(no_kohir)-3) as no_kohir_2,\n" . "left(no_bukti_set,length(no_bukti_set)-3) as no_bukti_set_2,\n" . "* from tuuset98 where npwpd_set = '" . $this->SQLValue($this->wp->GetDBValue("2"), ccsText) . "' {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (SELECT a.t_cust_account_id, a.t_customer_id, a.npwd, a.p_vat_type_id, a.t_vat_registration_id, a.t_customer_order_id,\n" . "a.registration_date, a.company_name, a.company_brand, a.address_name, a.address_no, a.address_rt, a.address_rw, a.p_region_id_kelurahan, a.p_region_id_kecamatan, a.p_region_id, a.phone_no, a.mobile_no, a.fax_no, a.zip_code, a.creation_date, a.created_by, a.updated_date, a.updated_by,\n" . "b.vat_code,\n" . "c.registration_date AS vat_registration_date,\n" . "d.order_no, d. order_date,\n" . "e.region_name AS nama_kota,\n" . "f.region_name AS nama_kecamatan,\n" . "g.region_name AS nama_kelurahan\n" . "\n" . "FROM t_cust_acc_masa_jab_detail a\n" . "LEFT JOIN p_vat_type b ON a.p_vat_type_id = b.p_vat_type_id\n" . "LEFT JOIN t_vat_registration c ON a.t_vat_registration_id = c.t_vat_registration_id\n" . "LEFT JOIN t_customer_order d ON a.t_customer_order_id = d.t_customer_order_id\n" . "LEFT JOIN p_region e ON a.p_region_id = e.p_region_id\n" . "LEFT JOIN p_region f ON a.p_region_id_kecamatan = f.p_region_id\n" . "LEFT JOIN p_region g ON a.p_region_id_kelurahan = g.p_region_id\n" . "\n" . "WHERE (upper(a.company_name) ILIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%' OR upper(a.npwd) ILIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%')\n" . "AND a.t_cust_acc_masa_jab_id = " . $this->SQLValue($this->wp->GetDBValue("2"), ccsInteger) . ") cnt";
     $this->SQL = "SELECT a.t_cust_account_id, a.t_customer_id, a.npwd, a.p_vat_type_id, a.t_vat_registration_id, a.t_customer_order_id,\n" . "a.registration_date, a.company_name, a.company_brand, a.address_name, a.address_no, a.address_rt, a.address_rw, a.p_region_id_kelurahan, a.p_region_id_kecamatan, a.p_region_id, a.phone_no, a.mobile_no, a.fax_no, a.zip_code, a.creation_date, a.created_by, a.updated_date, a.updated_by,\n" . "b.vat_code,\n" . "c.registration_date AS vat_registration_date,\n" . "d.order_no, d. order_date,\n" . "e.region_name AS nama_kota,\n" . "f.region_name AS nama_kecamatan,\n" . "g.region_name AS nama_kelurahan\n" . "\n" . "FROM t_cust_acc_masa_jab_detail a\n" . "LEFT JOIN p_vat_type b ON a.p_vat_type_id = b.p_vat_type_id\n" . "LEFT JOIN t_vat_registration c ON a.t_vat_registration_id = c.t_vat_registration_id\n" . "LEFT JOIN t_customer_order d ON a.t_customer_order_id = d.t_customer_order_id\n" . "LEFT JOIN p_region e ON a.p_region_id = e.p_region_id\n" . "LEFT JOIN p_region f ON a.p_region_id_kecamatan = f.p_region_id\n" . "LEFT JOIN p_region g ON a.p_region_id_kelurahan = g.p_region_id\n" . "\n" . "WHERE (upper(a.company_name) ILIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%' OR upper(a.npwd) ILIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%')\n" . "AND a.t_cust_acc_masa_jab_id = " . $this->SQLValue($this->wp->GetDBValue("2"), ccsInteger) . " {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (SELECT x.receipt_no,\n" . "x.p_finance_period_id,\n" . "x.description,\n" . "f_per.*\n" . "FROM p_finance_period f_per,\n" . "(select sett.p_finance_period_id,\n" . "receipt_no,sett_type.description\n" . "\t\t\t\t\t\tfrom\n" . "\t\t\t\t\t\t\tt_vat_setllement sett,\n" . "\t\t\t\t\t\t\tp_settlement_type sett_type,\n" . "t_payment_receipt rec\n" . "\t\t\t\t\t\t\tWHERE sett.t_cust_account_id = " . $this->SQLValue($this->wp->GetDBValue("2"), ccsText) . "\n" . "\t\t\t\t\t\t\tand sett.p_settlement_type_id = sett_type.p_settlement_type_id\n" . "\t\t\t\t\t\t\tand sett.t_vat_setllement_id = rec.t_vat_setllement_id (+)\n" . "\t\t\t\t\t\t\tand sett.p_settlement_type_id <> 7) as x\n" . "\t\t\t\t\twhere f_per.p_finance_period_id = x.p_finance_period_id(+)\n" . "\t\t\t\t\tand f_per.end_date < (select start_date from p_finance_period where p_finance_period_id = " . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . ")\n" . "\t\t\t\t\tand f_per.start_date >= '01-01-2013'\n" . "\t\t\t\t\tand (receipt_no is null or receipt_no ='')\n" . "\t\t\t\t\tand f_per.start_date >= '" . $this->SQLValue($this->wp->GetDBValue("3"), ccsText) . "') cnt";
     $this->SQL = "SELECT x.receipt_no,\n" . "x.p_finance_period_id,\n" . "x.description,\n" . "f_per.*\n" . "FROM p_finance_period f_per,\n" . "(select sett.p_finance_period_id,\n" . "receipt_no,sett_type.description\n" . "\t\t\t\t\t\tfrom\n" . "\t\t\t\t\t\t\tt_vat_setllement sett,\n" . "\t\t\t\t\t\t\tp_settlement_type sett_type,\n" . "t_payment_receipt rec\n" . "\t\t\t\t\t\t\tWHERE sett.t_cust_account_id = " . $this->SQLValue($this->wp->GetDBValue("2"), ccsText) . "\n" . "\t\t\t\t\t\t\tand sett.p_settlement_type_id = sett_type.p_settlement_type_id\n" . "\t\t\t\t\t\t\tand sett.t_vat_setllement_id = rec.t_vat_setllement_id (+)\n" . "\t\t\t\t\t\t\tand sett.p_settlement_type_id <> 7) as x\n" . "\t\t\t\t\twhere f_per.p_finance_period_id = x.p_finance_period_id(+)\n" . "\t\t\t\t\tand f_per.end_date < (select start_date from p_finance_period where p_finance_period_id = " . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . ")\n" . "\t\t\t\t\tand f_per.start_date >= '01-01-2013'\n" . "\t\t\t\t\tand (receipt_no is null or receipt_no ='')\n" . "\t\t\t\t\tand f_per.start_date >= '" . $this->SQLValue($this->wp->GetDBValue("3"), ccsText) . "'\n" . "\t\t\t\t\t {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (select to_char(i,'dd') as tanggal,nvl(realisasi_harian,0) as realisasi \n" . "from (select i::date from generate_series((select start_date from p_finance_period where p_finance_period_id=" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . "), \n" . "  (select end_date from p_finance_period where p_finance_period_id=" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . "), '1 day'::interval) i) as hari\n" . "left join \n" . "\t(select \n" . "\t\ttrunc(b.payment_date)as tanggal_bayar,\n" . "\t\tcount(b.payment_amount) as realisasi_harian \n" . "\t\tfrom t_vat_setllement a\n" . "\t\tleft join t_payment_receipt b on a.t_vat_setllement_id=b.t_vat_setllement_id\n" . "\t\twhere a.p_vat_type_dtl_id in (select p_vat_type_dtl_id from p_vat_type_dtl where p_vat_type_id=" . $this->SQLValue($this->wp->GetDBValue("2"), ccsInteger) . ")\n" . "\t\tand b.t_vat_setllement_id is not null\n" . "\t\tand b.payment_date \n" . "\t\t\tBETWEEN \n" . "\t\t\t\t(select start_date from p_finance_period where p_finance_period_id=" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . ")\n" . "\t\t\tand \n" . "\t\t\t\t(select end_date from p_finance_period where p_finance_period_id=" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . ")\n" . "\t\tGROUP BY tanggal_bayar\n" . "\t\tORDER BY tanggal_bayar) pembayaran\n" . "\tON pembayaran.tanggal_bayar=hari.i) cnt";
     $this->SQL = "select to_char(i,'dd') as tanggal,nvl(realisasi_harian,0) as realisasi \n" . "from (select i::date from generate_series((select start_date from p_finance_period where p_finance_period_id=" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . "), \n" . "  (select end_date from p_finance_period where p_finance_period_id=" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . "), '1 day'::interval) i) as hari\n" . "left join \n" . "\t(select \n" . "\t\ttrunc(b.payment_date)as tanggal_bayar,\n" . "\t\tcount(b.payment_amount) as realisasi_harian \n" . "\t\tfrom t_vat_setllement a\n" . "\t\tleft join t_payment_receipt b on a.t_vat_setllement_id=b.t_vat_setllement_id\n" . "\t\twhere a.p_vat_type_dtl_id in (select p_vat_type_dtl_id from p_vat_type_dtl where p_vat_type_id=" . $this->SQLValue($this->wp->GetDBValue("2"), ccsInteger) . ")\n" . "\t\tand b.t_vat_setllement_id is not null\n" . "\t\tand b.payment_date \n" . "\t\t\tBETWEEN \n" . "\t\t\t\t(select start_date from p_finance_period where p_finance_period_id=" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . ")\n" . "\t\t\tand \n" . "\t\t\t\t(select end_date from p_finance_period where p_finance_period_id=" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . ")\n" . "\t\tGROUP BY tanggal_bayar\n" . "\t\tORDER BY tanggal_bayar) pembayaran\n" . "\tON pembayaran.tanggal_bayar=hari.i";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
示例#26
0
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (SELECT a.t_bphtb_registration_id, a.payment_vat_amount,\n" . "b.registration_no, b.wp_name, b.njop_pbb\n" . "FROM t_payment_receipt_bphtb AS a\n" . "LEFT JOIN t_bphtb_registration AS b ON a.t_bphtb_registration_id = b.t_bphtb_registration_id\n" . "\n" . "WHERE (b.registration_no ILIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%' OR\n" . "b.njop_pbb ILIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%' OR\n" . "b.wp_name ILIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%'\n" . ") ) cnt";
     $this->SQL = "SELECT a.t_bphtb_registration_id, a.payment_vat_amount,\n" . "b.registration_no, b.wp_name, b.njop_pbb\n" . "FROM t_payment_receipt_bphtb AS a\n" . "LEFT JOIN t_bphtb_registration AS b ON a.t_bphtb_registration_id = b.t_bphtb_registration_id\n" . "\n" . "WHERE (b.registration_no ILIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%' OR\n" . "b.njop_pbb ILIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%' OR\n" . "b.wp_name ILIKE '%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%'\n" . ") ";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*)\n\n" . "FROM t_cust_order_legal_doc";
     $this->SQL = "SELECT * \n\n" . "FROM t_cust_order_legal_doc {SQL_Where} {SQL_OrderBy}";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (select * from f_status_sudah_transaksi(" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . ")) cnt";
     $this->SQL = "select * from f_status_sudah_transaksi(" . $this->SQLValue($this->wp->GetDBValue("1"), ccsFloat) . ")";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }
示例#29
0
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
     $this->CountSQL = "SELECT COUNT(*)  " . "FROM feedback";
     $this->SQL = "SELECT *  " . "FROM feedback";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect");
     $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     $this->query(CCBuildSQL($this->SQL, $this->Where, $this->Order));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect");
     $this->MoveToPage($this->AbsolutePage);
 }
 function Open()
 {
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
     $this->CountSQL = "SELECT COUNT(*) FROM (SELECT a.t_cust_account_id, a.npwd, a.wp_name, a.p_vat_type_id,  a.p_account_status_id,\n" . "b.vat_code AS jenis_pajak, c.code AS status_wp, a.last_satatus_date\n" . "FROM t_cust_account AS a\n" . "LEFT JOIN p_vat_type AS b ON a.p_vat_type_id = b.p_vat_type_id\n" . "LEFT JOIN p_account_status AS c ON a.p_account_status_id = c.p_account_status_id\n" . "WHERE\n" . "( upper(a.wp_name) LIKE upper('%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%') OR \n" . "  upper(a.npwd) LIKE upper('%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%')\n" . ")\n" . ") cnt";
     $this->SQL = "SELECT a.t_cust_account_id, a.npwd, a.wp_name, a.p_vat_type_id,  a.p_account_status_id,\n" . "b.vat_code AS jenis_pajak, c.code AS status_wp, a.last_satatus_date\n" . "FROM t_cust_account AS a\n" . "LEFT JOIN p_vat_type AS b ON a.p_vat_type_id = b.p_vat_type_id\n" . "LEFT JOIN p_account_status AS c ON a.p_account_status_id = c.p_account_status_id\n" . "WHERE\n" . "( upper(a.wp_name) LIKE upper('%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%') OR \n" . "  upper(a.npwd) LIKE upper('%" . $this->SQLValue($this->wp->GetDBValue("1"), ccsText) . "%')\n" . ")\n" . "";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
     if ($this->CountSQL) {
         $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
     } else {
         $this->RecordsCount = "CCS not counted";
     }
     $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
 }