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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 562cb493212497cffadce51e4ff62fdb5cd7986020944767635fb9ba06ec90c8
4
- data.tar.gz: 7991f49f62f2d2553bc9822adaa4198f19f68a3947a1dfcd9624b928a3eeaed6
3
+ metadata.gz: dd66d24c0e32d8c2062bb683a462892ec79779902e66cd184d5a087bb1e439ad
4
+ data.tar.gz: 164dbb6e924555332d22f0f8e07dfc172910810c232c64784d089e5459a3f697
5
5
  SHA512:
6
- metadata.gz: 2bc7c42c23d84036beaa7df47fa2c8d4ca8438dcf0dba760f3691e5470fdaed0483eb4f2372ed1fc4090b69ff21d3078b9503cef2f32e414ab77c7153746df86
7
- data.tar.gz: ff6b3f6331e2d10da1e1a4c82d408000f5555066875f28d5310630d18e230bf2a17e67ab8f3e1b43e0792501a0aac15f6e8f65cdaf6d1c5703264ecc511d145b
6
+ metadata.gz: 4719d9a45e7de490242687d6022a0ebd478529ca584ba6d475f889d02c2f964fd3fb513c5b11b87c4fd831e9e063bf6fa248e45b13570fa98155af884ccb7fbe
7
+ data.tar.gz: a0438c17da408bff68f51947332b7f4c110b29eeee46837555097c29343db513afb8b58e591b0cd302b05025cf915d8338a086d95aee5354df752a954125c1b7
@@ -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, default: 100
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 month_on
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 = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33.267
4
+ version: 0.0.33.268
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox