Commit 96871e6a authored by msharma's avatar msharma

Remove Invoice amendment join in getdata as discussed with manohar sir


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92403 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8a75f18f
...@@ -344,7 +344,8 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -344,7 +344,8 @@ Put a validation chq amount in filter and total of details matches in case heade
+ "ORDER BY A.CUST_CODE, E.REF_NO "; + "ORDER BY A.CUST_CODE, E.REF_NO ";
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,(select E.REF_NO from invoice_amendment e where e.invoice_id = a.invoice_id and e.status = 'S' and e.confirmed = 'Y') 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,(select E.REF_NO from invoice_amendment e where e.invoice_id = a.invoice_id and e.status = 'S' and e.confirmed = 'Y') 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,'' AS CHEQUE_NO ,B.CHQ_AMOUNT,A.CUST_CODE,D.TOT_AMT " //Added by manoj dtd 21/12/2012
+ "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 "
+ "AND A.CUST_CODE = C.CUST_CODE " + "AND A.CUST_CODE = C.CUST_CODE "
...@@ -366,8 +367,9 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -366,8 +367,9 @@ Put a validation chq amount in filter and total of details matches in case heade
+ "AND NOT EXISTS (SELECT 1 FROM RECEIPT I " + "AND NOT EXISTS (SELECT 1 FROM RECEIPT I "
+ "WHERE I.SITE_CODE = A.SITE_CODE " + "WHERE I.SITE_CODE = A.SITE_CODE "
+ "AND I.CUST_CODE = A.CUST_CODE " + "AND I.CUST_CODE = A.CUST_CODE "
+ "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')) " //+ "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, (select E.REF_NO from invoice_amendment e where e.invoice_id = a.invoice_id and e.status = 'S' and e.confirmed = 'Y') "; +" ) "
+ "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);
......
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