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
java.util.Date startDate = new java.util.Date(System.currentTimeMillis());
java.util.Date endDate = new java.util.Date(System.currentTimeMillis());
String strToWrite = "";
String strWrite = "";
String endDateStr = null;
String startDateStr = null;
String tranIdVoucher = "";
......@@ -70,6 +71,7 @@ public class PorcpVouchCreateSch implements Schedule
String loginSiteCode="";
String siteDescrMst = "";
double qtyPassed=0,qtyRejected=0,qtyReturned=0,qtyReceived=0;
try
{
GenericUtility genericUtility = GenericUtility.getInstance();
......@@ -100,8 +102,8 @@ public class PorcpVouchCreateSch implements Schedule
currAppdate=sdf.format(today);
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");
java.util.Date currentDate = new java.util.Date();
System.out.println(">>>>>>>>>>currentDate:"+currentDate);
......@@ -121,7 +123,7 @@ public class PorcpVouchCreateSch implements Schedule
while(rs.next())
{
//siteCode=rs.getString("SITE_CODE");
isValidReceipt=true;
tranidRcp = rs.getString("tran_id");
double countQC=0,countQCclose=0;
......@@ -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 )
{
continue;
isValidReceipt=false;
break;
}
}
//}
}
rs2.close();
......@@ -224,54 +227,63 @@ public class PorcpVouchCreateSch implements Schedule
}
CreatePoRcpVoucher createVouc = new CreatePoRcpVoucher();
retString = createVouc.createPoRcpVoucher(tranidRcp,xtraParams, conn);
fos1.write(("Status is:: [" + retString +"]\r\n").getBytes());
System.out.println("retString----"+retString);
tranIdVoucher=retString.substring( retString.indexOf("<TranID>")+8, retString.indexOf("</TranID>"));
System.out.println("tranIdVoucher is :"+tranIdVoucher);
/***********STR***********/
sql1 = "select tran_id from vouchrcp where prcp_id = ? ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1,tranIdVoucher);
rs1 = pstmt1.executeQuery();
if ( rs1.next() )
{
voucherId = rs1.getString("tran_id");
System.out.println("isValidReceipt["+isValidReceipt+"]");
voucherId="";
if(isValidReceipt)
{
CreatePoRcpVoucher createVouc = new CreatePoRcpVoucher();
retString = createVouc.createPoRcpVoucher(tranidRcp,xtraParams, conn);
//fos1.write(("Status is:: [" + retString +"]\r\n").getBytes());
System.out.println("retString----"+retString);
if( retString.indexOf("Success") != -1 )
{
voucherId=retString.substring( retString.indexOf("<TranID>")+8, retString.indexOf("</TranID>"));
conn.commit();
}
else
{
conn.rollback();
}
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
strToWrite =strToWrite+ "TranID of Receipt : "+tranidRcp+" Voucher No : "+voucherId+"\r\n\r\n";
System.out.println("voucherId is :"+voucherId);
endDate = new java.util.Date(System.currentTimeMillis());
calendar.setTime(new java.sql.Timestamp(System.currentTimeMillis()));
strToWrite = strToWrite + "Return String : "+retString+"\r\n\r\n";
fos1.write(strToWrite.getBytes());
System.out.println("End Time for transaction"+endDateStr+"string to write"+strToWrite);
if( retString.indexOf("Success") != -1 )
{
conn.commit();
}
else
{
conn.rollback();
}
/***********STR***********/
/* sql1 = "select tran_id from vouchrcp where prcp_id = ? ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1,tranIdVoucher);
rs1 = pstmt1.executeQuery();
if ( rs1.next() )
{
voucherId = rs1.getString("tran_id");
}
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=null;
pstmt.close();
pstmt=null;
System.out.println("End Time for transaction"+endDateStr+"string to write"+strToWrite);
}catch(Exception e)
{
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