Commit 638ecb7c authored by ssalve's avatar ssalve

Sarita : Done changes for Validation and Itemchange for Purchase Order Receipt...

Sarita : Done changes for Validation and Itemchange for Purchase Order Receipt Reference (Header) and Line Number Receipt(Detail) on 17 OCT 2018 

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@192081 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7adcbc96
......@@ -154,7 +154,7 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
double mqty=0.0,mqty1=0.0,mqty2=0.0,mperc=0.0,ld_qtytol=0.0,lc_rcp_qty=0.0,lc_old_qty=0.0,lc_qty=0.0;
double lc_stk_qty=0.0,lc_qty_std=0.0, lc_order_qty=0.0 , lc_porcpqty=0.0, lc_ct3_qty=0.0, lc_qty_used=0.0;
String lsmsg="",startStr="",endStr="",descrStr="",descrStart="",descrEnd="",value="";
String lineNoRcp = "";//Added by sarita on 16 OCT 2018
try {
System.out.println("@@@@@@@@ wfvaldata called");
//conn = connDriver.getConnectDB("DriverITM");
......@@ -2147,7 +2147,25 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
}
//Added by sarita for line_no__rcp Validation on 16 OCT 2018 [START]
if("line_no__rcp".equalsIgnoreCase(childNodeName))
{
System.out.println(" ********* Inside [line_no__rcp] Validation ************");
tranIdRef = checkNull(genericUtility.getColumnValue("tran_id__ref", dom1));
lineNoRcp = checkNull(genericUtility.getColumnValue("line_no__rcp", dom));
System.out.println("tran_id__ref ["+tranIdRef+"] \t line_no__rcp ["+lineNoRcp+"]");
if(tranIdRef != null && tranIdRef.trim().length() > 0)
{
if(lineNoRcp == null || lineNoRcp.trim().length() == 0)
{
errCode = "VTINVRCPNO";//Invalid line no Rcp
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
//Added by sarita for line_no__rcp Validation on 16 OCT 2018 [END]
}
}
int errListSize = errList.size();
......@@ -3743,6 +3761,7 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
lctareweight = 0,
netAmt = 0;
String reStr="";
String tranIdRef = "", lineNoRcp = "";//Added by sarita on 16 OCT 2018
System.out
.println("**********************In case 2 ***********************");
......@@ -3782,8 +3801,9 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
ctr++;
} while (ctr < childNodeListLength && !childNodeName.equals(currentColumn));
if (currentColumn.trim().equalsIgnoreCase("itm_defaultedit")) {
if (currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
{
System.out.println("Inside itm_defaultedit form no. 2 --");
ls_retopt = checkNull(genericUtility.getColumnValue(
"ret_opt", dom));
System.out.println("ls_retopt@@["+ls_retopt+"]");
......@@ -3842,6 +3862,115 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
valueXmlString.append("<purc_order protect =\"0\">")
.append("<![CDATA[]]>").append("</purc_order>");
}
//Added by sarita on 16 OCT 2018 to set rate using price_list type [START]
tranIdRef = checkNull(genericUtility.getColumnValue(
"tran_id__ref", dom1));
lineNoRcp = checkNull(genericUtility.getColumnValue(
"line_no__rcp", dom));
mPordNo = checkNull(genericUtility.getColumnValue(
"purc_order", dom1));
mItem = checkNull(genericUtility.getColumnValue(
"item_code", dom));
mlotno = checkNull(genericUtility.getColumnValue(
"lot_no", dom));
mPordLine = checkNull(genericUtility.getColumnValue(
"line_no__ord", dom));
System.out.println("tranIdRef ["+tranIdRef+"] \t lineNoRcp["+lineNoRcp+"] \t mPordNo ["+mPordNo+"] \t mItem ["+mItem+"] \t mlotno ["+mlotno+"]\t mPordLine ["+mPordLine+"]");
sql = "Select rate From porcpdet where purc_order = ? and line_no__ord = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mPordNo);
pstmt.setString(2, mPordLine);
rs = pstmt.executeQuery();
if (rs.next()) {
mRate = rs.getDouble("rate");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(tranIdRef == null || tranIdRef.trim().length() == 0)
{
if(lineNoRcp != null && lineNoRcp.trim().length() > 0)
{
sql = "select price_list "
+ " from porder where purc_order = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mPordNo);//
rs = pstmt.executeQuery();
if (rs.next()) {
ls_pricelist = checkNull(rs.getString(1));
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
String listType = disscommon.getPriceListType(ls_pricelist,conn);
System.out.println("listType is ["+listType+"]");
String lsporateoption = "";
if((mrate <= 0) && ("B".equalsIgnoreCase(listType)))
{
mrate = disscommon.pickRate(ls_pricelist,
ls_tran_id, mItem, mlotno, "B", conn);
System.out.println("mrate[" + mrate + "]");
valueXmlString.append("<rate protect =\"1\">").append("<![CDATA["+mrate+"]]>").append("</rate>");
}
else
{
System.out.println("mrate[" + mrate + "]");
sql="select case when po_rate_option is null then 'N' else po_rate_option end" +
" from item where item_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mItem);
rs = pstmt.executeQuery();
if (rs.next())
{
lsporateoption = checkNull(rs.getString(1));
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(lsporateoption == null || lsporateoption.trim().length() == 0)
{
lsporateoption="N";
}
if("N".equalsIgnoreCase(lsporateoption))
{
valueXmlString.append("<rate protect =\"1\">").append("<![CDATA["+mrate+"]]>").append("</rate>");
}
else
{
valueXmlString.append("<rate protect =\"0\">").append("<![CDATA["+mrate+"]]>").append("</rate>");
}
}
}
}
//Added by sarita on 16 OCT 2018 to set rate using price_list type [START]
} else if (currentColumn.trim().equalsIgnoreCase("itm_default")) {
......@@ -4554,7 +4683,6 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
System.out.println("lot_no@@@@"+mlotno);
System.out.println("lot_sl@@@@"+mlotsl);
System.out.println("ls_tranid_ref@@"+ls_tranid_ref);
}else if(currentColumn.trim().equalsIgnoreCase("line_no__ord"))
{
......@@ -5312,9 +5440,9 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
} else if ((ls_tranid_ref.trim().length() > 0)
&& (ls_lineno__rcp.trim().length() > 0)) {
System.out.println("comming into if-else2");
sql = " select item_code, quantity, unit, rate, "
+ " discount , loc_code, lot_no, lot_sl, "
+ " acct_code__dr, cctr_code__dr, acct_code__cr, cctr_code__cr, "
......@@ -5327,10 +5455,10 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
+ " acct_code__prov_dr, acct_code__prov_cr, cctr_code__prov_dr, cctr_code__prov_cr, "
+ " tax_class,tax_chap,tax_env, "
+"LINE_NO__ORD "//Add by Ajay on 08/05/18
+ // move below tax details in same sql which
// coming from porcpdet instead of porddet
// -D14ISUN003
// coming from porcpdet instead of porddet
// -D14ISUN003
" from porcpdet "
+ " where ( tran_id = ? ) and "
+ " ( purc_order = ? ) and "
......@@ -5386,8 +5514,8 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
mtaxchap = chkNull(rs.getString(41));
mtaxenv = chkNull(rs.getString(42));
mPordLine = chkNull(rs.getString(43));//Add by Ajay on 08/05/18
System.out.println("mrate ["+mrate+"] \t mQty ["+mQty+"]");
}
rs.close();
rs = null;
......@@ -5395,11 +5523,16 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
pstmt = null;
System.out.println("sql@@"+sql);
valueXmlString.append("<grade>")
.append("<![CDATA[" + ls_grade + "]]>")
.append("</grade>");
.append("<![CDATA[" + ls_grade + "]]>")
.append("</grade>");
//Added by sarita to set quantity and rate on 16 OCT 2018 [START]
valueXmlString.append("<quantity>")
.append("<![CDATA[" + mQty + "]]>")
.append("</quantity>");
valueXmlString.append("<rate protect =\"1\">")
.append("<![CDATA[" + mrate + "]]>")
.append("</rate>");
//Added by sarita to set quantity and rate on 16 OCT 2018 [END]
} else
{
System.out.println("comming into else@3");
......@@ -5419,7 +5552,7 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
//pstmt.setString(3, ls_lineno__rcp);//
rs = pstmt.executeQuery();
if (rs.next()) {
mItem = checkNull(rs.getString(1));
mQty = rs.getDouble(2);
mUom = checkNull(rs.getString(3));
......@@ -5448,8 +5581,8 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
ls_acct_pcr = checkNull(rs.getString(26));
ls_cctr_pdr = checkNull(rs.getString(27));
ls_cctr_pcr = checkNull(rs.getString(28));
}
rs.close();
......@@ -5459,31 +5592,99 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
System.out.println("sql@@@"+sql);
}
if(mrate <= 0) {
//Commented and Added by sarita on 16OCT2018 [START]
/*if(mrate <= 0) {
sql = "select price_list "
+ " from porder where purc_order = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mPordNo);//
rs = pstmt.executeQuery();
if (rs.next()) {
ls_pricelist = checkNull(rs.getString(1));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out
.println("ls_pricelist@@@" + ls_pricelist);
mrate = disscommon.pickRate(ls_pricelist,
ldt_trandt1, mItem, mlotno, "B", conn);// pickRate(ls_pricelist,
// ldt_trandt,
// mItem,mlotno,"B",
// conn);//gbf_pick_rate(ls_pricelist,ldt_trandt,mitem,mlotno,'B')
System.out.println("mrate[" + mrate + "]");
}*/
sql = "select price_list "
+ " from porder where purc_order = ? ";
+ " from porder where purc_order = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mPordNo);//
rs = pstmt.executeQuery();
if (rs.next()) {
ls_pricelist = checkNull(rs.getString(1));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out
.println("ls_pricelist@@@" + ls_pricelist);
mrate = disscommon.pickRate(ls_pricelist,
ldt_trandt1, mItem, mlotno, "B", conn);// pickRate(ls_pricelist,
// ldt_trandt,
// mItem,mlotno,"B",
// conn);//gbf_pick_rate(ls_pricelist,ldt_trandt,mitem,mlotno,'B')
System.out.println("mrate[" + mrate + "]");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
String listType = disscommon.getPriceListType(ls_pricelist,conn);
System.out.println("listType is ["+listType+"]");
String lsporateoption = "";
if((mrate <= 0) && ("B".equalsIgnoreCase(listType)))
{
mrate = disscommon.pickRate(ls_pricelist,
ldt_trandt1, mItem, mlotno, "B", conn);
System.out.println("mrate[" + mrate + "]");
valueXmlString.append("<rate protect =\"1\">").append("<![CDATA["+mrate+"]]>").append("</rate>");
}
else
{
System.out.println("mrate[" + mrate + "]");
sql="select case when po_rate_option is null then 'N' else po_rate_option end" +
" from item where item_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mItem);
rs = pstmt.executeQuery();
if (rs.next())
{
lsporateoption = checkNull(rs.getString(1));
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(lsporateoption == null || lsporateoption.trim().length() == 0)
{
lsporateoption="N";
}
if("N".equalsIgnoreCase(lsporateoption))
{
valueXmlString.append("<rate protect =\"1\">").append("<![CDATA["+mrate+"]]>").append("</rate>");
}
else
{
valueXmlString.append("<rate protect =\"0\">").append("<![CDATA["+mrate+"]]>").append("</rate>");
}
}
//Commented and Added by sarita on 16OCT2018 [END]
sql = "Select descr, ordc_perc "
+ " from item where item_code = ? ";
......@@ -5529,11 +5730,11 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
valueXmlString.append("<unit__rate>")
.append("<![CDATA[" + mRateUom + "]]>")
.append("</unit__rate>");
valueXmlString.append("<rate>")
.append("<![CDATA[" + mrate + "]]>")
.append("</rate>");
//Commented by sarita on 16 OCT 2018 [START]
/*valueXmlString.append("<rate>")
.append("<![CDATA[" + mrate + "]]>")
.append("</rate>");*/
//Commented by sarita on 16 OCT 2018 [END]
valueXmlString.append("<rate__clg>")
.append("<![CDATA[" + lc_rate__clg + "]]>")
.append("</rate__clg>");
......@@ -5783,7 +5984,6 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
System.out.println("lot_sl@@@@"+mlotsl);
System.out.println("ls_tranid_ref@@"+ls_tranid_ref);
}
else if (currentColumn.trim().equalsIgnoreCase("item_code")) {
......@@ -6829,6 +7029,7 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
} else if(currentColumn.trim().equalsIgnoreCase("lot_sl"))
{
mLocation = checkNull(genericUtility.getColumnValue(
"loc_code", dom));
mlotno = checkNull(genericUtility.getColumnValue("lot_no",
......@@ -7039,7 +7240,6 @@ public class PoReturnIC extends ValidatorEJB implements PoReturnICLocal,
.append("</rate__clg>");
}
}
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