svn commit: r443454 - /incubator/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r443454 - /incubator/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml

sichen
Author: sichen
Date: Thu Sep 14 13:08:17 2006
New Revision: 443454

URL: http://svn.apache.org/viewvc?view=rev&rev=443454
Log:
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>