Author: mor
Date: Wed Jul 30 07:30:22 2008 New Revision: 681067 URL: http://svn.apache.org/viewvc?rev=681067&view=rev Log: Misc. improvements for supplier return. Now return items can be edited Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/ReturnItems.groovy ofbiz/trunk/applications/order/webapp/ordermgr/return/returnItems.ftl ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/AddItemsFromInventory.groovy Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml?rev=681067&r1=681066&r2=681067&view=diff ============================================================================== --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml (original) +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml Wed Jul 30 07:30:22 2008 @@ -468,14 +468,20 @@ <simple-method method-name="removeReturnItem" short-description="Remove Return Item"> <check-permission permission="ORDERMGR" action="_DELETE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunRemoveQuoteItem"/></check-permission> <check-errors/> - - <set from-field="parameters.returnId" field="headerPKMap.returnId"/> - <find-by-primary-key entity-name="ReturnHeader" map-name="headerPKMap" value-name="returnHeader"/> - <if-compare field="returnHeader.statusId" operator="not-equals" type="String" value="RETURN_REQUESTED"> - <add-error><fail-property resource="OrderErrorUiLabels" property="OrderCannotRemoveItemsOnceReturnIsApproved"/></add-error> - <check-errors/> + + <entity-one entity-name="ReturnHeader" value-name="returnHeader"/> + <if-compare field="returnHeader.returnHeaderTypeId" operator="equals" value="CUSTOMER_RETURN"> + <if-compare field="returnHeader.statusId" operator="not-equals" type="String" value="RETURN_REQUESTED"> + <add-error><fail-property resource="OrderErrorUiLabels" property="OrderCannotRemoveItemsOnceReturnIsApproved"/></add-error> + </if-compare> + <else> + <if-compare field="returnHeader.statusId" operator="not-equals" type="String" value="SUP_RETURN_REQUESTED"> + <add-error><fail-property resource="OrderErrorUiLabels" property="OrderCannotRemoveItemsOnceReturnIsApproved"/></add-error> + </if-compare> + </else> </if-compare> - + <check-errors/> + <set from-field="parameters.returnId" field="lookupPKMap.returnId"/> <set from-field="parameters.returnItemSeqId" field="lookupPKMap.returnItemSeqId"/> <find-by-primary-key entity-name="ReturnItem" map-name="lookupPKMap" value-name="returnItem"/> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/ReturnItems.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/ReturnItems.groovy?rev=681067&r1=681066&r2=681067&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/ReturnItems.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/ReturnItems.groovy Wed Jul 30 07:30:22 2008 @@ -78,10 +78,12 @@ context.shippingAmount = shippingAmount; } roleTypeId = "PLACING_CUSTOMER"; +partyId = returnHeader.fromPartyId; if (returnHeaderTypeId == "VENDOR_RETURN") { - roleTypeId = "SUPPLIER"; + roleTypeId = "BILL_FROM_VENDOR"; + partyId = returnHeader.toPartyId; } -partyOrders = delegator.findByAnd("OrderHeaderAndRoles", [roleTypeId : roleTypeId, partyId : returnHeader.fromPartyId], ["orderId"]); +partyOrders = delegator.findByAnd("OrderHeaderAndRoles", [roleTypeId : roleTypeId, partyId : partyId], ["orderId"]); context.partyOrders = partyOrders; // get the list of return shipments associated to the return Modified: ofbiz/trunk/applications/order/webapp/ordermgr/return/returnItems.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnItems.ftl?rev=681067&r1=681066&r2=681067&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/return/returnItems.ftl (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/return/returnItems.ftl Wed Jul 30 07:30:22 2008 @@ -93,8 +93,11 @@ <!-- if we're called with loadOrderItems or createReturn, then orderId would exist --> <#if !requestParameters.orderId?exists> <table cellspacing="0" class="basic-table"> - <#assign readOnly = (returnHeader.statusId != "RETURN_REQUESTED")> - + <#if "CUSTOMER_RETURN" == returnHeader.returnHeaderTypeId> + <#assign readOnly = (returnHeader.statusId != "RETURN_REQUESTED")> + <#else> + <#assign readOnly = (returnHeader.statusId != "SUP_RETURN_REQUESTED")> + </#if> <tr><td colspan="10"><h3>${uiLabelMap.OrderOrderReturn} #${returnId}</h3></td></tr> <#-- information about orders and amount refunded/credited on past returns --> @@ -244,7 +247,7 @@ </#if></div></td> <#if (readOnly)> <td> - <#if returnHeader.statusId == "RETURN_COMPLETED"> + <#if returnHeader.statusId == "RETURN_COMPLETED" || returnHeader.statusId == "SUP_RETURN_COMPLETED"> <#assign itemResp = item.getRelatedOne("ReturnItemResponse")?if_exists> <#if itemResp?has_content> <#if itemResp.paymentId?has_content> @@ -262,7 +265,7 @@ </#if> </td> </#if> - <#if returnHeader.statusId == "RETURN_REQUESTED"> + <#if returnHeader.statusId == "RETURN_REQUESTED" || returnHeader.statusId == "SUP_RETURN_REQUESTED"> <td align='right'><a href="<@ofbizUrl>removeReturnItem?returnId=${item.returnId}&returnItemSeqId=${item.returnItemSeqId}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonRemove}</a> <#else> <td> </td> @@ -309,16 +312,23 @@ </form> </table> - <#if (returnHeader.statusId == "RETURN_REQUESTED") && (rowCount > 0)> + <#if (returnHeader.statusId == "RETURN_REQUESTED" || returnHeader.statusId == "SUP_RETURN_REQUESTED") && (rowCount > 0)> <br/> <form name="acceptReturn" method="post" action="<@ofbizUrl>/updateReturn</@ofbizUrl>"> + <#if "CUSTOMER_RETURN" == returnHeader.returnHeaderTypeId> + <#assign statusId = "RETURN_ACCEPTED"> + <#assign partyId = returnHeader.fromPartyId> + <#else> + <#assign statusId = "SUP_RETURN_ACCEPTED"> + <#assign partyId = returnHeader.toPartyId> + </#if> <input type="hidden" name="returnId" value="${returnId}"> - <input type="hidden" name="statusId" value="RETURN_ACCEPTED"> + <input type="hidden" name="statusId" value="${statusId}"> <div align="right"><input type="submit" value="${uiLabelMap.OrderReturnAccept}"></div> </form> </#if> - <#if returnHeader.statusId == "RETURN_REQUESTED"> + <#if returnHeader.statusId == "RETURN_REQUESTED" || returnHeader.statusId == "SUP_RETURN_REQUESTED"> <br/> <form name="returnItems" method="post" action="<@ofbizUrl>returnItems</@ofbizUrl>"> <input type="hidden" name="returnId" value="${returnId}"> @@ -339,7 +349,7 @@ </tr> <#else> <tr> - <td colspan="4" nowrap><div>${uiLabelMap.OrderNoOrderFoundForParty}: <a href="${customerDetailLink}${returnHeader.fromPartyId?default('_NA_')}" class="buttontext">${returnHeader.fromPartyId?default('[null]')}</a></div></td> + <td colspan="4" nowrap><div>${uiLabelMap.OrderNoOrderFoundForParty}: <a href="${customerDetailLink}${partyId?default('_NA_')}" class="buttontext">${partyId?default('[null]')}</a></div></td> </tr> <tr> <td width='25%' align='right' nowrap><div>${uiLabelMap.OrderOrderId}</div></td> Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/AddItemsFromInventory.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/AddItemsFromInventory.groovy?rev=681067&r1=681066&r2=681067&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/AddItemsFromInventory.groovy (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/AddItemsFromInventory.groovy Wed Jul 30 07:30:22 2008 @@ -40,8 +40,6 @@ issuedItems = []; itemIssuances.each { itemIssuance -> totalQtyIssued = totalQtyIssued + Double.valueOf(itemIssuance.quantity); - inventoryItemId = itemIssuance.inventoryItemId; - quantity = itemIssuance.quantity; issuedItems.add([inventoryItemId : itemIssuance.inventoryItemId, quantity : itemIssuance.quantity]); } |
Free forum by Nabble | Edit this page |