<#-- 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. -->

<#if requestParameters.hideFields?default("N") == "Y"> ${uiLabelMap.CommonShowLookupFields} <#else> <#if inventoryList??> ${uiLabelMap.CommonHideFields}

<#if requestParameters.hideFields?default("N") != "Y">
${uiLabelMap.ManufacturingProductId}   <@htmlTemplate.lookupField value='${requestParameters.productId!}' formName="lookupinventory" name="productId" id="productId" fieldFormName="LookupProduct"/>
${uiLabelMap.CommonFromDate}   <@htmlTemplate.renderDateTimeField name="eventDate" event="" action="" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" value="${requestParameters.eventDate!nowTimestamp}" size="25" maxlength="30" id="fromDate_2" dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>
      ${uiLabelMap.CommonFind}  
<#if requestParameters.hideFields?default("N") != "Y"> <#if requestParameters.lookupFlag?default("N") == "Y">
<#if inventoryList?has_content> <#assign rowClass = "alternate-row">
${uiLabelMap.CommonElementsFound}
<#if 0 < viewIndex> " class="submenutext">${uiLabelMap.CommonPrevious} <#else> ${uiLabelMap.CommonPrevious} <#if 0 < listSize> ${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize} <#if highIndex < listSize> " class="submenutextright">${uiLabelMap.CommonNext} <#else> ${uiLabelMap.CommonNext}  
<#assign count = lowIndex> <#assign productTmp = ""> <#list inventoryList[lowIndex..highIndex-1] as inven> <#assign product = inven.getRelatedOne("Product", false)> <#if facilityId?has_content> <#if ! product.equals( productTmp )> <#assign quantityAvailableAtDate = 0> <#assign errorEvents = delegator.findByAnd("MrpEvent", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("mrpEventTypeId", "ERROR", "productId", inven.productId), null, false)> <#assign qohEvents = delegator.findByAnd("MrpEvent", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("mrpEventTypeId", "INITIAL_QOH", "productId", inven.productId), null, false)> <#assign additionalErrorMessage = ""> <#assign initialQohEvent = ""> <#assign productFacility = ""> <#if qohEvents?has_content> <#assign initialQohEvent = Static["org.apache.ofbiz.entity.util.EntityUtil"].getFirst(qohEvents)> <#if initialQohEvent?has_content> <#if initialQohEvent.quantity?has_content> <#assign quantityAvailableAtDate = initialQohEvent.quantity> <#if initialQohEvent.facilityId?has_content> <#assign productFacility = delegator.findOne("ProductFacility", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("facilityId", initialQohEvent.facilityId, "productId", inven.productId), false)!> <#else> <#assign additionalErrorMessage = "No QOH information found, assuming 0."> <#if additionalErrorMessage?has_content> <#list errorEvents as errorEvent> <#assign quantityAvailableAtDate = quantityAvailableAtDate?default(0) + inven.getBigDecimal("quantity")> <#assign productTmp = product> <#assign MrpEventType = inven.getRelatedOne("MrpEventType", false)> <#assign count=count+1>
${uiLabelMap.CommonType}   ${uiLabelMap.CommonDescription} ${uiLabelMap.CommonDate}   ${uiLabelMap.CommonQuantity} ${uiLabelMap.ManufacturingTotalQuantity}

[${inven.productId}]  ${product.internalName!} <#if productFacility?has_content>
${uiLabelMap.ProductFacility}: ${productFacility.facilityId!}
${uiLabelMap.ProductMinimumStock}: ${productFacility.minimumStock!}
${uiLabelMap.ProductReorderQuantity}: ${productFacility.reorderQuantity!}
${uiLabelMap.ProductDaysToShip}: ${productFacility.daysToShip!}
${quantityAvailableAtDate}
${additionalErrorMessage}
${errorEvent.eventName!}
${MrpEventType.get("description",locale)}   ${inven.eventName!} color='red'>${inven.getString("eventDate")}   ${inven.getString("quantity")} ${quantityAvailableAtDate!}
<#else>
${uiLabelMap.CommonNoElementFound}