Commit a9d9f0c3 authored by cpatil's avatar cpatil

merge from branch


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101323 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8eeae584
......@@ -62,7 +62,7 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
double lcAdj = 0;
String xmlValues = null;
String mTranId="", mTranSer="", mRefNo="";
String sqlStr1 = "";
try
{
......@@ -71,8 +71,7 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
genericUtility = new E12GenericUtility();
itmDBAccessEJB = new ITMDBAccessEJB();
//24/01/14 manoharan FI3JSUN007 adjust freight dr note also
drnNotIn = " ";
//24/01/14 manoharan FI3JSUN007 adjust freight dr note alsof
if (frtDrnArr.length == 1)
{
......@@ -85,10 +84,15 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
drnNotIn ="";
for(int i = 0; i < frtDrnArr.length; i++)
{
drnNotIn =drnNotIn+"'"+frtDrnArr[i]+"',";
if( frtDrnArr[i] != null && frtDrnArr[i].trim().length() > 0)
{
drnNotIn =drnNotIn+"'"+frtDrnArr[i]+"',";
}
}
drnNotIn =drnNotIn.substring(0,drnNotIn.length()-1);
System.out.println("12-Mar-16 manoharan drnNotIn after ["+drnNotIn + "]");
if( drnNotIn != null && drnNotIn.trim().length() > 0)
{
drnNotIn =drnNotIn.substring(0,drnNotIn.length()-1);
}System.out.println("12-Mar-16 manoharan drnNotIn after ["+drnNotIn + "]");
adjustNewProduct = distCommon.getDisparams("999999","ADJUST_NEWPRODUCT",conn);
if (!"NULLFOUND".equals(adjustNewProduct) || "Y".equals(adjustNewProduct) )
{
......@@ -257,23 +261,23 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
pstmt.close();
pstmt = null;
//ended by bhavin
System.out.println("@@@@@@@@264 drnNotIn["+drnNotIn+"]");
//24/01/14 Manoharan FI3JSUN007 adjust all the freight drn
if (drnNotIn.trim().length() > 0 )
{
sqlStr = "insert into receivables_adj "
sqlStr1 = "insert into receivables_adj "
+ "(tran_id, ref_ser, ref_no, tot_amt, adj_amt, net_amt,ref_ser_adj,ref_no_adj, tran_id__rcv) "
+ " values (?, ?, ?, ?, ?, 0, ?, ? ,?) ";
pstmtInsert = conn.prepareStatement(sqlStr);
pstmtInsert = conn.prepareStatement(sqlStr1);
//old logic kept in this Condition
sqlStr = "select tran_id, tran_ser, ref_no, tot_amt, adj_amt from receivables "
+ " where tran_ser = 'MDRCRD' and ref_no in ( ? ) " //( " + drnNotIn + ") ) "
+ " where tran_ser = 'MDRCRD' and ref_no in ( "+drnNotIn+" ) "
+ " and tot_amt - adj_amt > 0 "
+ " and site_code = '" + siteCode + "' "
+ " and item_ser = '" + itemSer + "' "
+ " and cust_code = '" + custCode + "' order by tran_id ";
pstmt = conn.prepareStatement(sqlStr);
pstmt.setString(1,mOrderNo);
//pstmt.setString(1,drnNotIn);
rs = pstmt.executeQuery();
while(rs.next())
{
......@@ -328,7 +332,7 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
//04-09-2005 manoharan
//reverted on 15-09-2005 as per sun requirement
//if (adjDrCr = TRUE ) //Commented by jasmina-19/01/10-DI89SUN228
System.out.println("@@@@@@@@335 adjDrCr["+adjDrCr+"]adjNewProdInv["+adjNewProdInv+"]adjustNewProduct["+adjustNewProduct+"]ordTypeNewPrd["+ordTypeNewPrd+"]");
if (adjDrCr || (adjNewProdInv && ("Y".equals(adjustNewProduct) && ordTypeNewPrd != null && ordTypeNewPrd.trim().length() > 0) ) ) //Added by jasmina-19/01/10-DI89SUN228
{
//if (adjDrCr or adjustNewProduct = 'Y' )
......@@ -353,8 +357,10 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
//
String[] arrStr;
System.out.println("@@@@@@@@360 adjDrCr["+adjDrCr+"]adjNewProdInv["+adjNewProdInv+"]");
if (adjDrCr && adjNewProdInv ) //if (condition Added by jasmina-19/01/10-DI89SUN228
{
System.out.println("1@@@@@@@@ tranTypeFinChrgDrn["+tranTypeFinChrgDrn+"]");
//old logic kept in this Condition
sqlStr = "select tran_id, tran_ser, ref_no, tot_amt, adj_amt from receivables ";
if (tranTypeFinChrgDrn != null && tranTypeFinChrgDrn.trim().length() > 0)
......@@ -394,6 +400,7 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
//}
// 04-09-2005 manoharan
//if ((not isnull(ordTypeNewPrd)) and (len(trim(ordTypeNewPrd)) > 0) )
System.out.println("@@@@@@@@ ordTypeNewPrd["+ordTypeNewPrd+"]adjustNewProduct["+adjustNewProduct+"]tranTypeFinChrgDrn["+tranTypeFinChrgDrn+"]");
if (ordTypeNewPrd != null && ordTypeNewPrd.trim().length() > 0 && "Y".equals(adjustNewProduct) )
{
// end 04-09-2005 manoharan
......@@ -418,7 +425,7 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
}
else
{
sqlStr = sqlStr + " ) ";
// sqlStr = sqlStr + " ) ";//TEST
}
}
sqlStr = sqlStr + " and tot_amt - adj_amt > 0 "
......@@ -430,6 +437,7 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
}
else if (adjDrCr && (!adjNewProdInv) ) //Else if (Condtion Added by jasmina 22/01/10-DI89SUN228
{
System.out.println("2@@@@@@@@ ");
sqlStr = "select tran_id, tran_ser, ref_no, tot_amt, adj_amt from receivables ";
if (tranTypeFinChrgDrn != null && tranTypeFinChrgDrn.trim().length() > 0)
{
......@@ -476,6 +484,7 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
}
else if (!adjDrCr && adjNewProdInv ) //Else if (Condtion Added by jasmina 22/01/10-DI89SUN228
{
System.out.println("3@@@@@@@@ ");
if ( ordTypeNewPrd != null && ordTypeNewPrd.trim().length() > 0 && "Y".equals(adjustNewProduct) )
{
......@@ -503,10 +512,10 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
sqlStr = "insert into receivables_adj "
sqlStr1 = "insert into receivables_adj "
+ "(tran_id, ref_ser, ref_no, tot_amt, adj_amt, net_amt,ref_ser_adj,ref_no_adj, tran_id__rcv) "
+ " values (?, ?, ?, ?, ?, 0, ?, ? ,?) ";
pstmtInsert = conn.prepareStatement(sqlStr);
pstmtInsert = conn.prepareStatement(sqlStr1);
pstmt = conn.prepareStatement(sqlStr);
rs = pstmt.executeQuery();
......@@ -593,6 +602,7 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
//String[] arrStr;
if (adjDrCr && adjNewProdInv) //if (condition Added by jasmina-19/01/10-DI89SUN228
{
System.out.println("4@@@@@@@@ ");
//old logic kept in this Condition
sqlStr = "select tran_id, tran_ser, ref_no, tot_amt, adj_amt from receivables ";
if (tranTypeFinChrgDrn != null && tranTypeFinChrgDrn.trim().length() > 0)
......@@ -658,7 +668,7 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
}
else
{
sqlStr = sqlStr + " ) ";
//sqlStr = sqlStr + " ) ";
}
}
sqlStr = sqlStr + " and tot_amt - adj_amt > 0 "
......@@ -670,6 +680,7 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
}
else if (adjDrCr && !adjNewProdInv) //Else if (Condtion Added by jasmina 22/01/10-DI89SUN228
{
System.out.println("5@@@@@@@@ tranTypeFinChrgDrn["+tranTypeFinChrgDrn+"]");
sqlStr = "select tran_id, tran_ser, ref_no, tot_amt, adj_amt from receivables ";
if (tranTypeFinChrgDrn != null && tranTypeFinChrgDrn.trim().length() > 0)
{
......@@ -716,7 +727,7 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
}
else if (!adjDrCr && adjNewProdInv) //Else if (Condtion Added by jasmina 22/01/10-DI89SUN228
{
System.out.println("6@@@@@@@@ ");
if ((ordTypeNewPrd != null && ordTypeNewPrd.trim().length() > 0) && "Y".equals(adjustNewProduct))
{
arrStr = ordTypeNewPrd.split(",");
......@@ -972,11 +983,11 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
nextID = tg.generateTranSeqID("R-ADJ", "tran_id", keystr, conn);
System.out.println("nextID ["+nextID + "]");
// 09-01-02 End Arif
sqlStr = "insert into receivables_adj "
sqlStr1 = "insert into receivables_adj "
+ " (tran_id, ref_ser, ref_no, tot_amt, adj_amt, net_amt,ref_ser_adj,ref_no_adj, tran_id__rcv) "
+ " values (?, ?, ?, ?, ?, ?, ?, ? ,?) ";
pstmtInsert.close();
pstmtInsert = conn.prepareStatement(sqlStr);
pstmtInsert = conn.prepareStatement(sqlStr1);
pstmtInsert.setString(1,nextID);
pstmtInsert.setString(2,mTranSer);
......@@ -1015,29 +1026,29 @@ public String invoiceDrcrAdj(String siteCode, String invoiceId, String custCode,
nextID = tg.generateTranSeqID("R-ADJ", "tran_id", keystr, conn);
System.out.println("nextID ["+nextID + "]");
// 09-01-02 End Arif
sqlStr = "INSERT INTO receivables_adj "
sqlStr1 = "INSERT INTO receivables_adj "
+ " (tran_id, ref_ser, ref_no, tot_amt, "
+ " adj_amt, ref_ser_adj, ref_no_adj, "
+ " net_amt, tran_id__rcv ) "
+ " values (?, ?, ?, ?, ?, ' ', ' ', ?, ' ') ";
pstmtInsert = conn.prepareStatement(sqlStr);
pstmtInsert = conn.prepareStatement(sqlStr1);
pstmtInsert.setString(1,nextID);
pstmtInsert.setString(2,adjTranSer);
pstmtInsert.setString(3,adjRefNo);
pstmtInsert.setDouble(4,netAmt);
pstmtInsert.setDouble(5,(mDrAmt - netAmt) * -1);
pstmtInsert.setDouble(5,netAmt-((mDrAmt - netAmt) * -1));
pstmtInsert.setDouble(6,(netAmt - (mDrAmt - netAmt)));
pstmtInsert.executeUpdate();
pstmtInsert.close();
//ended by prince
sqlStr = "update invoice "
+ " set adj_amount = ? "
+ " where invoice_id = ? ";
+ " where invoice_id = ? ";
pstmtInsert = conn.prepareStatement(sqlStr);
pstmtInsert.setDouble(1,(mDrAmt - netAmt) * -1);
pstmtInsert.setString(1,invoiceId);
pstmtInsert.setString(2,invoiceId);
pstmtInsert.executeUpdate();
}
......
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