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 {
String prevRefNo = "";
//Added by Santosh on 04/01/17
double invQty = 0.0;
//added by nandkumar gadkari on 04/07/19
int schemeCnt=0;
try
{
// 06-Dec-16 manoharan moved from inside loop
......@@ -4187,9 +4189,38 @@ public class PostOrderActivity {
}
else if ("I".equalsIgnoreCase(tranType))
{
//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";
}
}
pstmtLot = conn.prepareStatement(sql);
//Changed by wasim on 17-05-2017 for setting correct parameter for prepared statements [START]
/*pstmtLot.setString(1, invoiceId);
......@@ -4215,6 +4246,12 @@ public class PostOrderActivity {
while (rsLot.next())
{
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
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