Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obtain postal addresses in orderinfo services to show on order template #151

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions service/mantle/order/OrderInfoServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ along with this software (see the LICENSE.md file). If not, see
<auto-parameters entity-name="mantle.party.contact.TelecomNumber"/></parameter>
</parameter>
<parameter name="customerDetail" type="Map"><auto-parameters entity-name="mantle.party.PartyDetail"/></parameter>
<parameter name="customerContactInfo"/>
<parameter name="customerEmail"/>
<parameter name="vendorDetail" type="Map"><auto-parameters entity-name="mantle.party.PartyDetail"/></parameter>
<parameter name="vendorContactInfo"/>
<parameter name="isCustomerInternalOrg" type="Boolean"/>
<parameter name="isVendorInternalOrg" type="Boolean"/>
<parameter name="orderPartPartyList" type="List"><parameter name="orderPartParty">
Expand Down Expand Up @@ -291,7 +293,18 @@ along with this software (see the LICENSE.md file). If not, see
EntityList partNoParentOrderItemList = partOrderItemList.findAll({ it.parentItemSeqId == null })

EntityValue customerDetail = ec.entity.find("mantle.party.PartyDetail").condition("partyId", orderPart.customerPartyId).one()
Map customerContactInfo = null;
if (customerDetail) {
customerContactInfo = ec.service.sync().name("mantle.party.ContactServices.get#PartyContactInfo")
.parameter("partyId", orderPart.customerPartyId).parameter("postalContactMechPurposeId","PostalOrder")
.parameter("emailContactMechPurposeId", 'EmailOrder').parameter("defaultToPrimaryPurpose", true).call()
String customerEmail = customerContactInfo?.emailAddress}
EntityValue vendorDetail = ec.entity.find("mantle.party.PartyDetail").condition("partyId", orderPart.vendorPartyId).one()
Map vendorContactInfo = null;
if (vendorDetail) {
vendorContactInfo = ec.service.sync().name("mantle.party.ContactServices.get#PartyContactInfo")
.parameter("partyId", orderPart.vendorPartyId).parameter("postalContactMechPurposeId","PostalOrder")
.parameter("defaultToPrimaryPurpose", true).call()}
boolean isCustomerInternalOrg = ec.entity.find("mantle.party.PartyRole")
.condition("partyId", orderPart.customerPartyId).condition("roleTypeId", "OrgInternal").one() as boolean
boolean isVendorInternalOrg = ec.entity.find("mantle.party.PartyRole")
Expand All @@ -304,13 +317,6 @@ along with this software (see the LICENSE.md file). If not, see
String shipToPartyId = customerShipToDetail?.partyId ?: orderPart.customerPartyId
String billToPartyId = customerBillToDetail?.partyId ?: orderPart.customerPartyId

String customerEmail = null
if (orderPart.customerPartyId) {
customerEmail = ec.service.sync().name("mantle.party.ContactServices.get#PartyContactInfo")
.parameter("partyId", orderPart.customerPartyId).parameter("emailContactMechPurposeId", "EmailOrder")
.parameter("defaultToPrimaryPurpose", true).call()?.emailAddress
}

boolean hasShippableItems = orderItemList.find({ it.product?.productTypeEnumId in ['PtAsset', 'PtDigitalAsset', 'PtAssetUse'] }) != null
boolean singleLot = false
boolean newerInventory = false
Expand Down Expand Up @@ -409,6 +415,7 @@ along with this software (see the LICENSE.md file). If not, see
postalAddress:postalAddress, postalAddressStateGeo:postalAddressStateGeo,
telecomNumber:telecomNumber, facility:facility,
facilityContactInfo:facilityContactInfo, customerDetail:customerDetail, customerEmail:customerEmail,
vendorContactInfo: vendorContactInfo, customerContactInfo: customerContactInfo,
vendorDetail:vendorDetail, isCustomerInternalOrg:isCustomerInternalOrg, isVendorInternalOrg:isVendorInternalOrg,
orderPartPartyList:orderPartPartyList, customerShipToDetail:customerShipToDetail,
customerBillToDetail:customerBillToDetail, partShipmentItemSourceList:partShipmentItemSourceList,
Expand Down