Author: apatel
Date: Fri Jul 20 09:54:34 2007 New Revision: 558048 URL: http://svn.apache.org/viewvc?view=rev&rev=558048 Log: Now return order Id handled. Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl 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=558048&r1=558047&r2=558048 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original) +++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Fri Jul 20 09:54:34 2007 @@ -325,7 +325,7 @@ } bodyParameters.put("externalIdSet", externalIdSet); - // if order was a return replacement order (associated with return) + // Check if order was a return replacement order (associated with return) List returnItemResponses = null; List returnItemRespExprs = UtilMisc.toList(new EntityExpr("replacementOrderId", EntityOperator.NOT_EQUAL, null)); EntityCondition returnItemRespCond = new EntityConditionList(returnItemRespExprs, EntityOperator.AND); @@ -336,8 +336,15 @@ returnItemResponses = delegator.findByCondition("ReturnItemResponse", returnItemRespCond, fieldsToSelect, null); Iterator rirIter = returnItemResponses.iterator(); while (rirIter.hasNext()) { - if (rirIter.next().equals(shipment.getString("primaryOrderId"))) { + GenericValue returnItemResponse = (GenericValue) rirIter.next(); + String replacementOrderId = returnItemResponse.getString("replacementOrderId"); + if (replacementOrderId.equals(shipment.getString("primaryOrderId"))) { bodyParameters.put("shipnotes", "RETURNLABEL"); + + // Get the associated return Id (replaceReturnId) + String returnItemResponseId = returnItemResponse.getString("returnItemResponseId"); + GenericValue returnItem = EntityUtil.getFirst(delegator.findByAnd("ReturnItem", UtilMisc.toMap("returnItemResponseId", returnItemResponseId))); + bodyParameters.put("replacementReturnId", returnItem.getString("returnId")); } } } catch (GenericEntityException e) { Modified: ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl?view=diff&rev=558048&r1=558047&r2=558048 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl (original) +++ ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl Fri Jul 20 09:54:34 2007 @@ -112,7 +112,7 @@ <of:DOCUMENTID>${correspondingPoId?if_exists}</of:DOCUMENTID> </n:DOCUMNTREF> </#list> - <#-- TODO: data preparation code to create the replacementReturnId; this is the returnId if the order is a return replacement order --> + <#-- data preparation code to create the replacementReturnId; this is the returnId if the order is a return replacement order --> <#if replacementReturnId?exists> <n:DOCUMNTREF> <of:DOCTYPE>RMA</of:DOCTYPE> |
Free forum by Nabble | Edit this page |