List<GenericValue> billings = null;
if (item.getEntityName().equals("ShipmentReceipt")) {
billings = delegator.findByAnd("ReturnItemBilling", UtilMisc.toMap("shipmentReceiptId", item.getString("receiptId"), "returnId", returnId,
"returnItemSeqId", item.get("returnItemSeqId")));
} else if (item.getEntityName().equals("ItemIssuance")) {
billings = delegator.findByAnd("ReturnItemBilling", UtilMisc.toMap("returnId", returnId, "returnItemSeqId", returnItemSeqId));
}
// if there are billings, we have already billed the item, so skip it
if (UtilValidate.isNotEmpty(billings)) continue;
// get the List of items shipped to/from this returnId