Commit 093767c3 authored by kmandhre's avatar kmandhre

add request date ,dlv date ,account code and cctr code in detail


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92946 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1bf477ff
...@@ -87,9 +87,14 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -87,9 +87,14 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
String indentNo = ""; String indentNo = "";
String tranDateS = ""; String tranDateS = "";
String unitRate=""; String unitRate="";
String acctCode = "",cctrCode = "";
System.out.println("editFlag ---->>>["+editFlag+"]"); System.out.println("editFlag ---->>>["+editFlag+"]");
String unit = ""; String unit = "";
String updateFlag = "",status = ""; String updateFlag = "",status = "";
String taxChap = "";
String taxClass = "";
String taxEnv = "";
int ctr = 0; int ctr = 0;
int currentFormNo = 0; int currentFormNo = 0;
int cnt = 0; int cnt = 0;
...@@ -144,7 +149,7 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -144,7 +149,7 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
{ {
itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom)); itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom));
// added by cpandey Validation for duplicate tran id in boqhdr on 07/03/13 // added by cpandey Validation for duplicate tran id in boqhdr on 07/03/13
sql = "select count(*) from boqhdr where tran_id = ?"; /*sql = "select count(*) from boqhdr where tran_id = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId); pstmt.setString(1, tranId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -161,9 +166,11 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -161,9 +166,11 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
errCode = "VTDUPTRID"; errCode = "VTDUPTRID";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }*/
// end of validation // end of validation
//added by cpandey validation for duplicate entry of indent no in boqhdr on 07/03/13 //added by cpandey validation for duplicate entry of indent no in boqhdr on 07/03/13
if("A".equalsIgnoreCase(editFlag))
{
sql = "select count(*) from boqhdr where indent_no = ?"; sql = "select count(*) from boqhdr where indent_no = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, indentNo); pstmt.setString(1, indentNo);
...@@ -181,9 +188,10 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -181,9 +188,10 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
errCode = "VTDUPINDNO"; errCode = "VTDUPINDNO";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
}
//end of addition //end of addition
//changes done by cpandey for approved indent no status = 'A' //changes done by cpandey for approved indent no status = 'A'
sql = "select count(*) from indent where status = 'A' and item_code = ?"; sql = "select count(*) from indent where status = 'A' and item_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -672,6 +680,154 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -672,6 +680,154 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
} }
} }
} }
else if (childNodeName.trim().equalsIgnoreCase("tax_class"))
{
taxClass=checkNull(this.genericUtility.getColumnValue("tax_class", dom));
if(taxClass != null && taxClass.trim().length() > 0)
{
sql = "select count(*) from taxClass where tax_class = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, taxClass);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt == 0 )
{
errCode = "VTTAXCLA1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
/*else
{
errCode = "VMTXCLNUL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}*/
}
else if (childNodeName.trim().equalsIgnoreCase("tax_chap"))
{
taxChap=checkNull(this.genericUtility.getColumnValue("tax_chap", dom));
if(taxChap != null && taxChap.trim().length() > 0)
{
sql = "select count(*) from taxChap where tax_chap = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, taxChap);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt == 0 )
{
errCode = "INTAXCHAP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
/*else
{
errCode = "VMTXCPNUL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}*/
}
else if (childNodeName.trim().equalsIgnoreCase("tax_env"))
{
taxEnv=checkNull(this.genericUtility.getColumnValue("tax_env", dom));
if(taxEnv != null && taxEnv.trim().length() > 0)
{
sql = "select count(*) from taxEnv where tax_env = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, taxEnv);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt == 0 )
{
errCode = "INTAXENV";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
/*else
{
errCode = "VMTAXENV";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}*/
}
else if (childNodeName.trim().equalsIgnoreCase("acct_code__dr"))
{
acctCode = checkNull(this.genericUtility.getColumnValue("acct_code__dr", dom));
if(acctCode != null && acctCode.trim().length() > 0)
{
sql = " SELECT COUNT(*) FROM ACCOUNTS WHERE ACCT_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt == 0 )
{
errCode = "VMACCTBK";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.trim().equalsIgnoreCase("cctr_code__dr"))
{
cctrCode = checkNull(this.genericUtility.getColumnValue("cctr_code__dr", dom));
if(cctrCode != null && cctrCode.trim().length() > 0)
{
sql = " SELECT COUNT(*) FROM COSTCTR WHERE CCTR_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctrCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt == 0 )
{
errCode = "VMCCTRMT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
} }
valueXmlString.append("</Detail1>"); valueXmlString.append("</Detail1>");
...@@ -810,6 +966,9 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -810,6 +966,9 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
String unitStd=""; String unitStd="";
String descr = ""; String descr = "";
String siteCode = ""; String siteCode = "";
String taxChap = "";
String taxClass = "";
String taxEnv = "";
int ctr = 0; int ctr = 0;
int currentFormNo = 0; int currentFormNo = 0;
double quantity = 0.0; double quantity = 0.0;
...@@ -820,7 +979,7 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -820,7 +979,7 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
double quantityStduom = 0.0 ; double quantityStduom = 0.0 ;
double rateStduom = 0.0 ; double rateStduom = 0.0 ;
double convQtuomStduom = 0.0; double convQtuomStduom = 0.0;
java.util.Date reqDate = null;
int childNodeListLength = 0; int childNodeListLength = 0;
java.util.Date statusDate = null; java.util.Date statusDate = null;
ArrayList errList = new ArrayList(); ArrayList errList = new ArrayList();
...@@ -1110,13 +1269,13 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -1110,13 +1269,13 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
amountBc = amount*stdExrt; amountBc = amount*stdExrt;
System.out.println("amountsssssssss"+quantity+""+rate+""+stdExrt+""+amount+""+amountBc); System.out.println("amountsssssssss"+quantity+""+rate+""+stdExrt+""+amount+""+amountBc);
valueXmlString.append("<amount>").append("<![CDATA["+amount+"]]>").append("</amount>"); valueXmlString.append("<amount>").append("<![CDATA["+amount+"]]>").append("</amount>");
valueXmlString.append("<amount__bc>").append("<![CDATA["+amountBc+"]]>").append("</amount__bc>"); valueXmlString.append("<amount__bc>").append("<![CDATA["+amountBc+"]]>").append("</amount__bc>");
unitRate=checkNull(this.genericUtility.getColumnValue("unit__rate", dom)); unitRate=checkNull(this.genericUtility.getColumnValue("unit__rate", dom));
unit=checkNull(this.genericUtility.getColumnValue("unit", dom)); unit=checkNull(this.genericUtility.getColumnValue("unit", dom));
itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom)); itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom));
if(unitRate.equalsIgnoreCase(unit)) if(unitRate.equalsIgnoreCase(unit))
{ {
valueXmlString.append("<conv__qty_stduom >").append("<![CDATA["+1+"]]>").append("</conv__qty_stduom>"); valueXmlString.append("<conv__qty_stduom >").append("<![CDATA["+1+"]]>").append("</conv__qty_stduom>");
...@@ -1140,7 +1299,7 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -1140,7 +1299,7 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
valueXmlString.append("<conv__qty_stduom >").append("<![CDATA["+convQtuomStduom+"]]>").append("</conv__qty_stduom>"); valueXmlString.append("<conv__qty_stduom >").append("<![CDATA["+convQtuomStduom+"]]>").append("</conv__qty_stduom>");
//valueXmlString.append("<rate__stduom >").append("<![CDATA["+quantityStduom+"]]>").append("</rate__stduom>"); //valueXmlString.append("<rate__stduom >").append("<![CDATA["+quantityStduom+"]]>").append("</rate__stduom>");
valueXmlString.append("<quantity__stduom >").append("<![CDATA["+quantityStduom+"]]>").append("</quantity__stduom>"); valueXmlString.append("<quantity__stduom >").append("<![CDATA["+quantityStduom+"]]>").append("</quantity__stduom>");
ArrayList convRateList = distCommon.getConvQuantityFact(unit, unitRate, itemCode, rate, 0, conn); ArrayList convRateList = distCommon.getConvQuantityFact(unit, unitRate, itemCode, rate, 0, conn);
System.out.println("convRateList = "+convRateList); System.out.println("convRateList = "+convRateList);
...@@ -1221,18 +1380,58 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -1221,18 +1380,58 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail2>"); valueXmlString.append("<Detail2>");
childNodeListLength = childNodeList.getLength(); childNodeListLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeListLength; ctr++)
do
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
if (childNodeName.trim().equalsIgnoreCase("itm_default")) if (childNodeName.equals(currentColumn))
{
childNode.getFirstChild();
}
ctr++;
}
while ((ctr < childNodeListLength) && (!childNodeName.equals(currentColumn)));
System.out.println("CURRENT COLUMN ["+currentColumn+"]");
//for (ctr = 0; ctr < childNodeListLength; ctr++) //comment by kunal on 5/04/13
//{
//childNode = childNodeList.item(ctr);
//childNodeName = childNode.getNodeName();
if (currentColumn.trim().equalsIgnoreCase("itm_default"))
{ {
indentNo=checkNull(this.genericUtility.getColumnValue("indent_no", dom1));
System.out.println("indent no is "+indentNo);
sql = "SELECT REQ_DATE FROM INDENT WHERE IND_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, indentNo);
rs = pstmt.executeQuery();
if(rs.next())
{
reqDate = rs.getDate(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(reqDate == null)
{
valueXmlString.append("<req_date>").append("<![CDATA["+""+"]]>").append("</req_date>");
}
else
{
valueXmlString.append("<req_date>").append("<![CDATA["+sdf.format(reqDate)+"]]>").append("</req_date>");
}
} }
else if (currentColumn.trim().equalsIgnoreCase("item_code")) else if (currentColumn.trim().equalsIgnoreCase("item_code"))
{ {
itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom)); itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom));
sql = "select descr ,item_ser ,unit ,unit__pur,unit__rate ,pack_code from item where item_code = ?";
sql = "select descr ,item_ser ,unit ,unit__pur,unit__rate ,pack_code,tax_chap,tax_class from item where item_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode); pstmt.setString(1, itemCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -1244,6 +1443,8 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -1244,6 +1443,8 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
unitPur = rs.getString(4)== null?"":rs.getString(3); unitPur = rs.getString(4)== null?"":rs.getString(3);
unitRate = rs.getString(5)== null?"":rs.getString(3); unitRate = rs.getString(5)== null?"":rs.getString(3);
packCode = rs.getString("pack_code")== null?"":rs.getString("pack_code"); packCode = rs.getString("pack_code")== null?"":rs.getString("pack_code");
taxChap = rs.getString("tax_chap")== null?"":rs.getString("tax_chap");
taxClass = rs.getString("tax_class")== null?"":rs.getString("tax_class");
} }
rs.close(); rs.close();
rs = null; rs = null;
...@@ -1256,7 +1457,9 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -1256,7 +1457,9 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
valueXmlString.append("<unit__std >").append("<![CDATA["+unit+"]]>").append("</unit__std>"); valueXmlString.append("<unit__std >").append("<![CDATA["+unit+"]]>").append("</unit__std>");
valueXmlString.append("<unit__rate>").append("<![CDATA["+unitRate+"]]>").append("</unit__rate>"); valueXmlString.append("<unit__rate>").append("<![CDATA["+unitRate+"]]>").append("</unit__rate>");
valueXmlString.append("<pack_code>").append("<![CDATA["+packCode+"]]>").append("</pack_code>"); valueXmlString.append("<pack_code>").append("<![CDATA["+packCode+"]]>").append("</pack_code>");
valueXmlString.append("<tax_chap>").append("<![CDATA["+taxChap+"]]>").append("</tax_chap>");
valueXmlString.append("<tax_class>").append("<![CDATA["+taxClass+"]]>").append("</tax_class>");
sql = "select descr from packing where pack_code = ?"; sql = "select descr from packing where pack_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, packCode); pstmt.setString(1, packCode);
...@@ -1272,8 +1475,9 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -1272,8 +1475,9 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
valueXmlString.append("<packing_descr >").append("<![CDATA["+descrPackCode+"]]>").append("</packing_descr>"); valueXmlString.append("<packing_descr >").append("<![CDATA["+descrPackCode+"]]>").append("</packing_descr>");
} }
else if (childNodeName.trim().equalsIgnoreCase("unit__rate")) else if (currentColumn.trim().equalsIgnoreCase("unit__rate"))
{ {
System.out.println("unit__rate ITEM CHANGE ="); System.out.println("unit__rate ITEM CHANGE =");
unitRate=checkNull(this.genericUtility.getColumnValue("unit__rate", dom)); unitRate=checkNull(this.genericUtility.getColumnValue("unit__rate", dom));
...@@ -1299,25 +1503,25 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -1299,25 +1503,25 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
System.out.println("convQtyList = "+convQtyList); System.out.println("convQtyList = "+convQtyList);
convQtuomStduom = Double.parseDouble(convQtyList.get(0).toString()); convQtuomStduom = Double.parseDouble(convQtyList.get(0).toString());
//arraylist for rate stduom //arraylist for rate stduom
ArrayList convRateList = distCommon.getConvQuantityFact(unit, unitRate, itemCode, rate, 0, conn); ArrayList convRateList = distCommon.getConvQuantityFact(unit, unitRate, itemCode, rate, 0, conn);
convQtuomStduom = Double.parseDouble(convRateList.get(0).toString()); convQtuomStduom = Double.parseDouble(convRateList.get(0).toString());
rateStduom = Double.parseDouble(convRateList.get(1).toString()); rateStduom = Double.parseDouble(convRateList.get(1).toString());
System.out.println("meffQty ["+convQtuomStduom+"]"); System.out.println("meffQty ["+convQtuomStduom+"]");
//changes done by cpandey for rate__stduom -- rateStduom //changes done by cpandey for rate__stduom -- rateStduom
System.out.println("meffQty ["+rateStduom+"]"); System.out.println("meffQty ["+rateStduom+"]");
valueXmlString.append("<conv__qty_stduom >").append("<![CDATA["+convQtuomStduom+"]]>").append("</conv__qty_stduom>"); valueXmlString.append("<conv__qty_stduom >").append("<![CDATA["+convQtuomStduom+"]]>").append("</conv__qty_stduom>");
//valueXmlString.append("<rate__stduom >").append("<![CDATA["+quantityStduom+"]]>").append("</rate__stduom>"); //valueXmlString.append("<rate__stduom >").append("<![CDATA["+quantityStduom+"]]>").append("</rate__stduom>");
valueXmlString.append("<rate__stduom >").append("<![CDATA["+rateStduom+"]]>").append("</rate__stduom>"); valueXmlString.append("<rate__stduom >").append("<![CDATA["+rateStduom+"]]>").append("</rate__stduom>");
System.out.println("convRateList = "+convRateList); System.out.println("convRateList = "+convRateList);
System.out.println("meffQty ["+convQtuomStduom+"]"); System.out.println("meffQty ["+convQtuomStduom+"]");
quantityStduom = Double.parseDouble(convQtyList.get(1).toString()); quantityStduom = Double.parseDouble(convQtyList.get(1).toString());
System.out.println("meffQty ["+quantityStduom+"]"); System.out.println("meffQty ["+quantityStduom+"]");
//changes done by cpandey for quantity__stduom -- quantityStduom //changes done by cpandey for quantity__stduom -- quantityStduom
valueXmlString.append("<conv__rate_stduom >").append("<![CDATA["+convQtuomStduom+"]]>").append("</conv__rate_stduom>"); valueXmlString.append("<conv__rate_stduom >").append("<![CDATA["+convQtuomStduom+"]]>").append("</conv__rate_stduom>");
// valueXmlString.append("<quantity__stduom >").append("<![CDATA["+rateStduom+"]]>").append("</quantity__stduom>"); // valueXmlString.append("<quantity__stduom >").append("<![CDATA["+rateStduom+"]]>").append("</quantity__stduom>");
valueXmlString.append("<quantity__stduom >").append("<![CDATA["+quantityStduom+"]]>").append("</quantity__stduom>"); valueXmlString.append("<quantity__stduom >").append("<![CDATA["+quantityStduom+"]]>").append("</quantity__stduom>");
} }
...@@ -1358,7 +1562,7 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -1358,7 +1562,7 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
valueXmlString.append("<conv__qty_stduom >").append("<![CDATA["+convQtuomStduom+"]]>").append("</conv__qty_stduom>"); valueXmlString.append("<conv__qty_stduom >").append("<![CDATA["+convQtuomStduom+"]]>").append("</conv__qty_stduom>");
//valueXmlString.append("<rate__stduom >").append("<![CDATA["+quantityStduom+"]]>").append("</rate__stduom>"); //valueXmlString.append("<rate__stduom >").append("<![CDATA["+quantityStduom+"]]>").append("</rate__stduom>");
valueXmlString.append("<quantity__stduom >").append("<![CDATA["+quantityStduom+"]]>").append("</quantity__stduom>"); valueXmlString.append("<quantity__stduom >").append("<![CDATA["+quantityStduom+"]]>").append("</quantity__stduom>");
ArrayList convRateList = distCommon.getConvQuantityFact(unit, unitRate, itemCode, rate, 0, conn); ArrayList convRateList = distCommon.getConvQuantityFact(unit, unitRate, itemCode, rate, 0, conn);
System.out.println("convRateList = "+convRateList); System.out.println("convRateList = "+convRateList);
...@@ -1392,7 +1596,9 @@ implements BillofQuantityICLocal, BillofQuantityICRemote ...@@ -1392,7 +1596,9 @@ implements BillofQuantityICLocal, BillofQuantityICRemote
valueXmlString.append("<packing_descr >").append("<![CDATA["+descrPackCode+"]]>").append("</packing_descr>"); valueXmlString.append("<packing_descr >").append("<![CDATA["+descrPackCode+"]]>").append("</packing_descr>");
} }
}
//}
valueXmlString.append("</Detail2>"); valueXmlString.append("</Detail2>");
......
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