svn commit: r533827 - in /ofbiz/trunk/applications/order: config/OrderErrorUiLabels.properties script/org/ofbiz/order/order/OrderReturnServices.xml webapp/ordermgr/WEB-INF/actions/return/returnHeader.bsh webapp/ordermgr/return/returnHeader.ftl

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

svn commit: r533827 - in /ofbiz/trunk/applications/order: config/OrderErrorUiLabels.properties script/org/ofbiz/order/order/OrderReturnServices.xml webapp/ordermgr/WEB-INF/actions/return/returnHeader.bsh webapp/ordermgr/return/returnHeader.ftl

jacopoc
Author: jacopoc
Date: Mon Apr 30 12:02:39 2007
New Revision: 533827

URL: http://svn.apache.org/viewvc?view=rev&rev=533827
Log:
Before a cross-ship return can be approved, a paymentMethodId must be associated on the ReturnHeader.
The payment method is used to guarantee the cross-shipped item.

Modified:
    ofbiz/trunk/applications/order/config/OrderErrorUiLabels.properties
    ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/returnHeader.bsh
    ofbiz/trunk/applications/order/webapp/ordermgr/return/returnHeader.ftl

Modified: ofbiz/trunk/applications/order/config/OrderErrorUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderErrorUiLabels.properties?view=diff&rev=533827&r1=533826&r2=533827
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderErrorUiLabels.properties (original)
+++ ofbiz/trunk/applications/order/config/OrderErrorUiLabels.properties Mon Apr 30 12:02:39 2007
@@ -206,6 +206,7 @@
 OrderRentalOrderItems=Rental order items in the order, however no workEfforts with start/end date and number of persons
 OrderRequestedReturnQuantityNotAvailablePreviousReturnsMayExist=Requested return quantity [ ${parameters.returnQuantity} ] not available ; previous returns may exist [ ${returnableQuantity} ].
 OrderReservationLengthShouldBeAPositiveNumber=Reservation length should be a positive number
+OrderReturnPaymentMethodNotSetForCrossShip=A payment method must be set for cross-ship returns
 OrderReturnPriceCannotExceedThePurchasePrice=Return price [ ${parameters.returnPrice} ] cannot exceed the purchase price [ ${returnablePrice} ].
 OrderReturnPriceCannotExceedTheOrderTotal=Return total of all return items [${returnTotal}] cannot exceed the order total of [ ${orderTotal} ].
 OrderReturnTotalCannotLessThanZero=Return total [${returnTotalAmount}] can not less than zero.

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml?view=diff&rev=533827&r1=533826&r2=533827
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml Mon Apr 30 12:02:39 2007
@@ -136,7 +136,19 @@
 
             <!-- check them all to make sure that the return total does not exceed order total.  -->
             <iterate entry-name="returnItem" list-name="returnItems">
-
+              <!-- check, for cross-ship returns, if a payment method is set to guarantee the cross-shipped item(s)..  -->
+              <if>
+                  <condition>
+                      <and>
+                          <if-empty field-name="returnHeader.paymentMethodId"/>
+                          <if-compare field-name="returnItem.returnTypeId" operator="equals" value="RTN_CSREPLACE"/>
+                      </and>
+                  </condition>
+                  <then>
+                      <add-error><fail-property resource="OrderErrorUiLabels" property="OrderReturnPaymentMethodNotSetForCrossShip"/></add-error>
+                  </then>
+              </if>
+              <check-errors/>
                <!-- tally up the return total amount -->
                <calculate field-name="returnTotalAmount">
                    <calcop field-name="returnTotalAmount" operator="add">

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/returnHeader.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/returnHeader.bsh?view=diff&rev=533827&r1=533826&r2=533827
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/returnHeader.bsh (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/returnHeader.bsh Mon Apr 30 12:02:39 2007
@@ -42,6 +42,17 @@
         postalAddressFrom = returnHeader.getRelatedOne("PostalAddress");            
         currentAccount = returnHeader.getRelatedOne("BillingAccount");
         context.put("currentAccount", currentAccount);
+        currentPaymentMethod = returnHeader.getRelatedOne("PaymentMethod");
+        if (currentPaymentMethod != null) {
+            currentCreditCard = currentPaymentMethod.getRelatedOne("CreditCard");
+            if (currentCreditCard != null) {
+                context.put("currentCreditCard", currentCreditCard);
+            } else {
+                currentEftAccount = currentPaymentMethod.getRelatedOne("EftAccount");
+                context.put("currentEftAccount", currentEftAccount);
+            }
+        }
+        context.put("currentPaymentMethod", currentPaymentMethod);
         currentFacility = returnHeader.getRelatedOne("Facility");
         context.put("currentFacility", currentFacility);    
         context.put("entryDate", returnHeader.getTimestamp("entryDate"));
@@ -74,6 +85,18 @@
     billingAccountList = EntityUtil.filterByDate(billingAccountList);
 }
 context.put("billingAccountList", billingAccountList);
