Commit 2d56e815 authored by msharma's avatar msharma

getdata for S-INV IN SINGLE SQL


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92456 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bc642ef3
...@@ -317,7 +317,9 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -317,7 +317,9 @@ Put a validation chq amount in filter and total of details matches in case heade
// + "ORDER BY B.CHEQUE_NO "; // + "ORDER BY B.CHEQUE_NO ";
// 20/07/12 manoharan invoice amendment consideration removed // 20/07/12 manoharan invoice amendment consideration removed
/*//Manoj dtd 28/12/2012 Not Required
sql = "SELECT A.INVOICE_ID,D.TRAN_SER,A.TRAN_DATE,D.TOT_AMT - D.ADJ_AMT,C.CUST_NAME," sql = "SELECT A.INVOICE_ID,D.TRAN_SER,A.TRAN_DATE,D.TOT_AMT - D.ADJ_AMT,C.CUST_NAME,"
+ "B.BANK_CODE,B.CHEQUE_DATE,E.REF_NO AS CHEQUE_NO,B.CHQ_AMOUNT,A.CUST_CODE,D.TOT_AMT " //added by rajesh k to get cust_code + "B.BANK_CODE,B.CHEQUE_DATE,E.REF_NO AS CHEQUE_NO,B.CHQ_AMOUNT,A.CUST_CODE,D.TOT_AMT " //added by rajesh k to get cust_code
+ "FROM INVOICE A,SORDER B ,CUSTOMER C, RECEIVABLES D, INVOICE_AMENDMENT E " + "FROM INVOICE A,SORDER B ,CUSTOMER C, RECEIVABLES D, INVOICE_AMENDMENT E "
+ "WHERE A.SALE_ORDER = B.SALE_ORDER " + "WHERE A.SALE_ORDER = B.SALE_ORDER "
...@@ -372,7 +374,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -372,7 +374,7 @@ Put a validation chq amount in filter and total of details matches in case heade
//+ "AND I.REF_NO = (select E.REF_NO from invoice_amendment e where e.invoice_id = a.invoice_id and e.status = 'S' and e.confirmed = 'Y') " // Commented by manoj dtd 21/12/2012 to remove join with invoice amendment //+ "AND I.REF_NO = (select E.REF_NO from invoice_amendment e where e.invoice_id = a.invoice_id and e.status = 'S' and e.confirmed = 'Y') " // Commented by manoj dtd 21/12/2012 to remove join with invoice amendment
+" ) " +" ) "
*/ */
+ "ORDER BY A.CUST_CODE "; /*+ "ORDER BY A.CUST_CODE ";
//this.fw.write("getData SQL ..."+ sql + "\n"); //this.fw.write("getData SQL ..."+ sql + "\n");
writeLog(filePtr,"GetData 1st Sql :::."+ sql,true); writeLog(filePtr,"GetData 1st Sql :::."+ sql,true);
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -459,7 +461,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -459,7 +461,7 @@ Put a validation chq amount in filter and total of details matches in case heade
}//while }//while
rs.close(); rs.close();
pstmt.close(); pstmt.close();
*/
//*********Added on 28092006 //*********Added on 28092006
sql = "SELECT D.REF_NO,D.TRAN_SER,D.REF_DATE,D.TOT_AMT - D.ADJ_AMT,C.CUST_NAME ," sql = "SELECT D.REF_NO,D.TRAN_SER,D.REF_DATE,D.TOT_AMT - D.ADJ_AMT,C.CUST_NAME ,"
//+ "' ' C.BANK_CODE,D.TRAN_DATE,' ' AS CHEQUE_NO,0.0 CHQ_AMOUNT,C.CUST_CODE " //+ "' ' C.BANK_CODE,D.TRAN_DATE,' ' AS CHEQUE_NO,0.0 CHQ_AMOUNT,C.CUST_CODE "
...@@ -467,7 +469,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -467,7 +469,7 @@ Put a validation chq amount in filter and total of details matches in case heade
+ " D.CUST_REF_NO,D.REAS_CODE,D.REAS_DETAIL,D.CUST_REF_DATE,D.ADJ_AMT,D.CUST_REF_AMT,D.DUE_DATE,D.TOT_AMT " // ADDED BY RAJESH AS ALIAS IS NOT REQUIRED FOR BANK_CODE + " D.CUST_REF_NO,D.REAS_CODE,D.REAS_DETAIL,D.CUST_REF_DATE,D.ADJ_AMT,D.CUST_REF_AMT,D.DUE_DATE,D.TOT_AMT " // ADDED BY RAJESH AS ALIAS IS NOT REQUIRED FOR BANK_CODE
+ "FROM CUSTOMER C, RECEIVABLES D " + "FROM CUSTOMER C, RECEIVABLES D "
+ "WHERE C.CUST_CODE = D.CUST_CODE " + "WHERE C.CUST_CODE = D.CUST_CODE "
+ "AND D.TRAN_SER <> 'S-INV' " //+ "AND D.TRAN_SER <> 'S-INV' "//Manoj dtd 28/12/2012 Not Required
+ "AND D.TOT_AMT - D.ADJ_AMT <> 0 " + "AND D.TOT_AMT - D.ADJ_AMT <> 0 "
+ "AND D.SITE_CODE = ? " //'"+siteCode.trim()+"' " + "AND D.SITE_CODE = ? " //'"+siteCode.trim()+"' "
//+ "AND D.CUST_CODE >= '"+custCodeFrom.trim()+"' AND D.CUST_CODE <= '"+custCodeTo.trim()+"' " //+ "AND D.CUST_CODE >= '"+custCodeFrom.trim()+"' AND D.CUST_CODE <= '"+custCodeTo.trim()+"' "
...@@ -638,7 +640,9 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -638,7 +640,9 @@ Put a validation chq amount in filter and total of details matches in case heade
retTabSepStrBuff = null; retTabSepStrBuff = null;
conn.close(); conn.close();
conn = null; conn = null;
if(rs!=null)
rs.close(); rs.close();
if(pstmt!=null)
pstmt.close(); pstmt.close();
} }
......
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