refactored inventory view screen to use form widget; 99% exactly the same (except for additional fields) as the previous version; only difference right now is the display of facility locations

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@534254 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Zeneski
2007-05-01 22:12:53 +00:00
parent d8ecfb4e1c
commit 285510faa6
7 changed files with 172 additions and 387 deletions
@@ -37,7 +37,7 @@ under the License.
<#list inventoryItemList as inventoryItem>
<#assign product = inventoryItem.getRelatedOne('Product')?if_exists>
<tr>
<td>${inventoryItem.inventoryItemId}</td>
<td><a href="/facility/control/EditInventoryItem?inventoryItemId=${inventoryItem.inventoryItemId}&externalLoginKey=${requestAttributes.externalLoginKey?if_exists}" class="linktext">${inventoryItem.inventoryItemId}</a></td>
<td>
<#if product?has_content>
<#if product.isVariant?default('N') == 'Y'>
@@ -25,13 +25,13 @@ under the License.
<auto-fields-service service-name="updateProduct" map-name="product"/>
</form>
<form name="EditProduct" type="single" target="updateProduct" title="" default-map-name="product"
default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
default-title-style="tableheadtext" default-widget-style="inputBox">
<alt-target use-when="product==null" target="createProduct"/>
<field use-when="product==null" name="isCreate"><hidden value="true"/></field>
<field use-when="product!=null" name="productId" title="${uiLabelMap.ProductProductId}" tooltip="${uiLabelMap.ProductNotModificationRecreatingProduct}" widget-style="tabletext"><display/></field>
<field use-when="product!=null" name="productId" title="${uiLabelMap.ProductProductId}" tooltip="&amp;nbsp;${uiLabelMap.ProductNotModificationRecreatingProduct}" widget-style="tabletext"><display/></field>
<field use-when="product==null&amp;&amp;productId==null" name="productId" title="${uiLabelMap.ProductProductId}"><text size="20" maxlength="20"/></field>
<field use-when="product==null&amp;&amp;productId!=null" name="productId" title="${uiLabelMap.ProductProductId}" tooltip="${uiLabelMap.ProductNotFindProductId} [${productId}]"><text size="20" maxlength="20"/></field>
@@ -1,127 +0,0 @@
/*
* 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.
*/
import java.util.*;
import java.io.*;
import org.ofbiz.entity.*;
import org.ofbiz.base.util.*;
import org.ofbiz.widget.html.*;
delegator = request.getAttribute("delegator");
parameterMap = UtilHttp.getParameterMap(request);
facilityId = request.getParameter("facilityId");
locationSeqId = request.getParameter("locationSeqId");
session.removeAttribute("inventoryItemId");
boolean tryEntity = true;
if (request.getAttribute("_ERROR_MESSAGE_") != null) tryEntity = false;
inventoryItemId = request.getParameter("inventoryItemId");
if (UtilValidate.isEmpty(inventoryItemId) && UtilValidate.isNotEmpty((String) request.getAttribute("inventoryItemId"))) {
inventoryItemId = request.getAttribute("inventoryItemId");
}
inventoryItem = delegator.findByPrimaryKey("InventoryItem", UtilMisc.toMap("inventoryItemId", inventoryItemId));
curStatusItem = null;
inventoryItemType = null;
facilityLocation = null;
facility = null;
if(inventoryItem == null) {
tryEntity = false;
} else {
curStatusItem = inventoryItem.getRelatedOneCache("StatusItem");
inventoryItemType = inventoryItem.getRelatedOneCache("InventoryItemType");
facilityLocation = inventoryItem.getRelatedOne("FacilityLocation");
facility = inventoryItem.getRelatedOne("Facility");
if (facility != null && facilityId == null) {
facilityId = facility.getString("facilityId");
parameters.put("facilityId", facilityId);
}
//statuses
if ("NON_SERIAL_INV_ITEM".equals(inventoryItem.getString("inventoryItemTypeId"))) {
//do nothing for non-serialized inventory
} else if ("SERIALIZED_INV_ITEM".equals(inventoryItem.getString("inventoryItemTypeId"))) {
if (UtilValidate.isNotEmpty(inventoryItem.getString("statusId"))) {
statusChange = delegator.findByAnd("StatusValidChange", UtilMisc.toMap("statusId", inventoryItem.getString("statusId")));
statusItems = new ArrayList();
statusChangeIter = statusChange.iterator();
while (statusChangeIter.hasNext()) {
iterStatusChange = statusChangeIter.next();
iterStatusItem = delegator.findByPrimaryKey("StatusItem", UtilMisc.toMap("statusId", iterStatusChange.get("statusIdTo")));
if (iterStatusItem != null) statusItems.add(iterStatusItem);
}
context.put("statusItems", statusItems);
} else {
//no status id, just get all statusItems
statusItems = delegator.findByAnd("StatusItem", UtilMisc.toMap("statusTypeId", "INV_SERIALIZED_STTS"), UtilMisc.toList("sequenceId"));
context.put("statusItems", statusItems);
}
}
}
//inv item types
inventoryItemTypes = delegator.findAll("InventoryItemType", UtilMisc.toList("description"));
//facilities
facilities = delegator.findAll("Facility", UtilMisc.toList("facilityName"));
//get physicalInventoryAndVarianceDatas if this is a NON_SERIAL_INV_ITEM
if (inventoryItem != null && "NON_SERIAL_INV_ITEM".equals(inventoryItem.getString("inventoryItemTypeId"))) {
physicalInventoryAndVariances = delegator.findByAnd("PhysicalInventoryAndVariance", UtilMisc.toMap("inventoryItemId", inventoryItemId), UtilMisc.toList("-physicalInventoryDate", "-physicalInventoryId"));
physicalInventoryAndVarianceDatas = new ArrayList(physicalInventoryAndVariances.size());
physicalInventoryAndVarianceIter = physicalInventoryAndVariances.iterator();
while (physicalInventoryAndVarianceIter.hasNext()) {
physicalInventoryAndVariance = physicalInventoryAndVarianceIter.next();
physicalInventoryAndVarianceData = new HashMap();
physicalInventoryAndVarianceDatas.add(physicalInventoryAndVarianceData);
physicalInventoryAndVarianceData.put("physicalInventoryAndVariance", physicalInventoryAndVariance);
physicalInventoryAndVarianceData.put("varianceReason", physicalInventoryAndVariance.getRelatedOneCache("VarianceReason"));
physicalInventoryAndVarianceData.put("person", physicalInventoryAndVariance.getRelatedOne("Person"));
physicalInventoryAndVarianceData.put("partyGroup", physicalInventoryAndVariance.getRelatedOne("PartyGroup"));
}
context.put("physicalInventoryAndVarianceDatas", physicalInventoryAndVarianceDatas);
}
nowTimestampString = UtilDateTime.nowTimestamp().toString();
context.put("inventoryItem", inventoryItem);
context.put("inventoryItemId", inventoryItemId);
context.put("inventoryItemType", inventoryItemType);
context.put("curStatusItem", curStatusItem);
context.put("facilityLocation", facilityLocation);
context.put("facility", facility);
context.put("facilityId", facilityId);
context.put("locationSeqId", locationSeqId);
context.put("inventoryItemTypes", inventoryItemTypes);
context.put("facilities", facilities);
context.put("nowTimestampString", nowTimestampString);
context.put("tryEntity", tryEntity);
if (tryEntity) {
context.put("inventoryItemData", inventoryItem);
} else {
context.put("inventoryItemData", parameterMap);
}
@@ -0,0 +1,41 @@
/*
* 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.
*/
import java.util.*;
import org.ofbiz.entity.*;
import org.ofbiz.base.util.*;
// get physicalInventoryAndVarianceDatas if this is a NON_SERIAL_INV_ITEM
if (inventoryItem != null && "NON_SERIAL_INV_ITEM".equals(inventoryItem.getString("inventoryItemTypeId"))) {
physicalInventoryAndVariances = delegator.findByAnd("PhysicalInventoryAndVariance", UtilMisc.toMap("inventoryItemId", inventoryItemId), UtilMisc.toList("-physicalInventoryDate", "-physicalInventoryId"));
physicalInventoryAndVarianceDatas = new ArrayList(physicalInventoryAndVariances.size());
physicalInventoryAndVarianceIter = physicalInventoryAndVariances.iterator();
while (physicalInventoryAndVarianceIter.hasNext()) {
physicalInventoryAndVariance = physicalInventoryAndVarianceIter.next();
physicalInventoryAndVarianceData = new HashMap();
physicalInventoryAndVarianceDatas.add(physicalInventoryAndVarianceData);
physicalInventoryAndVarianceData.put("physicalInventoryAndVariance", physicalInventoryAndVariance);
physicalInventoryAndVarianceData.put("varianceReason", physicalInventoryAndVariance.getRelatedOneCache("VarianceReason"));
physicalInventoryAndVarianceData.put("person", physicalInventoryAndVariance.getRelatedOne("Person"));
physicalInventoryAndVarianceData.put("partyGroup", physicalInventoryAndVariance.getRelatedOne("PartyGroup"));
}
context.put("physicalInventoryAndVarianceDatas", physicalInventoryAndVarianceDatas);
}
@@ -1,246 +0,0 @@
<#--
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.
-->
<div class="head1">${uiLabelMap.ProductEditInventoryItemWithId} [${inventoryItemId?if_exists}]</div>
<a href="<@ofbizUrl>EditInventoryItem<#if facilityId?exists>?facilityId=${facilityId}</#if></@ofbizUrl>" class="buttontext">${uiLabelMap.ProductNewInventoryItem}</a>
<#if inventoryItemId?exists>
<a href="<@ofbizUrl>TransferInventoryItem?inventoryItemId=${inventoryItemId}<#if facilityId?exists>&facilityId=${facilityId}</#if></@ofbizUrl>" class="buttontext">${uiLabelMap.ProductTransferItem}</a>
<a href="<@ofbizUrl>ViewInventoryItemDetail?inventoryItemId=${inventoryItemId}<#if facilityId?exists>&facilityId=${facilityId}</#if></@ofbizUrl>" class="buttontext">${uiLabelMap.ProductInventoryDetails}</a>
</#if>
<#if inventoryItem?exists>
<form action="<@ofbizUrl>UpdateInventoryItem</@ofbizUrl>" method="post" style="margin: 0;" name="inventoryItemForm">
<table border="0" cellpadding="2" cellspacing="0">
<input type="hidden" name="inventoryItemId" value="${inventoryItemId}">
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductInventoryItemId}</div></td>
<td>&nbsp;</td>
<td>
<b>${inventoryItemId}</b> ${uiLabelMap.ProductNotModificationRecrationInventoryItem}
</td>
</tr>
<#else>
<#if inventoryItemId?exists>
<form action="<@ofbizUrl>CreateInventoryItem</@ofbizUrl>" method="post" style="margin: 0;" name="inventoryItemForm">
<table border="0" cellpadding="2" cellspacing="0">
<h3>${uiLabelMap.ProductNotFindInventoryItemWithId} "${inventoryItemId}".</h3>
<#else>
<form action="<@ofbizUrl>CreateInventoryItem</@ofbizUrl>" method="post" style="margin: 0;" name="inventoryItemForm">
<table border="0" cellpadding="2" cellspacing="0">
</#if>
</#if>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductInventoryItemTypeId}</div></td>
<td>&nbsp;</td>
<td>
<select name="inventoryItemTypeId" size="1" class="selectBox">
<#if inventoryItemType?exists>
<option selected value="${inventoryItemType.inventoryItemTypeId}">${inventoryItemType.get("description",locale)}</option>
<option value="${inventoryItemType.inventoryItemTypeId}">----</option>
</#if>
<#list inventoryItemTypes as nextInventoryItemType>
<option value="${nextInventoryItemType.inventoryItemTypeId}">${nextInventoryItemType.get("description",locale)}</option>
</#list>
</select>
</td>
</tr>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductProductId}</div></td>
<td>&nbsp;</td>
<td>
<input type="text" name="productId" value="${inventoryItemData.productId?if_exists}" size="20" maxlength="20" class="inputBox">
<#if (inventoryItem.productId)?has_content>
<a href="/catalog/control/EditProduct?productId=${inventoryItem.productId}&externalLoginKey=${externalLoginKey?if_exists}" class="buttontext">${uiLabelMap.CommonEdit}&nbsp;${uiLabelMap.ProductProduct}&nbsp;${inventoryItem.productId}</a>
<#else>
<a href="javascript:call_fieldlookup2(document.inventoryItemForm.productId,'LookupProduct');"><img src="<@ofbizContentUrl>/images/fieldlookup.gif"</@ofbizContentUrl>" width="16" height="16" border="0" alt="Lookup"/></a>
</#if>
</td>
</tr>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.PartyPartyId}</div></td>
<td>&nbsp;</td>
<td>
<input type="text" name="partyId" value="${inventoryItemData.partyId?if_exists}" size="20" maxlength="20" class="inputBox">
<a href="javascript:call_fieldlookup2(document.inventoryItemForm.partyId, 'LookupPartyName');"><img src="<@ofbizContentUrl>/images/fieldlookup.gif</@ofbizContentUrl>" width="16" height="16" border="0" alt="Lookup"/></a>
</td>
</tr>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductFacilityOwner}</div></td>
<td>&nbsp;</td>
<td>
<input type="text" name="ownerPartyId" value="${inventoryItemData.ownerPartyId?if_exists}" size="20" maxlength="20" class="inputBox">
<a href="javascript:call_fieldlookup2(document.inventoryItemForm.ownerPartyId, 'LookupPartyName');"><img src="<@ofbizContentUrl>/images/fieldlookup.gif</@ofbizContentUrl>" width="16" height="16" border="0" alt="Lookup"/></a>
</td>
</tr>
<#if "SERIALIZED_INV_ITEM" == (inventoryItem.inventoryItemTypeId)?if_exists>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductStatus}</div></td>
<td>&nbsp;</td>
<td>
<select name="statusId" class="selectBox">
<#if (inventoryItem.statusId)?has_content>
<option value="${inventoryItem.statusId}">${(curStatusItem.get("description",locale))?default("[" + inventoryItem.statusId + "]")}</option>
<option value="${inventoryItem.statusId}">----</option>
</#if>
<#if !tryEntity && requestParameters.statusId?has_content>
<#assign selectedStatusId = requestParameters.statusId>
</#if>
<#list statusItems as statusItem>
<option value="${statusItem.statusId}"<#if selectedStatusId?if_exists == statusItem.statusId>${uiLabelMap.ProductSelected}</#if>>${statusItem.get("description",locale)}</option>
</#list>
</select>
</td>
</tr>
</#if>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductDateReceived}</div></td>
<td>&nbsp;</td>
<td>
<input type="text" size="25" name="datetimeReceived" value="${(inventoryItemData.datetimeReceived.toString())?if_exists}" class="inputBox">
<a href="javascript:call_cal(document.inventoryItemForm.datetimeReceived, '${(inventoryItemData.datetimeReceived.toString())?default(nowTimestampString)}');"><img src='/images/cal.gif' width='16' height='16' border='0' alt='Calendar'></a>
</td>
</tr>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductExpireDate}</div></td>
<td>&nbsp;</td>
<td>
<input type="text" size="25" name="expireDate" value="${(inventoryItemData.expireDate.toString())?if_exists}" class="inputBox">
<a href="javascript:call_cal(document.inventoryItemForm.expireDate, '${(inventoryItemData.expireDate.toString())?default(nowTimestampString)}');"><img src='/images/cal.gif' width='16' height='16' border='0' alt='Calendar'></a>
</td>
</tr>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductFacilityContainer}</div></td>
<td>&nbsp;</td>
<td>
<span class="tabletext">${uiLabelMap.ProductSelectFacility} : </span>
<select name="facilityId" class="selectBox">
<#if inventoryItem?exists>
<option value="${inventoryItem.facilityId}">${(facility.facilityName)?if_exists} [${inventoryItem.facilityId}]</option>
<option value="${inventoryItem.facilityId}">----</option>
</#if>
<#if !tryEntity && requestParameters.facilityId?has_content>
<#assign selectedFacilityId = requestParameters.facilityId>
</#if>
<#list facilities as nextFacility>
<option value="${nextFacility.facilityId}"<#if selectedFacilityId?if_exists == nextFacility.facilityId> ${uiLabelMap.ProductSelected}</#if>>${nextFacility.facilityName?if_exists} [${nextFacility.facilityId}]</option>
</#list>
</select>
<#if (inventoryItem.facilityId)?has_content>
<a href="<@ofbizUrl>EditFacility?facilityId=${inventoryItem.facilityId}</@ofbizUrl>" class="buttontext">${uiLabelMap.ProductEditFacility} [${inventoryItem.facilityId}]</a>
</#if>
<br/>
<span class="tabletext">${uiLabelMap.ProductOrEnterContainerId} :</span>
<input type="text" name="containerId" value="${inventoryItemData.containerId?if_exists}" size="20" maxlength="20" class="inputBox"/>
</td>
</tr>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductFacilityLocation}</div></td>
<td>&nbsp;</td>
<td>
<#if facilityLocation?exists>
<div class="tabletext">
<b>${uiLabelMap.ProductArea} :</b>&nbsp;${facilityLocation.areaId?if_exists}
<b>${uiLabelMap.ProductAisle} :</b>&nbsp;${facilityLocation.aisleId?if_exists}
<b>${uiLabelMap.ProductSection} :</b>&nbsp;${facilityLocation.sectionId?if_exists}
<b>${uiLabelMap.ProductLevel} :</b>&nbsp;${facilityLocation.levelId?if_exists}
<b>${uiLabelMap.ProductPosition}:</b>&nbsp;${facilityLocation.positionId?if_exists}
</div>
</#if>
<#if inventoryItem?exists>
<input type="text" size="20" maxsize="20" name="locationSeqId" value="${inventoryItem.locationSeqId?if_exists}" class="inputBox"/>
<span class="tabletext">
<a href="javascript:call_fieldlookup2(document.inventoryItemForm.locationSeqId,'LookupFacilityLocation<#if (facilityId?exists)>?facilityId=${facilityId}</#if>');">
<img src="<@ofbizContentUrl>/images/fieldlookup.gif"</@ofbizContentUrl>" width="15" height="14" border="0" alt="Click here For Field Lookup"/>
</a>
</span>
&nbsp;<a href="<@ofbizUrl>FindFacilityLocation?facilityId=${facilityId?if_exists}&inventoryItemId=${inventoryItemId}</@ofbizUrl>" class="buttontext">${uiLabelMap.ProductFindLocation}</a>
<#else>
<input type="text" size="20" maxsize="20" name="locationSeqId" value="${locationSeqId?if_exists}" class="inputBox">
<span class="tabletext">
<a href="javascript:call_fieldlookup2(document.inventoryItemForm.locationSeqId,'LookupFacilityLocation<#if (facilityId?exists)>?facilityId=${facilityId}</#if>');">
<img src="<@ofbizContentUrl>/images/fieldlookup.gif"</@ofbizContentUrl>" width="15" height="14" border="0" alt="Click here For Field Lookup"/>
</a>
</span>
</#if>
</td>
</tr>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductLotId}</div></td>
<td>&nbsp;</td>
<td><input type="text" name="lotId" value="${inventoryItemData.lotId?if_exists}" size="20" maxlength="20" class="inputBox"></td>
</tr>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductUomId}</div></td>
<td>&nbsp;</td>
<td><input type="text" name="uomId" value="${inventoryItemData.uomId?if_exists}" size="20" maxlength="20" class="inputBox"></td>
</tr>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductBinNumber}</div></td>
<td>&nbsp;</td>
<td><input type="text" name="binNumber" value="${inventoryItemData.binNumber?if_exists}" size="20" maxlength="20" class="inputBox"></td>
</tr>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductPerUnitPrice}</div></td>
<td>&nbsp;</td>
<td><input type="text" name="unitCost" value="${inventoryItemData.unitCost?default(0)}" size="20" maxlength="20" class="inputBox"></td>
</tr>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductComments}</div></td>
<td>&nbsp;</td>
<td><input type="text" name="comments" value="${inventoryItemData.comments?if_exists}" size="60" maxlength="250" class="inputBox"></td>
</tr>
<tr><td colspan="3">&nbsp;</td></tr>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductSoftIdentifier}</div></td>
<td>&nbsp;</td>
<td><input type="text" name="comments" value="${inventoryItemData.softIdentifier?if_exists}" size="30" maxlength="250" class="inputBox"></td>
</tr>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductActivationNumber}</div></td>
<td>&nbsp;</td>
<td><input type="text" name="comments" value="${inventoryItemData.activationNumber?if_exists}" size="30" maxlength="250" class="inputBox"></td>
</tr>
<#if "NON_SERIAL_INV_ITEM" == (inventoryItem.inventoryItemTypeId)?if_exists>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductAvailablePromiseQuantityHand}</div></td>
<td>&nbsp;</td>
<td>
<div class="tabletext">${inventoryItemData.availableToPromiseTotal?if_exists} / ${inventoryItemData.quantityOnHandTotal?if_exists}</div>
<div class="tabletext">${uiLabelMap.ProductPhysicalInventoryVariance}</div>
</td>
</tr>
<#elseif "SERIALIZED_INV_ITEM" == (inventoryItem.inventoryItemTypeId)?if_exists>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductSerialNumber}</div></td>
<td>&nbsp;</td>
<td><input type="text" name="serialNumber" value="${inventoryItemData.serialNumber?if_exists}" size="30" maxlength="60" class="inputBox"></td>
</tr>
<#elseif inventoryItem?exists>
<tr>
<td align="right"><div class="tabletext">${uiLabelMap.ProductSerialAtpQoh}</div></td>
<td>&nbsp;</td>
<td><div class="tabletext" style="color: red;">${uiLabelMap.ProductErrorType} [${inventoryItem.inventoryItemTypeId?if_exists}] ${uiLabelMap.ProductUnknownSpecifyType}.</div></td>
</tr>
</#if>
<tr>
<td colspan="2">&nbsp;</td>
<td colspan="5"><input type="submit" value="${uiLabelMap.CommonUpdate}" class="smallSubmit"></td>
</tr>
</table>
</form>
@@ -20,8 +20,79 @@ under the License.
<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/widget-form.xsd">
<form name="EditInventoryItem" type="single" target="UpdateInventoryItem" title="">
<actions>
<set field="inventoryItemTypeId" from-field="inventoryItem.inventoryItemTypeId"/>
<set field="productId" from-field="inventoryItem.productId"/>
<set field="facilityId" from-field="inventoryItem.facilityId"/>
<set field="locationSeqId" from-field="inventoryItem.locationSeqId"/>
<entity-one entity-name="FacilityLocation" value-name="facilityLocation">
<field-map field-name="locationSeqId" env-name="locationSeqId"/>
<field-map field-name="facilityId" env-name="facilityId"/>
</entity-one>
</actions>
<alt-target use-when="inventoryItemId==null" target="CreateInventoryItem"/>
<auto-fields-service service-name="updateInventoryItem" map-name="inventoryItem"/>
<!-- ignored fields -->
<field name="oldAvailableToPromise"><ignored/></field>
<field name="oldQuantityOnHand"><ignored/></field>
<!-- custom formatted fields -->
<field use-when="inventoryItem!=null" name="inventoryItemId" tooltip="&amp;nbsp;${uiLabelMap.ProductNotModificationRecrationInventoryItem}"><display/></field>
<field use-when="inventoryItem==null" name="inventoryItemId"><text/></field>
<field name="inventoryItemTypeId">
<drop-down allow-empty="false">
<entity-options entity-name="InventoryItemType" description="${description}" key-field-name="inventoryItemTypeId"/>
</drop-down>
</field>
<field name="productId">
<text>
<sub-hyperlink use-when="productId!=null" target="/catalog/control/EditProduct?productId=${productId}" target-type="inter-app" description="Edit Product [${productId}]"/>
</text>
</field>
<field name="statusId">
<drop-down allow-empty="true">
<entity-options entity-name="StatusItem" description="${description}" key-field-name="statusId">
<entity-constraint name="statusTypeId" operator="equals" value="INV_SERIALIZED_STTS"/>
</entity-options>
</drop-down>
</field>
<field name="facilityId">
<drop-down allow-empty="true">
<entity-options entity-name="Facility" description="${facilityName}" key-field-name="facilityId">
<entity-order-by field-name="facilityName"/>
</entity-options>
<sub-hyperlink use-when="facilityId!=null" target="EditFacility?facilityId=${facilityId}" description="Edit Facility [${facilityId}]"/>
</drop-down>
</field>
<field name="locationSeqId" title="${uiLabelMap.ProductFacilityLocation}">
<lookup target-form-name="LookupFacilityLocation">
<sub-hyperlink use-when="locationSeqId!=null" target="EditFacilityLocation?facilityId=${facilityId}&amp;locationSeqId=${locationSeqId}"></sub-hyperlink>
</lookup>
</field>
<field name="partyId">
<lookup target-form-name="LookupPartyName"/>
</field>
<field name="ownerPartyId">
<lookup target-form-name="LookupPartyName"/>
</field>
<field name="unitCost"><text/></field>
<field use-when="inventoryItemTypeId.equals(&quot;NON_SERIAL_INV_ITEM&quot;)" name="totals" title="${uiLabelMap.ProductAvailablePromiseQuantityHand}">
<display description="${inventoryItem.availableToPromiseTotal} / ${inventoryItem.quantityOnHandTotal}"/>
</field>
<field use-when="inventoryItem!=null" name="submit" title="Update">
<submit/>
</field>
<field use-when="inventoryItem==null" name="submit" title="Create">
<submit/>
</field>
</form>
<form name="CreatePhysicalInventoryAndVariance" type="single" target="createPhysicalInventoryAndVariance" title=""
default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
<auto-fields-service service-name="createPhysicalInventoryAndVariance"/>
<field name="physicalInventoryId"><ignored/></field>
<field name="physicalInventoryDate"><ignored/></field>
@@ -454,8 +454,11 @@ under the License.
<set field="headerItem" value="facility"/>
<set field="tabButtonItem" value="EditFacilityInventoryItems"/>
<set field="displayWithNoFacility" value="Y"/>
<script location="component://product/webapp/facility/WEB-INF/actions/inventory/EditInventoryItem.bsh"/>
<set field="facilityId" from-field="parameters.facilityId"/>
<set field="inventoryItemId" from-field="parameters.inventoryItemId"/>
<entity-one entity-name="Facility" value-name="facility" auto-field-map="true"/>
<entity-one entity-name="InventoryItem" value-name="inventoryItem" auto-field-map="true"/>
<entity-condition entity-name="OrderItemShipGrpInvRes" list-name="inventoryItemReservations">
<condition-list combine="and">
<condition-expr field-name="inventoryItemId" operator="equals" env-name="inventoryItemId"/>
@@ -464,25 +467,68 @@ under the License.
</entity-condition>
</actions>
<widgets>
<section>
<condition>
<and>
<not>
<if-empty field-name="inventoryItem"/>
</not>
<if-empty field-name="facility"/>
</and>
</condition>
<actions>
<set field="parameters.facilityId" from-field="inventoryItem.facilityId"/>
<set field="facilityId" from-field="inventoryItem.facilityId"/>
<entity-one entity-name="Facility" value-name="facility"/>
</actions>
<widgets/>
</section>
<decorator-screen name="CommonFacilityDecorator" location="${parameters.commonFacilityDecoratorLocation}">
<decorator-section name="body">
<platform-specific>
<html><html-template location="component://product/webapp/facility/inventory/EditInventoryItem.ftl"/></html>
</platform-specific>
<container>
<section>
<condition>
<not><if-empty field-name="inventoryItem"/></not>
</condition>
<widgets>
<container style="widget-container">
<link target="EditInventoryItem?facilityId=${facilityId}" text="${uiLabelMap.ProductNewInventoryItem}" style="buttontext"/>
<link target="TransferInventoryItem?inventoryItemId=${inventoryItemId}&amp;facilityId=${facilityId}" text="${uiLabelMap.ProductTransferItem}" style="buttontext"/>
<link target="ViewInventoryItemDetail?inventoryItemId=${inventoryItemId}&amp;facilityId=${facilityId}" text="${uiLabelMap.ProductInventoryDetails}" style="buttontext"/>
</container>
</widgets>
<fail-widgets>
<container style="widget-container">
<link target="EditInventoryItem?facilityId=${facilityId}" text="${uiLabelMap.ProductNewInventoryItem}" style="buttontext"/>
</container>
</fail-widgets>
</section>
<container style="widget-container">
<include-form name="EditInventoryItem" location="component://product/webapp/facility/inventory/InventoryForms.xml"/>
</container>
<container style="widget-container">
<label style="head2">${uiLabelMap.ProductInventoryItemReservations}</label>
</container>
<include-form name="InventoryItemReservations" location="component://product/webapp/facility/inventory/InventoryForms.xml"/>
<container style="widget-container">
<include-form name="InventoryItemReservations" location="component://product/webapp/facility/inventory/InventoryForms.xml"/>
</container>
<section>
<condition>
<if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM"/>
</condition>
<actions>
<script location="component://product/webapp/facility/WEB-INF/actions/inventory/PhysicalInventoryVariance.bsh"/>
</actions>
<widgets>
<container>
<container style="widget-container">
<label style="head2">${uiLabelMap.ProductPhysicalInventoryVariances}</label>
</container>
<include-form name="CreatePhysicalInventoryAndVariance" location="component://product/webapp/facility/inventory/InventoryForms.xml"/>
<include-form name="ViewPhysicalInventoryAndVariance" location="component://product/webapp/facility/inventory/InventoryForms.xml"/>
<container style="widget-container">
<include-form name="CreatePhysicalInventoryAndVariance" location="component://product/webapp/facility/inventory/InventoryForms.xml"/>
</container>
<container style="widget-container">
<include-form name="ViewPhysicalInventoryAndVariance" location="component://product/webapp/facility/inventory/InventoryForms.xml"/>
</container>
</widgets>
</section>
</decorator-section>