@@ -126,8 +126,10 @@ along with this software (see the LICENSE.md file). If not, see
126126 <auto-parameters entity-name =" mantle.party.contact.TelecomNumber" /></parameter >
127127 </parameter >
128128 <parameter name =" customerDetail" type =" Map" ><auto-parameters entity-name =" mantle.party.PartyDetail" /></parameter >
129+ <parameter name =" customerContactInfo" />
129130 <parameter name =" customerEmail" />
130131 <parameter name =" vendorDetail" type =" Map" ><auto-parameters entity-name =" mantle.party.PartyDetail" /></parameter >
132+ <parameter name =" vendorContactInfo" />
131133 <parameter name =" isCustomerInternalOrg" type =" Boolean" />
132134 <parameter name =" isVendorInternalOrg" type =" Boolean" />
133135 <parameter name =" orderPartPartyList" type =" List" ><parameter name =" orderPartParty" >
@@ -292,7 +294,18 @@ along with this software (see the LICENSE.md file). If not, see
292294 EntityList partNoParentOrderItemList = partOrderItemList.findAll({ it.parentItemSeqId == null })
293295
294296 EntityValue customerDetail = ec.entity.find("mantle.party.PartyDetail").condition("partyId", orderPart.customerPartyId).one()
297+ Map customerContactInfo = null;
298+ if (customerDetail) {
299+ customerContactInfo = ec.service.sync().name("mantle.party.ContactServices.get#PartyContactInfo")
300+ .parameter("partyId", orderPart.customerPartyId).parameter("postalContactMechPurposeId","PostalOrder")
301+ .parameter("emailContactMechPurposeId", 'EmailOrder').parameter("defaultToPrimaryPurpose", true).call()
302+ String customerEmail = customerContactInfo?.emailAddress}
295303 EntityValue vendorDetail = ec.entity.find("mantle.party.PartyDetail").condition("partyId", orderPart.vendorPartyId).one()
304+ Map vendorContactInfo = null;
305+ if (vendorDetail) {
306+ vendorContactInfo = ec.service.sync().name("mantle.party.ContactServices.get#PartyContactInfo")
307+ .parameter("partyId", orderPart.vendorPartyId).parameter("postalContactMechPurposeId","PostalOrder")
308+ .parameter("defaultToPrimaryPurpose", true).call()}
296309 boolean isCustomerInternalOrg = ec.entity.find("mantle.party.PartyRole")
297310 .condition("partyId", orderPart.customerPartyId).condition("roleTypeId", "OrgInternal").one() as boolean
298311 boolean isVendorInternalOrg = ec.entity.find("mantle.party.PartyRole")
@@ -305,13 +318,6 @@ along with this software (see the LICENSE.md file). If not, see
305318 String shipToPartyId = customerShipToDetail?.partyId ?: orderPart.customerPartyId
306319 String billToPartyId = customerBillToDetail?.partyId ?: orderPart.customerPartyId
307320
308- String customerEmail = null
309- if (orderPart.customerPartyId) {
310- customerEmail = ec.service.sync().name("mantle.party.ContactServices.get#PartyContactInfo")
311- .parameter("partyId", orderPart.customerPartyId).parameter("emailContactMechPurposeId", "EmailOrder")
312- .parameter("defaultToPrimaryPurpose", true).call()?.emailAddress
313- }
314-
315321 boolean hasShippableItems = orderItemList.find({ it.product?.productTypeEnumId in ['PtAsset', 'PtDigitalAsset', 'PtAssetUse'] }) != null
316322 boolean singleLot = false
317323 boolean newerInventory = false
@@ -410,6 +416,7 @@ along with this software (see the LICENSE.md file). If not, see
410416 postalAddress:postalAddress, postalAddressStateGeo:postalAddressStateGeo,
411417 telecomNumber:telecomNumber, facility:facility,
412418 facilityContactInfo:facilityContactInfo, customerDetail:customerDetail, customerEmail:customerEmail,
419+ vendorContactInfo: vendorContactInfo, customerContactInfo: customerContactInfo,
413420 vendorDetail:vendorDetail, isCustomerInternalOrg:isCustomerInternalOrg, isVendorInternalOrg:isVendorInternalOrg,
414421 orderPartPartyList:orderPartPartyList, customerShipToDetail:customerShipToDetail,
415422 customerBillToDetail:customerBillToDetail, partShipmentItemSourceList:partShipmentItemSourceList,
0 commit comments