IDEMPIERE-5002 RMA does not handle UoM properly (#928)

This commit is contained in:
Ricardo Santana 2021-10-21 04:23:17 -03:00 committed by GitHub
parent 2a4d5dded0
commit 1970ee6539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -104,7 +104,7 @@ public class MRMALine extends X_M_RMALine
{
MInvoiceLine invoiceLine = new MInvoiceLine(getCtx(), getInvoiceLineId(), get_TrxName());
precision = invoiceLine.getPrecision();
unitAmount = invoiceLine.getPriceEntered();
unitAmount = invoiceLine.getPriceActual();
originalQty = invoiceLine.getQtyInvoiced();
taxId = invoiceLine.getC_Tax_ID();
}
@ -112,7 +112,7 @@ public class MRMALine extends X_M_RMALine
{
MOrderLine orderLine = new MOrderLine (getCtx(), m_ioLine.getC_OrderLine_ID(), get_TrxName());
precision = orderLine.getPrecision();
unitAmount = orderLine.getPriceEntered();
unitAmount = orderLine.getPriceActual();
originalQty = orderLine.getQtyDelivered();
taxId = orderLine.getC_Tax_ID();
}

View File

@ -280,17 +280,17 @@ public abstract class CreateFromShipment extends CreateFrom
StringBuilder sqlStmt = new StringBuilder();
sqlStmt.append("SELECT rl.M_RMALine_ID, rl.line, rl.Qty - rl.QtyDelivered, p.M_Product_ID, COALESCE(p.Name, c.Name), uom.C_UOM_ID, COALESCE(uom.UOMSymbol,uom.Name) ");
sqlStmt.append("FROM M_RMALine rl INNER JOIN M_InOutLine iol ON rl.M_InOutLine_ID=iol.M_InOutLine_ID ");
sqlStmt.append("LEFT OUTER JOIN M_Product p ON p.M_Product_ID=iol.M_Product_ID ");
if (Env.isBaseLanguage(Env.getCtx(), "C_UOM"))
{
sqlStmt.append("LEFT OUTER JOIN C_UOM uom ON (uom.C_UOM_ID=iol.C_UOM_ID) ");
sqlStmt.append("LEFT OUTER JOIN C_UOM uom ON (uom.C_UOM_ID=COALESCE(p.C_UOM_ID,iol.C_UOM_ID)) ");
}
else
{
sqlStmt.append("LEFT OUTER JOIN C_UOM_Trl uom ON (uom.C_UOM_ID=iol.C_UOM_ID AND uom.AD_Language='");
sqlStmt.append("LEFT OUTER JOIN C_UOM_Trl uom ON (uom.C_UOM_ID=COALESCE(p.C_UOM_ID,iol.C_UOM_ID) AND uom.AD_Language='");
sqlStmt.append(Env.getAD_Language(Env.getCtx())).append("') ");
}
sqlStmt.append("LEFT OUTER JOIN M_Product p ON p.M_Product_ID=iol.M_Product_ID ");
sqlStmt.append("LEFT OUTER JOIN C_Charge c ON c.C_Charge_ID=iol.C_Charge_ID ");
sqlStmt.append("WHERE rl.M_RMA_ID=? ");
sqlStmt.append("AND rl.M_InOutLine_ID IS NOT NULL");