You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2007/09/10 10:13:28 UTC

svn commit: r574167 - /ofbiz/branches/release4.0/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java

Author: jleroux
Date: Mon Sep 10 01:13:27 2007
New Revision: 574167

URL: http://svn.apache.org/viewvc?rev=574167&view=rev
Log:
Applied fix from trunk for revision: 557899

Modified:
    ofbiz/branches/release4.0/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java

Modified: ofbiz/branches/release4.0/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java?rev=574167&r1=574166&r2=574167&view=diff
==============================================================================
--- ofbiz/branches/release4.0/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java (original)
+++ ofbiz/branches/release4.0/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java Mon Sep 10 01:13:27 2007
@@ -86,6 +86,8 @@
         }
         
         Timestamp thruDate = lastSubscription != null ? (Timestamp) lastSubscription.get("thruDate") : null;
+        
+        // set the fromDate, one way or another
         if (thruDate == null) {
             // no thruDate? start with NOW
             thruDate = nowTimestamp;
@@ -95,10 +97,10 @@
             //don't want to penalize for skipping time, in other words if they had a subscription last year for a month and buy another month, we want that second month to start now and not last year
             if (thruDate.before(nowTimestamp)) {
                 thruDate = nowTimestamp;
-            } else {
-                newSubscription.set("fromDate", thruDate);
             }
+            newSubscription.set("fromDate", thruDate);
         }
+        
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(thruDate);
         int field = Calendar.MONTH;