svn commit: r563525 - in /ofbiz/trunk/applications/order: servicedef/services.xml src/org/ofbiz/order/order/OrderServices.java src/org/ofbiz/order/shoppingcart/ShoppingCart.java webapp/ordermgr/entry/orderagreements.ftl

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

svn commit: r563525 - in /ofbiz/trunk/applications/order: servicedef/services.xml src/org/ofbiz/order/order/OrderServices.java src/org/ofbiz/order/shoppingcart/ShoppingCart.java webapp/ordermgr/entry/orderagreements.ftl

jacopoc
Author: jacopoc
Date: Tue Aug  7 08:34:47 2007
New Revision: 563525

URL: http://svn.apache.org/viewvc?view=rev&rev=563525
Log:
Added ability to set a work effort id at the beginning of the order entry (backend); it will generate a record in the OrderHeaderWorkEffort entity.

Modified:
    ofbiz/trunk/applications/order/servicedef/services.xml
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
    ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl

Modified: ofbiz/trunk/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?view=diff&rev=563525&r1=563524&r2=563525
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services.xml Tue Aug  7 08:34:47 2007
@@ -103,6 +103,7 @@
         <attribute name="originFacilityId" type="String" mode="IN" optional="true"/>
         <attribute name="transactionId" type="String" mode="IN" optional="true"/>
         <attribute name="terminalId" type="String" mode="IN" optional="true"/>
+        <attribute name="workEffortId" type="String" mode="IN" optional="true"/>
         <attribute name="autoOrderShoppingListId" type="String" mode="IN" optional="true"/>
         <attribute name="webSiteId" type="String" mode="IN" optional="true"/>
         <attribute name="externalId" type="String" mode="IN" optional="true"/>

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?view=diff&rev=563525&r1=563524&r2=563525
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Tue Aug  7 08:34:47 2007
@@ -965,6 +965,15 @@
            }
        }
 
+       // if a workEffortId is passed, then prepare a OrderHeaderWorkEffort value
+       String workEffortId = (String) context.get("workEffortId");
+       if (UtilValidate.isNotEmpty(workEffortId)) {
+           GenericValue orderHeaderWorkEffort = delegator.makeValue("OrderHeaderWorkEffort", null);
+           orderHeaderWorkEffort.set("orderId", orderId);
+           orderHeaderWorkEffort.set("workEffortId", workEffortId);
+           toBeStored.add(orderHeaderWorkEffort);
+       }
+
         try {
             // store line items, etc so that they will be there for the foreign key checks
             delegator.storeAll(toBeStored);

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?view=diff&rev=563525&r1=563524&r2=563525
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Tue Aug  7 08:34:47 2007
@@ -83,6 +83,7 @@
     private double billingAccountAmt = 0.00;
     private String agreementId = null;
     private String quoteId = null;
+    private String workEffortId = null;
     private long nextItemSeq = 1;
 
     private String defaultItemDeliveryDate = null;
@@ -172,6 +173,7 @@
         this.poNumber = cart.getPoNumber();
         this.orderId = cart.getOrderId();
         this.orderName = "Copy of " + cart.getOrderName();
+        this.workEffortId = cart.getWorkEffortId();
         this.firstAttemptOrderId = cart.getFirstAttemptOrderId();
         this.billingAccountId = cart.getBillingAccountId();
         this.agreementId = cart.getAgreementId();
@@ -348,7 +350,15 @@
     public String getOrderName() {
         return orderName;
     }
+
+    public void setWorkEffortId(String workEffortId) {
+        this.workEffortId = workEffortId;
+    }
     
+    public String getWorkEffortId() {
+        return workEffortId;
+    }
+
     public void setAttribute(String name, Object value) {
         this.attributes.put(name, value);
     }
@@ -3698,6 +3708,7 @@
         result.put("transactionId", this.getTransactionId());
         result.put("originFacilityId", this.getFacilityId());
         result.put("terminalId", this.getTerminalId());
+        result.put("workEffortId", this.getWorkEffortId());
         result.put("autoOrderShoppingListId", this.getAutoOrderShoppingListId());
 
         result.put("billToCustomerPartyId", this.getBillToCustomerPartyId());

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl?view=diff&rev=563525&r1=563524&r2=563525
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl Tue Aug  7 08:34:47 2007
@@ -104,6 +104,18 @@
 
       <tr>
         <td>&nbsp;</td>
+        <td class="tableheadtext" align="right">
+          ${uiLabelMap.WorkEffortWorkEffortId}
+        </td>
+        <td>&nbsp;</td>
+        <td align="left">
+          <input type="text" name="workEffortId" size="15"/>
+          <a href="javascript:call_fieldlookup2(document.agreementForm.workEffortId,'LookupWorkEffort');"><img src='/images/fieldlookup.gif' width='15' height='14' border='0' alt='Click here For Field Lookup'/></a>
+        </td>
+      </tr>
+
+      <tr>
+        <td>&nbsp;</td>
         <td align='right' valign='top' nowrap>
           <div class='tableheadtext'>
             ${uiLabelMap.OrderShipAfterDateDefault}