caboose-cms 0.8.59 → 0.8.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8854c5eb4ae1dee3f1374f0fb4d2a62068aa9760
4
- data.tar.gz: b2d414cfa6f72c0fd78cafcea2de5cd26345031e
3
+ metadata.gz: f5c5ba850878fe90aaad10b85a49a22fb7ac6315
4
+ data.tar.gz: a23f403479820953621d16ba00f98fe3d850525e
5
5
  SHA512:
6
- metadata.gz: 31d8ad0c0727e6e7fac55698f42936be2edc61195ffc7cff9697578a754a283b32029db0cf10d7ad47ce5b2b817ea84230876306dc0a605d8fd6d25012e38917
7
- data.tar.gz: 4b643e9870a550a767c6878e396204cb09e1414b4b25c821364c820cabf2573b9d0bdb6fbb29eb033548a13b54c356373087ba589b114124e70950b64031ad80
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
  {
@@ -5,6 +5,7 @@ module Caboose
5
5
  self.primary_key = 'id'
6
6
 
7
7
  belongs_to :site
8
+ belongs_to :variant
8
9
  has_many :user_subscriptions
9
10
  attr_accessible :id ,
10
11
  :site_id ,
@@ -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.parse(self.date_started.year, s.start_month, s.start_day)
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.parse(self.date_started.year, self.date_started.month, s.start_day)
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.subcription.interval
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
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.8.59'
2
+ VERSION = '0.8.60'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.59
4
+ version: 0.8.60
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry