Commit 142950e3 authored by msaggam's avatar msaggam

Purchase return - In itemchanged 1. if only one stock record found to set...

Purchase return - In itemchanged 1. if only one stock record found to set stock related information such as loc_code,lot_no,lot_sl automatically
2. On entering lot_no if only one lot_sl found to set automatically

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@202845 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6e59d050
......@@ -6368,6 +6368,48 @@ PoReturnICRemote {
}
// Added by Mahesh Saggam on 28-June-2019 [Start]
ls_site = checkNull(genericUtility.getColumnValue("site_code", dom1));
System.out.println("$$Site Code = "+ls_site);
if(mcode != null && mcode.trim().length() > 0)
{
sql = "select count(*) from stock where ITEM_CODE = ? and site_code = ? and quantity > 0";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mcode);
pstmt.setString(2, ls_site);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt == 1)
{
sql = "select loc_code,lot_no,lot_sl from stock where ITEM_CODE = ? and site_code = ? and quantity > 0";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mcode);
pstmt.setString(2, ls_site);
rs = pstmt.executeQuery();
if(rs.next())
{
mLocation = rs.getString(1);
mlotno = rs.getString(2);
mlotsl = rs.getString(3);
}
valueXmlString.append("<loc_code>").append("<![CDATA[" + mLocation + "]]>").append("</loc_code>");
valueXmlString.append("<lot_no>").append("<![CDATA[" + mlotno + "]]>").append("</lot_no>");
valueXmlString.append("<lot_sl>").append("<![CDATA[" + mlotsl + "]]>").append("</lot_sl>");
}
}
// Added by Mahesh Saggam on 28-June-2019 [End]
} else if (currentColumn.trim().equalsIgnoreCase("quantity"))
{
quantity = genericUtility.getColumnValue("quantity", dom);
......@@ -7155,8 +7197,8 @@ PoReturnICRemote {
"tran_type", dom));
lc_rate__clgStr = checkNull(genericUtility.getColumnValue(
"rate__clg", dom));
lc_rate__clg = lc_rate__clgStr == null ? 0 : Double
.parseDouble(lc_rate__clgStr);
System.out.println("Rate String = "+lc_rate__clgStr);
lc_rate__clg = lc_rate__clgStr == null || lc_rate__clgStr.trim().length() == 0 ? 0 : Double.parseDouble(lc_rate__clgStr);
System.out.println("LOT_NO@ls_tran_type check["+ls_tran_type);
if (lc_rate__clg == 0) {
lc_rate__clg = 0;
......@@ -7202,6 +7244,46 @@ PoReturnICRemote {
}
// Added by Mahesh Saggam on 28-June-2019 [Start]
mItem = checkNull(genericUtility.getColumnValue("item_code", dom));
ls_site = checkNull(genericUtility.getColumnValue("site_code", dom1));
if(mlotno != null && mlotno.trim().length() > 0)
{
sql = "select count(*) from stock where ITEM_CODE = ? and SITE_CODE = ? and LOT_NO = ? and quantity > 0";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mItem);
pstmt.setString(2, ls_site);
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 lot_sl from stock where ITEM_CODE = ? and SITE_CODE = ? and LOT_NO = ? and quantity > 0";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mItem);
pstmt.setString(2, ls_site);
pstmt.setString(3, mlotno);
rs = pstmt.executeQuery();
if(rs.next())
{
mlotsl = rs.getString(1);
}
valueXmlString.append("<lot_sl>").append("<![CDATA[" + mlotsl + "]]>").append("</lot_sl>");
}
}
// 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