+
+// payment method info
+if (partyId != null) {
+    List creditCardList = EntityUtil.filterByDate(delegator.findByAnd("PaymentMethodAndCreditCard", UtilMisc.toMap("partyId", partyId)));
+    if (UtilValidate.isNotEmpty(creditCardList)) {
+        context.put("creditCardList", creditCardList);
+    }
+    List eftAccountList = EntityUtil.filterByDate(delegator.findByAnd("PaymentMethodAndEftAccount", UtilMisc.toMap("partyId", partyId)));
+    if (UtilValidate.isNotEmpty(eftAccountList)) {
+        context.put("eftAccountList", eftAccountList);
+    }
+}
 
 facilityList = delegator.findAll("Facility", UtilMisc.toList("facilityName"));
 context.put("facilityList", facilityList);

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/return/returnHeader.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnHeader.ftl?view=diff&rev=533827&r1=533826&r2=533827
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/return/returnHeader.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/return/returnHeader.ftl Mon Apr 30 12:02:39 2007
@@ -29,9 +29,9 @@
     <a href="<@ofbizUrl>return.pdf?returnId=${returnId?if_exists}</@ofbizUrl>" class="buttontext">PDF</a>
 </div>
 <#else>
-  <div class="head1">${uiLabelMap.OrderCreateNewReturn}</div>
+  <h1>${uiLabelMap.OrderCreateNewReturn}</h1>
   <#if requestParameters.returnId?has_content>
-    <div class="head2">${uiLabelMap.OrderNoReturnFoundWithId} : ${requestParameters.returnId}</div>
+    <h2>${uiLabelMap.OrderNoReturnFoundWithId} : ${requestParameters.returnId}</h2>
   </#if>
   <br/>
 </#if>
@@ -141,6 +141,40 @@
         <input type='text' class='inputBox' size='20' name='billingAccountId'>
       </#if>
     </td>                
+  </tr>
+  <tr>
+    <td width='14%'>&nbsp;</td>
+    <td width='6%' align='right' nowrap>${uiLabelMap.FormFieldTitle_paymentMethodId}</td>
+    <td width='6%'>&nbsp;</td>
+    <td width='74%'>
+      <#if creditCardList?exists || eftAccountList?exists>
+        <select name='paymentMethodId'>
+          <#if currentCreditCard?exists>
+            <option value="${currentCreditCard.paymentMethodId}">CC:&nbsp;${Static["org.ofbiz.party.contact.ContactHelper"].formatCreditCard(currentCreditCard)}</option>
+          </#if>
+          <#if currentEftAccount?exists>
+            <option value="${currentEftAccount.paymentMethodId}">EFT:&nbsp;${currentEftAccount.nameOnAccount?if_exists}, ${currentEftAccount.accountNumber?if_exists}</option>
+          </#if>
+          <option value=""></option>
+          <#if creditCardList?has_content>
+            <#list creditCardList as creditCardPm>
+              <#assign creditCard = creditCardPm.getRelatedOne("CreditCard")>
+              <option value="${creditCard.paymentMethodId}">CC:&nbsp;${Static["org.ofbiz.party.contact.ContactHelper"].formatCreditCard(creditCard)}</option>
+            </#list>
+          </#if>
+          <#if eftAccountList?has_content>
+            <#list eftAccountList as eftAccount>
+              <option value="${eftAccount.paymentMethodId}">EFT:&nbsp;${eftAccount.nameOnAccount?if_exists}, ${eftAccount.accountNumber?if_exists}</option>
+            </#list>
+          </#if>
+        </select>
+      <#else>
+        <input type='text' size='20' name='paymentMethodId'>
+      </#if>
+      <#if returnHeader.fromPartyId?has_content>
+        <a href="/partymgr/control/editcreditcard?partyId=${returnHeader.fromPartyId}${externalKeyParam}" target="partymgr" class="smallSubmit">${uiLabelMap.AccountingCreateNewCreditCard}</a>
+      </#if>
+    </td>
   </tr>
   <tr>
     <td width='14%'>&nbsp;</td>