public DataTable selectAllFmtp1(String year, StatusPay spay) { DataTable dt = new DataTable(); String wherestatuspay = ""; if (spay == StatusPay.waitappv) { wherestatuspay = " and ed." + expnC.status_appv + "='1'"; } else if (spay == StatusPay.appv) { wherestatuspay = " and ed." + expnC.status_appv + "='2'"; } else if (spay == StatusPay.all) { wherestatuspay = ""; } String sql = "select fmtp.f_method_payment_name_t, itmts.item_type_sub_name_t, sum(edd.amount) as amt " + "from t_expenses_draw_detail edd " + "inner join t_expenses_draw ed on edd.expenses_draw_id = ed.expenses_draw_id " + "inner join b_items itm on edd.item_id = itm.item_id " + "inner join b_items_type_sub itmts on itm.item_type_sub_id = itmts.item_type_sub_id " + "inner join f_method_payment fmtp on itm.f_method_payment_id = fmtp.f_method_payment_id " + "Where edd." + expnC.active + " ='1' and ed." + expnC.year + "='" + year + "' " + wherestatuspay + " " + "group by itmts.item_type_sub_name_t, fmtp.f_method_payment_name_t "; dt = conn.selectData(conn.conn, sql); return(dt); }
public DataSet selectAllFmtp(String pay_amount, StatusPay spay) { DataSet ds = new DataSet(); String wherestatuspay = ""; if (spay == StatusPay.waitappv) { wherestatuspay = " and ed." + ecc.expense_clear_cash_date + "='1'"; } else if (spay == StatusPay.appv) { wherestatuspay = " and ed." + ecc.expense_clear_cash_date + "='2'"; } else if (spay == StatusPay.all) { wherestatuspay = ""; } String sql = "select fmtp.f_method_payment_name_t, itmts.item_type_sub_name_t, sum(edd.item_name_t) as amt " + "from t_expenses_draw_detail edd " + "inner join t_expenses_draw ed on edd.expense_clear_cash_id = ed.expense_clear_cash_id " + "inner join b_items itm on edd.item_id = itm.item_id " + "inner join b_items_type_sub itmts on itm.item_type_sub_id = itmts.item_type_sub_id " + "inner join f_method_payment fmtp on itm.f_method_payment_id = fmtp.f_method_payment_id " + "Where edd." + ecc.active + " ='1' and ed." + ecc.pay_amount + "='" + pay_amount + "' " + wherestatuspay + " " + "group by itmts.item_type_sub_name_t, fmtp.f_method_payment_name_t "; ds = conn.selectDataDS(conn.conn, sql); return(ds); }
public DataTable selectToPayAll1(String year, StatusPay spay, StatusPayType spaytype) { DataTable dt = new DataTable(); String wherestatuspay = "", wherestatuspaytype = "", wherestatuspage = ""; if (spay == StatusPay.waitappv) { wherestatuspay = " and " + expnC.status_appv + " in ('1','0') and " + expnC.status_pay + "='1'"; } else if (spay == StatusPay.appv) { wherestatuspay = " and " + expnC.status_appv + "='2' and " + expnC.status_pay + "='1'"; } else if (spay == StatusPay.all) { wherestatuspay = ""; } if (spaytype == StatusPayType.Cash) { wherestatuspaytype = " and " + expnC.status_pay_type + " ='1' "; } else if (spaytype == StatusPayType.Cheque) { wherestatuspaytype = " and " + expnC.status_pay_type + " ='2' "; } else if (spaytype == StatusPayType.all) { wherestatuspaytype = " and " + expnC.status_pay_type + " in ('1','2') "; } wherestatuspage = " and " + expnC.status_page + "='1' "; String sql = "select expC." + expnC.expenses_draw_id + "," + expnC.expenses_draw_code + "," + expnC.desc1 + "," + expnC.remark + "," + expnC.amount + "," + expnC.status_appv + "," + expnC.status_pay_type + "," + expnC.status_pay + " " + "From " + expnC.table + " expC " + " " + "Where expC." + expnC.active + " ='1' and " + expnC.year + "='" + year + "' " + wherestatuspay + wherestatuspaytype + wherestatuspage; dt = conn.selectData(conn.conn, sql); return(dt); }