Commit 72606941 authored by msalla's avatar msalla

Issue in Purchase receipt "Total additional cost" value.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@201319 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7bd73952
...@@ -192,7 +192,10 @@ public class PoRcpRetPostSave extends ValidatorEJB implements PoRcpRetPostSaveLo ...@@ -192,7 +192,10 @@ public class PoRcpRetPostSave extends ValidatorEJB implements PoRcpRetPostSaveLo
exchRateFrt = rs.getDouble("EXCH_RATE__FRT"); exchRateFrt = rs.getDouble("EXCH_RATE__FRT");
insuranceAmt = rs.getDouble("INSURANCE_AMT"); insuranceAmt = rs.getDouble("INSURANCE_AMT");
exchRateIns = rs.getDouble("EXCH_RATE__INS"); exchRateIns = rs.getDouble("EXCH_RATE__INS");
clearingCharges = rs.getDouble("EXCH_RATE__INS"); //commented vy monika-29-my-2019
//clearingCharges = rs.getDouble("EXCH_RATE__INS");
//changes -By-Monika-29-may-19
clearingCharges = rs.getDouble("CLEARING_CHARGES");//end
exchRateClr = rs.getDouble("EXCH_RATE__CLR"); exchRateClr = rs.getDouble("EXCH_RATE__CLR");
otherCharges = rs.getDouble("OTHER_CHARGES"); otherCharges = rs.getDouble("OTHER_CHARGES");
exchRateOthch = rs.getDouble("EXCH_RATE__OTHCH"); exchRateOthch = rs.getDouble("EXCH_RATE__OTHCH");
...@@ -220,6 +223,9 @@ public class PoRcpRetPostSave extends ValidatorEJB implements PoRcpRetPostSaveLo ...@@ -220,6 +223,9 @@ public class PoRcpRetPostSave extends ValidatorEJB implements PoRcpRetPostSaveLo
} }
//frtAmount = totQty * frtRate *("Q".equalsIgnoreCase(frtType) ? 1 : 0); //frtAmount = totQty * frtRate *("Q".equalsIgnoreCase(frtType) ? 1 : 0);
//end //end
//changes by-monika-29-may-2019--
System.out.println("test1:--"+(frtAmount*exchRateFrt)+"test2:--"+(insuranceAmt*exchRateIns)+"test3:--"+(clearingCharges*exchRateClr)+"test4:--"+(otherCharges*exchRateOthch));
//end
totAddlCost = (frtAmount*exchRateFrt)+(insuranceAmt*exchRateIns)+(clearingCharges*exchRateClr)+(otherCharges*exchRateOthch); totAddlCost = (frtAmount*exchRateFrt)+(insuranceAmt*exchRateIns)+(clearingCharges*exchRateClr)+(otherCharges*exchRateOthch);
System.out.println("totAddlCost--["+totAddlCost+"]"); System.out.println("totAddlCost--["+totAddlCost+"]");
......
package ibase.webitm.ejb.dis;
package ibase.webitm.ejb.dis;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB; import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.ejb.dis.PoReceiptIcLocal;
import ibase.webitm.ejb.dis.PoReceiptIcRemote;
import ibase.webitm.ejb.fin.FinCommon; import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.sys.UtilMethods; import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
...@@ -512,7 +515,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -512,7 +515,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
errList.add( errCode ); errList.add( errCode );
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
/* System.out.println("Error Fired"); /* System.out.println("Error Fired");
errCode = "VTUREC1"; // item series cannot be blank errCode = "VTUREC1"; // item series cannot be blank
errList.add( errCode ); errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );*/ errFields.add( childNodeName.toLowerCase() );*/
...@@ -727,9 +730,9 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -727,9 +730,9 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
System.out.println("gr_no--# cnt > 0"+cnt); System.out.println("gr_no--# cnt > 0"+cnt);
if(cnt > 0) if(cnt > 0)
{ {
// errCode = "VTGR1"; // errCode = "VTGR1";
// errString = getErrorString("gr_no",errCode,userId); // errString = getErrorString("gr_no",errCode,userId);
// break; // break;
errCode = "VTGR1"; errCode = "VTGR1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -833,9 +836,9 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -833,9 +836,9 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
errCode = "VTDUPDCNO"; errCode = "VTDUPDCNO";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
// errCode = "VTDUPDCNO"; // errCode = "VTDUPDCNO";
// errString = getErrorString("dc_no",errCode,userId); // errString = getErrorString("dc_no",errCode,userId);
// break; // break;
} }
} }
...@@ -1734,23 +1737,13 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -1734,23 +1737,13 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
qty= (quantity == null || quantity.trim().length() == 0) ? 0 :Double.parseDouble(quantity); qty= (quantity == null || quantity.trim().length() == 0) ? 0 :Double.parseDouble(quantity);
System.out.println("Quantity double parse"+qty); System.out.println("Quantity double parse"+qty);
if(qty <= 0)
//Changed By PriyankaC as per SM sir suggestions. on 16MAY2019.[START]
/*if(qty <= 0)
{ {
errCode = "VTQTY18"; errCode = "VTQTY18";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
}*/
if(qty < 0)
{
errCode = "VTQTYN";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} }
//Changed By PriyankaC as per SM sir suggestions. on 16MAY2019.[END]
else else
{ {
...@@ -3053,50 +3046,22 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -3053,50 +3046,22 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
pstmt = null; pstmt = null;
if("N".equals(lsporateoption)) if("N".equals(lsporateoption))
{ {
/*if (rate != lcrate1 ) if (rate != lcrate1 )
{ {
errCode = "VTRATE4"; errCode = "VTRATE4";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase());; errFields.add(childNodeName.toLowerCase());;
}*/
//PC
if (rate > lcrate1 )
{
errCode = "VTRRATENMR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());;
}
else if (rate < lcrate1 )
{
errCode = "VTPORATELS";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());;
} }
//PC
} }
else if("L".equals(lsporateoption)) else if("L".equals(lsporateoption))
{ {
/*if (rate != lcrate1 ) if (rate != lcrate1 )
{ {
errCode = "VTRATE4"; errCode = "VTRATE4";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
}*/
//PC
if (rate > lcrate1 )
{
errCode = "VTRRATENMR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());;
} }
else if (rate < lcrate1 )
{
errCode = "VTPORATELS";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());;
}
//PC
} }
/*if( errCode== null || errCode.trim().length() == 0) /*if( errCode== null || errCode.trim().length() == 0)
{*/ //COMMENTED BY NANDKUMAR GADKARI ON 03/05/18 {*/ //COMMENTED BY NANDKUMAR GADKARI ON 03/05/18
...@@ -4442,6 +4407,22 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -4442,6 +4407,22 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
if((suppcode != null && suppcode.trim().length() >0) && (sitecode != null && sitecode.trim().length() >0)) if((suppcode != null && suppcode.trim().length() >0) && (sitecode != null && sitecode.trim().length() >0))
{ {
//Added by PriyankaC on 09MAY2019 to get qc_reqd from itemser [START]. //Added by PriyankaC on 09MAY2019 to get qc_reqd from itemser [START].
sql="select case when qc_reqd is null then 'N' else qc_reqd end from itemser where item_ser = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,itemser);;
rs=pstmt.executeQuery();
if(rs.next())
{
lsqcreqd=checkNull(rs.getString(1));
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
if(lsqcreqd.trim().length()==0)
{
//Added by PriyankaC on 09MAY2019 to get qc_reqd from itemser [END].
sql=" select (case when qc_reqd is null then 'N' else qc_reqd end) from site_supplier where site_code = ? and supp_code = ?"; sql=" select (case when qc_reqd is null then 'N' else qc_reqd end) from site_supplier where site_code = ? and supp_code = ?";
pstmt= conn.prepareStatement( sql ); pstmt= conn.prepareStatement( sql );
pstmt.setString( 1,sitecode); pstmt.setString( 1,sitecode);
...@@ -4455,7 +4436,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -4455,7 +4436,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
}
if (lsqcreqd == null || lsqcreqd.trim().length() == 0) if (lsqcreqd == null || lsqcreqd.trim().length() == 0)
{ {
sql="select (case when qc_reqd is null then 'N' else qc_reqd end) from supplier where supp_code =?"; sql="select (case when qc_reqd is null then 'N' else qc_reqd end) from supplier where supp_code =?";
...@@ -4471,22 +4452,6 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -4471,22 +4452,6 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if(lsqcreqd.trim().length()==0)
{
sql="select case when qc_reqd is null then 'N' else qc_reqd end from itemser where item_ser = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,itemser);;
rs=pstmt.executeQuery();
if(rs.next())
{
lsqcreqd=checkNull(rs.getString(1));
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
}
//Added by PriyankaC on 09MAY2019 to get qc_reqd from itemser [END].
if (lsqcreqd != null && lsqcreqd.trim().length()>0) if (lsqcreqd != null && lsqcreqd.trim().length()>0)
{ {
if("Y".equalsIgnoreCase(lsqcreqd)) if("Y".equalsIgnoreCase(lsqcreqd))
...@@ -4719,6 +4684,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -4719,6 +4684,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
char ct;
sql="select porder.curr_code__frt, porder.curr_code__ins ,frt_type,frt_rate,frt_amt," + sql="select porder.curr_code__frt, porder.curr_code__ins ,frt_type,frt_rate,frt_amt," +
"insurance_amt from porder where porder.purc_order = ? "; "insurance_amt from porder where porder.purc_order = ? ";
pstmt= conn.prepareStatement( sql ); pstmt= conn.prepareStatement( sql );
...@@ -4726,7 +4692,8 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -4726,7 +4692,8 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if( rs.next() ) if( rs.next() )
{ {
lscurrcodefrt = rs.getString(1);
if( rs.next() ) lscurrcodefrt = rs.getString(1);
lscurrcodeins = rs.getString(2); lscurrcodeins = rs.getString(2);
lsfrttype = rs.getString(3); lsfrttype = rs.getString(3);
lcfrtrate = rs.getDouble(4); lcfrtrate = rs.getDouble(4);
...@@ -4862,6 +4829,23 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -4862,6 +4829,23 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
//Added by PriyankaC on 09MAY2019 to get qc_reqd from itemser [START]. //Added by PriyankaC on 09MAY2019 to get qc_reqd from itemser [START].
itemser = genericUtility.getColumnValue("itemser", dom); itemser = genericUtility.getColumnValue("itemser", dom);
System.out.println("itemser["+itemser+"]"); System.out.println("itemser["+itemser+"]");
sql="select case when qc_reqd is null then 'N' else qc_reqd end from itemser where item_ser = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,itemser);;
rs=pstmt.executeQuery();
if(rs.next())
{
lsqcreqd=checkNull(rs.getString(1));
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
if(lsqcreqd == null ||lsqcreqd.trim().length()==0)
{
//Added by PriyankaC on 09MAY2019 to get qc_reqd from itemser [END].
sql=" select (case when qc_reqd is null then 'N' else qc_reqd end) from site_supplier where site_code = ? and supp_code = ?"; sql=" select (case when qc_reqd is null then 'N' else qc_reqd end) from site_supplier where site_code = ? and supp_code = ?";
pstmt= conn.prepareStatement( sql ); pstmt= conn.prepareStatement( sql );
pstmt.setString( 1,qcSiteCode); pstmt.setString( 1,qcSiteCode);
...@@ -4875,7 +4859,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -4875,7 +4859,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
}
if (lsqcreqd == null || lsqcreqd.trim().length() == 0) if (lsqcreqd == null || lsqcreqd.trim().length() == 0)
{ {
sql="select (case when qc_reqd is null then 'N' else qc_reqd end) from supplier where supp_code =?"; sql="select (case when qc_reqd is null then 'N' else qc_reqd end) from supplier where supp_code =?";
...@@ -4891,22 +4875,6 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -4891,22 +4875,6 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if (lsqcreqd == null || lsqcreqd.trim().length() == 0)
{
sql="select case when qc_reqd is null then 'N' else qc_reqd end from itemser where item_ser = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,itemser);;
rs=pstmt.executeQuery();
if(rs.next())
{
lsqcreqd=checkNull(rs.getString(1));
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
}
//Added by PriyankaC on 09MAY2019 to get qc_reqd from itemser [END].
if (lsqcreqd != null && lsqcreqd.trim().length()>0) if (lsqcreqd != null && lsqcreqd.trim().length()>0)
{ {
if("Y".equalsIgnoreCase(lsqcreqd)) if("Y".equalsIgnoreCase(lsqcreqd))
...@@ -4921,6 +4889,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -4921,6 +4889,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
} }
else if (currentColumn.trim().equalsIgnoreCase("curr_code__frt")) else if (currentColumn.trim().equalsIgnoreCase("curr_code__frt"))
{ {
String Effdate1=""; String Effdate1="";
Timestamp effdate=null; Timestamp effdate=null;
String lcadditionalcost1=""; String lcadditionalcost1="";
...@@ -4960,6 +4929,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -4960,6 +4929,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
lcexchrate=fincommon.getDailyExchRateSellBuy(lscurrcode, lscurrcodebase, lssitecode, Effdate1, "B", conn); lcexchrate=fincommon.getDailyExchRateSellBuy(lscurrcode, lscurrcodebase, lssitecode, Effdate1, "B", conn);
valueXmlString.append("<exch_rate__frt protect =\"1\">").append("<![CDATA[" + lcexchrate + "]]>").append("</exch_rate__frt>"); valueXmlString.append("<exch_rate__frt protect =\"1\">").append("<![CDATA[" + lcexchrate + "]]>").append("</exch_rate__frt>");
} }
/* //commented by-monika-29-may-2019
String lcexchrate3="",lcexchrate4="",lcexchrate5="",lcexchrate6=""; String lcexchrate3="",lcexchrate4="",lcexchrate5="",lcexchrate6="";
lcexchrate3 = checkNull(genericUtility.getColumnValue( "exch_rate__frt", dom)); lcexchrate3 = checkNull(genericUtility.getColumnValue( "exch_rate__frt", dom));
exchratefrt=(lcexchrate3==null || lcexchrate3.trim().length() == 0) ?0:Double.parseDouble(lcexchrate3); exchratefrt=(lcexchrate3==null || lcexchrate3.trim().length() == 0) ?0:Double.parseDouble(lcexchrate3);
...@@ -4968,15 +4938,18 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -4968,15 +4938,18 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
lcexchrate5 = checkNull(genericUtility.getColumnValue( "exch_rate__clr", dom )); lcexchrate5 = checkNull(genericUtility.getColumnValue( "exch_rate__clr", dom ));
exchratefrtclr=(lcexchrate3==null || lcexchrate5.trim().length() == 0) ?0:Double.parseDouble(lcexchrate5); exchratefrtclr=(lcexchrate3==null || lcexchrate5.trim().length() == 0) ?0:Double.parseDouble(lcexchrate5);
lcexchrate6 = checkNull(genericUtility.getColumnValue( "exch_rate__othch", dom )); lcexchrate6 = checkNull(genericUtility.getColumnValue( "exch_rate__othch", dom ));
exchratetoth=(lcexchrate4==null || lcexchrate6.trim().length() == 0)?0:Double.parseDouble(lcexchrate6); exchratetoth=(lcexchrate4==null || lcexchrate6.trim().length() == 0)?0:Double.parseDouble(lcexchrate6);*/
//String lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,lcexchrate,exchratefrtins,exchratefrtclr,exchratetoth ,conn);
lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,lcexchrate,exchratefrtins,exchratefrtclr,exchratetoth ,conn); //changes-made by-Monika-29-may-2019
lcadditionalcost1= toTalCostAddition(dom,conn);
valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>"); valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>");
} }
else if (currentColumn.trim().equalsIgnoreCase("curr_code__ins")) else if (currentColumn.trim().equalsIgnoreCase("curr_code__ins"))
{ {
String Effdate1=""; String Effdate1="";
Timestamp effdate=null; Timestamp effdate=null;
String lcadditionalcost1=""; String lcadditionalcost1="";
...@@ -5021,6 +4994,8 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -5021,6 +4994,8 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
lcexchrate=fincommon.getDailyExchRateSellBuy(lscurrcode, lscurrcodebase, lssitecode, Effdate1, "B", conn); lcexchrate=fincommon.getDailyExchRateSellBuy(lscurrcode, lscurrcodebase, lssitecode, Effdate1, "B", conn);
valueXmlString.append("<exch_rate__ins protect =\"1\">").append("<![CDATA[" + lcexchrate + "]]>").append("</exch_rate__ins>"); valueXmlString.append("<exch_rate__ins protect =\"1\">").append("<![CDATA[" + lcexchrate + "]]>").append("</exch_rate__ins>");
} }
//commented by-Monika-29-may-2019
/*
String lcexchrate3="",lcexchrate4="",lcexchrate5="",lcexchrate6=""; String lcexchrate3="",lcexchrate4="",lcexchrate5="",lcexchrate6="";
lcexchrate3 = checkNull(genericUtility.getColumnValue( "exch_rate__frt", dom)); lcexchrate3 = checkNull(genericUtility.getColumnValue( "exch_rate__frt", dom));
exchratefrt=(lcexchrate3 == null || lcexchrate3.trim().length() == 0) ?0:Double.parseDouble(lcexchrate3); exchratefrt=(lcexchrate3 == null || lcexchrate3.trim().length() == 0) ?0:Double.parseDouble(lcexchrate3);
...@@ -5032,8 +5007,11 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -5032,8 +5007,11 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
exchratefrtclr=(lcexchrate3==null || lcexchrate5.trim().length() == 0) ?0:Double.parseDouble(lcexchrate5); exchratefrtclr=(lcexchrate3==null || lcexchrate5.trim().length() == 0) ?0:Double.parseDouble(lcexchrate5);
lcexchrate6 = checkNull(genericUtility.getColumnValue( "exch_rate__othch", dom )); lcexchrate6 = checkNull(genericUtility.getColumnValue( "exch_rate__othch", dom ));
exchratetoth=(lcexchrate4==null || lcexchrate6.trim().length() == 0) ?0:Double.parseDouble(lcexchrate6); exchratetoth=(lcexchrate4==null || lcexchrate6.trim().length() == 0) ?0:Double.parseDouble(lcexchrate6);*/
lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,exchratefrt,lcexchrate,exchratefrtclr,exchratetoth ,conn); //String lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,lcexchrate,exchratefrtins,exchratefrtclr,exchratetoth ,conn);
//changes-made by-Monika-29-may-2019
lcadditionalcost1= toTalCostAddition(dom,conn);
System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]"); System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]");
valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>"); valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>");
} }
...@@ -5080,6 +5058,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -5080,6 +5058,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
lcexchrate=fincommon.getDailyExchRateSellBuy(lscurrcode, lscurrcodebase, lssitecode, Effdate1, "B", conn); lcexchrate=fincommon.getDailyExchRateSellBuy(lscurrcode, lscurrcodebase, lssitecode, Effdate1, "B", conn);
valueXmlString.append("<exch_rate__othch protect =\"1\">").append("<![CDATA[" + lcexchrate + "]]>").append("</exch_rate__othch>"); valueXmlString.append("<exch_rate__othch protect =\"1\">").append("<![CDATA[" + lcexchrate + "]]>").append("</exch_rate__othch>");
} }
/*commented by-monika-on-29-may-2019
String lcexchrate3="",lcexchrate4="",lcexchrate5="",lcexchrate6=""; String lcexchrate3="",lcexchrate4="",lcexchrate5="",lcexchrate6="";
lcexchrate3 = checkNull(genericUtility.getColumnValue( "exch_rate__frt", dom)); lcexchrate3 = checkNull(genericUtility.getColumnValue( "exch_rate__frt", dom));
exchratefrt=(lcexchrate3==null || lcexchrate3.trim().length() == 0)?0:Double.parseDouble(lcexchrate3); exchratefrt=(lcexchrate3==null || lcexchrate3.trim().length() == 0)?0:Double.parseDouble(lcexchrate3);
...@@ -5091,7 +5070,8 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -5091,7 +5070,8 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
exchratefrtclr=(lcexchrate3==null || lcexchrate5.trim().length() == 0) ?0:Double.parseDouble(lcexchrate5); exchratefrtclr=(lcexchrate3==null || lcexchrate5.trim().length() == 0) ?0:Double.parseDouble(lcexchrate5);
lcexchrate6 = checkNull(genericUtility.getColumnValue( "exch_rate__othch", dom )); lcexchrate6 = checkNull(genericUtility.getColumnValue( "exch_rate__othch", dom ));
exchratetoth=(lcexchrate4==null || lcexchrate6.trim().length() == 0)?0:Double.parseDouble(lcexchrate6); exchratetoth=(lcexchrate4==null || lcexchrate6.trim().length() == 0)?0:Double.parseDouble(lcexchrate6);
lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,exchratefrt,exchratefrtins,exchratefrtclr,lcexchrate ,conn); lcadditionalcost1= toTalCostAddition(dom,dom1,dom2,xtraParams,conn);*/
lcadditionalcost1= toTalCostAddition(dom,conn);
System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]"); System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]");
valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>"); valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>");
} }
...@@ -5139,6 +5119,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -5139,6 +5119,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
lcexchrate=fincommon.getDailyExchRateSellBuy(lscurrcode, lscurrcodebase, lssitecode, Effdate1, "B", conn); lcexchrate=fincommon.getDailyExchRateSellBuy(lscurrcode, lscurrcodebase, lssitecode, Effdate1, "B", conn);
valueXmlString.append("<exch_rate__clr protect =\"1\">").append("<![CDATA[" + lcexchrate + "]]>").append("</exch_rate__clr>"); valueXmlString.append("<exch_rate__clr protect =\"1\">").append("<![CDATA[" + lcexchrate + "]]>").append("</exch_rate__clr>");
} }
/* commented-by-Monika-29-may-2019
String lcexchrate3="",lcexchrate4="",lcexchrate5="",lcexchrate6=""; String lcexchrate3="",lcexchrate4="",lcexchrate5="",lcexchrate6="";
lcexchrate3 = checkNull(genericUtility.getColumnValue( "exch_rate__frt", dom)); lcexchrate3 = checkNull(genericUtility.getColumnValue( "exch_rate__frt", dom));
...@@ -5152,13 +5133,17 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -5152,13 +5133,17 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
lcexchrate6 = checkNull(genericUtility.getColumnValue( "exch_rate__othch", dom )); lcexchrate6 = checkNull(genericUtility.getColumnValue( "exch_rate__othch", dom ));
exchratetoth=(lcexchrate4==null || lcexchrate6.trim().length() == 0) ?0:Double.parseDouble(lcexchrate6); exchratetoth=(lcexchrate4==null || lcexchrate6.trim().length() == 0) ?0:Double.parseDouble(lcexchrate6);
lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,exchratefrt,exchratefrtins,exchratefrtclr,exchratetoth ,conn); String lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,lcexchrate,exchratefrtins,exchratefrtclr,exchratetoth ,conn);
*/
//changes made by-Monika-29-may-2019
lcadditionalcost1= toTalCostAddition(dom,conn);//end
System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]"); System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]");
valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>"); valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>");
} }
else if (currentColumn.trim().equalsIgnoreCase("exch_rate__frt")) else if (currentColumn.trim().equalsIgnoreCase("exch_rate__frt"))
{ {
String Effdate1=""; //commented-by-monika-29-05-2019
/*String Effdate1="";
Timestamp effdate=null; Timestamp effdate=null;
String lcadditionalcost1=""; String lcadditionalcost1="";
String lcexchrate1="",lcfreight1="",lcinsurance1="",lcclearing1="",lcother1=""; String lcexchrate1="",lcfreight1="",lcinsurance1="",lcclearing1="",lcother1="";
...@@ -5237,14 +5222,16 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -5237,14 +5222,16 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
{ {
lcexchrate6 = "0" ; lcexchrate6 = "0" ;
} }
exchratetoth=lcexchrate4==null ?0:Double.parseDouble(lcexchrate6); exchratetoth=lcexchrate4==null ?0:Double.parseDouble(lcexchrate6);*/
lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,lcexchrate,exchratefrtins,exchratefrtclr,exchratetoth ,conn); // lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,lcexchrate,exchratefrtins,exchratefrtclr,exchratetoth ,conn);
String lcadditionalcost1=toTalCostAddition(dom,conn);//end
System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]"); System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]");
valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>"); valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>");
} }
else if (currentColumn.trim().equalsIgnoreCase("exch_rate__ins")) else if (currentColumn.trim().equalsIgnoreCase("exch_rate__ins"))
{ {
String Effdate1=""; //commented-by-monika-29-may-2019
/*String Effdate1="";
Timestamp effdate=null; Timestamp effdate=null;
String lcadditionalcost1=""; String lcadditionalcost1="";
String lcexchrate1="",lcfreight1="",lcinsurance1="",lcclearing1="",lcother1=""; String lcexchrate1="",lcfreight1="",lcinsurance1="",lcclearing1="",lcother1="";
...@@ -5323,14 +5310,16 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -5323,14 +5310,16 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
{ {
lcexchrate6 = "0" ; lcexchrate6 = "0" ;
} }
exchratetoth=lcexchrate4==null ?0:Double.parseDouble(lcexchrate6); exchratetoth=lcexchrate4==null ?0:Double.parseDouble(lcexchrate6);*/
lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,exchratefrt,lcexchrate,exchratefrtclr,exchratetoth ,conn); //lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,exchratefrt,lcexchrate,exchratefrtclr,exchratetoth ,conn);
//changes-done-by-Monika-29-15-2019
String lcadditionalcost1=toTalCostAddition(dom,conn);//end
System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]"); System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]");
valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>"); valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>");
} }
else if (currentColumn.trim().equalsIgnoreCase("exch_rate__clr")) else if (currentColumn.trim().equalsIgnoreCase("exch_rate__clr"))
{ {//commented by-monika-29-may-2019
String Effdate1=""; /*String Effdate1="";
Timestamp effdate=null; Timestamp effdate=null;
String lcadditionalcost1=""; String lcadditionalcost1="";
String lcexchrate1="",lcfreight1="",lcinsurance1="",lcclearing1="",lcother1=""; String lcexchrate1="",lcfreight1="",lcinsurance1="",lcclearing1="",lcother1="";
...@@ -5411,13 +5400,16 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -5411,13 +5400,16 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
lcexchrate6 = "0" ; lcexchrate6 = "0" ;
} }
exchratetoth=lcexchrate4==null ?0:Double.parseDouble(lcexchrate6); exchratetoth=lcexchrate4==null ?0:Double.parseDouble(lcexchrate6);
lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,exchratefrt,exchratefrtins,lcexchrate,exchratetoth ,conn); lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,exchratefrt,exchratefrtins,lcexchrate,exchratetoth ,conn);*/
//changes-made-by -monika-29-may-2019
String lcadditionalcost1= toTalCostAddition(dom,conn);//end
System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]"); System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]");
valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>"); valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>");
} }
else if (currentColumn.trim().equalsIgnoreCase("insurance_amt")) else if (currentColumn.trim().equalsIgnoreCase("insurance_amt"))
{ {
String Effdate1=""; //commented-by-Monika-29-may-2019
/*String Effdate1="";
Timestamp effdate=null; Timestamp effdate=null;
String lcadditionalcost1=""; String lcadditionalcost1="";
String lcexchrate1="",lcfreight1="",lcinsurance1="",lcclearing1="",lcother1=""; String lcexchrate1="",lcfreight1="",lcinsurance1="",lcclearing1="",lcother1="";
...@@ -5496,13 +5488,16 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -5496,13 +5488,16 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
lcexchrate6 = "0" ; lcexchrate6 = "0" ;
} }
exchratetoth=lcexchrate4==null ?0:Double.parseDouble(lcexchrate6); exchratetoth=lcexchrate4==null ?0:Double.parseDouble(lcexchrate6);
lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,exchratefrt,lcexchrate,exchratefrtclr,exchratetoth ,conn); lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,exchratefrt,lcexchrate,exchratefrtclr,exchratetoth ,conn);*/
//changes-made by-Monika-29-may-2019
String lcadditionalcost1= toTalCostAddition(dom,conn);//end
System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]"); System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]");
valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>"); valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>");
} }
else if (currentColumn.trim().equalsIgnoreCase("frt_amt")) else if (currentColumn.trim().equalsIgnoreCase("frt_amt"))
{ {
String Effdate1=""; //commented by-Monika-29-05-2019
/*String Effdate1="";
Timestamp effdate=null; Timestamp effdate=null;
String lcadditionalcost1=""; String lcadditionalcost1="";
String lcexchrate1="",lcfreight1="",lcinsurance1="",lcclearing1="",lcother1=""; String lcexchrate1="",lcfreight1="",lcinsurance1="",lcclearing1="",lcother1="";
...@@ -5582,11 +5577,15 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -5582,11 +5577,15 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
lcexchrate6 = "0" ; lcexchrate6 = "0" ;
} }
exchratetoth=lcexchrate4==null ?0:Double.parseDouble(lcexchrate6); exchratetoth=lcexchrate4==null ?0:Double.parseDouble(lcexchrate6);
lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,lcexchrate,exchratefrtins,exchratefrtclr,exchratetoth ,conn); lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,lcexchrate,exchratefrtins,exchratefrtclr,exchratetoth ,conn);*/
//changes -made by-29-may-2019
String lcadditionalcost1=toTalCostAddition(dom,conn);//end
valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>"); valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>");
} }
else if (currentColumn.trim().equalsIgnoreCase("clearing_charges")) else if (currentColumn.trim().equalsIgnoreCase("clearing_charges"))
{ {/*
commented by-Monika-29-may-2019
String Effdate1=""; String Effdate1="";
Timestamp effdate=null; Timestamp effdate=null;
String lcadditionalcost1=""; String lcadditionalcost1="";
...@@ -5666,14 +5665,17 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -5666,14 +5665,17 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
{ {
lcexchrate6 = "0" ; lcexchrate6 = "0" ;
} }
exchratetoth=lcexchrate4==null ?0:Double.parseDouble(lcexchrate6); exchratetoth=lcexchrate4==null ?0:Double.parseDouble(lcexchrate6);*/
lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,exchratefrt,exchratefrtins,lcexchrate,exchratetoth ,conn); //lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,exchratefrt,exchratefrtins,lcexchrate,exchratetoth ,conn);
//changes-made-by-Monika-29-05-2019
String lcadditionalcost1=toTalCostAddition(dom,conn);//end
System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]"); System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]");
valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>"); valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>");
} }
else if (currentColumn.trim().equalsIgnoreCase("exch_rate__othch")) else if (currentColumn.trim().equalsIgnoreCase("exch_rate__othch"))
{ {
String Effdate1=""; //commented-by-Monika-29-may-2019
/*String Effdate1="";
Timestamp effdate=null; Timestamp effdate=null;
String lcadditionalcost1=""; String lcadditionalcost1="";
String lcexchrate1="",lcfreight1="",lcinsurance1="",lcclearing1="",lcother1=""; String lcexchrate1="",lcfreight1="",lcinsurance1="",lcclearing1="",lcother1="";
...@@ -5737,13 +5739,15 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -5737,13 +5739,15 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
exchratefrtclr=(lcexchrate3==null || lcexchrate5.trim().length() == 0)?0:Double.parseDouble(lcexchrate5); exchratefrtclr=(lcexchrate3==null || lcexchrate5.trim().length() == 0)?0:Double.parseDouble(lcexchrate5);
lcexchrate6 = checkNull( genericUtility.getColumnValue( "exch_rate__othch", dom )); lcexchrate6 = checkNull( genericUtility.getColumnValue( "exch_rate__othch", dom ));
exchratetoth=(lcexchrate4==null || lcother1.trim().length() == 0)?0:Double.parseDouble(lcexchrate6); exchratetoth=(lcexchrate4==null || lcother1.trim().length() == 0)?0:Double.parseDouble(lcexchrate6);*/
lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,exchratefrt,exchratefrtins,exchratefrtclr,lcexchrate ,conn); //lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,exchratefrt,exchratefrtins,exchratefrtclr,lcexchrate ,conn);
//changes-made by-Monika-29-may-2019
String lcadditionalcost1=toTalCostAddition(dom,conn);//end
System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]"); System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]");
valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>"); valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>");
} }
else if (currentColumn.trim().equalsIgnoreCase("other_charges")) else if (currentColumn.trim().equalsIgnoreCase("other_charges"))
{ {/* commented -by-monika-29-may-2019
String Effdate1=""; String Effdate1="";
Timestamp effdate=null; Timestamp effdate=null;
String lcadditionalcost1=""; String lcadditionalcost1="";
...@@ -5792,7 +5796,9 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -5792,7 +5796,9 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
exchratefrtclr=(lcexchrate5==null || lcexchrate5.trim().length() == 0) ?0:Double.parseDouble(lcexchrate5); exchratefrtclr=(lcexchrate5==null || lcexchrate5.trim().length() == 0) ?0:Double.parseDouble(lcexchrate5);
lcexchrate6 = checkNull(genericUtility.getColumnValue( "exch_rate__othch", dom )); lcexchrate6 = checkNull(genericUtility.getColumnValue( "exch_rate__othch", dom ));
exchratetoth=(lcexchrate6==null || lcexchrate6.trim().length() == 0) ?0:Double.parseDouble(lcexchrate6); exchratetoth=(lcexchrate6==null || lcexchrate6.trim().length() == 0) ?0:Double.parseDouble(lcexchrate6);
lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,exchratefrt,exchratefrtins,exchratefrtclr,lcexchrate ,conn); lcadditionalcost1= toTalCostAddition(acfreight,acinsurance,acclearing,acother,lcexchrate,exchratefrtins,exchratefrtclr,exchratetoth ,conn);;*/
//changes-made by-Monika-29-may-2019
String lcadditionalcost1= toTalCostAddition(dom,conn);//end
System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]"); System.out.println("curr_code__ins-->total_addl_cost["+lcadditionalcost1+"]");
valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>"); valueXmlString.append("<total_addl_cost>").append("<![CDATA[" + lcadditionalcost1 + "]]>").append("</total_addl_cost>");
} }
...@@ -6588,7 +6594,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -6588,7 +6594,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
pstmt = null; pstmt = null;
//<quantity //<quantity
//Added by sarita to get ProjectCode Value on 03 APR 2019 [START] //Added by sarita to get ProjectCode Value on 03 APR 2019 [START]
valueXmlString.append("<proj_code protect =\"0\">").append("<![CDATA[" + projectCode + "]]>").append("</proj_code>");// UNPROTECTED BY NANDKUMAR GADKARI ON 14/05/19 valueXmlString.append("<proj_code protect =\"1\">").append("<![CDATA[" + projectCode + "]]>").append("</proj_code>");
//Added by sarita to get ProjectCode Value on 03 APR 2019 [END] //Added by sarita to get ProjectCode Value on 03 APR 2019 [END]
valueXmlString.append("<anal_code >").append("<![CDATA[" + lsanalcode + "]]>").append("</anal_code>"); valueXmlString.append("<anal_code >").append("<![CDATA[" + lsanalcode + "]]>").append("</anal_code>");
if(lsanalcode != null && lsanalcode.trim().length() >0) if(lsanalcode != null && lsanalcode.trim().length() >0)
...@@ -7164,42 +7170,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -7164,42 +7170,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
{ {
//mcode = dw_detedit[ii_currformno].GetItemString(dw_detedit[ii_currformno].getrow(), '') //mcode = dw_detedit[ii_currformno].GetItemString(dw_detedit[ii_currformno].getrow(), '')
mcode=checkNull(genericUtility.getColumnValue( "item_code", dom )); mcode=checkNull(genericUtility.getColumnValue( "item_code", dom ));
//PriyankaC On 13MAY2019. TO SET loc code from siteItem.
sql="select qc_reqd from siteitem where item_code = ? and site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsitemcode);
pstmt.setString(2, lssite);
rs = pstmt.executeQuery();
if (rs.next())
{
lsqcreqd = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(lsqcreqd == null || lsqcreqd.trim().length() == 0)
{
sql="select (case when qc_reqd is null then 'N' else qc_reqd end) from item where item_code = ?"; sql="select (case when qc_reqd is null then 'N' else qc_reqd end) from item where item_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsitemcode);
rs = pstmt.executeQuery();
if (rs.next())
{
lsqcreqd = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if(lsqcreqd == null || lsqcreqd.trim().length() == 0)
{
lsqcreqd="N";
}
/*sql="select (case when qc_reqd is null then 'N' else qc_reqd end) from item where item_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mcode); pstmt.setString(1, mcode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -7209,8 +7180,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -7209,8 +7180,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close();*/ pstmt.close();
// PriyankaC END
pstmt = null; pstmt = null;
if("Y".equalsIgnoreCase(lsqcreqd)) if("Y".equalsIgnoreCase(lsqcreqd))
...@@ -8035,42 +8005,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -8035,42 +8005,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
{ {
//mcode = dw_detedit[ii_currformno].GetItemString(dw_detedit[ii_currformno].getrow(), '') //mcode = dw_detedit[ii_currformno].GetItemString(dw_detedit[ii_currformno].getrow(), '')
mcode=checkNull(genericUtility.getColumnValue( "item_code", dom )); mcode=checkNull(genericUtility.getColumnValue( "item_code", dom ));
//PriyankaC on 13MAy2019 to set loc code from siteitem.
sql="select qc_reqd from siteitem where item_code = ? and site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsitemcode);
pstmt.setString(2, lssite);
rs = pstmt.executeQuery();
if (rs.next())
{
lsqcreqd = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(lsqcreqd == null || lsqcreqd.trim().length() == 0)
{
sql="select (case when qc_reqd is null then 'N' else qc_reqd end) from item where item_code = ?"; sql="select (case when qc_reqd is null then 'N' else qc_reqd end) from item where item_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsitemcode);
rs = pstmt.executeQuery();
if (rs.next())
{
lsqcreqd = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if(lsqcreqd == null || lsqcreqd.trim().length() == 0)
{
lsqcreqd="N";
}
/*sql="select (case when qc_reqd is null then 'N' else qc_reqd end) from item where item_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mcode); pstmt.setString(1, mcode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -8081,8 +8016,8 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -8081,8 +8016,8 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null;*/ pstmt = null;
//Priyankac [END]
if("Y".equalsIgnoreCase(lsqcreqd)) if("Y".equalsIgnoreCase(lsqcreqd))
{ {
lscctrloccode = lscostctr.trim()+"Q"; lscctrloccode = lscostctr.trim()+"Q";
...@@ -8992,7 +8927,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -8992,7 +8927,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
{ {
/*expirydate = Timestamp.valueOf(genericUtility.getValidDateString(dtStr1, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); /*expirydate = Timestamp.valueOf(genericUtility.getValidDateString(dtStr1, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("expirydate@D["+expirydate+"]");//dhiraj System.out.println("expirydate@D["+expirydate+"]");//dhiraj
*/ dtStr2=dtStr1; */ dtStr2=dtStr1;
System.out.println("dtStr2["+dtStr2+"]"); System.out.println("dtStr2["+dtStr2+"]");
} }
if(!"Y".equalsIgnoreCase(lsmfgset) && !"U".equalsIgnoreCase(lsmfgset)) if(!"Y".equalsIgnoreCase(lsmfgset) && !"U".equalsIgnoreCase(lsmfgset))
...@@ -9015,7 +8950,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -9015,7 +8950,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
{ {
/*expirydate = Timestamp.valueOf(genericUtility.getValidDateString(dtStr1, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); /*expirydate = Timestamp.valueOf(genericUtility.getValidDateString(dtStr1, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("expirydate@D@E["+expirydate.toString()+"]");//dhiraj System.out.println("expirydate@D@E["+expirydate.toString()+"]");//dhiraj
*/ dtStr2=dtStr1; */ dtStr2=dtStr1;
System.out.println("dtStr2["+dtStr2+"]"); System.out.println("dtStr2["+dtStr2+"]");
//expirydate = CalcExpiry1(mmfgDate, lishelflife);//DHIRAJ //expirydate = CalcExpiry1(mmfgDate, lishelflife);//DHIRAJ
//System.out.println("expirydate@CalcX@E["+expirydate+"]");//dhiraj //System.out.println("expirydate@CalcX@E["+expirydate+"]");//dhiraj
...@@ -9958,7 +9893,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -9958,7 +9893,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
} }
System.out.println("Packing COde || site_code :["+lsmfgsite+"]"); System.out.println("Packing COde || site_code :["+lsmfgsite+"]");
return lsmfgsite; return lsmfgsite;
} }
private String checkNull(String input) { private String checkNull(String input) {
if (input == null) { if (input == null) {
input = ""; input = "";
...@@ -10024,41 +9959,41 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -10024,41 +9959,41 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
private String gf_check_conv_fact(String itemCode, String unitfrom,String unitto, Double convfact, Connection conn) private String gf_check_conv_fact(String itemCode, String unitfrom,String unitto, Double convfact, Connection conn)
throws SQLException throws SQLException
{ {
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
int recCnt = 0; int recCnt = 0;
String errCode = "", variencetype = "", order = "NOTFOUND", sql = ""; String errCode = "", variencetype = "", order = "NOTFOUND", sql = "";
double varience = 0, mastfact = 0; double varience = 0, mastfact = 0;
System.out.println("@@@@@2 unitfrom[" + unitfrom + "]::unitto["+ unitto + "]::convfact[" + convfact + "]"); System.out.println("@@@@@2 unitfrom[" + unitfrom + "]::unitto["+ unitto + "]::convfact[" + convfact + "]");
if (unitfrom.equalsIgnoreCase(unitto) && (!(convfact == 1))) if (unitfrom.equalsIgnoreCase(unitto) && (!(convfact == 1)))
{ {
errCode = "VTUCON1"; errCode = "VTUCON1";
return errCode; return errCode;
} }
sql = " select fact, varience_type, varience_value " sql = " select fact, varience_type, varience_value "
+ " from uomconv where ( uomconv.unit__fr = ? ) and" + " from uomconv where ( uomconv.unit__fr = ? ) and"
+ " ( uomconv.unit__to = ? ) and ( uomconv.item_code = ? ) "; + " ( uomconv.unit__to = ? ) and ( uomconv.item_code = ? ) ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, unitfrom); pstmt.setString(1, unitfrom);
pstmt.setString(2, unitto); pstmt.setString(2, unitto);
pstmt.setString(3, itemCode); pstmt.setString(3, itemCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
mastfact = rs.getDouble(1); mastfact = rs.getDouble(1);
variencetype = rs.getString(1); variencetype = rs.getString(1);
varience = rs.getDouble(1); varience = rs.getDouble(1);
recCnt++; recCnt++;
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("recCnt == 0["+recCnt+"]"); System.out.println("recCnt == 0["+recCnt+"]");
if (recCnt == 0) if (recCnt == 0)
{ {
// 2. Check in the reverse order (TO - FROM) for the item // 2. Check in the reverse order (TO - FROM) for the item
sql = " select fact, varience_type, varience_value " sql = " select fact, varience_type, varience_value "
+ " from uomconv where ( uomconv.unit__fr = ? ) and ( uomconv.unit__to = ? ) " + " from uomconv where ( uomconv.unit__fr = ? ) and ( uomconv.unit__to = ? ) "
...@@ -10139,24 +10074,24 @@ if (recCnt == 0) ...@@ -10139,24 +10074,24 @@ if (recCnt == 0)
{ {
order = "REVORD"; order = "REVORD";
} }
} }
else else
{ {
order = "ACTORD"; order = "ACTORD";
} }
if (variencetype == null || variencetype.length() == 0) if (variencetype == null || variencetype.length() == 0)
{ {
variencetype = ""; variencetype = "";
} }
System.out.println("Order"+order); System.out.println("Order"+order);
if ("NOTFOUND".equalsIgnoreCase(order)) if ("NOTFOUND".equalsIgnoreCase(order))
{ {
errCode = "VTUOMCONV"; errCode = "VTUOMCONV";
} }
else else
{ {
if ("REVORD".equalsIgnoreCase(order)) if ("REVORD".equalsIgnoreCase(order))
{ {
if (!(mastfact == 0)) { if (!(mastfact == 0)) {
...@@ -10178,11 +10113,11 @@ else ...@@ -10178,11 +10113,11 @@ else
if (convfact > mastfact + varience) { if (convfact > mastfact + varience) {
errCode = "VTUOMVAR"; errCode = "VTUOMVAR";
} }
} }
return errCode; return errCode;
} }
private String setDescription(String descr, String table, String field,String value, Connection conn) throws SQLException private String setDescription(String descr, String table, String field,String value, Connection conn) throws SQLException
{ {
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
...@@ -10227,10 +10162,103 @@ return errCode; ...@@ -10227,10 +10162,103 @@ return errCode;
pstmt = null; pstmt = null;
return lsqcreqd;// return lsqcreqd;//
} }
private String toTalCostAddition(double acfreight,double acinsurance,double acclearing,double acother,double exchratefrt,double exchratefrtins,double exchratefrtclr,double exchratetoth ,Connection conn) throws SQLException //commented -by -monika-29-may-2019
{
String lcexchrate1="",lcexchrate2="",lcexchrate3="",lcexchrate4=""; //private String toTalCostAddition(double acfreight,double acinsurance,double acclearing,double acother,double exchratefrt,double exchratefrtins,double exchratefrtclr,double exchratetoth ,Connection conn) throws SQLException
private String toTalCostAddition(Document dom,Connection conn) throws Exception
{// setNodeValue( dom, "exch_rate__ins", lcexchrate );
/*String lcexchrate1="",lcexchrate2="",lcexchrate3="",lcexchrate4="";
String lcadditionalcost1="";*/
//changes -made-by monika
String lcexchrate2="",lcexchrate3="",lcexchrate4="",lcexchrate5="",lcexchrate6="",sql="",lscurrcodebase="",lscurrcode="",lssitecode="";
conn = getConnection();
double lcexchrate;
PreparedStatement pstmt = null;
ResultSet rs = null;
StringBuffer valueXmlString = new StringBuffer();
String Effdate1="";
Timestamp effdate=null;
String lcadditionalcost1=""; String lcadditionalcost1="";
String lcexchrate1="",lcfreight1="",lcinsurance1="",lcclearing1="",lcother1="";
double acfreight=0,acinsurance=0,acclearing=0,acother=0;
double exchratefrt=0,exchratefrtins=0,exchratefrtclr=0,exchratetoth=0;
lscurrcode =genericUtility.getColumnValue( "curr_code__ins", dom );
lssitecode =genericUtility.getColumnValue( "site_code", dom );
Effdate1 =genericUtility.getColumnValue("eff_date", dom);
lcfreight1 = checkNull(genericUtility.getColumnValue( "frt_amt", dom ));
if(lcfreight1 == null || lcfreight1.trim().length() == 0)
{
lcfreight1 = "0" ;
}
acfreight=lcfreight1==null ?0:Double.parseDouble(lcfreight1);
lcinsurance1 = checkNull(genericUtility.getColumnValue( "insurance_amt", dom ));
if(lcinsurance1 == null || lcinsurance1.trim().length() == 0)
{
lcinsurance1 = "0" ;
}
acinsurance=lcinsurance1==null ?0:Double.parseDouble(lcinsurance1);
lcclearing1 = checkNull( genericUtility.getColumnValue( "clearing_charges", dom ));
if(lcclearing1 == null || lcclearing1.trim().length() == 0)
{
lcclearing1 = "0" ;
}
acclearing=lcclearing1==null ?0:Double.parseDouble(lcclearing1);
lcother1 = checkNull(genericUtility.getColumnValue( "other_charges", dom ));
if(lcother1 == null || lcother1.trim().length() == 0)
{
lcother1 = "0" ;
}
acother=lcother1==null ?0:Double.parseDouble(lcother1);
System.out.println("exch_rate__ins-->frt_amt["+acfreight+"]");
System.out.println("exch_rate__ins-->insurance_amt["+acinsurance+"]");
System.out.println("exch_rate__ins-->clearing_charges["+acclearing+"]");
System.out.println("exch_rate__ins-->other_charges["+lcother1+"]");
effdate = Timestamp.valueOf(genericUtility.getValidDateString(Effdate1.toString(),genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())+ " 00:00:00.0");
sql="select a.curr_code from finent a, site b where b.fin_entity = a.fin_entity and b.site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lssitecode);
rs = pstmt.executeQuery();
if (rs.next()) {
lscurrcodebase = checkNull(rs.getString(1));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(lscurrcode !=null && lscurrcode.trim().length()>0)
{
lcexchrate=finCommon.getDailyExchRateSellBuy(lscurrcode, lscurrcodebase, lssitecode, Effdate1, "B", conn);
valueXmlString.append("<exch_rate__ins protect =\"1\">").append("<![CDATA[" + lcexchrate + "]]>").append("</exch_rate__ins>");
// gbf_exchrate_protect(ls_currcode,ls_sitecode,'exch_rate__clr') remaining in code
}
lcexchrate3 = checkNull(genericUtility.getColumnValue( "exch_rate__frt", dom));
if(lcexchrate3 == null || lcexchrate3.trim().length() == 0)
{
lcexchrate3 = "0" ;
}
exchratefrt=lcexchrate3==null ?0:Double.parseDouble(lcexchrate3);
lcexchrate4 = checkNull(genericUtility.getColumnValue( "exch_rate__ins", dom ));
if(lcexchrate4 == null || lcexchrate4.trim().length() == 0)
{
lcexchrate4 = "0" ;
}
exchratefrtins=lcexchrate4==null ?0:Double.parseDouble(lcexchrate4);
lcexchrate5 = checkNull(genericUtility.getColumnValue( "exch_rate__clr", dom ));
if(lcexchrate5 == null || lcexchrate5.trim().length() == 0)
{
lcexchrate5 = "0" ;
}
exchratefrtclr=lcexchrate3==null ?0:Double.parseDouble(lcexchrate5);
lcexchrate6 = checkNull(genericUtility.getColumnValue( "exch_rate__othch", dom ));
if(lcexchrate6 == null || lcexchrate6.trim().length() == 0)
{
lcexchrate6 = "0" ;
}
exchratetoth=lcexchrate4==null ?0:Double.parseDouble(lcexchrate6);
E12GenericUtility genericUtility= new E12GenericUtility(); E12GenericUtility genericUtility= new E12GenericUtility();
double lcadditionalcost=0; double lcadditionalcost=0;
try try
......
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