Commit 41e74039 authored by prane's avatar prane

change to clear the data before rebuild the summary data

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@213600 ce508802-f39f-4f6c-b175-0d175dae99d5
parent afa28ed1
......@@ -127,6 +127,31 @@ public class InvDemSuppTraceBean
chgQty = supplyQty;
}
//Pavan Rane16DEC19 start [to delete the site item line by keeping qty reference for delete in trace]
if("D".equalsIgnoreCase(changeType))
{
changeType = "D";
qtyAfter = demandQty == 0.0 ? supplyQty: demandQty;
sql = " delete from INV_DEM_SUPP "
+ " where site_code = ?"
+ " and item_code = ?"
+ " and ref_ser = ?"
+ " and ref_id = ?"
+ " and ref_line = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode);
pstmt.setString(2,itemCode);
pstmt.setString(3,refSer);
pstmt.setString(4,refId);
pstmt.setString(5,refLine);
pstmt.executeUpdate();
updCnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
BaseLogger.log("3", null, null, "INV_DEM_SUPP deleted........>>"+updCnt);
} else
{
if(demSuppCnt > 0)
{
changeType = "C";
......@@ -151,6 +176,7 @@ public class InvDemSuppTraceBean
}
else
{
demSuppCnt ++;
changeType = "A";
sql = "INSERT INTO INV_DEM_SUPP(SITE_CODE, ITEM_CODE, REF_SER, REF_ID, REF_LINE, DUE_DATE, DEMAND_QTY, SUPPLY_QTY, CHG_DATE, CHG_USER, CHG_TERM) VALUES (?,?,?,?,?,?,?,?,?,?,?)";
pstmtUpd = conn.prepareStatement(sql);
......@@ -171,7 +197,9 @@ public class InvDemSuppTraceBean
BaseLogger.log("3", null, null, "INV_DEM_SUPP insert........>>"+updCnt);
}
}
if(demSuppCnt > 0)
{
sql = "INSERT INTO INV_DEM_SUPP_TRACE (TRAN_ID, TRAN_DATE, SITE_CODE, ITEM_CODE, REF_SER, REF_ID, REF_LINE, CHANGE_TYPE, CHG_PROCESS, CHG_QTY, QTY_BEFORE, QTY_AFTER, CHG_DATE, CHG_USER, CHG_TERM)"
+ " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmtUpd = conn.prepareStatement(sql);
......@@ -194,6 +222,7 @@ public class InvDemSuppTraceBean
pstmtUpd.close();
pstmtUpd = null;
BaseLogger.log("3", null, null, "INV_DEM_SUPP_TRACE Updated........"+updCnt);
}
}
catch(SQLException e)
......
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