diff --git a/org.adempiere.base/src/org/compiere/model/MOrder.java b/org.adempiere.base/src/org/compiere/model/MOrder.java index 773133e89e..aaf0d65c7f 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrder.java +++ b/org.adempiere.base/src/org/compiere/model/MOrder.java @@ -1093,6 +1093,14 @@ public class MOrder extends X_C_Order implements DocAction } } + // IDEMPIERE-4318 Validation - Prepay Order must not allow Cash payment rule + MDocType dt = MDocType.get(getCtx(), getC_DocTypeTarget_ID()); + if ( MDocType.DOCSUBTYPESO_PrepayOrder.equals(dt.getDocSubTypeSO()) + && PAYMENTRULE_Cash.equals(getPaymentRule())) { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@Invalid@ @PaymentRule@")); + return false; + } + if (! recursiveCall && (!newRecord && is_ValueChanged(COLUMNNAME_C_PaymentTerm_ID))) { recursiveCall = true; try {