caboose-cms 0.8.59 → 0.8.60
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5c5ba850878fe90aaad10b85a49a22fb7ac6315
|
4
|
+
data.tar.gz: a23f403479820953621d16ba00f98fe3d850525e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88908188c6d4f53c82b59e1761d477b61fe88b3040208bf53fcd5184a37af738169accf690a7d242da7e82731f9e0c8244e62da784e0d65918a23da6833a4da0
|
7
|
+
data.tar.gz: 648a6468d05c068df994709e6f2fb38069d9683e08c761e753773a5487e0dfdb8cecd9f0f604c7ad93ce08d265eaa2b27e42300ebe0e06e2704587e6221ff154
|
@@ -63,7 +63,7 @@ BlockContentController.prototype = {
|
|
63
63
|
{
|
64
64
|
// Include the file before instantiating the controller
|
65
65
|
$(document).on(modal_controller + '_modal_controller_loaded', function() { that.modal = eval(new_modal_eval_string); });
|
66
|
-
that.mc.include_assets(js_file);
|
66
|
+
that.mc.include_assets(js_file);
|
67
67
|
}
|
68
68
|
else // We're good, go ahead and instantiate
|
69
69
|
{
|
@@ -28,10 +28,10 @@ module Caboose
|
|
28
28
|
s = self.subscription
|
29
29
|
d = nil
|
30
30
|
if s.interval == Subscription::INTERVAL_YEARLY
|
31
|
-
d = Date.
|
31
|
+
d = Date.new(self.date_started.year, s.start_month, s.start_day)
|
32
32
|
d = d + 1.year if d < self.date_started
|
33
33
|
elsif s.interval == Subscription::INTERVAL_MONTHLY
|
34
|
-
d = Date.
|
34
|
+
d = Date.new(self.date_started.year, s.start_month, s.start_day)
|
35
35
|
d = d + 1.month if d < self.date_started
|
36
36
|
end
|
37
37
|
self.date_started_full = d
|
@@ -48,7 +48,7 @@ module Caboose
|
|
48
48
|
|
49
49
|
self.calculate_date_started_full if self.date_started_full.nil?
|
50
50
|
|
51
|
-
interval = case self.
|
51
|
+
interval = case self.subscription.interval
|
52
52
|
when Subscription::INTERVAL_MONTHLY then 1.month
|
53
53
|
when Subscription::INTERVAL_YEARLY then 1.year
|
54
54
|
end
|
@@ -97,12 +97,13 @@ module Caboose
|
|
97
97
|
d2 = d2 + interval
|
98
98
|
end
|
99
99
|
d = self.date_started + 1.day - 1.day
|
100
|
-
while d <= d2
|
100
|
+
while d <= d2 do
|
101
101
|
# See if an invoice has already been created for today
|
102
|
-
li = self.line_items.where("date_starts = ? date_ends = ?", d, d + interval - 1.day).first
|
102
|
+
li = self.line_items.where("date_starts = ? AND date_ends = ?", d, d + interval - 1.day).first
|
103
103
|
if li.nil?
|
104
104
|
invoice = Caboose::Invoice.create(
|
105
105
|
:site_id => self.subscription.site_id,
|
106
|
+
:customer_id => self.user_id,
|
106
107
|
:status => Caboose::Invoice::STATUS_PENDING,
|
107
108
|
:financial_status => Caboose::Invoice::STATUS_PENDING,
|
108
109
|
:date_created => DateTime.now,
|
@@ -123,6 +124,7 @@ module Caboose
|
|
123
124
|
invoice.calculate
|
124
125
|
invoice.save
|
125
126
|
end
|
127
|
+
d = d + interval
|
126
128
|
end
|
127
129
|
return true
|
128
130
|
end
|
data/lib/caboose/version.rb
CHANGED