Commit 3a90a2ef authored by vkadam's avatar vkadam

While record match add one more filter as porderNo.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98077 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 719c6105
...@@ -239,19 +239,20 @@ public class MatchVoucherConfSch implements Schedule ...@@ -239,19 +239,20 @@ public class MatchVoucherConfSch implements Schedule
if(tableName.equalsIgnoreCase("PORCP")) if(tableName.equalsIgnoreCase("PORCP"))
{ {
billNoCnt=matchTableField("PORCP","TRAN_ID",receiptNo,"INVOICE_NO",billNo,conn); // Change to pordNo to receiptNo // billNoCnt=matchTableField("PORCP","TRAN_ID",receiptNo,"INVOICE_NO",billNo,conn); // Change to pordNo to receiptNo
billNoCnt=matchTableField("PORCP","TRAN_ID",receiptNo,"INVOICE_NO",billNo,porderNo,conn); // Add pordNo also 09/JUN/15.
if(billNoCnt<=0){ if(billNoCnt<=0){
//Insert mismatch status of PORCP bill_no in table PAY_3WAY_STAT //Insert mismatch status of PORCP bill_no in table PAY_3WAY_STAT
failCnt=insertMismatchReason(suppBillId,voucherNo,porderNo,billNo,bllDate,"PORCP","BILL_NO",conn, failCnt=insertMismatchReason(suppBillId,voucherNo,porderNo,billNo,bllDate,"PORCP","BILL_NO",conn,
xtraParams,"BNO_MISMMATCH_REAS"); xtraParams,"BNO_MISMMATCH_REAS");
} }
billDateCnt=matchTableField("PORCP","TRAN_ID",receiptNo,"INVOICE_DATE",billDate,conn); billDateCnt=matchTableField("PORCP","TRAN_ID",receiptNo,"INVOICE_DATE",billDate,porderNo,conn);
if(billDateCnt<=0){ if(billDateCnt<=0){
//Insert mismatch status of PORCP bill_date in table PAY_3WAY_STAT //Insert mismatch status of PORCP bill_date in table PAY_3WAY_STAT
failCnt=insertMismatchReason(suppBillId,voucherNo,porderNo,billNo,bllDate,"PORCP","BILL_DATE",conn, failCnt=insertMismatchReason(suppBillId,voucherNo,porderNo,billNo,bllDate,"PORCP","BILL_DATE",conn,
xtraParams,"BDT_MISMMATCH_REAS"); xtraParams,"BDT_MISMMATCH_REAS");
} }
billAmtCnt=matchTableField("PORCP","TRAN_ID",receiptNo,"AMOUNT",billAmt,conn); billAmtCnt=matchTableField("PORCP","TRAN_ID",receiptNo,"AMOUNT",billAmt,porderNo,conn);
if(billAmtCnt<=0){ if(billAmtCnt<=0){
//Insert mismatch status of PORCP bill_amt in table PAY_3WAY_STAT //Insert mismatch status of PORCP bill_amt in table PAY_3WAY_STAT
failCnt=insertMismatchReason(suppBillId,voucherNo,porderNo,billNo,bllDate,"PORCP","BILL_AMT",conn, failCnt=insertMismatchReason(suppBillId,voucherNo,porderNo,billNo,bllDate,"PORCP","BILL_AMT",conn,
...@@ -260,20 +261,20 @@ public class MatchVoucherConfSch implements Schedule ...@@ -260,20 +261,20 @@ public class MatchVoucherConfSch implements Schedule
} }
else else
{ {
billNoCnt=matchTableField("VOUCHER","TRAN_ID",voucherNo, "BILL_NO", billNo, conn); billNoCnt=matchTableField("VOUCHER","TRAN_ID",voucherNo, "BILL_NO", billNo,porderNo, conn); // Add pordNo also 09/JUN/15.
if(billNoCnt<=0){ if(billNoCnt<=0){
//Insert mismatch status of VOUCHER bill_no in table PAY_3WAY_STAT //Insert mismatch status of VOUCHER bill_no in table PAY_3WAY_STAT
failCnt=insertMismatchReason(suppBillId,voucherNo,porderNo,billNo,bllDate,"VOUCHER","BILL_NO",conn, failCnt=insertMismatchReason(suppBillId,voucherNo,porderNo,billNo,bllDate,"VOUCHER","BILL_NO",conn,
xtraParams,"BNO_MISMMATCH_REAS"); xtraParams,"BNO_MISMMATCH_REAS");
} }
billDateCnt=matchTableField("VOUCHER","TRAN_ID",voucherNo, "BILL_DATE", billDate, conn); billDateCnt=matchTableField("VOUCHER","TRAN_ID",voucherNo, "BILL_DATE", billDate,porderNo, conn);
if(billDateCnt<=0){ if(billDateCnt<=0){
//Insert mismatch status of VOUCHER bill_date in table PAY_3WAY_STAT //Insert mismatch status of VOUCHER bill_date in table PAY_3WAY_STAT
failCnt=insertMismatchReason(suppBillId,voucherNo,porderNo,billNo,bllDate,"VOUCHER","BILL_DATE",conn, failCnt=insertMismatchReason(suppBillId,voucherNo,porderNo,billNo,bllDate,"VOUCHER","BILL_DATE",conn,
xtraParams,"BDT_MISMMATCH_REAS"); xtraParams,"BDT_MISMMATCH_REAS");
} }
// billAmtCnt=matchTableField("VOUCHER","TRAN_ID",voucherNo, "BILL_AMT", billAmt, conn); // billAmtCnt=matchTableField("VOUCHER","TRAN_ID",voucherNo, "BILL_AMT", billAmt, conn);
billAmtCnt=matchTableField("VOUCHER","TRAN_ID",voucherNo, "BILL_AMT", billAmt, conn); billAmtCnt=matchTableField("VOUCHER","TRAN_ID",voucherNo, "BILL_AMT", billAmt,porderNo, conn);
if(billAmtCnt<=0){ if(billAmtCnt<=0){
//Insert mismatch status of VOUCHER bill_amt in table PAY_3WAY_STAT //Insert mismatch status of VOUCHER bill_amt in table PAY_3WAY_STAT
failCnt=insertMismatchReason(suppBillId,voucherNo,porderNo,billNo,bllDate,"VOUCHER","BILL_AMT",conn, failCnt=insertMismatchReason(suppBillId,voucherNo,porderNo,billNo,bllDate,"VOUCHER","BILL_AMT",conn,
...@@ -597,7 +598,7 @@ public class MatchVoucherConfSch implements Schedule ...@@ -597,7 +598,7 @@ public class MatchVoucherConfSch implements Schedule
* in respective table * in respective table
* and return matching count * and return matching count
* */ * */
private int matchTableField(String tableName, String fieldName1, String fieldValue1, String fieldName2, String fieldValue2, Connection conn) private int matchTableField(String tableName, String fieldName1, String fieldValue1, String fieldName2, String fieldValue2,String porderNo, Connection conn)
{ {
int cnt=0; int cnt=0;
String sql=""; String sql="";
...@@ -616,7 +617,7 @@ public class MatchVoucherConfSch implements Schedule ...@@ -616,7 +617,7 @@ public class MatchVoucherConfSch implements Schedule
bllDate = java.sql.Timestamp.valueOf( sdfDb.format(tempDt)+" 00:00:00.0"); bllDate = java.sql.Timestamp.valueOf( sdfDb.format(tempDt)+" 00:00:00.0");
} }
sql ="select count(*) as cnt from "+tableName+" where "+fieldName1+"=? AND "+fieldName2+"=?"; sql ="select count(*) as cnt from "+tableName+" where "+fieldName1+"=? AND "+fieldName2+"=? AND PURC_ORDER=?"; // Add pordNo also 09/JUN/15.
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,fieldValue1); pstmt.setString(1,fieldValue1);
if(fieldName2.equalsIgnoreCase("BILL_DATE")||fieldName2.equalsIgnoreCase("INVOICE_DATE")) if(fieldName2.equalsIgnoreCase("BILL_DATE")||fieldName2.equalsIgnoreCase("INVOICE_DATE"))
...@@ -627,6 +628,7 @@ public class MatchVoucherConfSch implements Schedule ...@@ -627,6 +628,7 @@ public class MatchVoucherConfSch implements Schedule
{ {
pstmt.setString(2,fieldValue2); pstmt.setString(2,fieldValue2);
} }
pstmt.setString(3, porderNo);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
...@@ -642,6 +644,7 @@ public class MatchVoucherConfSch implements Schedule ...@@ -642,6 +644,7 @@ public class MatchVoucherConfSch implements Schedule
}catch(Exception e){ }catch(Exception e){
e.printStackTrace(); e.printStackTrace();
} }
System.out.println("@@New SQL is :-----"+sql);
System.out.println("Matching Count is :- ["+cnt+"]"); System.out.println("Matching Count is :- ["+cnt+"]");
return cnt; return cnt;
} }
......
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