Commit c04559d3 authored by vkadam's avatar vkadam

Select sitecode from finparam, split manually and generate single coted comma sepreted string.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98618 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6f066a5a
...@@ -175,7 +175,7 @@ public class ConfVouchChPartnerSch implements Schedule ...@@ -175,7 +175,7 @@ public class ConfVouchChPartnerSch implements Schedule
PreparedStatement pstmt=null; PreparedStatement pstmt=null;
ResultSet rs=null; ResultSet rs=null;
String sql=""; String sql="",deftExcSitePORCPV="",tempSiteCode="";
String tranId="",retString=""; String tranId="",retString="";
int cnt=0; int cnt=0;
...@@ -203,13 +203,47 @@ public class ConfVouchChPartnerSch implements Schedule ...@@ -203,13 +203,47 @@ public class ConfVouchChPartnerSch implements Schedule
{ {
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;
sql = "SELECT case when var_value is null then ' ' else var_value END as var_value"
+ " from finparm where var_name='DEFT_EXC_SITE_PORCPV' and prd_code='999999'";
pstmt=conn.prepareStatement(sql);
rs=pstmt.executeQuery();
if(rs.next())
{
deftExcSitePORCPV=rs.getString("var_value");
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
System.out.println("deftExcSitePORCPV :- ["+deftExcSitePORCPV+"]");
String tempArray[]=deftExcSitePORCPV.split(",");
System.out.println("tempArray[].length :-["+tempArray.length+"]");
if(tempArray.length>0)
{
for(int itrArr=0;itrArr<tempArray.length;itrArr++)
{
tempSiteCode=tempSiteCode+"'"+tempArray[itrArr]+"',";
}
System.out.println("tempSiteCode before sunStr:- ["+tempSiteCode+"]");
tempSiteCode=tempSiteCode.substring(0, tempSiteCode.length()-1);
}
System.out.println("tempSiteCode New:- ["+tempSiteCode+"]");
sql="SELECT DISTINCT A.TRAN_ID FROM VOUCHER A,VOUCHRCP B,PORCP C,SUPPLIER D" sql="SELECT DISTINCT A.TRAN_ID FROM VOUCHER A,VOUCHRCP B,PORCP C,SUPPLIER D"
+ " WHERE A.TRAN_ID=B.TRAN_ID AND B.PRCP_ID=C.TRAN_ID" + " WHERE A.TRAN_ID=B.TRAN_ID AND B.PRCP_ID=C.TRAN_ID"
+ " AND A.TRAN_DATE >= ?" + " AND A.TRAN_DATE >= ?"
+ " AND A.SUPP_CODE=D.SUPP_CODE" + " AND A.SUPP_CODE=D.SUPP_CODE"
+ " AND A.SITE_CODE IN (select site_code from site where site_code__cons LIKE '%__600')" + " AND A.SITE_CODE IN (select site_code from site where site_code__cons LIKE '%__600')"
+ " AND A.SITE_CODE NOT IN(SELECT case when var_value is null then ' ' else var_value END" + " AND A.SITE_CODE NOT IN( "+ tempSiteCode +")"
+ " from finparm where var_name='DEFT_EXC_SITE_PORCPV' and prd_code='999999')"
+ " AND CASE WHEN A.CONFIRMED IS NULL THEN 'N' ELSE A.CONFIRMED END='N'" + " AND CASE WHEN A.CONFIRMED IS NULL THEN 'N' ELSE A.CONFIRMED END='N'"
+ " AND( ( C.reciept_type ='F' and C.tran_ser='P-RCP' ) or ( C.ret_opt ='C' and C.tran_ser='P-RET') )" + " AND( ( C.reciept_type ='F' and C.tran_ser='P-RCP' ) or ( C.ret_opt ='C' and C.tran_ser='P-RET') )"
+ " AND D.CHANNEL_PARTNER='Y'"; + " AND D.CHANNEL_PARTNER='Y'";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment