ish_models 0.0.33.267 → 0.0.33.269
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gameui/asset3d.rb +2 -1
- data/lib/ish/invoice.rb +12 -8
- data/lib/wco/price.rb +1 -1
- data/lib/wco/product.rb +17 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8a7d7dce5c47ec5fd14dd24b9058caa39fe2274e97d7ba92fc12dea2b5409dc
|
4
|
+
data.tar.gz: 44b14bc9b6102fe774e803a52cc1eb58e60e19c3146a9ca3cde251689b96449e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10afe05f48b979bb9bf9e872190bf5895dda533cf96dc14bb2d7b043babf22f1e27dc2be6cc9795185582e45feaa3f835e1f9a0a906be905957c81077512f429
|
7
|
+
data.tar.gz: 605c986b2ee54ed153fe994a9a21a01a1ba9a149319bec7a4d829eea04e19fc1223987f9f211d6bc9dd8092f33cb5cef8d02357b5254bdfb19634f5871bf5e08
|
data/lib/gameui/asset3d.rb
CHANGED
@@ -9,6 +9,7 @@ class ::Gameui::Asset3d
|
|
9
9
|
include Ish::Utils
|
10
10
|
|
11
11
|
belongs_to :marker, class_name: 'Gameui::Marker', optional: true
|
12
|
+
belongs_to :invoice, class_name: 'Ish::Invoice', optional: true
|
12
13
|
|
13
14
|
has_mongoid_attached_file :object,
|
14
15
|
:storage => :s3,
|
@@ -22,7 +23,7 @@ class ::Gameui::Asset3d
|
|
22
23
|
|
23
24
|
def export_fields
|
24
25
|
%w|
|
25
|
-
marker_id
|
26
|
+
marker_id invoice_id
|
26
27
|
asset3d_file_name asset3d_content_type asset3d_file_size asset3d_updated_at asset3d_fingerprint
|
27
28
|
|;
|
28
29
|
end
|
data/lib/ish/invoice.rb
CHANGED
@@ -23,22 +23,26 @@ class Ish::Invoice
|
|
23
23
|
Leadset.find leadset_id
|
24
24
|
end
|
25
25
|
|
26
|
-
field :number, type: Integer
|
27
|
-
increments :number
|
26
|
+
field :number, type: Integer
|
28
27
|
|
29
28
|
field :month_on, type: Date
|
30
29
|
|
30
|
+
has_one :asset, class_name: '::Gameui::Asset3d' ## the pdf
|
31
|
+
|
32
|
+
def filename
|
33
|
+
"invoice-#{number}.pdf"
|
34
|
+
end
|
35
|
+
|
31
36
|
# field :amount_cents, type: Integer
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
# field :items, type: Array
|
37
|
+
|
38
|
+
field :description, type: String
|
39
|
+
field :items, type: Array # used by stripe
|
36
40
|
|
37
41
|
|
38
42
|
|
39
43
|
## Prawn/pdf unit of measure is 1/72"
|
40
44
|
## Canvas width: 612, height: 792
|
41
|
-
def generate_monthly_invoice
|
45
|
+
def generate_monthly_invoice
|
42
46
|
tree_img_url = "#{Rails.root.join('public')}/tree-1.jpg"
|
43
47
|
wasya_co_logo_url = "#{Rails.root.join('public')}/259x66-WasyaCo-logo.png"
|
44
48
|
|
@@ -76,7 +80,7 @@ class Ish::Invoice
|
|
76
80
|
|
77
81
|
pdf.bounding_box( [4.5*72, 8.25*72], width: 3.25*72, height: 0.75*72 ) do
|
78
82
|
pdf.text "Notes:"
|
79
|
-
pdf.text "Support & various tasks, for the month of #{ month_on }."
|
83
|
+
pdf.text "Support & various tasks, for the month of #{ month_on.strftime('%B') }."
|
80
84
|
end
|
81
85
|
|
82
86
|
lineitems_with_header = [
|
data/lib/wco/price.rb
CHANGED
data/lib/wco/product.rb
CHANGED
@@ -7,23 +7,29 @@ class Wco::Product
|
|
7
7
|
|
8
8
|
field :product_id # stripe
|
9
9
|
|
10
|
-
## @TODO: remove, interval makes no sense on product! replace with Wco::Price . _vp_ 2023-09-07
|
11
|
-
# INTERVALS = [ nil, 'day', 'week', 'month', 'year' ]
|
12
|
-
# field :interval, type: String
|
13
|
-
|
14
|
-
## @TODO: remove, interval makes no sense on product! replace with Wco::Price . _vp_ 2023-09-07
|
15
|
-
# field :price_id # stripe
|
16
|
-
|
17
|
-
## @TODO: remove, interval makes no sense on product! replace with Wco::Price . _vp_ 2023-09-07
|
18
|
-
# field :price_cents, type: Integer
|
19
|
-
|
20
10
|
## @TODO: remove, interval makes no sense on product! replace with Wco::Price . _vp_ 2023-09-07
|
21
11
|
# has_many :subscriptions, class_name: '::Wco::Subscription', inverse_of: :subscription
|
22
12
|
|
23
13
|
has_many :prices, class_name: '::Wco::Price', inverse_of: :product
|
24
14
|
|
25
15
|
def self.list
|
26
|
-
[ [nil,nil] ] + self.all.map { |i| [i.name, i.id] }
|
16
|
+
[ [nil,nil] ] + self.all.order_by({ name: :asc }).map { |i| [i.name, i.id] }
|
27
17
|
end
|
28
18
|
|
29
19
|
end
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
## @TODO: remove, interval makes no sense on product! replace with Wco::Price . _vp_ 2023-09-07
|
30
|
+
# INTERVALS = [ nil, 'day', 'week', 'month', 'year' ]
|
31
|
+
# field :interval, type: String
|
32
|
+
## @TODO: remove, interval makes no sense on product! replace with Wco::Price . _vp_ 2023-09-07
|
33
|
+
# field :price_id # stripe
|
34
|
+
## @TODO: remove, interval makes no sense on product! replace with Wco::Price . _vp_ 2023-09-07
|
35
|
+
# field :price_cents, type: Integer
|