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

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

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

jleroux@apache.org
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;