Commit ca3bced5 authored by prane's avatar prane

Not to update demand/supply in inv_dem_supp for those location having invstat type is 'S'

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@217577 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1e9899f9
......@@ -802,35 +802,53 @@ public class StockUpdate
pstmt.setString(40,this.refSerFor);
pstmt.setString(41,this.refIdFor);
int updCnt = update = pstmt.executeUpdate();
update = pstmt.executeUpdate();
System.out.println("No recore Insert invtrace ::- ["+update+"]");
pstmt.close();
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
if(updCnt > 0 )
if(update > 0 )
{
InvDemSuppTraceBean invDemSupTrcBean = new InvDemSuppTraceBean();
HashMap demandSupplyMap = null;
if( !("D-ISS".equalsIgnoreCase(this.tranSer.trim()) || "S-DSP".equalsIgnoreCase(this.tranSer.trim())) )
{
demandSupplyMap = new HashMap();
demandSupplyMap.put("site_code", this.siteCode);
demandSupplyMap.put("item_code", this.itemCode);
demandSupplyMap.put("ref_ser", "STK");
demandSupplyMap.put("ref_id", "NA");
demandSupplyMap.put("ref_line", "NA");
demandSupplyMap.put("due_date", this.tranDate);
demandSupplyMap.put("demand_qty", 0.0);
demandSupplyMap.put("supply_qty", effQty);
demandSupplyMap.put("change_type", "A");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", userId);
demandSupplyMap.put("chg_term", termId);
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
if(errString != null && errString.trim().length() > 0)
{
System.out.println("retString["+errString+"]");
return errString;
}
{
int invStCnt = 0;
sql = "select count(*) from location, invstat "
+ " where location.inv_stat = invstat.inv_stat "
+ " and location.loc_code = ? "
+ " and invstat.stat_type <> 'S'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, this.locationCode);
rs = pstmt.executeQuery();
if(rs.next())
{
invStCnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
if( invStCnt > 0 )
{
demandSupplyMap = new HashMap();
demandSupplyMap.put("site_code", this.siteCode);
demandSupplyMap.put("item_code", this.itemCode);
demandSupplyMap.put("ref_ser", "STK");
demandSupplyMap.put("ref_id", "NA");
demandSupplyMap.put("ref_line", "NA");
demandSupplyMap.put("due_date", this.tranDate);
demandSupplyMap.put("demand_qty", 0.0);
demandSupplyMap.put("supply_qty", effQty);
demandSupplyMap.put("change_type", "A");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", userId);
demandSupplyMap.put("chg_term", termId);
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
if(errString != null && errString.trim().length() > 0)
{
System.out.println("retString["+errString+"]");
return errString;
}
}
}
}
/**Added by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
......@@ -2842,32 +2860,51 @@ public class StockUpdate
System.out.println("CHG_TERM :");
int updCnt = pstmt.executeUpdate();
pstmt.close();
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
if( updCnt > 0 )
{
InvDemSuppTraceBean invDemSupTrcBean = new InvDemSuppTraceBean();
HashMap demandSupplyMap = null;
if( !("D-ISS".equalsIgnoreCase(this.tranSer.trim()) || "S-DSP".equalsIgnoreCase(this.tranSer.trim())) )
{
demandSupplyMap = new HashMap();
demandSupplyMap.put("site_code", this.siteCode);
demandSupplyMap.put("item_code", this.itemCode);
demandSupplyMap.put("ref_ser", "STK");
demandSupplyMap.put("ref_id", "NA");
demandSupplyMap.put("ref_line", "NA");
demandSupplyMap.put("due_date", this.tranDate);
demandSupplyMap.put("demand_qty", 0.0);
demandSupplyMap.put("supply_qty", effQty);
demandSupplyMap.put("change_type", "A");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", userId);
demandSupplyMap.put("chg_term", termId);
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
if(errString != null && errString.trim().length() > 0)
{
System.out.println("retString["+errString+"]");
return errString;
}
{
int invStCnt = 0;
sql = "select count(*) from location, invstat "
+ " where location.inv_stat = invstat.inv_stat "
+ " and location.loc_code = ? "
+ " and invstat.stat_type <> 'S'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, this.locationCode);
rs = pstmt.executeQuery();
if(rs.next())
{
invStCnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
if( invStCnt > 0 )
{
demandSupplyMap = new HashMap();
demandSupplyMap.put("site_code", this.siteCode);
demandSupplyMap.put("item_code", this.itemCode);
demandSupplyMap.put("ref_ser", "STK");
demandSupplyMap.put("ref_id", "NA");
demandSupplyMap.put("ref_line", "NA");
demandSupplyMap.put("due_date", this.tranDate);
demandSupplyMap.put("demand_qty", 0.0);
demandSupplyMap.put("supply_qty", effQty);
demandSupplyMap.put("change_type", "A");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", userId);
demandSupplyMap.put("chg_term", termId);
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
if(errString != null && errString.trim().length() > 0)
{
System.out.println("retString["+errString+"]");
return errString;
}
}
}
}
/**Added by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
......
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