Commit 69fe6422 authored by dpawar's avatar dpawar

added source code partial quantity validation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93591 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7500796e
......@@ -29,6 +29,7 @@ import org.w3c.dom.NodeList;
public class ProofOfDelivery extends ValidatorEJB implements ProofOfDeliveryLocal,ProofOfDeliveryRemote
{
String str,confirmedInv="";
public String wfValData(String xmlString, String xmlString1, String xmlString2,String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
System.out.println("------------ wfvalData method called-----------------");
......@@ -254,7 +255,7 @@ public class ProofOfDelivery extends ValidatorEJB implements ProofOfDeliveryLoca
//qtyResalD=qtyResalD+isTotalAmountPodQtyGrt(conn,str,qtyInvD);
System.out.println("POD qty with new entry value---------->>"+qtyResalD);
System.out.println("Actual quantity after sales return---->>["+qtyInvD+"]");
if(isTotalAmountPodQtyGrt(conn,str,qtyInvD,qtyResalD)) //VTSLRETER
if(isTotalAmountPodQtyGrt(conn,str,qtyInvD,qtyResalD,itemCodeSret)) //VTSLRETER
{
//Invoice quantity for item(s) is returned.Please check sales return.
errCode = "VTSLRETER";
......@@ -266,12 +267,12 @@ public class ProofOfDelivery extends ValidatorEJB implements ProofOfDeliveryLoca
}
System.out.println("in isPartialyInvoiceChk condition------------ ");
sql1="select tran_id from spl_sales_por_hdr where invoice_id = ?";
//sql1="select tran_id from spl_sales_por_hdr where invoice_id = ?";
//totalInvQty=isTotalAmountPodQtyGrt(conn,str,qtyInvD);
//totalInvQty = totalInvQty+ qtyResalD;
System.out.println("qtyInvD---->> "+qtyInvD+" qtyResaleD : "+qtyResaleD);
System.out.println("Final totalInvQty ----->"+totalInvQty );
if ( isTotalAmountPodQtyGrt(conn,str,qtyInvD,qtyResalD))
if ( isTotalAmountPodQtyGrt(conn,str,qtyInvD,qtyResaleD,itemCodeSret))
{
System.out.println("the total qty condition true---------");
errCode = "VTPODGRT";
......@@ -671,16 +672,18 @@ public class ProofOfDelivery extends ValidatorEJB implements ProofOfDeliveryLoca
}
private boolean isTotalAmountPodQtyGrt(Connection conn,String invID,double actualInvQty,double currentPODvalue)
private boolean isTotalAmountPodQtyGrt(Connection conn,String invID,double actualInvQty,double currentPodQty,String itemCodeSret)
{
System.out.println("---in method getTotalAmountPodQty@@@@@@@ ------invoice ID :["+invID+"]");
System.out.println("---in method isTotalAmountPodQtyGrt@@@@@@@ ------invoice ID :["+invID+"]");
System.out.println("actualInvQty----->>"+actualInvQty+" currentPodQty----->>"+currentPodQty);
Map<String,Double> itemMap=new HashMap<String,Double>();
PreparedStatement pstmt2 = null,pstmt1=null,pstmt3=null ;
ResultSet rs2 = null,rs1=null,rs3=null;
String sql1="",tranID="",confirmed="",itemCode="";
int lineNo=0,count=0;
double qtyInv=0.0,podQty=0.0,totalPodQty=0.0;
Double totalParsingQty=0.0;
double qtyInv=0.0,podQty=0.0,totalPodQty=0.0,consumeQty=0.0,finalPodqty=0.0;
boolean isItemCodeMatch=false;
sql1="select tran_id,confirmed from spl_sales_por_hdr where invoice_id = ? and confirmed = ? and wf_status <> 'R'";
try
{
......@@ -710,10 +713,12 @@ public class ProofOfDelivery extends ValidatorEJB implements ProofOfDeliveryLoca
itemCode=rs1.getString(2);
qtyInv=rs1.getDouble(3);
podQty=rs1.getDouble(4);
System.out.println("Line no@@@ ---->"+lineNo+ " qtyInv-->>"+qtyInv+" podQty->>"+podQty);
System.out.println("Line no @@@@ ---->"+lineNo+ " qtyInv-->>"+qtyInv+" podQty->>"+podQty+" itemCode =["+itemCode+"]");
itemCode=itemCode==null ? "" : itemCode.trim();
sql1="";
sql1="select sum(quantity__resale) from spl_sales_por_det where item_code = ? and tran_id = ?";
/*sql1="select sum(quantity__resale) from spl_sales_por_det where item_code = ? and tran_id = ?";
pstmt3=conn.prepareStatement(sql1);
pstmt3.setString(1, itemCode);
pstmt3.setString(2, tranID);
......@@ -721,30 +726,54 @@ public class ProofOfDelivery extends ValidatorEJB implements ProofOfDeliveryLoca
if(rs3.next())
{
totalPodQty=rs3.getDouble(1);
}
System.out.println("sumation of total POD itemwise ------>>"+totalPodQty);
System.out.println("Current pod value ------>>"+currentPODvalue);
totalPodQty=totalPodQty + currentPODvalue;
System.out.println("Fina POD qty after adding current value ------>>"+totalPodQty);
if( totalPodQty > actualInvQty)
}*/
if(itemMap !=null)
{
System.out.println("---------return true value from isTotalAmountPodQtyGrt");
return true;
for (String key : itemMap.keySet())
{
System.out.println("(In map$$$) Item Code--->>"+key+" itemCode--->>"+itemMap.get(key));
if(key.equalsIgnoreCase(itemCode))
{
System.out.println("item code match---------");
//totalPodQty=itemMap.get(key);
itemMap.put(itemCode, (itemMap.get(key)+ podQty));
System.out.println("item code="+itemCode+ " TotalPODqty="+(itemMap.get(key)+podQty));
isItemCodeMatch=true; }
}
}
if(!(isItemCodeMatch))
itemMap.put(itemCode,podQty);
isItemCodeMatch=false;
rs3.close();rs3=null;
pstmt3.close();pstmt3=null;
//totalPodQty=totalPodQty + podQty;
/*if( podQty < qtyInv)
return true; */
}
rs1.close();rs1=null;
pstmt1.close();pstmt1=null;
}
}
System.out.println("Item code in hashMap ---------->>");
for (String key : itemMap.keySet())
{
System.out.println("Item code -->> " + key);
}
System.out.println("PODqty FINAL in hashMap ---------->>");
for (Double key : itemMap.values())
{
System.out.println("f values = " + key);
// itemMap.get(itemCodeSret);
finalPodqty= itemMap.get(itemCodeSret) + currentPodQty;
System.out.println("Final pod Quantity------>>"+finalPodqty+" Actual POD qty--->>"+actualInvQty);
if(finalPodqty > actualInvQty)
{
System.out.println("-------------------POD quantity is greater--------------------------------------------------------");
return true;
}
}
System.out.println("Total POD quantity $$$--------->>"+totalPodQty);
//System.out.println("TranID in getTotalAmountPodQty --->>["+tranID+"] TotalPODqty -->["+totalPodqty+"]");
/*if (confirmed.equalsIgnoreCase("Y"))
......@@ -779,6 +808,8 @@ public class ProofOfDelivery extends ValidatorEJB implements ProofOfDeliveryLoca
return false;
}
private boolean isPartialyInvoiceChk(Connection conn,String invID)
{
System.out.println("---in method isPartialyInvoiceChk ------invoice ID :["+invID+"]");
......
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