Commit 3703f726 authored by ngadkari's avatar ngadkari

In min_rate_history update added sum quantity and effective cost of same item...

In min_rate_history update added sum quantity and effective  cost of same item lot in invoice trace   

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@208878 ce508802-f39f-4f6c-b175-0d175dae99d5
parent de5623ec
...@@ -3809,7 +3809,7 @@ public class PostOrderActivity { ...@@ -3809,7 +3809,7 @@ public class PostOrderActivity {
String sqlCnt=""; String sqlCnt="";
//added by nandkumar gadkari on 04/07/19 //added by nandkumar gadkari on 04/07/19
int schemeCnt=0; int schemeCnt=0;
double totItemLotQuantity=0; double totItemLotQuantity=0,totItemLotQtyEffCost=0;
try try
{ {
// 06-Dec-16 manoharan moved from inside loop // 06-Dec-16 manoharan moved from inside loop
...@@ -4283,7 +4283,7 @@ public class PostOrderActivity { ...@@ -4283,7 +4283,7 @@ public class PostOrderActivity {
{ {
ldEffCost = rsLot.getDouble("inv_rate"); ldEffCost = rsLot.getDouble("inv_rate");
//added by nandkumar gadkari on 20/09/19--------start------------------for total quantity update //added by nandkumar gadkari on 20/09/19--------start------------------for total quantity update
sql = " select SUM(quantity) from invoice_trace where " /*sql = " select SUM(quantity) from invoice_trace where "
+ " invoice_id = ? and sord_no = ? and item_code = ? and lot_no = ? and line_type not in ('I','V','P') "; + " invoice_id = ? and sord_no = ? and item_code = ? and lot_no = ? and line_type not in ('I','V','P') ";
pstmt2 = conn.prepareStatement(sql); pstmt2 = conn.prepareStatement(sql);
...@@ -4305,7 +4305,7 @@ public class PostOrderActivity { ...@@ -4305,7 +4305,7 @@ public class PostOrderActivity {
if(totItemLotQuantity > invQty) if(totItemLotQuantity > invQty)
{ {
invQty=totItemLotQuantity; invQty=totItemLotQuantity;
} }*/
//added by nandkumar gadkari on 20/09/19--------end------------------for total quantity update //added by nandkumar gadkari on 20/09/19--------end------------------for total quantity update
} }
...@@ -4317,6 +4317,34 @@ public class PostOrderActivity { ...@@ -4317,6 +4317,34 @@ public class PostOrderActivity {
invQty=totQty; invQty=totQty;
} }
//added by nandkumar gadkari on 14/08/19--------end--------- //added by nandkumar gadkari on 14/08/19--------end---------
//added by nandkumar gadkari on 01/10/19--------start------------------for total quantity update
sql = " select SUM(quantity), Round(sum((quantity * rate) - ( ((quantity * rate)*discount)/100)) / sum(quantity),2) from invoice_trace where "
+ " invoice_id = ? and sord_no = ? and item_code = ? and lot_no = ? and line_type not in ('I','V','P') ";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, invoiceId);
pstmt2.setString(2, refNo);
pstmt2.setString(3, itemCode);
pstmt2.setString(4, lotNo);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
totItemLotQuantity = rs2.getDouble(1);
totItemLotQtyEffCost = rs2.getDouble(2);
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
if(totItemLotQuantity > invQty)
{
invQty=totItemLotQuantity;
ldEffCost =totItemLotQtyEffCost;
}
//added by nandkumar gadkari on 01/10/19--------end------------------for total quantity update
if ((priceList.trim()).length() > 0) if ((priceList.trim()).length() > 0)
{ {
rate = distCommon.pickRate(priceList, sdf.format(sysdate), itemCode, lotNo, "B", conn); rate = distCommon.pickRate(priceList, sdf.format(sysdate), itemCode, lotNo, "B", conn);
......
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