Commit ccca4a02 authored by pdas's avatar pdas

changes for item change of last purchase rate in po ammendment


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97889 ce508802-f39f-4f6c-b175-0d175dae99d5
parent def0651d
......@@ -3919,10 +3919,11 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
}
else if (currentColumn.trim().equalsIgnoreCase("ind_no")) {
lineNoOrd = genericUtility.getColumnValue("line_no__ord",
dom);
itemCode = genericUtility.getColumnValue("item_code", dom);
if (lineNoOrd == null || lineNoOrd.trim().length() == 0) {
indNo = genericUtility.getColumnValue("ind_no", dom);
itemSer = genericUtility
......@@ -3936,6 +3937,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
.append("</item_code>");
sql = " Select item_code,unit__ind,(quantity__stduom - ord_qty) as pendqty ,req_date,site_code__dlv,conv__qty_stduom,"
+ " acct_code, cctr_code ,remarks from indent where ind_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, indNo);
rs = pstmt.executeQuery();
......@@ -4001,7 +4003,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
"<![CDATA[" + rate + "]]>").append(
"</rate>");
sql = " Select descr, loc_code, unit, unit__pur into :mdescr, :mloc, :ls_unit, :ls_unitpur from item where item_code = :itemcode ";
sql = " Select descr, loc_code, unit, unit__pur from item where item_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
......@@ -4087,13 +4089,21 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
valueXmlString.append("<rate__stduom >").append(
"<![CDATA[" + rate + "]]>").append(
"</rate__stduom>");
String reqDateStr = sdf.format(reqDate.getTime());
String reqDateStr="";
if(reqDate != null)
{
reqDateStr = sdf.format(reqDate.getTime());
}
valueXmlString.append("<req_date >").append(
"<![CDATA[" + reqDateStr + "]]>").append(
"</req_date>");
valueXmlString.append("<dlv_date >").append(
"<![CDATA[" + reqDateStr + "]]>").append(
"</dlv_date>");
valueXmlString.append("<pack_code >").append(
"<![CDATA[" + packCode + "]]>").append(
"</pack_code>");
......@@ -4105,7 +4115,9 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
dom1);
itemCode = genericUtility.getColumnValue(
"item_code", dom);
if (acct_dr == null || acct_dr.trim().length() == 0) {
cctr_dr = fincommon.getFromAcctDetr(itemCode,
itemSer, "IN", conn);
......@@ -4116,6 +4128,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
acct_dr = cctr_drStr[0];
} else {
acct_dr = "";
}
}
......@@ -4149,6 +4162,36 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
valueXmlString.append("<cctr_code__cr >").append(
"<![CDATA[" + cctr_cr + "]]>").append(
"</cctr_code__cr>");
lastPurcRate = 0d;
lastPurcPo = "";
// indent no = genericUtility.getColumnValue("item_code",
// dom); //Priyanka
siteCode = checkNull(genericUtility.getColumnValue(
"site_code__dlv", dom1));
System.out.println("Sitecode isssssss" + siteCode);
ordDateHdr = checkNull(genericUtility.getColumnValue(
"ord_date", dom1));
ordDate = Timestamp.valueOf(genericUtility
.getValidDateString(ordDateHdr, genericUtility
.getApplDateFormat(), genericUtility
.getDBDateFormat())
+ " 00:00:00.0");
lastPurcRate = getLastPurcRate(itemCode, ordDate,
siteCode, conn);
System.out.println("lastPurcRate ::[ " + lastPurcRate
+ " ]");
lastPurcPo = getLastPurcPo(itemCode, ordDate, siteCode,
conn);
System.out.println("lastPurcPo ::[ " + lastPurcPo
+ " ]");
valueXmlString.append("<last_purc_rate>").append(
"<![CDATA[" + lastPurcRate + "]]>").append(
"</last_purc_rate>");
valueXmlString.append("<last_purc_po>").append(
"<![CDATA[" + lastPurcPo + "]]>").append(
"</last_purc_po>");
} else {
valueXmlString
.append("<item_code protect = \"0\">")
......@@ -4433,6 +4476,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
} else if (currentColumn.trim().equalsIgnoreCase("quantity")) {
String quantityStr = genericUtility.getColumnValue(
"quantity", dom);
quantity = quantityStr == null ? 0 : Double
.parseDouble(quantityStr);
unit = genericUtility.getColumnValue("unit", dom);
......@@ -4488,6 +4532,35 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
valueXmlString.append("<quantity__stduom>").append(
"<![CDATA[" + quantityStduom + "]]>").append(
"</quantity__stduom>");
lastPurcRate = 0d;
lastPurcPo = "";
// quantity = genericUtility.getColumnValue("item_code",
// dom); //Priyanka
siteCode = checkNull(genericUtility.getColumnValue(
"site_code__dlv", dom1));
System.out.println("Sitecode isssssss" + siteCode);
ordDateHdr = checkNull(genericUtility.getColumnValue(
"ord_date", dom1));
ordDate = Timestamp.valueOf(genericUtility
.getValidDateString(ordDateHdr, genericUtility
.getApplDateFormat(), genericUtility
.getDBDateFormat())
+ " 00:00:00.0");
lastPurcRate = getLastPurcRate(itemCode, ordDate, siteCode,
conn);
System.out.println("lastPurcRate ::[ " + lastPurcRate
+ " ]");
lastPurcPo = getLastPurcPo(itemCode, ordDate, siteCode,
conn);
System.out.println("lastPurcPo ::[ " + lastPurcPo + " ]");
valueXmlString.append("<last_purc_rate>").append(
"<![CDATA[" + lastPurcRate + "]]>").append(
"</last_purc_rate>");
valueXmlString.append("<last_purc_po>").append(
"<![CDATA[" + lastPurcPo + "]]>").append(
"</last_purc_po>");
} else if (currentColumn.trim().equalsIgnoreCase("rate")) {
......@@ -4499,6 +4572,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
unitStd = genericUtility.getColumnValue("unit__std", dom);
itemCode = genericUtility.getColumnValue("item_code", dom);
unit = genericUtility.getColumnValue("unit", dom);
conv_rtuom_stduomStr = genericUtility.getColumnValue(
"conv__rtuom_stduom", dom);
conv_rtuom_stduom = conv_rtuom_stduomStr == null ? 0
......@@ -4535,6 +4609,34 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
"</rate__stduom>");
valueXmlString.append("<rate__clg>").append(
"<![CDATA[" + rate + "]]>").append("</rate__clg>");
lastPurcRate = 0d;
lastPurcPo = "";
// rate = genericUtility.getColumnValue("item_code",
// dom); //Priyanka
siteCode = checkNull(genericUtility.getColumnValue(
"site_code__dlv", dom1));
System.out.println("Sitecode isssssss" + siteCode);
ordDateHdr = checkNull(genericUtility.getColumnValue(
"ord_date", dom1));
ordDate = Timestamp.valueOf(genericUtility
.getValidDateString(ordDateHdr, genericUtility
.getApplDateFormat(), genericUtility
.getDBDateFormat())
+ " 00:00:00.0");
lastPurcRate = getLastPurcRate(itemCode, ordDate, siteCode,
conn);
System.out.println("lastPurcRate ::[ " + lastPurcRate
+ " ]");
lastPurcPo = getLastPurcPo(itemCode, ordDate, siteCode,
conn);
System.out.println("lastPurcPo ::[ " + lastPurcPo + " ]");
valueXmlString.append("<last_purc_rate>").append(
"<![CDATA[" + lastPurcRate + "]]>").append(
"</last_purc_rate>");
valueXmlString.append("<last_purc_po>").append(
"<![CDATA[" + lastPurcPo + "]]>").append(
"</last_purc_po>");
} else if (currentColumn.trim().equalsIgnoreCase(
"conv__rtuom_stduom")) {
conv_rtuom_stduomStr = genericUtility.getColumnValue(
......@@ -4579,6 +4681,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
itemCode = genericUtility.getColumnValue("item_code", dom);
String quantityStr = genericUtility.getColumnValue(
"quantity", dom);
quantity = quantityStr == null ? 0 : Double
.parseDouble(quantityStr);
conv_qty_stduom = 0;
......@@ -4602,6 +4705,35 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
valueXmlString.append("<quantity__stduom>").append(
"<![CDATA[" + qty_stduom + "]]>").append(
"</quantity__stduom>");
lastPurcRate = 0d;
lastPurcPo = "";
// unit = genericUtility.getColumnValue("item_code",
// dom); //Priyanka
siteCode = checkNull(genericUtility.getColumnValue(
"site_code__dlv", dom1));
System.out.println("Sitecode isssssss" + siteCode);
ordDateHdr = checkNull(genericUtility.getColumnValue(
"ord_date", dom1));
ordDate = Timestamp.valueOf(genericUtility
.getValidDateString(ordDateHdr, genericUtility
.getApplDateFormat(), genericUtility
.getDBDateFormat())
+ " 00:00:00.0");
lastPurcRate = getLastPurcRate(itemCode, ordDate, siteCode,
conn);
System.out.println("lastPurcRate ::[ " + lastPurcRate
+ " ]");
lastPurcPo = getLastPurcPo(itemCode, ordDate, siteCode,
conn);
System.out.println("lastPurcPo ::[ " + lastPurcPo + " ]");
valueXmlString.append("<last_purc_rate>").append(
"<![CDATA[" + lastPurcRate + "]]>").append(
"</last_purc_rate>");
valueXmlString.append("<last_purc_po>").append(
"<![CDATA[" + lastPurcPo + "]]>").append(
"</last_purc_po>");
} else if (currentColumn.trim().equalsIgnoreCase("unit__rate")) {
unitRate = genericUtility.getColumnValue("unit__rate", dom);
unitStd = genericUtility.getColumnValue("unit__std", dom);
......
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