You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2007/03/21 13:30:01 UTC

svn commit: r520857 - in /ofbiz/trunk/applications/order: config/OrderUiLabels.properties script/org/ofbiz/order/requirement/RequirementServices.xml webapp/ordermgr/WEB-INF/controller.xml widget/ordermgr/RequirementScreens.xml

Author: jacopoc
Date: Wed Mar 21 05:29:59 2007
New Revision: 520857

URL: http://svn.apache.org/viewvc?view=rev&rev=520857
Log:
Improved business rules to automatically assign a (product) requirement to a supplier: now validity dates are considered against the requirement date, and also minimum order quantity, and the supplier with the minimum last price and higher preference is selected.

Modified:
    ofbiz/trunk/applications/order/config/OrderUiLabels.properties
    ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
    ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml

Modified: ofbiz/trunk/applications/order/config/OrderUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderUiLabels.properties?view=diff&rev=520857&r1=520856&r2=520857
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderUiLabels.properties (original)
+++ ofbiz/trunk/applications/order/config/OrderUiLabels.properties Wed Mar 21 05:29:59 2007
@@ -144,6 +144,7 @@
 OrderApproved=Approved
 OrderApprovedProductRequirements=Approved Product Requirements
 OrderApprovedProductRequirementsByVendor=Approved Requirements By Vendor
+OrderAutoAssign=Auto Assign
 OrderAutoCreateQuoteAdjustments=Auto Create Adjustments
 OrderAvs=AVS
 OrderBackOrdered=Backordered

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml?view=diff&rev=520857&r1=520856&r2=520857
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml Wed Mar 21 05:29:59 2007
@@ -73,11 +73,12 @@
                 <entity-condition entity-name="SupplierProduct" list-name="supplierProducts">
                     <condition-list>
                         <condition-expr field-name="productId" env-name="requirement.productId"/>
-                        <!-- TODO: compare quantity in requirement to the quantity in the SupplierProduct entity -->
-                        <!--<condition-expr field-name="supplierPrefOrderId" value="PRODUCT_REQUIREMENT"/>-->
+                        <condition-expr field-name="minimumOrderQuantity" env-name="requirement.quantity" operator="less-equals"/>
                     </condition-list>
+                    <order-by field-name="lastPrice"/>
                     <order-by field-name="supplierPrefOrderId"/>
                 </entity-condition>
+                <filter-list-by-date list-name="supplierProducts" valid-date-name="requirement.requiredByDate" from-field-name="availableFromDate" thru-field-name="availableThruDate"/>
                 <first-from-list list-name="supplierProducts" entry-name="supplierProduct"/>
                 <if-not-empty field-name="supplierProduct.partyId">
                     <make-value value-name="requirementSupplier" entity-name="RequirementRole"/>

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?view=diff&rev=520857&r1=520856&r2=520857
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Wed Mar 21 05:29:59 2007
@@ -1058,6 +1058,11 @@
         <event type="service" invoke="updateRequirementRole"/>
         <response name="success" type="view" value="ListRequirementRoles"/>
     </request-map>
+    <request-map uri="autoAssignRequirementToSupplier">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="autoAssignRequirementToSupplier"/>
+        <response name="success" type="view" value="ListRequirementRoles"/>
+    </request-map>
 
     <request-map uri="ApproveRequirements">
         <security https="true" auth="true"/>

Modified: ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml?view=diff&rev=520857&r1=520856&r2=520857
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml Wed Mar 21 05:29:59 2007
@@ -327,6 +327,7 @@
                     <decorator-section name="body">
                         <container>
                             <link target="EditRequirementRole?requirementId=${requirementId}" text="${uiLabelMap.CommonNew}" style="buttontext"/>
+                            <link target="autoAssignRequirementToSupplier?requirementId=${requirementId}" text="${uiLabelMap.OrderAutoAssign}" style="buttontext"/>
                         </container>
                         <include-form name="ListRequirementRoles" location="component://order/webapp/ordermgr/requirement/RequirementForms.xml"/>
                     </decorator-section>