IDEMPIERE-1574 Sales Order Line lets Price under the Price Limit when updating
This commit is contained in:
parent
891b7b50ed
commit
853b3e9da8
|
@ -510,6 +510,8 @@ public class CalloutInvoice extends CalloutEngine
|
|||
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID");
|
||||
int M_PriceList_ID = Env.getContextAsInt(ctx, WindowNo, "M_PriceList_ID");
|
||||
int StdPrecision = MPriceList.getStandardPrecision(ctx, M_PriceList_ID);
|
||||
MPriceList pl = new MPriceList(ctx, M_PriceList_ID, null);
|
||||
boolean isEnforcePriceLimit = pl.isEnforcePriceLimit();
|
||||
BigDecimal QtyEntered, QtyInvoiced, PriceEntered, PriceActual, PriceLimit, Discount, PriceList;
|
||||
// get values
|
||||
QtyEntered = (BigDecimal)mTab.getValue("QtyEntered");
|
||||
|
@ -630,7 +632,7 @@ public class CalloutInvoice extends CalloutEngine
|
|||
|
||||
// Check PriceLimit
|
||||
String epl = Env.getContext(ctx, WindowNo, "EnforcePriceLimit");
|
||||
boolean enforce = Env.isSOTrx(ctx, WindowNo) && epl != null && epl.equals("Y");
|
||||
boolean enforce = Env.isSOTrx(ctx, WindowNo) && epl != null && !epl.equals("") ? epl.equals("Y") : isEnforcePriceLimit;
|
||||
if (enforce && MRole.getDefault().isOverwritePriceLimit())
|
||||
enforce = false;
|
||||
// Check Price Limit?
|
||||
|
|
|
@ -1038,6 +1038,8 @@ public class CalloutOrder extends CalloutEngine
|
|||
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID");
|
||||
int M_PriceList_ID = Env.getContextAsInt(ctx, WindowNo, "M_PriceList_ID");
|
||||
int StdPrecision = MPriceList.getStandardPrecision(ctx, M_PriceList_ID);
|
||||
MPriceList pl = new MPriceList(ctx, M_PriceList_ID, null);
|
||||
boolean isEnforcePriceLimit = pl.isEnforcePriceLimit();
|
||||
BigDecimal QtyEntered, QtyOrdered, PriceEntered, PriceActual, PriceLimit, Discount, PriceList;
|
||||
// get values
|
||||
QtyEntered = (BigDecimal)mTab.getValue("QtyEntered");
|
||||
|
@ -1158,7 +1160,7 @@ public class CalloutOrder extends CalloutEngine
|
|||
|
||||
// Check PriceLimit
|
||||
String epl = Env.getContext(ctx, WindowNo, "EnforcePriceLimit");
|
||||
boolean enforce = Env.isSOTrx(ctx, WindowNo) && epl != null && epl.equals("Y");
|
||||
boolean enforce = Env.isSOTrx(ctx, WindowNo) && epl != null && !epl.equals("") ? epl.equals("Y") : isEnforcePriceLimit;
|
||||
if (enforce && MRole.getDefault().isOverwritePriceLimit())
|
||||
enforce = false;
|
||||
// Check Price Limit?
|
||||
|
|
|
@ -858,6 +858,19 @@ public class MInvoiceLine extends X_C_InvoiceLine
|
|||
&& Env.ZERO.compareTo(getPriceActual()) == 0
|
||||
&& Env.ZERO.compareTo(getPriceList()) == 0)
|
||||
setPrice();
|
||||
// IDEMPIERE-1574 Sales Order Line lets Price under the Price Limit when updating
|
||||
// Check PriceLimit
|
||||
boolean enforce = m_IsSOTrx && m_parent.getM_PriceList().isEnforcePriceLimit();
|
||||
if (enforce && MRole.getDefault().isOverwritePriceLimit())
|
||||
enforce = false;
|
||||
// Check Price Limit?
|
||||
if (enforce && getPriceLimit() != Env.ZERO
|
||||
&& getPriceActual().compareTo(getPriceLimit()) < 0)
|
||||
{
|
||||
log.saveError("UnderLimitPrice", "PriceEntered=" + getPriceEntered() + ", PriceLimit=" + getPriceLimit());
|
||||
return false;
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
// Set Tax
|
||||
|
|
|
@ -827,6 +827,19 @@ public class MOrderLine extends X_C_OrderLine
|
|||
// Check if on Price list
|
||||
if (m_productPrice == null)
|
||||
getProductPricing(m_M_PriceList_ID);
|
||||
// IDEMPIERE-1574 Sales Order Line lets Price under the Price Limit when updating
|
||||
// Check PriceLimit
|
||||
boolean enforce = m_IsSOTrx && m_parent.getM_PriceList().isEnforcePriceLimit();
|
||||
if (enforce && MRole.getDefault().isOverwritePriceLimit())
|
||||
enforce = false;
|
||||
// Check Price Limit?
|
||||
if (enforce && getPriceLimit() != Env.ZERO
|
||||
&& getPriceActual().compareTo(getPriceLimit()) < 0)
|
||||
{
|
||||
log.saveError("UnderLimitPrice", "PriceEntered=" + getPriceEntered() + ", PriceLimit=" + getPriceLimit());
|
||||
return false;
|
||||
}
|
||||
//
|
||||
if (!m_productPrice.isCalculated())
|
||||
{
|
||||
throw new ProductNotOnPriceListException(m_productPrice, getLine());
|
||||
|
|
Loading…
Reference in New Issue