Commit b27154ee authored by ngadkari's avatar ngadkari

Changes in sql and commented duplicate block

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@214617 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4fe18241
...@@ -335,7 +335,8 @@ public class InvoiceDrcrAdj ...@@ -335,7 +335,8 @@ public class InvoiceDrcrAdj
//reverted on 15-09-2005 as per sun requirement //reverted on 15-09-2005 as per sun requirement
//if (adjDrCr = TRUE ) //Commented by jasmina-19/01/10-DI89SUN228 //if (adjDrCr = TRUE ) //Commented by jasmina-19/01/10-DI89SUN228
System.out.println("@@@@@@@@335 adjDrCr["+adjDrCr+"]adjNewProdInv["+adjNewProdInv+"]adjustNewProduct["+adjustNewProduct+"]ordTypeNewPrd["+ordTypeNewPrd+"]"); 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 //commeted by nandkumar gadkari on 06/01/20 for duplicate block
/* if (adjDrCr || (adjNewProdInv && ("Y".equals(adjustNewProduct) && ordTypeNewPrd != null && ordTypeNewPrd.trim().length() > 0) ) ) //Added by jasmina-19/01/10-DI89SUN228
{ {
//if (adjDrCr or adjustNewProduct = 'Y' ) //if (adjDrCr or adjustNewProduct = 'Y' )
// 03-08-2005 manoharan dynamic cursor used to have multiple // 03-08-2005 manoharan dynamic cursor used to have multiple
...@@ -372,6 +373,10 @@ public class InvoiceDrcrAdj ...@@ -372,6 +373,10 @@ public class InvoiceDrcrAdj
for (int i = 0; i < frtDrnArr.length; i++) for (int i = 0; i < frtDrnArr.length; i++)
{ {
tranTypeFinChrgDrn = tranTypeFinChrgDrn+"'"+frtDrnArr[i]+"',"; tranTypeFinChrgDrn = tranTypeFinChrgDrn+"'"+frtDrnArr[i]+"',";
}// loop commented and change by arrStr string array by nandkumar gadkari on 06/01/20
for (int i = 0; i < arrStr.length; i++)
{
tranTypeFinChrgDrn = tranTypeFinChrgDrn+"'"+arrStr[i]+"',";
} }
tranTypeFinChrgDrn = tranTypeFinChrgDrn.substring(0,tranTypeFinChrgDrn.length()-1); tranTypeFinChrgDrn = tranTypeFinChrgDrn.substring(0,tranTypeFinChrgDrn.length()-1);
sqlStr = sqlStr + " where ( ( (tran_ser = 'DRNRCP') "; sqlStr = sqlStr + " where ( ( (tran_ser = 'DRNRCP') ";
...@@ -413,6 +418,11 @@ public class InvoiceDrcrAdj ...@@ -413,6 +418,11 @@ public class InvoiceDrcrAdj
{ {
ordTypeNewPrd = ordTypeNewPrd+"'"+frtDrnArr[i]+"',"; ordTypeNewPrd = ordTypeNewPrd+"'"+frtDrnArr[i]+"',";
} }
// loop commented and change by arrStr string array by nandkumar gadkari on 06/01/20
for (int i = 0; i < arrStr.length; i++)
{
ordTypeNewPrd = ordTypeNewPrd+"'"+arrStr[i]+"',";
}
ordTypeNewPrd = ordTypeNewPrd.substring(0,ordTypeNewPrd.length()-1); ordTypeNewPrd = ordTypeNewPrd.substring(0,ordTypeNewPrd.length()-1);
sqlStr = sqlStr + " or ( tran_ser = 'S-INV' " sqlStr = sqlStr + " or ( tran_ser = 'S-INV' "
...@@ -449,6 +459,11 @@ public class InvoiceDrcrAdj ...@@ -449,6 +459,11 @@ public class InvoiceDrcrAdj
{ {
tranTypeFinChrgDrn = tranTypeFinChrgDrn+"'"+frtDrnArr[i]+"',"; tranTypeFinChrgDrn = tranTypeFinChrgDrn+"'"+frtDrnArr[i]+"',";
} }
// loop commented and change by arrStr string array by nandkumar gadkari on 06/01/20
for (int i = 0; i < arrStr.length; i++)
{
tranTypeFinChrgDrn = tranTypeFinChrgDrn+"'"+arrStr[i]+"',";
}
tranTypeFinChrgDrn = tranTypeFinChrgDrn.substring(0,tranTypeFinChrgDrn.length()-1); tranTypeFinChrgDrn = tranTypeFinChrgDrn.substring(0,tranTypeFinChrgDrn.length()-1);
sqlStr = sqlStr + " where ( ( (tran_ser = 'DRNRCP' ) "; sqlStr = sqlStr + " where ( ( (tran_ser = 'DRNRCP' ) ";
...@@ -496,6 +511,11 @@ public class InvoiceDrcrAdj ...@@ -496,6 +511,11 @@ public class InvoiceDrcrAdj
{ {
ordTypeNewPrd = ordTypeNewPrd+"'"+frtDrnArr[i]+"',"; ordTypeNewPrd = ordTypeNewPrd+"'"+frtDrnArr[i]+"',";
} }
// loop commented and change by arrStr string array by nandkumar gadkari on 06/01/20
for (int i = 0; i < arrStr.length; i++)
{
ordTypeNewPrd = ordTypeNewPrd+"'"+arrStr[i]+"',";
}
ordTypeNewPrd = ordTypeNewPrd.substring(0,ordTypeNewPrd.length()-1); ordTypeNewPrd = ordTypeNewPrd.substring(0,ordTypeNewPrd.length()-1);
...@@ -568,8 +588,8 @@ public class InvoiceDrcrAdj ...@@ -568,8 +588,8 @@ public class InvoiceDrcrAdj
mTotAmt = 0; mTotAmt = 0;
mAdjAmt = 0; mAdjAmt = 0;
mDiffAmt = 0; mDiffAmt = 0;
} }*/
//commeted by nandkumar gadkari on 06/01/20 for duplicate block
// end 24/01/14 manoharan // end 24/01/14 manoharan
// 04-09-2005 manoharan // 04-09-2005 manoharan
...@@ -612,9 +632,14 @@ public class InvoiceDrcrAdj ...@@ -612,9 +632,14 @@ public class InvoiceDrcrAdj
arrStr = tranTypeFinChrgDrn.split(","); arrStr = tranTypeFinChrgDrn.split(",");
tranTypeFinChrgDrn =""; tranTypeFinChrgDrn ="";
for (int i = 0; i < frtDrnArr.length; i++) /*for (int i = 0; i < frtDrnArr.length; i++)
{ {
tranTypeFinChrgDrn = tranTypeFinChrgDrn+"'"+frtDrnArr[i]+"',"; tranTypeFinChrgDrn = tranTypeFinChrgDrn+"'"+frtDrnArr[i]+"',";
}*/
// loop commented and change by arrStr string array by nandkumar gadkari on 06/01/20
for (int i = 0; i < arrStr.length; i++)
{
tranTypeFinChrgDrn = tranTypeFinChrgDrn+"'"+arrStr[i]+"',";
} }
tranTypeFinChrgDrn = tranTypeFinChrgDrn.substring(0,tranTypeFinChrgDrn.length()-1); tranTypeFinChrgDrn = tranTypeFinChrgDrn.substring(0,tranTypeFinChrgDrn.length()-1);
...@@ -627,7 +652,7 @@ public class InvoiceDrcrAdj ...@@ -627,7 +652,7 @@ public class InvoiceDrcrAdj
} }
else else
{ {
sqlStr = sqlStr + " ) "; sqlStr = sqlStr + " or ( tran_ser = 'MDRCRD' ) ) ";//added by nandkumar gadkari on 06/01/20
} }
sqlStr = sqlStr + " and ref_type not in (" + tranTypeFinChrgDrn + ") ) " ; sqlStr = sqlStr + " and ref_type not in (" + tranTypeFinChrgDrn + ") ) " ;
} }
...@@ -640,7 +665,7 @@ public class InvoiceDrcrAdj ...@@ -640,7 +665,7 @@ public class InvoiceDrcrAdj
} }
else else
{ {
sqlStr = sqlStr + " ) "; sqlStr = sqlStr + " or ( tran_ser = 'MDRCRD' ) ) ) ";//added by nandkumar gadkari on 06/01/20
} }
} }
// if (len(trim(drnNotIn)) > 0 then // 24/01/14 manoharan to FI3JSUN007 do not consider ther freight drn // if (len(trim(drnNotIn)) > 0 then // 24/01/14 manoharan to FI3JSUN007 do not consider ther freight drn
...@@ -652,15 +677,20 @@ public class InvoiceDrcrAdj ...@@ -652,15 +677,20 @@ public class InvoiceDrcrAdj
{ {
arrStr = ordTypeNewPrd.split(","); arrStr = ordTypeNewPrd.split(",");
ordTypeNewPrd =""; ordTypeNewPrd ="";
for (int i = 0; i < frtDrnArr.length; i++) /*for (int i = 0; i < frtDrnArr.length; i++)
{ {
ordTypeNewPrd = ordTypeNewPrd+"'"+frtDrnArr[i]+"',"; ordTypeNewPrd = ordTypeNewPrd+"'"+frtDrnArr[i]+"',";
}*/
// loop commented and change by arrStr string array by nandkumar gadkari on 06/01/20
for (int i = 0; i < arrStr.length; i++)
{
ordTypeNewPrd = ordTypeNewPrd+"'"+arrStr[i]+"',";
} }
ordTypeNewPrd = ordTypeNewPrd.substring(0,ordTypeNewPrd.length()-1); ordTypeNewPrd = ordTypeNewPrd.substring(0,ordTypeNewPrd.length()-1);
// end 04-09-2005 manoharan // end 04-09-2005 manoharan
sqlStr = sqlStr + " or ( tran_ser = 'S-INV' " + sqlStr = sqlStr + " or ( tran_ser = 'S-INV' " +
" and ref_type in (" + ordTypeNewPrd + ") " + " and ref_type in (" + ordTypeNewPrd + ") " +
" and ? - due_date >= " + llIgnoreDrDays + " ) "; " and cast( ? as date) - due_date >= " + llIgnoreDrDays + " ) ";// cast( ? as date) added by nandkumar gadkari on 06/01/19
} }
else else
{ {
...@@ -688,20 +718,25 @@ public class InvoiceDrcrAdj ...@@ -688,20 +718,25 @@ public class InvoiceDrcrAdj
{ {
arrStr = tranTypeFinChrgDrn.split(","); arrStr = tranTypeFinChrgDrn.split(",");
tranTypeFinChrgDrn =""; tranTypeFinChrgDrn ="";
for (int i = 0; i < frtDrnArr.length; i++) /*for (int i = 0; i < frtDrnArr.length; i++)
{ {
tranTypeFinChrgDrn = tranTypeFinChrgDrn+"'"+frtDrnArr[i]+"',"; tranTypeFinChrgDrn = tranTypeFinChrgDrn+"'"+frtDrnArr[i]+"',";
}*/
// loop commented and change by arrStr string array by nandkumar gadkari on 06/01/20
for (int i = 0; i < arrStr.length; i++)
{
tranTypeFinChrgDrn = tranTypeFinChrgDrn+"'"+arrStr[i]+"',";
} }
tranTypeFinChrgDrn = tranTypeFinChrgDrn.substring(0,tranTypeFinChrgDrn.length()-1); tranTypeFinChrgDrn = tranTypeFinChrgDrn.substring(0,tranTypeFinChrgDrn.length()-1);
sqlStr = sqlStr + " where ( ( (tran_ser = 'DRNRCP' )"; sqlStr = sqlStr + " where ( ( (tran_ser = 'DRNRCP' )";
if ( drnNotIn.trim().length() > 0 ) // 24/01/14 manoharan to FI3JSUN007 do not consider ther freight drn if ( drnNotIn.trim().length() > 0 ) // 24/01/14 manoharan to FI3JSUN007 do not consider ther freight drn
{ {
sqlStr = sqlStr + " or ( tran_ser = 'MDRCRD' and ref_no not in ( " + drnNotIn + ") ) ) "; sqlStr = sqlStr + " or ( tran_ser = 'MDRCRD' and ref_no not in ( " + drnNotIn + ") ) ) ";
} }
else else
{ {
sqlStr = sqlStr + " or ( tran_ser = 'MDRCRD' ) ) ";//sqlStr = sqlStr + " ) "; sqlStr = sqlStr + " or ( tran_ser = 'MDRCRD' ) ) ";//sqlStr = sqlStr + " ) ";
} }
sqlStr = sqlStr + " and ref_type not in (" + tranTypeFinChrgDrn + ") ) "; sqlStr = sqlStr + " and ref_type not in (" + tranTypeFinChrgDrn + ") ) ";
} }
...@@ -734,16 +769,21 @@ public class InvoiceDrcrAdj ...@@ -734,16 +769,21 @@ public class InvoiceDrcrAdj
{ {
arrStr = ordTypeNewPrd.split(","); arrStr = ordTypeNewPrd.split(",");
ordTypeNewPrd =""; ordTypeNewPrd ="";
for (int i = 0; i < frtDrnArr.length; i++) /*for (int i = 0; i < frtDrnArr.length; i++)
{ {
ordTypeNewPrd = ordTypeNewPrd+"'"+frtDrnArr[i]+"',"; ordTypeNewPrd = ordTypeNewPrd+"'"+frtDrnArr[i]+"',";
}*/
// loop commented and change by arrStr string array by nandkumar gadkari on 06/01/20
for (int i = 0; i < arrStr.length; i++)
{
ordTypeNewPrd = ordTypeNewPrd+"'"+arrStr[i]+"',";
} }
ordTypeNewPrd = ordTypeNewPrd.substring(0,ordTypeNewPrd.length()-1); ordTypeNewPrd = ordTypeNewPrd.substring(0,ordTypeNewPrd.length()-1);
sqlStr = "select tran_id, tran_ser, ref_no, tot_amt, adj_amt from receivables " sqlStr = "select tran_id, tran_ser, ref_no, tot_amt, adj_amt from receivables "
+ " where tran_ser = 'S-INV' " + " where tran_ser = 'S-INV' "
+ " and ref_type in (" + ordTypeNewPrd + ") " + " and ref_type in (" + ordTypeNewPrd + ") "
+ " and ? - due_date >= " + llIgnoreDrDays + " " + " and cast( ? as date) - due_date >= " + llIgnoreDrDays + " " // cast( ? as date) added by nandkumar gadkari on 06/01/19
+ " and tot_amt - adj_amt > 0 " + " and tot_amt - adj_amt > 0 "
+ " and site_code = '" + siteCode + "' " + " and site_code = '" + siteCode + "' "
+ " and item_ser = '" + itemSer + "' " + " and item_ser = '" + itemSer + "' "
...@@ -752,6 +792,12 @@ public class InvoiceDrcrAdj ...@@ -752,6 +792,12 @@ public class InvoiceDrcrAdj
+ " order by tran_id "; + " order by tran_id ";
} }
} }
//sqlstr11 added by nandkumar gadkari on 06/01/20
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(sqlStr1);
pstmt = conn.prepareStatement(sqlStr); pstmt = conn.prepareStatement(sqlStr);
if (adjNewProdInv && ordTypeNewPrd != null && ordTypeNewPrd.trim().length() > 0 && "Y".equals(adjustNewProduct)) //Added by jasmina 22/01/10-DI89SUN228 if (adjNewProdInv && ordTypeNewPrd != null && ordTypeNewPrd.trim().length() > 0 && "Y".equals(adjustNewProduct)) //Added by jasmina 22/01/10-DI89SUN228
{ {
...@@ -759,6 +805,7 @@ public class InvoiceDrcrAdj ...@@ -759,6 +805,7 @@ public class InvoiceDrcrAdj
} }
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next()) while(rs.next())
{ {
// end 03-08-2005 manoharan dynamic cursor used to have multiple // end 03-08-2005 manoharan dynamic cursor used to have multiple
......
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