Commit e4c42fe1 authored by cpandey's avatar cpandey

add validation for approved indent no


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92149 ce508802-f39f-4f6c-b175-0d175dae99d5
parent da87e71a
......@@ -87,7 +87,7 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
String unitRate="";
System.out.println("editFlag ---->>>["+editFlag+"]");
String unit = "";
String updateFlag = "";
String updateFlag = "",status = "";
int ctr = 0;
int currentFormNo = 0;
int cnt = 0;
......@@ -118,19 +118,12 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail1>");
int childNodeListLength = childNodeList.getLength();
System.out.println("EDIT FLAG --- 1-->>["+editFlag+"]");
tranId=checkNull(this.genericUtility.getColumnValue("tran_id", dom));
System.out.println("tran id from boqdet --4-->>>>["+tranId+"]");
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
// if (("Attribute").equalsIgnoreCase(childNodeName))
// {
// updateFlag = childNodeName.getNamedItem("updateFlag") ==null ? "": childNodeName.getNamedItem("updateFlag").getNodeValue();
// break;
// }
System.out.println("CURRENT COLUMN IN VALIDATION ["+childNodeName+"]");
if (childNodeName.equalsIgnoreCase("tran_date"))
{
......@@ -149,7 +142,8 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
if (indentNo != null && indentNo.trim().length() > 0 )
{
itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom));
sql = "select count(*) from indent where item_code = ?";
//changes done by cpandey for approved indent no status = 'A'
sql = "select count(*) from indent where status = 'A' and item_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
......@@ -161,13 +155,36 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
rs = null;
pstmt.close();
pstmt = null;
if(cnt == 0 )
{
errCode = "VTINDNO";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
//added by cpandey for approved indent no on 06/11/12
else
{
sql = "select status from indent where item_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
status = rs.getString("status");
System.out.println("Status of indent no-->> ["+status+"]");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if("A".equalsIgnoreCase(status.trim()))
{
errCode = "VTINDNONAP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
//end of changes
}
}
......@@ -175,12 +192,10 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
{
itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom));
System.out.println("Tran id from current application ----["+tranId+"]-->>");
//hitemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom1));
ditemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom2));
System.out.println("Detail item code --on header part--> ["+ditemCode+"] and detail item code---on header part--> ["+itemCode+"]");
itemCode = itemCode.trim();
ditemCode = ditemCode.trim();
//itemCode=this.genericUtility.getColumnValue("item_code", dom);
if (itemCode != null && itemCode.trim().length() > 0 )
{
sql = "select count(*) from item where item_code = ?";
......@@ -207,7 +222,8 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
errCode = "VMITEMBLK";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
//changes done by cpandey for matche item code from header and detail on in case of edite. on 05/11/12
if(("E").equalsIgnoreCase(editFlag))
{
sql = "select item_code from boqdet where tran_id = ?";
......@@ -238,6 +254,7 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
}
}
//end of changes on 05/11/12
else if (childNodeName.trim().equalsIgnoreCase("unit__rate"))
{
unitRate=checkNull(this.genericUtility.getColumnValue("unit__rate", dom));
......@@ -402,7 +419,6 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
rs = null;
pstmt.close();
pstmt = null;
if(cnt == 0)
{
errCode = "VMPROJ1";
......@@ -486,6 +502,7 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
//added by cpandey validation for matching item code from header and detial on 05/11/12
if(itemCode.trim().equalsIgnoreCase(hitemCode.trim()))
{
System.out.println("edit flag --4>>["+editFlag+"]");
......@@ -500,6 +517,7 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
}
}
//end of changes on 05/11/12
else if (childNodeName.trim().equalsIgnoreCase("unit__rate"))
{
unitRate=checkNull(this.genericUtility.getColumnValue("unit__rate", dom));
......@@ -883,8 +901,10 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
{
descrItem = checkNull(rs.getString(1));
itemSer = checkNull(rs.getString(2));
//unit = checkNull(rs.getString(3));
unitRate = checkNull(rs.getString(3));
//changes done by cpandey on 06/11/12
unit = checkNull(rs.getString(3));
unitRate = checkNull(rs.getString(4));
System.out.println("item code dedscr--> ["+descrItem+"] and item series--> ["+itemSer+"] and unit--> ["+unit+"] and unitRate--> ["+unitRate+"]");
}
rs.close();
rs = null;
......@@ -893,7 +913,8 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
valueXmlString.append("<item_descr >").append("<![CDATA["+descrItem+"]]>").append("</item_descr>");
valueXmlString.append("<item_ser>").append("<![CDATA["+itemSer+"]]>").append("</item_ser>");
//valueXmlString.append("<unit>").append("<![CDATA["+unit+"]]>").append("</unit>");
//changes done by cpandey on 06/11/12 according to qc required
valueXmlString.append("<unit>").append("<![CDATA["+unit+"]]>").append("</unit>");
valueXmlString.append("<unit__rate>").append("<![CDATA["+unitRate+"]]>").append("</unit__rate>");
}
else if (currentColumn.trim().equalsIgnoreCase("item_code"))
......@@ -1047,10 +1068,6 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
System.out.println("amountsssssssss"+quantity+""+rate+""+stdExrt+""+amount+""+amountBc);
valueXmlString.append("<amount>").append("<![CDATA["+amount+"]]>").append("</amount>");
valueXmlString.append("<amount__bc>").append("<![CDATA["+amountBc+"]]>").append("</amount__bc>");
unitRate=checkNull(this.genericUtility.getColumnValue("unit__rate", dom));
unit=checkNull(this.genericUtility.getColumnValue("unit", dom));
itemCode=checkNull(this.genericUtility.getColumnValue("item_code", 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