Skip to content

Commit

Permalink
get vendor/customer contactInfo for PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
hansbak committed Mar 23, 2020
1 parent 14f2be4 commit 841d516
Showing 1 changed file with 14 additions and 7 deletions.
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 @@ -292,7 +294,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 @@ -305,13 +318,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 @@ -410,6 +416,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

1 comment on commit 841d516

@growerp
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postal info on order pdf

Please sign in to comment.