Commit b3632f93 authored by dpawar's avatar dpawar

debit note funct.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93941 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c229a561
......@@ -118,7 +118,7 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli
if(wfStatus.trim().equalsIgnoreCase("S"))
{
String invoiceId="",custCode="",siteCode="",currCode="",loginCode="";
double ExchRate=0.0,actualDBamount=0.0;
double ExchRate=0.0,actualDBamount=0.0,rateInv=0,qtyInv=0;
loginCode=GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"loginEmpCode");
System.out.println("Login Code ------->> "+loginCode);
......@@ -149,7 +149,7 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli
}
sql="";
sql="select item_code,rate__resale,quantity__resale,aprv_rate,line_no,lot_no,lot_sl " +
sql="select item_code,rate__resale,quantity__resale,aprv_rate,line_no,lot_no,lot_sl,rate__inv,quantity__inv " +
"from spl_sales_por_det where tran_id = ? order by line_no";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, tranId);
......@@ -163,15 +163,19 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli
lineNo=rs.getInt(5);
lotNo=rs.getString(6);
lotSl=rs.getString(7);
rateInv=rs.getDouble(8);
qtyInv=rs.getDouble(9);
itemCode=itemCode==null ? "" :itemCode.trim();
lotNo=lotNo==null ? "" :lotNo.trim();
lotSl=lotSl==null ? "" :lotSl.trim();
debitNoteAmtDetail=getDebitNoteAmount(conn, tranId, lineNo,aprvRate,PODrate,PODqty);
//debitNoteAmtDetail=getDebitNoteAmount(conn, tranId, lineNo,aprvRate,PODrate,PODqty);
debitNoteAmtDetail=getDebitNoteAmount(conn, tranId, lineNo,rateInv,PODrate,PODqty,qtyInv);
mapDebitNoteAmt.put(lineNo, debitNoteAmtDetail);
detail2xmlString=getDetailsXmlString(conn, xtraParams, invoiceId, aprvRate, debitNoteAmtDetail);
//detail2xmlString=getDetailsXmlString(conn, xtraParams, invoiceId, aprvRate, debitNoteAmtDetail);
detail2xmlString=getDetailsXmlString(conn, xtraParams, invoiceId, rateInv, debitNoteAmtDetail);
} //end while-------------------@@@@@@@@@@---------------------------------------
System.out.println("Final actualDBamount---------->> : "+actualDBamount);
......@@ -648,14 +652,24 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli
}
private double getDebitNoteAmount (Connection conn,String tranId,int lineNo,double apprvRate,double podRate,double podQty)
private double getDebitNoteAmount (Connection conn,String tranId,int lineNo,double rateInv,double podRate,double podQty,double qtyInv)
{
System.out.println("-------- in getDebitNoteAmount method -------------");
double debitNoteAmount=0,aprvRate=0;
System.out.println("apprvRate-->>["+apprvRate+"]");
double debitNoteAmount=0,aprvRate=0,dbResale=0,dbAmt=0;
System.out.println("rateInv-->>["+rateInv+"]");
System.out.println("podRate-->>["+podRate+"]");
System.out.println("podQty-->>["+podQty+"]");
debitNoteAmount= (podRate - apprvRate) * podQty;
System.out.println("qtyInv-->>["+qtyInv+"]");
//debitNoteAmount= (podRate - apprvRate) * podQty;
dbResale= podRate * podQty;
dbAmt=rateInv * qtyInv;
System.out.println("dbResale-->>["+podQty+"]");
System.out.println("dbAmt-->>["+podQty+"]");
if(dbResale > dbAmt){
debitNoteAmount=dbResale - dbAmt;
}
System.out.println("debitNoteAmount-->>["+debitNoteAmount+"]");
return debitNoteAmount;
......
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