if (invoice.getString("invoiceTypeId").equals("SALES_INVOICE"))
destinationPartyId = invoice.getString("partyId");
if (invoice.getString("invoiceTypeId").equals("PURCHASE_INVOICE"))
destinationPartyId = invoice.getString("partyId");
try {
<BUG>locations = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose",

UtilMisc.toMap("partyId", destinationPartyId, "contactMechPurposeTypeId", contactMechPurposeTypeId), null, false));
} catch (GenericEntityException e) {</BUG>
Debug.logError("Trouble getting contact party purpose list", module);

if (invoice.getString("invoiceTypeId").equals("SALES_INVOICE"))
destinationPartyId = invoice.getString("partyId");
if (invoice.getString("invoiceTypeId").equals("PURCHASE_INVOICE"))
destinationPartyId = invoice.getString("partyId");
try {
locations = delegator.findByAnd("PartyContactWithPurpose",
UtilMisc.toMap("partyId", destinationPartyId, "contactMechPurposeTypeId", contactMechPurposeTypeId), null, false);
locations = EntityUtil.filterByDate(locations, null, "contactFromDate", "contactThruDate", true);
locations = EntityUtil.filterByDate(locations, null, "purposeFromDate", "purposeThruDate", true);
} catch (GenericEntityException e) {
Debug.logError("Trouble getting contact party purpose list", module);
