List<String> salesInvoiceRolePartyIds = EntityUtil.getFieldListFromEntityList(delegator.findList("InvoiceRole", EntityCondition.makeCondition(invoiceRoleConds, EntityOperator.AND), null, null, null, false), "partyId", true);
if (UtilValidate.isNotEmpty(salesInvoiceRolePartyIds)) {
salesRepPartyIds = UtilGenerics.checkList(CollectionUtils.intersection(salesRepPartyIds, salesInvoiceRolePartyIds));
}
}
invoice = delegator.findOne("Invoice", UtilMisc.toMap("invoiceId", salesInvoiceId), false);
String invoiceTypeId = invoice.getString("invoiceTypeId");
if ("CUST_RTN_INVOICE".equals(invoiceTypeId)) {
isReturn = true;
} else if (!"SALES_INVOICE".equals(invoiceTypeId)) {
Debug.logWarning("This type of invoice has no commission; returning success", module);