Author: apatel
Date: Wed Jul 25 02:32:44 2007 New Revision: 559372 URL: http://svn.apache.org/viewvc?view=rev&rev=559372 Log: some fixes in showShipment message. Added a utility service to move shipment to packed and then to shipped status. Modified: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml ofbiz/trunk/applications/product/servicedef/services_shipment.xml ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Modified: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml?view=diff&rev=559372&r1=559371&r2=559372 ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml Wed Jul 25 02:32:44 2007 @@ -1389,7 +1389,10 @@ <simple-method method-name="issueSerializedInvToShipmentPackageAndSetTracking" short-description=""> <!-- If serialNumber is provided, Then compare it with the serialNumber of inventoryItem on reservation. If they don't match, We'll have to reReserve specific inventory that is shiped. --> - + <!-- If serialNumber exist then run reserveAnInventoryItem for serialisedInventory.There is no need to check + this condition for the non-serialized inventory (Non serialized Inventory will derectly issued). + --> + <if-not-empty field-name="parameters.serialNumber"> <make-value entity-name="OrderItemShipGrpInvRes" value-name="orderItemShipGrpInvResLookupPk"/> <set-pk-fields value-name="orderItemShipGrpInvResLookupPk" map-name="parameters"/> <find-by-primary-key entity-name="OrderItemShipGrpInvRes" map-name="orderItemShipGrpInvResLookupPk" value-name="orderItemShipGrpInvRes"/> @@ -1401,6 +1404,7 @@ <result-to-field result-name="inventoryItemId" field-name="parameters.inventoryItemId"/> </call-service> </if-compare-field> + </if-not-empty> <!-- get InventoryItem issued to shipment --> <clear-field field-name="issueContext"/> <set from-field="parameters.shipmentId" field="issueContext.shipmentId"/> @@ -1424,11 +1428,9 @@ <set value="New" field="shipItemContext.shipmentPackageSeqId"/> </if-empty> <log level="info" message="Package SeqID : ${shipItemContext.shipmentPackageSeqId}"/> - - <set from-field="itemIssuance.shipmentId" field="shipPackageLookpPK.shipmentId"/> - <set from-field="shipItemContext.shipmentPackageSeqId" field="shipPackageLookupPK.shipmentPackageSeqId"/> - <find-by-and entity-name="ShipmentPackage" list-name="shipmentPackages" map-name="shipPackageLookupPK"/> - <first-from-list list-name="shipmentPackages" entry-name="shipmentPackage"/> + <make-value entity-name="ShipmentPackage" value-name="shipmentPackageLookupPk"/> + <set-pk-fields value-name="shipmentPackageLookupPk" map-name="parameters"/> + <find-by-primary-key entity-name="ShipmentPackage" map-name="shipmentPackageLookupPk" value-name="shipmentPackage"/> <if-empty field-name="shipmentPackage"> <set from-field="itemIssuance.shipmentId" field="shipPackageContext.shipmentId"/> <set from-field="shipItemContext.shipmentPackageSeqId" field="shipPackageContext.shipmentPackageSeqId"/> @@ -1459,22 +1461,22 @@ <if-empty field-name="routeSegLookup.shipmentPackageSeqId"> <log level="warning" message="No shipment package ID found; cannot update RouteSegment"/> </if-empty> - - <!-- update the shipment status to packed --> - <!--set from-field="parameters.shipmentId" field="packedContext.shipmentId"/> - <set value="SHIPMENT_PACKED" field="packedContext.statusId"/> - <call-service service-name="updateShipment" in-map-name="packedContext"/--> + + </simple-method> - <!-- update the shipment status to shipped --> - <!--if-empty field-name="parameters.setPackedOnly"> + <simple-method method-name="setShipmentStatusPackedAndShipped" short-description="Move a shipment into Packed status and then to Shipped status"> + <!--update the shipment status to packed --> + <set from-field="parameters.shipmentId" field="packedContext.shipmentId"/> + <set value="SHIPMENT_PACKED" field="packedContext.statusId"/> + <call-service service-name="updateShipment" in-map-name="packedContext"/> + <!--update the shipment status to shipped --> + <if-empty field-name="parameters.setPackedOnly"> <set from-field="parameters.shipmentId" field="packedContext.shipmentId"/> <set value="SHIPMENT_SHIPPED" field="packedContext.statusId"/> <call-service service-name="updateShipment" in-map-name="packedContext"/> - </if-empty--> - + </if-empty> </simple-method> - <simple-method method-name="quickShipOrderByItem" short-description="Quick ships order based on item list"> <!-- quick ship order using multiple packages per tracking number --> <!-- Parameters coming in: orderId, shipGroupSeqId,itemShipList, originFacilityId, setPackedOnly --> @@ -1832,6 +1834,7 @@ <remove-value value-name="lookedUpValue"/> </simple-method> --> + Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?view=diff&rev=559372&r1=559371&r2=559372 ============================================================================== --- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original) +++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Wed Jul 25 02:32:44 2007 @@ -689,8 +689,12 @@ <attribute name="quantityNotReserved" type="Double" mode="IN" optional="false"/> <attribute name="promisedDatetime" type="Timestamp" mode="IN" optional="false"/> <attribute name="shipmentPackageSeqId" type="String" mode="IN" optional="true"/> + </service> + <service name="setShipmentStatusPackedAndShipped" engine="simple" + location="org/ofbiz/shipment/shipment/ShipmentServices.xml" invoke="updateShipmentStatus" auth="true"> + <description>Move a shipment into Packed status and then to Shipped status</description> + <attribute name="shipmentId" type="String" mode="IN" optional="false"/> </service> - <service name="sendShipmentCompleteNotification" engine="java" require-new-transaction="true" max-retry="3" location="org.ofbiz.shipment.shipment.ShipmentServices" invoke="sendShipmentCompleteNotification" auth="true"> <description>Send a notification on Shipment Complete</description> Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?view=diff&rev=559372&r1=559371&r2=559372 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original) +++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Wed Jul 25 02:32:44 2007 @@ -258,6 +258,18 @@ } } } + try { + Map resultMap = dispatcher.runSync("setShipmentStatusPackedAndShipped", UtilMisc.toMap("shipmentId", shipmentId, "userLogin", userLogin)); + if (ServiceUtil.isError(resultMap)){ + String errMsg = ServiceUtil.getErrorMessage(resultMap); + errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "IssueSerializedInvServiceError")); + Debug.logError(errMsg, module); + } + } catch(GenericServiceException e) { + Debug.logInfo(e, module); + String errMsg = "Error executing issueSerializedInvToShipmentPackageAndSetTracking Service: "+e.toString(); + errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException")); + } } |
Free forum by Nabble | Edit this page |