Commit 574109a6 authored by ngadkari's avatar ngadkari

changes for not to set average effective cost

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@202932 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c25333a9
...@@ -3797,6 +3797,8 @@ public class PostOrderActivity { ...@@ -3797,6 +3797,8 @@ public class PostOrderActivity {
String prevRefNo = ""; String prevRefNo = "";
//Added by Santosh on 04/01/17 //Added by Santosh on 04/01/17
double invQty = 0.0; double invQty = 0.0;
//added by nandkumar gadkari on 04/07/19
int schemeCnt=0;
try try
{ {
// 06-Dec-16 manoharan moved from inside loop // 06-Dec-16 manoharan moved from inside loop
...@@ -4187,8 +4189,37 @@ public class PostOrderActivity { ...@@ -4187,8 +4189,37 @@ public class PostOrderActivity {
} }
else if ("I".equalsIgnoreCase(tranType)) else if ("I".equalsIgnoreCase(tranType))
{ {
sql = "select distinct lot_no from invoice_trace where invoice_id = ? and sord_no = ?" //added by nandkumar gadkari on 04/07/19--------start------------------for not to update average effective cost
sql = "select count(distinct EXP_LEV) as ll_scheme from invoice_trace where invoice_id = ? "
+ " and SORD_NO =? and SORD_LINE_NO = ? and item_code = ? ";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, invoiceId);
pstmt2.setString(2, refNo);
pstmt2.setString(3, refLineNo);
pstmt2.setString(4, itemCode);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
schemeCnt = rs2.getInt(1);
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
if(schemeCnt == 1)
{
sql = "select lot_no,Round(sum((quantity * rate) - ( ((quantity * rate)*discount)/100)) / sum(quantity),2) as inv_rate from invoice_trace "
+ " where invoice_id = ? and SORD_NO = ? and SORD_LINE_NO = ? and item_code = ? group by lot_no";
}
else
{
//added by nandkumar gadkari on 04/07/19--------end------------------for not to update average effective cost
sql = "select distinct lot_no from invoice_trace where invoice_id = ? and sord_no = ?"
+ " and sord_line_no = ? and item_code = ? order by lot_no"; + " and sord_line_no = ? and item_code = ? order by lot_no";
}
} }
pstmtLot = conn.prepareStatement(sql); pstmtLot = conn.prepareStatement(sql);
//Changed by wasim on 17-05-2017 for setting correct parameter for prepared statements [START] //Changed by wasim on 17-05-2017 for setting correct parameter for prepared statements [START]
...@@ -4215,6 +4246,12 @@ public class PostOrderActivity { ...@@ -4215,6 +4246,12 @@ public class PostOrderActivity {
while (rsLot.next()) while (rsLot.next())
{ {
lotNo = rsLot.getString("lot_no"); lotNo = rsLot.getString("lot_no");
//added by nandkumar gadkari on 04/07/19--------start------------------for not to update average effective cost
if(schemeCnt == 1)
{
ldEffCost = rsLot.getDouble("inv_rate");
}
//added by nandkumar gadkari on 04/07/19--------end------------------for not to update average effective cost
// 13-jan-17 manoharan moved from above as lot_no not available // 13-jan-17 manoharan moved from above as lot_no not available
if ((priceList.trim()).length() > 0) if ((priceList.trim()).length() > 0)
{ {
......
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