IDEMPIERE-5002 RMA does not handle UoM properly (#928)
This commit is contained in:
parent
2a4d5dded0
commit
1970ee6539
|
@ -104,7 +104,7 @@ public class MRMALine extends X_M_RMALine
|
||||||
{
|
{
|
||||||
MInvoiceLine invoiceLine = new MInvoiceLine(getCtx(), getInvoiceLineId(), get_TrxName());
|
MInvoiceLine invoiceLine = new MInvoiceLine(getCtx(), getInvoiceLineId(), get_TrxName());
|
||||||
precision = invoiceLine.getPrecision();
|
precision = invoiceLine.getPrecision();
|
||||||
unitAmount = invoiceLine.getPriceEntered();
|
unitAmount = invoiceLine.getPriceActual();
|
||||||
originalQty = invoiceLine.getQtyInvoiced();
|
originalQty = invoiceLine.getQtyInvoiced();
|
||||||
taxId = invoiceLine.getC_Tax_ID();
|
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());
|
MOrderLine orderLine = new MOrderLine (getCtx(), m_ioLine.getC_OrderLine_ID(), get_TrxName());
|
||||||
precision = orderLine.getPrecision();
|
precision = orderLine.getPrecision();
|
||||||
unitAmount = orderLine.getPriceEntered();
|
unitAmount = orderLine.getPriceActual();
|
||||||
originalQty = orderLine.getQtyDelivered();
|
originalQty = orderLine.getQtyDelivered();
|
||||||
taxId = orderLine.getC_Tax_ID();
|
taxId = orderLine.getC_Tax_ID();
|
||||||
}
|
}
|
||||||
|
|
|
@ -280,17 +280,17 @@ public abstract class CreateFromShipment extends CreateFrom
|
||||||
StringBuilder sqlStmt = new StringBuilder();
|
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("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("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"))
|
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
|
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(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("LEFT OUTER JOIN C_Charge c ON c.C_Charge_ID=iol.C_Charge_ID ");
|
||||||
sqlStmt.append("WHERE rl.M_RMA_ID=? ");
|
sqlStmt.append("WHERE rl.M_RMA_ID=? ");
|
||||||
sqlStmt.append("AND rl.M_InOutLine_ID IS NOT NULL");
|
sqlStmt.append("AND rl.M_InOutLine_ID IS NOT NULL");
|
||||||
|
|
Loading…
Reference in New Issue