Commit 93f7308a authored by msharma's avatar msharma

Issue resolved if full qty is rejected


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100088 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1dd8ee3d
...@@ -46,6 +46,7 @@ public class PorcpVouchCreateSch implements Schedule ...@@ -46,6 +46,7 @@ public class PorcpVouchCreateSch implements Schedule
java.util.Date startDate = new java.util.Date(System.currentTimeMillis()); java.util.Date startDate = new java.util.Date(System.currentTimeMillis());
java.util.Date endDate = new java.util.Date(System.currentTimeMillis()); java.util.Date endDate = new java.util.Date(System.currentTimeMillis());
String strToWrite = ""; String strToWrite = "";
String strWrite = "";
String endDateStr = null; String endDateStr = null;
String startDateStr = null; String startDateStr = null;
String tranIdVoucher = ""; String tranIdVoucher = "";
...@@ -70,6 +71,7 @@ public class PorcpVouchCreateSch implements Schedule ...@@ -70,6 +71,7 @@ public class PorcpVouchCreateSch implements Schedule
String loginSiteCode=""; String loginSiteCode="";
String siteDescrMst = ""; String siteDescrMst = "";
double qtyPassed=0,qtyRejected=0,qtyReturned=0,qtyReceived=0; double qtyPassed=0,qtyRejected=0,qtyReturned=0,qtyReceived=0;
try try
{ {
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
...@@ -100,8 +102,8 @@ public class PorcpVouchCreateSch implements Schedule ...@@ -100,8 +102,8 @@ public class PorcpVouchCreateSch implements Schedule
currAppdate=sdf.format(today); currAppdate=sdf.format(today);
System.out.println("intializingLog$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$........."+ intializingLog("Porcp_Vouch_Sch")); System.out.println("intializingLog$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$........."+ intializingLog("Porcp_Vouch_Sch"));
String tranDateFrom = "01/04/15"; String tranDateFrom = "01/04/14";
boolean isValidReceipt=true;
tranDateFromNew = Timestamp.valueOf(genericUtility.getValidDateString(tranDateFrom, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0"); tranDateFromNew = Timestamp.valueOf(genericUtility.getValidDateString(tranDateFrom, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
java.util.Date currentDate = new java.util.Date(); java.util.Date currentDate = new java.util.Date();
System.out.println(">>>>>>>>>>currentDate:"+currentDate); System.out.println(">>>>>>>>>>currentDate:"+currentDate);
...@@ -121,7 +123,7 @@ public class PorcpVouchCreateSch implements Schedule ...@@ -121,7 +123,7 @@ public class PorcpVouchCreateSch implements Schedule
while(rs.next()) while(rs.next())
{ {
//siteCode=rs.getString("SITE_CODE"); //siteCode=rs.getString("SITE_CODE");
isValidReceipt=true;
tranidRcp = rs.getString("tran_id"); tranidRcp = rs.getString("tran_id");
double countQC=0,countQCclose=0; double countQC=0,countQCclose=0;
...@@ -210,13 +212,14 @@ public class PorcpVouchCreateSch implements Schedule ...@@ -210,13 +212,14 @@ public class PorcpVouchCreateSch implements Schedule
if(qtyPassed != 0) //if(qtyPassed != 0)//Condition Commented by Manoj dtd 02/02/2016 to skip full rejected Purchase receipt
{ //{
if ((qtyReceived - qtyReturned) != qtyPassed ) if ((qtyReceived - qtyReturned) != qtyPassed )
{ {
continue; isValidReceipt=false;
break;
} }
} //}
} }
rs2.close(); rs2.close();
...@@ -224,54 +227,63 @@ public class PorcpVouchCreateSch implements Schedule ...@@ -224,54 +227,63 @@ public class PorcpVouchCreateSch implements Schedule
} }
System.out.println("isValidReceipt["+isValidReceipt+"]");
voucherId="";
CreatePoRcpVoucher createVouc = new CreatePoRcpVoucher(); if(isValidReceipt)
retString = createVouc.createPoRcpVoucher(tranidRcp,xtraParams, conn); {
fos1.write(("Status is:: [" + retString +"]\r\n").getBytes());
System.out.println("retString----"+retString); CreatePoRcpVoucher createVouc = new CreatePoRcpVoucher();
tranIdVoucher=retString.substring( retString.indexOf("<TranID>")+8, retString.indexOf("</TranID>")); retString = createVouc.createPoRcpVoucher(tranidRcp,xtraParams, conn);
System.out.println("tranIdVoucher is :"+tranIdVoucher); //fos1.write(("Status is:: [" + retString +"]\r\n").getBytes());
System.out.println("retString----"+retString);
/***********STR***********/ if( retString.indexOf("Success") != -1 )
sql1 = "select tran_id from vouchrcp where prcp_id = ? "; {
pstmt1 = conn.prepareStatement(sql1); voucherId=retString.substring( retString.indexOf("<TranID>")+8, retString.indexOf("</TranID>"));
pstmt1.setString(1,tranIdVoucher); conn.commit();
rs1 = pstmt1.executeQuery(); }
if ( rs1.next() ) else
{ {
voucherId = rs1.getString("tran_id"); conn.rollback();
}
}
rs1.close(); System.out.println("voucherId is :"+voucherId);
rs1=null;
pstmt1.close();
pstmt1=null;
strToWrite =strToWrite+ "TranID of Receipt : "+tranidRcp+" Voucher No : "+voucherId+"\r\n\r\n";
endDate = new java.util.Date(System.currentTimeMillis()); /***********STR***********/
calendar.setTime(new java.sql.Timestamp(System.currentTimeMillis())); /* sql1 = "select tran_id from vouchrcp where prcp_id = ? ";
strToWrite = strToWrite + "Return String : "+retString+"\r\n\r\n"; pstmt1 = conn.prepareStatement(sql1);
fos1.write(strToWrite.getBytes()); pstmt1.setString(1,tranIdVoucher);
System.out.println("End Time for transaction"+endDateStr+"string to write"+strToWrite); rs1 = pstmt1.executeQuery();
if( retString.indexOf("Success") != -1 ) if ( rs1.next() )
{ {
conn.commit(); voucherId = rs1.getString("tran_id");
}
else
{ }
conn.rollback(); rs1.close();
} rs1=null;
pstmt1.close();
pstmt1=null;
*/
//strToWrite =strToWrite+ "TranID of Receipt : "+tranidRcp+" Voucher No : "+voucherId+"\r\n\r\n";
strWrite="TranID of Receipt : "+tranidRcp+" Voucher No : "+voucherId+"\n Return String : "+retString+"\r\n\r\n";
fos1.write(strWrite.getBytes());
strWrite="";
endDate = new java.util.Date(System.currentTimeMillis());
calendar.setTime(new java.sql.Timestamp(System.currentTimeMillis()));
//strToWrite = strToWrite + "Return String : "+retString+"\r\n\r\n";
}
} }
rs.close(); rs.close();
rs=null; rs=null;
pstmt.close(); pstmt.close();
pstmt=null; pstmt=null;
System.out.println("End Time for transaction"+endDateStr+"string to write"+strToWrite);
}catch(Exception e) }catch(Exception e)
{ {
if(conn!=null) if(conn!=null)
......
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