Commit 69f3ea5f authored by prane's avatar prane

Validation for lot_no , if header tran_id__ref specified then for that tran_id...

Validation for lot_no , if header tran_id__ref specified then for that tran_id and detail line_no__rcp  in porcpdet the item_code and lot_no should be same as entered in detail.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@207000 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 492efb2a
......@@ -2307,9 +2307,43 @@ PoReturnICRemote {
}*/
}
//Pavan Rane 09sep19 start[to validate line item lot on porcpdet]
tranIdRcp = checkNull(genericUtility.getColumnValue("tran_id__rcp",dom));
lineNoRcp = checkNull(genericUtility.getColumnValue("line_no__rcp", dom));
System.out.println("Validation LotNo["+tranIdRcp+"]lineNoRcp["+lineNoRcp+"]ls_item["+ls_item+"]ls_stock_lotno["+ls_stock_lotno+"]");
if(tranIdRcp != null && tranIdRcp.trim().length() > 0)
{
if(lineNoRcp != null && lineNoRcp.trim().length() > 0)
{
lineNoRcp = " " + lineNoRcp.trim();
lineNoRcp = lineNoRcp.substring(lineNoRcp.length() - 3,lineNoRcp.length());
}
ll_ret = 0;
sql="select count(*) from porcpdet where tran_id = ? and line_no = ? and item_code = ? and lot_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranIdRcp);
pstmt.setString(2,lineNoRcp);
pstmt.setString(3,ls_item);
pstmt.setString(4,ls_stock_lotno);
rs = pstmt.executeQuery();
if (rs.next())
{
ll_ret = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(ll_ret == 0)
{
System.out.println("Lot_no porcp line-item-lot mismatch...");
errCode = "VTINVRCPNO";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
//Pavan Rane 09sep19 end[to validate line item lot on porcpdet]
}
//Added by sarita for line_no__rcp Validation on 16 OCT 2018 [START]
if("line_no__rcp".equalsIgnoreCase(childNodeName))
......@@ -6480,7 +6514,51 @@ PoReturnICRemote {
}
// Added by Mahesh Saggam on 28-June-2019 [End]
//Pavan Rane 09sep19 start [to set line_no__rcp on matching of lot no and itemchange]
tranIdRef = checkNull(genericUtility.getColumnValue("tran_id__ref", dom1));
if(mlotno == null || mlotno.trim().length() == 0) {
mlotno = checkNull(genericUtility.getColumnValue("lot_no", dom));
}
if(tranIdRef != null && tranIdRef.trim().length() > 0)
{
System.out.println("item_code.. ["+tranIdRef+"]mcode["+mcode+"]mlotno["+mlotno+"]...");
cnt = 0;
sql = "select count(*) from porcpdet where tran_id = ? and item_code = ? and lot_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranIdRef);
pstmt.setString(2, mcode);
pstmt.setString(3, mlotno);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt == 1)
{
sql = "select line_no from porcpdet where tran_id = ? and item_code = ? and lot_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranIdRef);
pstmt.setString(2, mcode);
pstmt.setString(3, mlotno);
rs = pstmt.executeQuery();
if(rs.next())
{
ls_lineno__rcp = rs.getString("line_no");
System.out.println("porcpdet item line_no["+ls_lineno__rcp+"]");
valueXmlString.append("<line_no__rcp>").append("<![CDATA[" + ls_lineno__rcp + "]]>").append("</line_no__rcp>");
setNodeValue(dom, "line_no__rcp", ls_lineno__rcp);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
//Pavan Rane 09sep19 end [to set line_no__rcp on matching of lot no and itemchange]
} else if (currentColumn.trim().equalsIgnoreCase("quantity"))
{
quantity = genericUtility.getColumnValue("quantity", dom);
......@@ -7349,7 +7427,48 @@ PoReturnICRemote {
valueXmlString.append("<lot_sl>").append("<![CDATA[" + mlotsl + "]]>").append("</lot_sl>");
}
}
//Pavan Rane 09sep19 start [to set line_no__rcp on matching of lot no and itemchange]
tranIdRef = checkNull(genericUtility.getColumnValue("tran_id__ref", dom1));
if(tranIdRef != null && tranIdRef.trim().length() > 0)
{
System.out.println("lot_no ["+tranIdRef+"]mItem["+mItem+"]mlotno["+mlotno+"]...");
cnt = 0;
sql = "select count(*) from porcpdet where tran_id = ? and item_code = ? and lot_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranIdRef);
pstmt.setString(2, mItem);
pstmt.setString(3, mlotno);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt == 1)
{
sql = "select line_no from porcpdet where tran_id = ? and item_code = ? and lot_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranIdRef);
pstmt.setString(2, mItem);
pstmt.setString(3, mlotno);
rs = pstmt.executeQuery();
if(rs.next())
{
ls_lineno__rcp = rs.getString("line_no");
System.out.println("porcpdet line_no["+ls_lineno__rcp+"]");
valueXmlString.append("<line_no__rcp>").append("<![CDATA[" + ls_lineno__rcp + "]]>").append("</line_no__rcp>");
setNodeValue(dom, "line_no__rcp", ls_lineno__rcp);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
//Pavan Rane 09sep19 end [to set line_no__rcp on matching of lot no and itemchange]
// Added by Mahesh Saggam on 28-June-2019 [End]
} else if(currentColumn.trim().equalsIgnoreCase("lot_sl"))
......
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