IDEMPIERE-4318 Validation - Prepay Order must not allow Cash payment rule (#127)

This commit is contained in:
Carlos Ruiz 2020-06-24 17:10:51 +02:00 committed by GitHub
parent 84577578ea
commit bcd1fa67cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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 {