Commit f419ed26 authored by manohar's avatar manohar

item_code default set as X and accordingly validation and itemchanged code changed


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94126 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 02044ce4
......@@ -189,7 +189,7 @@ public class WoContract extends ValidatorEJB implements WoContractLocal, WoContr
itemCode = genericUtility.getColumnValue("item_code", dom);
itemCode = itemCode == null ? "" : itemCode.trim();
if(itemCode != null && itemCode.trim().length() > 0)
if(itemCode != null && itemCode.trim().length() > 0 && !"X".equals(itemCode.trim()))
{
sql = " select count(*) from bomdet,workorder "
+ " where workorder.bom_code = bomdet.bom_code "
......@@ -237,12 +237,13 @@ public class WoContract extends ValidatorEJB implements WoContractLocal, WoContr
pstmt = null;
}
}
else
{
errCode = "VTITMNL"; //null item code
errString = itmDBAccessEJB.getErrorString("","VTITMNL",userId);
break ;
}
// 14/01/14 manoharan allow blank so that for all rubber stereo the sae contract will be used so commented
//else
//{
// errCode = "VTITMNL"; //null item code
// errString = itmDBAccessEJB.getErrorString("","VTITMNL",userId);
// break ;
//}
}
if(childNodeName.equalsIgnoreCase("contract_no"))
{
......@@ -447,6 +448,9 @@ public class WoContract extends ValidatorEJB implements WoContractLocal, WoContr
pstmt = null;
valueXmlString.append("<site_code> ").append("<![CDATA["+loginSite+"]]>").append("</site_code>");
valueXmlString.append("<site_descr>").append("<![CDATA["+siteDescr+"]]>").append("</site_descr>");
// 14/01/14 manoharan set default as blank so that for all rubber stereo the same contract wil be used
valueXmlString.append("<item_code>").append("<![CDATA[X]]>").append("</item_code>");
valueXmlString.append("<item_descr>").append("<![CDATA[ALL ITEMS]]>").append("</item_descr>");
}
else if (currentColumn.trim().equalsIgnoreCase("site_code"))
{
......@@ -468,20 +472,29 @@ public class WoContract extends ValidatorEJB implements WoContractLocal, WoContr
else if(currentColumn.trim().equalsIgnoreCase("item_code"))
{
itemCode = genericUtility.getColumnValue("item_code",dom) ;
sql = " select descr from item where item_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode.trim());
rs = pstmt.executeQuery();
if(rs.next())
if (itemCode != null && !"X".equals(itemCode))
{
sql = " select descr from item where item_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode.trim());
rs = pstmt.executeQuery();
if(rs.next())
{
itemDescr = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<item_descr>").append("<![CDATA[" + itemDescr + "]]>").append("</item_descr>");
}
else
{
itemDescr = rs.getString(1);
valueXmlString.append("<item_code>").append("<![CDATA[X]]>").append("</item_code>");
valueXmlString.append("<item_descr>").append("<![CDATA[ALL ITEMS]]>").append("</item_descr>");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<item_descr>").append("<![CDATA[" + itemDescr + "]]>").append("</item_descr>");
}
else if((currentColumn.trim().equalsIgnoreCase("itm_defaultedit")))
......
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