IDEMPIERE-4760 Credit check do not allow complete Customer Return (#652)

This commit is contained in:
igorpojzl 2021-04-19 14:44:02 +02:00 committed by GitHub
parent 8f31506ac7
commit c803886d25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -1131,7 +1131,7 @@ public class MInOut extends X_M_InOut implements DocAction
}
// Credit Check
if (isSOTrx() && !isReversal())
if (isSOTrx() && !isReversal() && !isCustomerReturn())
{
I_C_Order order = getC_Order();
if (order != null && MDocType.DOCSUBTYPESO_PrepayOrder.equals(order.getC_DocType().getDocSubTypeSO())
@ -1230,6 +1230,17 @@ public class MInOut extends X_M_InOut implements DocAction
return DocAction.STATUS_InProgress;
} // prepareIt
/**
* Check if Document is Customer Return.
* @return True if Document is Customer Return
*/
private boolean isCustomerReturn() {
MDocType doctype = MDocType.get(getC_DocType_ID());
if(isSOTrx() && doctype.getDocBaseType().equals("MMR") && doctype.isSOTrx())
return true;
return false;
}
/**
* Approve Document
* @return true if success