Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
1482 posts
|
Author: ashish
Date: Fri Mar 26 09:28:49 2010 New Revision: 927744 URL: http://svn.apache.org/viewvc?rev=927744&view=rev Log: Applied patch from jira issue OFBIZ-3552 - Initial Inventory Item Status is saved wrong in case of non-serialized inventory and when reason of return is "Defective Item", at the the time of receiving returns. Problem Description: 1) When returns are received and reason of return is "Defective Item" ,whether inventoryItemType is serialized or non-serialized, Initial Inventory Item Status is always saved as "INV_DEFECTIVE" 2) This should not be the case, value of Initial Inventory Item Status should be dependent on inventoryItemType. 3) i. e In Receive Return screen , when user selects inventoryItemType value of Initial Inventory Item Status should be changed dynamically . 4) So when inventoryItemType is non-serialized then value of Initial Inventory Item Status should be INV_NS_DEFECTIVE and if inventoryItemType is serialized value of value of Initial Inventory Item Status should be INV_DEFECTIVE. 5) This is a real bug, which causes ATP inventory figures wrong when sales order is placed. This is so because when sales order is placed, defective inventory items are assigned to sales order. 6) Reason of #5 is when inventory reservations are done in case of non-serialized inventory, In reserveForInventoryItemInline simple-method of InventoryReserveServices.xml , checks are made on value of inventoryItem.statusId = "INV_NS_DEFECTIVE". And as described in #1, Initial Inventory Item Status is always saved as "INV_DEFECTIVE". So this checks never gets satisfied. Thanks Divesh & Pranay for the contribution. Added: ofbiz/trunk/applications/product/webapp/facility/returns/UpdatedInventoryItemStatus.ftl (with props) Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml ofbiz/trunk/applications/product/webapp/facility/returns/receiveReturn.ftl ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml?rev=927744&r1=927743&r2=927744&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml Fri Mar 26 09:28:49 2010 @@ -609,6 +609,10 @@ under the License. <response name="success" type="view" value="ReceiveReturn"/> <response name="error" type="view" value="ReceiveReturn"/> </request-map> + <request-map uri="UpdatedInventoryItemStatus"> + <security https="true" auth="true"/> + <response name="success" type="view" value="UpdatedInventoryItemStatus"/> + </request-map> <!-- ================ Picklist Requests ================= --> <request-map uri="PicklistOptions"> @@ -1382,7 +1386,7 @@ under the License. <view-map name="TransferInventoryItem" type="screen" page="component://product/widget/facility/FacilityScreens.xml#TransferInventoryItem"/> <view-map name="ReceiveInventory" type="screen" page="component://product/widget/facility/FacilityScreens.xml#ReceiveInventory"/> <view-map name="ReceiveReturn" type="screen" page="component://product/widget/facility/FacilityScreens.xml#ReceiveReturn"/> - + <view-map name="UpdatedInventoryItemStatus" type="screen" page="component://product/widget/facility/FacilityScreens.xml#UpdatedInventoryItemStatus"/> <view-map name="FindFacilityPhysicalInventory" type="screen" page="component://product/widget/facility/FacilityScreens.xml#FindFacilityPhysicalInventory"/> <view-map name="PicklistOptions" type="screen" page="component://product/widget/facility/FacilityScreens.xml#PicklistOptions"/> Added: ofbiz/trunk/applications/product/webapp/facility/returns/UpdatedInventoryItemStatus.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/returns/UpdatedInventoryItemStatus.ftl?rev=927744&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/returns/UpdatedInventoryItemStatus.ftl (added) +++ ofbiz/trunk/applications/product/webapp/facility/returns/UpdatedInventoryItemStatus.ftl Fri Mar 26 09:28:49 2010 @@ -0,0 +1,29 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +<#assign inventoryItemType = parameters.inventoryItemType?default("NON_SERIAL_INV_ITEM")> +<#assign inventoryItemStatus = parameters.inventoryItemStatus?default("INV_RETURNED")> +<#if inventoryItemType == "NON_SERIAL_INV_ITEM"> + <option value="INV_RETURNED" <#if inventoryItemStatus == "INV_RETURNED">selected="selected"</#if>>${uiLabelMap.ProductReturned}</option> + <option value="INV_AVAILABLE" <#if inventoryItemStatus == "INV_AVAILABLE">selected="selected"</#if>>${uiLabelMap.ProductAvailable}</option> + <option value="INV_NS_DEFECTIVE" <#if inventoryItemStatus == "INV_DEFECTIVE">selected="selected"</#if>>${uiLabelMap.ProductDefective}</option> +<#else> + <option value="INV_RETURNED" <#if inventoryItemStatus == "INV_RETURNED">selected="selected"</#if>>${uiLabelMap.ProductReturned}</option> + <option value="INV_AVAILABLE" <#if inventoryItemStatus == "INV_AVAILABLE">selected="selected"</#if>>${uiLabelMap.ProductAvailable}</option> + <option value="INV_DEFECTIVE" <#if inventoryItemStatus == "INV_NS_DEFECTIVE">selected="selected"</#if>>${uiLabelMap.ProductDefective}</option> +</#if> \ No newline at end of file Propchange: ofbiz/trunk/applications/product/webapp/facility/returns/UpdatedInventoryItemStatus.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/product/webapp/facility/returns/UpdatedInventoryItemStatus.ftl ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/product/webapp/facility/returns/UpdatedInventoryItemStatus.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/applications/product/webapp/facility/returns/receiveReturn.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/returns/receiveReturn.ftl?rev=927744&r1=927743&r2=927744&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/returns/receiveReturn.ftl (original) +++ ofbiz/trunk/applications/product/webapp/facility/returns/receiveReturn.ftl Fri Mar 26 09:28:49 2010 @@ -165,7 +165,7 @@ under the License. </tr> <tr> <td width='10%'> - <select name="inventoryItemTypeId_o_${rowCount}" size="1"> + <select name="inventoryItemTypeId_o_${rowCount}" size="1" id="inventoryItemTypeId_o_${rowCount}" onchange="javascript:setInventoryItemStatus(this,${rowCount});"> <#list inventoryItemTypes as nextInventoryItemType> <option value='${nextInventoryItemType.inventoryItemTypeId}' <#if (facility.defaultInventoryItemTypeId?has_content) && (nextInventoryItemType.inventoryItemTypeId == facility.defaultInventoryItemTypeId)> @@ -177,10 +177,10 @@ under the License. </td> <td width="35%"> <span class="label">${uiLabelMap.ProductInitialInventoryItemStatus}:</span> - <select name="statusId_o_${rowCount}" size='1'> + <select name="statusId_o_${rowCount}" size='1' id = "statusId_o_${rowCount}"> <option value="INV_RETURNED">${uiLabelMap.ProductReturned}</option> <option value="INV_AVAILABLE">${uiLabelMap.ProductAvailable}</option> - <option value="INV_DEFECTIVE" <#if returnItem.returnReasonId?default("") == "RTN_DEFECTIVE_ITEM">Selected</#if>>${uiLabelMap.ProductDefective}</option> + <option value="INV_NS_DEFECTIVE" <#if returnItem.returnReasonId?default("") == "RTN_DEFECTIVE_ITEM">Selected</#if>>${uiLabelMap.ProductDefective}</option> </select> </td> <#if serializedInv?has_content> @@ -261,4 +261,10 @@ under the License. </form> </#if> </div> -</div> \ No newline at end of file +</div> +<script language="JavaScript" type="text/javascript"> + function setInventoryItemStatus(selection,index) { + var statusId = "statusId_o_" + index; + new Ajax.Updater($(statusId), 'UpdatedInventoryItemStatus',{parameters: {inventoryItemType:selection.value,inventoryItemStatus:$(statusId).value}}); + } +</script> \ No newline at end of file Modified: ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml?rev=927744&r1=927743&r2=927744&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml (original) +++ ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Fri Mar 26 09:28:49 2010 @@ -1100,7 +1100,19 @@ under the License. </widgets> </section> </screen> - + <screen name="UpdatedInventoryItemStatus"> + <section> + <actions> + <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/> + <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/> + </actions> + <widgets> + <platform-specific> + <html><html-template location="component://product/webapp/facility/returns/UpdatedInventoryItemStatus.ftl"/></html> + </platform-specific> + </widgets> + </section> + </screen> <screen name="PicklistOptions"> <section> <actions> |
Free forum by Nabble | Edit this page |