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,17 +227,30 @@ public class PorcpVouchCreateSch implements Schedule ...@@ -224,17 +227,30 @@ public class PorcpVouchCreateSch implements Schedule
} }
System.out.println("isValidReceipt["+isValidReceipt+"]");
voucherId="";
if(isValidReceipt)
{
CreatePoRcpVoucher createVouc = new CreatePoRcpVoucher(); CreatePoRcpVoucher createVouc = new CreatePoRcpVoucher();
retString = createVouc.createPoRcpVoucher(tranidRcp,xtraParams, conn); retString = createVouc.createPoRcpVoucher(tranidRcp,xtraParams, conn);
fos1.write(("Status is:: [" + retString +"]\r\n").getBytes()); //fos1.write(("Status is:: [" + retString +"]\r\n").getBytes());
System.out.println("retString----"+retString); System.out.println("retString----"+retString);
tranIdVoucher=retString.substring( retString.indexOf("<TranID>")+8, retString.indexOf("</TranID>")); if( retString.indexOf("Success") != -1 )
System.out.println("tranIdVoucher is :"+tranIdVoucher); {
voucherId=retString.substring( retString.indexOf("<TranID>")+8, retString.indexOf("</TranID>"));
conn.commit();
}
else
{
conn.rollback();
}
System.out.println("voucherId is :"+voucherId);
/***********STR***********/ /***********STR***********/
sql1 = "select tran_id from vouchrcp where prcp_id = ? "; /* sql1 = "select tran_id from vouchrcp where prcp_id = ? ";
pstmt1 = conn.prepareStatement(sql1); pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1,tranIdVoucher); pstmt1.setString(1,tranIdVoucher);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
...@@ -248,30 +264,26 @@ public class PorcpVouchCreateSch implements Schedule ...@@ -248,30 +264,26 @@ public class PorcpVouchCreateSch implements Schedule
rs1=null; rs1=null;
pstmt1.close(); pstmt1.close();
pstmt1=null; pstmt1=null;
*/
strToWrite =strToWrite+ "TranID of Receipt : "+tranidRcp+" Voucher No : "+voucherId+"\r\n\r\n"; //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()); endDate = new java.util.Date(System.currentTimeMillis());
calendar.setTime(new java.sql.Timestamp(System.currentTimeMillis())); calendar.setTime(new java.sql.Timestamp(System.currentTimeMillis()));
strToWrite = strToWrite + "Return String : "+retString+"\r\n\r\n"; //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();
} }
}
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