svn commit: r522004 - /ofbiz/trunk/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r522004 - /ofbiz/trunk/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl

jacopoc
Author: jacopoc
Date: Sat Mar 24 03:16:28 2007
New Revision: 522004

URL: http://svn.apache.org/viewvc?view=rev&rev=522004
Log:
Further improvements to the mrp log, still searching for a mysterious bug.

Modified:
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl

Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl?view=diff&rev=522004&r1=522003&r2=522004
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl Sat Mar 24 03:16:28 2007
@@ -154,12 +154,22 @@
             <#if ! product.equals( productTmp )>
                 <#assign quantityAvailableAtDate = 0>
                 <#assign errorEvents = delegator.findByAnd("InventoryEventPlanned", Static["org.ofbiz.base.util.UtilMisc"].toMap("inventoryEventPlanTypeId", "ERROR", "productId", inven.productId))>
-                <#assign initialQohEvent = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(delegator.findByAnd("InventoryEventPlanned", Static["org.ofbiz.base.util.UtilMisc"].toMap("inventoryEventPlanTypeId", "INITIAL_QOH", "productId", inven.productId)))>
-                <#if initialQohEvent?exists && initialQohEvent.eventQuantity?has_content>
-                    <#assign quantityAvailableAtDate = initialQohEvent.eventQuantity>
+                <#assign qohEvents = delegator.findByAnd("InventoryEventPlanned", Static["org.ofbiz.base.util.UtilMisc"].toMap("inventoryEventPlanTypeId", "INITIAL_QOH", "productId", inven.productId))>
+                <#assign additionalErrorMessage = "">
+                <#assign initialQohEvent = null>
+                <#assign productFacility = null>
+                <#if qohEvents?has_content>
+                    <#assign initialQohEvent = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(qohEvents)>
                 </#if>
-                <#if initialQohEvent?exists && initialQohEvent.facilityId?has_content>
-                    <#assign productFacility = delegator.findByPrimaryKey("ProductFacility", Static["org.ofbiz.base.util.UtilMisc"].toMap("facilityId", initialQohEvent.facilityId, "productId", inven.productId))?if_exists>
+                <#if initialQohEvent != null>
+                    <#if initialQohEvent.eventQuantity?has_content>
+                        <#assign quantityAvailableAtDate = initialQohEvent.eventQuantity>
+                    </#if>
+                    <#if initialQohEvent.facilityId?has_content>
+                        <#assign productFacility = delegator.findByPrimaryKey("ProductFacility", Static["org.ofbiz.base.util.UtilMisc"].toMap("facilityId", initialQohEvent.facilityId, "productId", inven.productId))?if_exists>
+                    </#if>
+                <#else>
+                    <#assign additionalErrorMessage = "No QOH information found, assuming 0.">
                 </#if>
                 <tr bgcolor="lightblue">  
                   <td align="left">
@@ -168,7 +178,7 @@
                     </div>
                   </td>
                   <td align="left">
-                    <#if productFacility?exists && productFacility?has_content>
+                    <#if productFacility != null && productFacility?has_content>
                       <div class='tabletext'>
                       <b>${uiLabelMap.ProductFacility}:</b>&nbsp;${productFacility.facilityId?if_exists}
                       </div>
@@ -187,6 +197,11 @@
                     <big><b><div class='tabletext'>${quantityAvailableAtDate}</div></b></big>
                   </td>
                 </tr>
+                <#if additionalErrorMessage?has_content>
+                <tr>
+                    <td colspan="7"><div class="tableheadtext"><font color="red">${additionalErrorMessage}</font></div></td>
+                </tr>
+                </#if>
                 <#list errorEvents as errorEvent>
                 <tr>
                     <td colspan="7"><div class="tableheadtext"><font color="red">${errorEvent.eventName?if_exists}</font></div></td>