Commit f278a3d2 authored by dpawar's avatar dpawar

rollaback when regulated price is null


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93442 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e58124ef
...@@ -111,7 +111,7 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli ...@@ -111,7 +111,7 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1, "Y"); pstmt.setString(1, "Y");
pstmt.setDate(2, new java.sql.Date(System.currentTimeMillis())); pstmt.setDate(2, new java.sql.Date(System.currentTimeMillis()));
pstmt.setString(3,loginCode); pstmt.setString(3,"E10808"); //loginCode
pstmt.setString(4, tranId); pstmt.setString(4, tranId);
updCnt=pstmt.executeUpdate(); updCnt=pstmt.executeUpdate();
...@@ -164,8 +164,10 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli ...@@ -164,8 +164,10 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli
{ {
//Error : Regulated price is Null //Error : Regulated price is Null
errString = itmdbAccess.getErrorString("", "VTREGPRCN", "", "", conn); errString = itmdbAccess.getErrorString("", "VTREGPRCN", "", "", conn);
System.out.println("---------Error : Regulated price is Null----------"); System.out.println("---------Error : Regulated price is Null (Transaction Rollback)----------");
return errString; conn.rollback();
return errString;
} }
else else
{ {
...@@ -233,9 +235,10 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli ...@@ -233,9 +235,10 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli
} }
catch (Exception e1) catch (Exception e1)
{ {
e.printStackTrace();
System.out.println("Exception Class [ProofOfDeliveryConf]::"+e.getMessage());
} }
e.printStackTrace();
System.out.println("Exception Class [ProofOfDeliveryConf]::"+e.getMessage());
} }
finally finally
...@@ -315,9 +318,7 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli ...@@ -315,9 +318,7 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli
cctrCode = getColumnDescr(conn,"cctr_code__ar", "customer", "cust_code", custCode); cctrCode = getColumnDescr(conn,"cctr_code__ar", "customer", "cust_code", custCode);
//acctCodetotAR=getColumnDescr(conn,"ACCT_CODE__TOT_AR", "item_acct_detr", "item_ser", itemSer); //acctCodetotAR=getColumnDescr(conn,"ACCT_CODE__TOT_AR", "item_acct_detr", "item_ser", itemSer);
//cctrCodetotAR=getColumnDescr(conn,"CCTR_CODE__TOT_AR", "item_acct_detr", "item_ser", itemSer); //cctrCodetotAR=getColumnDescr(conn,"CCTR_CODE__TOT_AR", "item_acct_detr", "item_ser", itemSer);
cctrCodetotAR = cctrCodetotAR== null ? " " :cctrCodetotAR; cctrCodetotAR = cctrCodetotAR== null ? " " :cctrCodetotAR;
xmlBuffer.append("<Detail1 objContext =\"1\"").append(" objName=\"misc_drcr_rcp_dr\" domID=\"1\" dbID=\"\">"); xmlBuffer.append("<Detail1 objContext =\"1\"").append(" objName=\"misc_drcr_rcp_dr\" domID=\"1\" dbID=\"\">");
xmlBuffer.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>"); xmlBuffer.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>");
...@@ -419,7 +420,7 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli ...@@ -419,7 +420,7 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli
StringBuffer detail2xml=new StringBuffer(); StringBuffer detail2xml=new StringBuffer();
PreparedStatement pstmt1=null; PreparedStatement pstmt1=null;
ResultSet rs1=null; ResultSet rs1=null;
String acctCodeUDF1="",acctCodeUDF2="",sql=""; String acctCodeUDF1="",acctCodeUDF2="",sql="",itemUnit="";
try try
{ {
sql="select UDF_STR1,UDF_STR2 from gencodes where FLD_NAME = ? AND MOD_NAME = ? AND FLD_VALUE = ? "; sql="select UDF_STR1,UDF_STR2 from gencodes where FLD_NAME = ? AND MOD_NAME = ? AND FLD_VALUE = ? ";
...@@ -442,6 +443,8 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli ...@@ -442,6 +443,8 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli
System.out.println("Exception :getDetail2xmlString method :==>"); System.out.println("Exception :getDetail2xmlString method :==>");
e.printStackTrace(); e.printStackTrace();
} }
itemUnit =getColumnDescr(conn, "unit","item","item_code", itemCode);
System.out.println("Item Code : "+itemCode+" itemCode Unit : "+itemUnit);
detail2xml.append("<Detail2 objContext =\"2\"").append(" objName=\"misc_drcr_rcp_dr\" domID=\"1\" dbID=\"\">"); detail2xml.append("<Detail2 objContext =\"2\"").append(" objName=\"misc_drcr_rcp_dr\" domID=\"1\" dbID=\"\">");
detail2xml.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>"); detail2xml.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>");
detail2xml.append("<tran_id/>"); detail2xml.append("<tran_id/>");
...@@ -457,7 +460,7 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli ...@@ -457,7 +460,7 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli
detail2xml.append("<quantity>").append("<![CDATA[").append(PODqty).append("]]></quantity>\r\n"); detail2xml.append("<quantity>").append("<![CDATA[").append(PODqty).append("]]></quantity>\r\n");
detail2xml.append("<lot_no>").append("<![CDATA[").append(lotNo).append("]]></lot_no>\r\n"); detail2xml.append("<lot_no>").append("<![CDATA[").append(lotNo).append("]]></lot_no>\r\n");
detail2xml.append("<lot_sl>").append("<![CDATA[").append(lotSl).append("]]></lot_sl>\r\n"); detail2xml.append("<lot_sl>").append("<![CDATA[").append(lotSl).append("]]></lot_sl>\r\n");
detail2xml.append("<unit>").append("<![CDATA[").append("DOZ").append("]]></unit>\r\n"); detail2xml.append("<unit>").append("<![CDATA[").append(itemUnit).append("]]></unit>\r\n");
detail2xml.append("</Detail2>"); detail2xml.append("</Detail2>");
System.out.println("Detail 2 xml string for line no--->>"+LineNo); System.out.println("Detail 2 xml string for line no--->>"+LineNo);
...@@ -496,7 +499,7 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli ...@@ -496,7 +499,7 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli
return retString; return retString;
} }
private String getColumnDescr(Connection conn, String columnName ,String tableName, String columnName2, String value) throws ITMException, RemoteException private String getColumnDescr(Connection conn, String columnName ,String tableName, String columnName2, String value)
{ {
PreparedStatement pstmt = null ; PreparedStatement pstmt = null ;
...@@ -522,7 +525,6 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli ...@@ -522,7 +525,6 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli
{ {
System.out.println("Exception in findValue "); System.out.println("Exception in findValue ");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e);
} }
System.out.println("returning String from findValue " + findValue); System.out.println("returning String from findValue " + findValue);
return findValue; return findValue;
......
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