lucadeal 0.5.3 → 0.5.5
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/CHANGELOG.md +8 -0
- data/README.md +3 -3
- data/lib/luca_deal/fee.rb +10 -10
- data/lib/luca_deal/invoice.rb +1 -1
- data/lib/luca_deal/product.rb +1 -1
- data/lib/luca_deal/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2ff306506550b9b61a9c3fa6ba072cff287c895c32cabf43ff2dec3d1ec0be8
|
4
|
+
data.tar.gz: f7868b2693bd695ebce548205b64e9724ded153f7219b75009f6b26562a05dc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a5f365a8837b62e5c24ceb8f2df7897960380c2abafa4e8b15892620399a6b75e6535a3bd52349b74799d7c58c1a8617458da386981179a7da6576157212e96
|
7
|
+
data.tar.gz: 911ac5f5a19191b280e6575b6c0bf328a37c0ee5b6e0a30b3d9fc252b06cc110a6ffaafc231e6ba07680fdc86abd695dbf6e92e4015fe59676b08156a886aa15
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -76,7 +76,7 @@ Invoice conditions are defined by contracts.
|
|
76
76
|
### Send Invoice
|
77
77
|
|
78
78
|
Invoice is implemented with HTML & ERB. Copy [default template](lib/luca_deal/templates/invoice.html.erb) to `templates/` in the data directory, and customize.
|
79
|
-
If you want to send invoices in PDF, you need to install `wkhtmltopdf command separately. Send mail command is
|
79
|
+
If you want to send invoices in PDF, you need to install `wkhtmltopdf` command separately. Send mail command is:
|
80
80
|
|
81
81
|
```
|
82
82
|
$ luca-deal invoice mail yyyy m
|
@@ -133,7 +133,7 @@ Contract is core object for calculation. Common fields are as follows:
|
|
133
133
|
| | effective | must | | Start date of the contract. |
|
134
134
|
| | defunct | | | End date of the contract. |
|
135
135
|
|
136
|
-
Fields for subscription customers are
|
136
|
+
Fields for subscription customers are:
|
137
137
|
|
138
138
|
| Top level | Second level | | historical | Description |
|
139
139
|
|-----------|---------------|----------|------------|------------------------------------------------------------------------------------------------------|
|
@@ -151,7 +151,7 @@ Fields for subscription customers are as bellows:
|
|
151
151
|
| | id | | | contract id of fee with sales partner. |
|
152
152
|
|
153
153
|
|
154
|
-
Fields for sales fee
|
154
|
+
Fields for sales fee:
|
155
155
|
|
156
156
|
| Top level | Second level | | historical | Description |
|
157
157
|
|-----------|--------------|----------|------------|-------------------------------------------------------------------------------------|
|
data/lib/luca_deal/fee.rb
CHANGED
@@ -66,7 +66,7 @@ module LucaDeal
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def deliver_mail(attachment_type = nil, mode: nil, skip_no_item: true)
|
69
|
-
attachment_type = CONST.config.dig('fee', 'attachment') || :html
|
69
|
+
attachment_type = LucaRecord::CONST.config.dig('fee', 'attachment') || :html
|
70
70
|
fees = self.class.asof(@date.year, @date.month)
|
71
71
|
raise "No report for #{@date.year}/#{@date.month}" if fees.count.zero?
|
72
72
|
|
@@ -75,7 +75,7 @@ module LucaDeal
|
|
75
75
|
next if skip_no_item && dat['items'].empty?
|
76
76
|
|
77
77
|
mail = compose_mail(dat, mode: mode, attachment: attachment_type.to_sym)
|
78
|
-
LucaSupport::Mail.new(mail, CONST.pjdir).deliver
|
78
|
+
LucaSupport::Mail.new(mail, LucaRecord::CONST.pjdir).deliver
|
79
79
|
self.class.add_status!(path, 'mail_delivered') if mode.nil?
|
80
80
|
end
|
81
81
|
end
|
@@ -100,9 +100,9 @@ module LucaDeal
|
|
100
100
|
|
101
101
|
mail = Mail.new
|
102
102
|
mail.to = dat.dig('customer', 'to') if mode.nil?
|
103
|
-
mail.subject = CONST.config.dig('fee', 'mail_subject') || 'Your Report is available'
|
103
|
+
mail.subject = LucaRecord::CONST.config.dig('fee', 'mail_subject') || 'Your Report is available'
|
104
104
|
if mode == :preview
|
105
|
-
mail.cc = CONST.config.dig('mail', 'preview') || CONST.config.dig('mail', 'from')
|
105
|
+
mail.cc = LucaRecord::CONST.config.dig('mail', 'preview') || LucaRecord::CONST.config.dig('mail', 'from')
|
106
106
|
mail.subject = '[preview] ' + mail.subject
|
107
107
|
end
|
108
108
|
mail.text_part = Mail::Part.new(body: render_erb(search_template('fee-report-mail.txt.erb')), charset: 'UTF-8')
|
@@ -226,7 +226,7 @@ module LucaDeal
|
|
226
226
|
# TODO: load labels from CONST.config before country defaults
|
227
227
|
#
|
228
228
|
def export_labels
|
229
|
-
case CONST.confg['country']
|
229
|
+
case LucaRecord::CONST.confg['country']
|
230
230
|
when 'jp'
|
231
231
|
{
|
232
232
|
debit: { fee: '支払手数料', tax: '支払手数料', deduction: '未払費用' },
|
@@ -244,9 +244,9 @@ module LucaDeal
|
|
244
244
|
#
|
245
245
|
def set_company
|
246
246
|
{}.tap do |h|
|
247
|
-
h['name'] = CONST.config.dig('company', 'name')
|
248
|
-
h['address'] = CONST.config.dig('company', 'address')
|
249
|
-
h['address2'] = CONST.config.dig('company', 'address2')
|
247
|
+
h['name'] = LucaRecord::CONST.config.dig('company', 'name')
|
248
|
+
h['address'] = LucaRecord::CONST.config.dig('company', 'address')
|
249
|
+
h['address2'] = LucaRecord::CONST.config.dig('company', 'address2')
|
250
250
|
end
|
251
251
|
end
|
252
252
|
|
@@ -280,9 +280,9 @@ module LucaDeal
|
|
280
280
|
# load Tax Rate from config.
|
281
281
|
#
|
282
282
|
def load_tax_rate(name)
|
283
|
-
return 0 if CONST.config.dig('tax_rate', name).nil?
|
283
|
+
return 0 if LucaRecord::CONST.config.dig('tax_rate', name).nil?
|
284
284
|
|
285
|
-
BigDecimal(take_current(CONST.config['tax_rate'], name).to_s)
|
285
|
+
BigDecimal(take_current(LucaRecord::CONST.config['tax_rate'], name).to_s)
|
286
286
|
end
|
287
287
|
|
288
288
|
# Fees are unique contract_id in each month
|
data/lib/luca_deal/invoice.rb
CHANGED
@@ -93,7 +93,7 @@ module LucaDeal
|
|
93
93
|
fy_end = Date.new(date.year, date.month, -1)
|
94
94
|
if detail
|
95
95
|
customers = {}.tap do |h|
|
96
|
-
Customer.all.each { |c| h[c['name']] = c }
|
96
|
+
Customer.all.each { |c| h[c['name']] = LucaSupport::Code.parse_current(c, fy_end) }
|
97
97
|
end
|
98
98
|
end
|
99
99
|
[].tap do |res|
|
data/lib/luca_deal/product.rb
CHANGED
@@ -17,7 +17,7 @@ module LucaDeal
|
|
17
17
|
YAML.dump(list).tap { |l| puts l }
|
18
18
|
end
|
19
19
|
|
20
|
-
# Save data with hash in Product format. Simple format is also available as
|
20
|
+
# Save data with hash in Product format. Simple format is also available as follows:
|
21
21
|
# {
|
22
22
|
# name: 'item_name(required)', price: 'item_price', qty: 'item_qty',
|
23
23
|
# initial: { name: 'item_name', price: 'item_price', qty: 'item_qty' }
|
data/lib/luca_deal/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucadeal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lucarecord
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.7.
|
19
|
+
version: 0.7.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.7.
|
26
|
+
version: 0.7.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|