Commit 74c905ba authored by pchavan's avatar pchavan

Add condition to validate stock quantity with despatch net quantity.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@192937 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c60c52d8
...@@ -112,7 +112,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -112,7 +112,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
String mlineno="",mitemcode="",mlotsl="",mloccode="",mitem_code__ord="",Ls_DespId="",ld_trandate_str=""; String mlineno="",mitemcode="",mlotsl="",mloccode="",mitem_code__ord="",Ls_DespId="",ld_trandate_str="";
double lc_sord_qty = 0,lc_tot_qty = 0,mNum1 = 0,mNum2 = 0,lc_stkqty=0,lc_PendingQty=0,lc_overshipperc=0,lc_ceilqty=0,modespperc=0;//mstkqty = 0, double lc_sord_qty = 0,lc_tot_qty = 0,mNum1 = 0,mNum2 = 0,lc_stkqty=0,lc_PendingQty=0,lc_overshipperc=0,lc_ceilqty=0,modespperc=0;//mstkqty = 0,
String ls_iss_criteria="",ls_item_code__parent="",ls_nature="",mitemord="",ls_stk_opt=""; String ls_iss_criteria="",ls_item_code__parent="",ls_nature="",mitemord="",ls_stk_opt="";
double netQuantity = 0 ,curNetQuentity =0; //PC
Timestamp ld_rest_upto=null,ld_trandate=null,ld_exp_date=null,ld_chk_date=null; Timestamp ld_rest_upto=null,ld_trandate=null,ld_exp_date=null,ld_chk_date=null;
double mstkQty=0,lc_conv=0,lc_int_qty=0,mmodqty=0,lc_free_value=0,lc_prv_bonus_value=0,lc_prv_sample_value=0; double mstkQty=0,lc_conv=0,lc_int_qty=0,mmodqty=0,lc_free_value=0,lc_prv_bonus_value=0,lc_prv_sample_value=0;
String ls_unit_desp="",ls_unit_std="",ls_order_type="",ls_track_shelf_life=""; String ls_unit_desp="",ls_unit_std="",ls_order_type="",ls_track_shelf_life="";
...@@ -1849,12 +1849,19 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -1849,12 +1849,19 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
//end if // end of if mVal2 = 'N' then //end if // end of if mVal2 = 'N' then
} }
//PriyankaC TO check stock quantity and despatch net quantity for validation...[Start] on 15NOV2018.
netQuantity = GetNumberOfQuantityFordespatch(dom2 ,mlotno,mlotsl,msite,mitemcode,mloccode);
System.out.println("Quentityofdispatch.." +netQuantity);
if(netQuantity > mstkQty)
{
errCode = "VTSTOCK2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
//PriyankaC TO check stock quantity and despatch net quantity for validation...[END]
}// end if // end if get_sqlcode(), stock quantity }// end if // end if get_sqlcode(), stock quantity
}// end if }// end if
}//end if // end if get_sqlcode(), sum(qty_alloc) }//end if // end if get_sqlcode(), sum(qty_alloc)
//}//end if // end if get_sqlcode(), qty_alloc //}//end if // end if get_sqlcode(), qty_alloc
//test purpose }//end if // end if mNum = 0 //test purpose }//end if // end if mNum = 0
...@@ -6977,6 +6984,66 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -6977,6 +6984,66 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
} }
return msgType; return msgType;
} }
//Added By PriyankaC to get net quantity of despatch for validation on 15Nov2015. [START]
private double GetNumberOfQuantityFordespatch(Document dom2 ,String lotNo,String lotSl,String siteCode,String itemCode,String locCode) throws Exception,ITMException
{
NodeList parentNodeList=null;
NodeList childList = null;
Node parentNode=null;
Node childNode = null;
String curLotNo = null,operationStr="";
String curLotSl = null;
String curLocCode = null;
String cursiteCode = null ,curItemCode = null ,curQuantity = null;
double totalNetQt=0 ;
double curNetQuentity = 0;
try
{
E12GenericUtility genericUtility= new E12GenericUtility();
parentNodeList = dom2.getElementsByTagName("Detail2");
int childNodeListLength = parentNodeList.getLength();
for(int ctr = 0; ctr < childNodeListLength; ctr++)
{
parentNode = parentNodeList.item(ctr);
cursiteCode = genericUtility.getColumnValueFromNode("site_code", parentNode);
curLotNo = genericUtility.getColumnValueFromNode("lot_no", parentNode);
curLotSl = genericUtility.getColumnValueFromNode("lot_sl", parentNode);
curItemCode = genericUtility.getColumnValueFromNode("item_code", parentNode);
curQuantity = genericUtility.getColumnValueFromNode("quantity", parentNode);
curQuantity = curQuantity == null ? "0" :curQuantity;
curNetQuentity = Double.parseDouble(curQuantity);
System.out.println("curNetWeight .........................."+curNetQuentity);
curLocCode = genericUtility.getColumnValueFromNode("loc_code", parentNode);
cursiteCode = cursiteCode == null ? " " :cursiteCode;
curLotNo = curLotNo == null ? " " :curLotNo;
curLotSl = curLotSl == null ? " " :curLotSl;
curLocCode = curLocCode == null ? " " :curLocCode;
System.out.println("siteCode "+siteCode) ;
if ( cursiteCode.trim().equalsIgnoreCase(siteCode.trim())
&& curLotNo.trim().equalsIgnoreCase(lotNo.trim())
&& curLotSl.trim().equalsIgnoreCase(lotSl.trim())
&& curLocCode.trim().equalsIgnoreCase(locCode.trim())
&& curItemCode.trim().equalsIgnoreCase(itemCode.trim())
)
{
totalNetQt = totalNetQt + curNetQuentity;
System.out.println("totalNetQt .........................."+totalNetQt);
}
} // end for
}//END TRY
catch(Exception e)
{
System.out.println("Exception ::"+e);
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("totalNetQt .....final...................."+totalNetQt);
return totalNetQt;
}
//Added By PriyankaC to get net quantity of despatch for validation on 15Nov2015. [START]
} }
\ No newline at end of file
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