ish_models 0.0.33.267 → 0.0.33.268
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 +4 -4
- data/lib/gameui/asset3d.rb +2 -1
- data/lib/ish/invoice.rb +9 -4
- 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: dd66d24c0e32d8c2062bb683a462892ec79779902e66cd184d5a087bb1e439ad
|
4
|
+
data.tar.gz: 164dbb6e924555332d22f0f8e07dfc172910810c232c64784d089e5459a3f697
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4719d9a45e7de490242687d6022a0ebd478529ca584ba6d475f889d02c2f964fd3fb513c5b11b87c4fd831e9e063bf6fa248e45b13570fa98155af884ccb7fbe
|
7
|
+
data.tar.gz: a0438c17da408bff68f51947332b7f4c110b29eeee46837555097c29343db513afb8b58e591b0cd302b05025cf915d8338a086d95aee5354df752a954125c1b7
|
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,11 +23,16 @@ 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'
|
31
|
+
|
32
|
+
def filename
|
33
|
+
"invoice-#{number}.pdf"
|
34
|
+
end
|
35
|
+
|
31
36
|
# field :amount_cents, type: Integer
|
32
37
|
# has_many :payments, :class_name => 'Ish::Payment'
|
33
38
|
# field :paid_amount_cents, type: Integer, :default => 0 ## @TODO: unused? _vp_ 2023-08-18
|
@@ -38,7 +43,7 @@ class Ish::Invoice
|
|
38
43
|
|
39
44
|
## Prawn/pdf unit of measure is 1/72"
|
40
45
|
## Canvas width: 612, height: 792
|
41
|
-
def generate_monthly_invoice
|
46
|
+
def generate_monthly_invoice
|
42
47
|
tree_img_url = "#{Rails.root.join('public')}/tree-1.jpg"
|
43
48
|
wasya_co_logo_url = "#{Rails.root.join('public')}/259x66-WasyaCo-logo.png"
|
44
49
|
|
@@ -76,7 +81,7 @@ class Ish::Invoice
|
|
76
81
|
|
77
82
|
pdf.bounding_box( [4.5*72, 8.25*72], width: 3.25*72, height: 0.75*72 ) do
|
78
83
|
pdf.text "Notes:"
|
79
|
-
pdf.text "Support & various tasks, for the month of #{ month_on }."
|
84
|
+
pdf.text "Support & various tasks, for the month of #{ month_on.strftime('%B') }."
|
80
85
|
end
|
81
86
|
|
82
87
|
lineitems_with_header = [
|