Author: sichen
Date: Thu Sep 14 13:08:17 2006
New Revision: 443454
URL:
http://svn.apache.org/viewvc?view=rev&rev=443454Log:
OFBIZ-285 - Get shipment phone number from shipment partyIdTo.
Modified:
incubator/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml
Modified: incubator/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml?view=diff&rev=443454&r1=443453&r2=443454==============================================================================
--- incubator/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml (original)
+++ incubator/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml Thu Sep 14 13:08:17 2006
@@ -421,7 +421,18 @@
<if-not-empty field-name="destTelecomOrderContactMech">
<set from-field="destTelecomOrderContactMech.contactMechId" field="shipment.destinationTelecomNumberId"/>
<else>
- <log level="warning" message="Cannot find a shipping destination phone number for ${shipment.primaryOrderId}"/>
+ <!-- use the first unexpired phone number of the shipment partyIdTo -->
+ <entity-and entity-name="PartyAndTelecomNumber" list-name="phoneNumbers">
+ <field-map field-name="partyId" env-name="shipment.partyIdTo"/>
+ </entity-and>
+ <filter-list-by-date list-name="phoneNumbers"/>
+ <first-from-list entry-name="phoneNumber" list-name="phoneNumbers"/>
+ <if-not-empty field-name="phoneNumber">
+ <set from-field="phoneNumber.contactMechId" field="shipment.destinationTelecomNumberId"/>
+ <else>
+ <log level="warning" message="Cannot find a shipping destination phone number for ${shipment.primaryOrderId}"/>
+ </else>
+ </if-not-empty>
</else>
</if-not-empty>
</if-empty>