Commit adcaf74f authored by manohar's avatar manohar

changes to carry forward porder number, date and discount percent while adding new detail


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91293 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e8b5469a
......@@ -1166,6 +1166,92 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
valueXmlString.append("<discount_per>").append("<![CDATA["+ discPerc + "]]>").append("</discount_per>");
}
valueXmlString.append("<item_ser>").append("<![CDATA["+ itemSeries != null ? itemSeries : "" + "]]>").append("</item_ser>");
/////////////////////////////////////////////////////////////////////////////////////////////////////
// 27/05/10 manoharan bill_no, bill_date and discount to be carried forward
NodeList detail2List = null;
Node detailNode = null;
NodeList childDetilList = null;
Node chidDetailNode = null;
detail2List = dom2.getElementsByTagName("Detail2");
itemCode = genericUtility.getColumnValue("item_code",dom);
lineNo = genericUtility.getColumnValue("line_no",dom);
//System.out.println("lineNo in str " + lineNo);
//System.out.println("lineNo after trim " + lineNo.trim());
if (detail2List.getLength() > 1)
{
System.out.println("Not 1st detail duplicating..................... ");
detailNode = detail2List.item(detail2List.getLength() - 2);
childDetilList = detailNode.getChildNodes();
String sDiscPer = "0", sDiscPerUnit = "0", porderNo = null, porderDate = null;
for(int p =0; p < childDetilList.getLength(); p++ )
{
chidDetailNode = childDetilList.item(p);
//System.out.println("current child node>>>>>>>>>> " + chidDetailNode.getNodeName() );
if(chidDetailNode.getNodeName().equalsIgnoreCase("discount_per") )
{
//System.out.println("discount_per node found >>>>>" + chidDetailNode.getNodeName());
if(chidDetailNode.getFirstChild() != null )
{
sDiscPer = chidDetailNode.getFirstChild().getNodeValue();
if(sDiscPer == null || sDiscPer.trim().length() == 0)
{
sDiscPer = "0";
}
}
}
if(chidDetailNode.getNodeName().equalsIgnoreCase("discount_per_unit") )
{
//System.out.println("discount_per_unit node found >>>>>" + chidDetailNode.getNodeName());
if(chidDetailNode.getFirstChild() != null )
{
sDiscPerUnit = chidDetailNode.getFirstChild().getNodeValue();
if(sDiscPerUnit == null || sDiscPerUnit.trim().length() == 0)
{
sDiscPerUnit = "0";
}
}
}
if(chidDetailNode.getNodeName().equalsIgnoreCase("porder_no") )
{
//System.out.println("porder_no node found >>>>>" + chidDetailNode.getNodeName());
if(chidDetailNode.getFirstChild() != null )
{
porderNo = chidDetailNode.getFirstChild().getNodeValue();
if(porderNo == null || porderNo.trim().length() == 0)
{
porderNo = " ";
}
}
}
if(chidDetailNode.getNodeName().equalsIgnoreCase("porder_date") )
{
//System.out.println("porder_date node found >>>>>" + chidDetailNode.getNodeName());
if(chidDetailNode.getFirstChild() != null )
{
porderDate = chidDetailNode.getFirstChild().getNodeValue();
if(porderDate == null || porderDate.trim().length() == 0)
{
porderDate = " ";
}
}
}
// append the values in current detail
}
valueXmlString.append("<discount_per>").append("<![CDATA[" + ( sDiscPer )+ "]]>").append("</discount_per>");
valueXmlString.append("<discount_per_unit>").append("<![CDATA[" + ( sDiscPerUnit )+ "]]>").append("</discount_per_unit>");
if(porderNo != null && !"null".equals(porderNo) && porderNo.trim().length() > 0)
{
valueXmlString.append("<porder_no>").append("<![CDATA[" + ( porderNo )+ "]]>").append("</porder_no>");
}
if(porderDate != null && !"null".equals(porderDate) && porderDate.trim().length() > 0)
{
valueXmlString.append("<porder_date>").append("<![CDATA[" + ( porderDate )+ "]]>").append("</porder_date>");
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
}
if (currentColumn.trim().equals( "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