Commit b44a85ae authored by ngadkari's avatar ngadkari

avg. rate set for different lot of same item

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@215447 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0dbe1c44
......@@ -4366,9 +4366,10 @@ public class PostOrderActivity {
/* 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') ";
*///SQL COMMENTED AND NEW ADDED BY NANDKUMAR GADKARI ON 07/01/20
sql = " select SUM(quantity), Round(sum((quantity * rate) - ( ((quantity * rate)*discount)/100)) / sum(quantity),2) from invoice_trace where "
/*sql = " select SUM(quantity), Round(sum((quantity * rate) - ( ((quantity * rate)*discount)/100)) / sum(quantity),2) from invoice_trace where "
+ " invoice_id = ? and item_code = ? and lot_no = ? and line_type not in ('I','V','P') ";*///commented by nandkumar gadkari on 20/01/20
sql = " select SUM(quantity) from invoice_trace where "
+ " invoice_id = ? 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);
......@@ -4378,7 +4379,7 @@ public class PostOrderActivity {
if (rs2.next())
{
totItemLotQuantity = rs2.getDouble(1);
totItemLotQtyEffCost = rs2.getDouble(2);
//totItemLotQtyEffCost = rs2.getDouble(2);commented by nandkumar gadkari on 20/01/20
}
pstmt2.close();
......@@ -4389,9 +4390,32 @@ public class PostOrderActivity {
if(totItemLotQuantity > invQty)
{
invQty=totItemLotQuantity;
ldEffCost =totItemLotQtyEffCost;
//ldEffCost =totItemLotQtyEffCost; commented by nandkumar gadkari on 20/01/20
}
//added by nandkumar gadkari on 20/01/20---------------start--------------------
sql = " select Round(sum((quantity * rate) - ( ((quantity * rate)*discount)/100)) / sum(quantity),2) from invoice_trace where "
+ " invoice_id = ? and item_code = ? and line_type not in ('I','V','P') ";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, invoiceId);
pstmt2.setString(2, itemCode);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
totItemLotQtyEffCost = rs2.getDouble(1);
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
ldEffCost =totItemLotQtyEffCost;
//added by nandkumar gadkari on 20/01/20---------------end--------------------
//added by nandkumar gadkari on 01/10/19--------end------------------for total quantity update
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