lucadeal 0.5.0 → 0.5.1
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 +7 -0
- data/exe/luca-deal +64 -30
- data/lib/luca_deal/fee.rb +11 -12
- data/lib/luca_deal/invoice.rb +14 -15
- data/lib/luca_deal/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2f5f085a31ba8be8e56a772cb3d063a42407e84d2901078e56d09989c6e04109
|
|
4
|
+
data.tar.gz: 15b4a9fe3f0dfc7ede51ab9557fbbe565bbbd3182733b7b6d4a1aca9b351e077
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f206506d1baa62b50c8a95e6cf0ded18ee6b4de6453f3a3d1a41d2b2c21060c846912dd85527ebe015816928804d87bfe70685fe380a06740ca402b1f6a4b73
|
|
7
|
+
data.tar.gz: 0b4a9b3d469a89ee0216735ec97c0df8eb5a0c29bd0bd0835b8182268fcaa72215052c0b018c64f4a2f06de69790429a094c31d6c59412246feb06386c9a4e10
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## LucaDeal 0.5.1
|
|
2
|
+
|
|
3
|
+
* Refine `luca-deal customer list` output: Limit columns to name, address and id.
|
|
4
|
+
* Reworked global constants w/LucaRecord v0.7
|
|
5
|
+
* Removed bundler from test suite avoiding casual native build
|
|
6
|
+
* add `luca-deal version` subcommand
|
|
7
|
+
|
|
1
8
|
## LucaDeal 0.5.0
|
|
2
9
|
|
|
3
10
|
* `luca-deal` command now searches valid sub directory.
|
data/exe/luca-deal
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/ruby
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
target = 'customers'
|
|
6
|
-
Dir.glob('*').reject { |f| File.symlink?(f) }
|
|
7
|
-
.find { |f| File.directory?("#{f}/data/#{target}") }.tap do |d|
|
|
8
|
-
abort "No valid data directory, exit..." if d.nil?
|
|
9
|
-
|
|
10
|
-
Dir.chdir(d)
|
|
11
|
-
end
|
|
12
|
-
end
|
|
4
|
+
REQUIRED_DIR='customers'
|
|
13
5
|
|
|
14
6
|
require 'date'
|
|
15
7
|
require 'optparse'
|
|
16
8
|
require 'luca_deal'
|
|
9
|
+
require 'luca_cmd'
|
|
17
10
|
|
|
18
11
|
class LucaCmd
|
|
19
12
|
class Customer < LucaCmd
|
|
@@ -67,6 +60,7 @@ class LucaCmd
|
|
|
67
60
|
end
|
|
68
61
|
|
|
69
62
|
def self.list(args = nil, params = {})
|
|
63
|
+
params[:col_order] = %w(name address id)
|
|
70
64
|
render(LucaDeal::Customer.new.list_name, params)
|
|
71
65
|
end
|
|
72
66
|
end
|
|
@@ -284,7 +278,7 @@ class LucaCmd
|
|
|
284
278
|
when 'json'
|
|
285
279
|
puts JSON.dump(dat)
|
|
286
280
|
when 'nu'
|
|
287
|
-
LucaSupport::View.nushell(dat, :expand)
|
|
281
|
+
LucaSupport::View.nushell(dat, :expand, params[:col_order] || [])
|
|
288
282
|
when 'explore'
|
|
289
283
|
LucaSupport::View.nushell(dat, :explore)
|
|
290
284
|
when 'csv'
|
|
@@ -303,7 +297,6 @@ def new_pj(args = nil, params = {})
|
|
|
303
297
|
LucaDeal::Setup.create_project args[0]
|
|
304
298
|
end
|
|
305
299
|
|
|
306
|
-
LucaRecord::Base.valid_project?
|
|
307
300
|
cmd = ARGV.shift
|
|
308
301
|
params = {}
|
|
309
302
|
|
|
@@ -315,7 +308,9 @@ when /customers?/
|
|
|
315
308
|
OptionParser.new do |opt|
|
|
316
309
|
opt.banner = 'Usage: luca-deal customers create CustomerName'
|
|
317
310
|
args = opt.parse(ARGV)
|
|
318
|
-
LucaCmd
|
|
311
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
312
|
+
LucaCmd::Customer.create(args, params)
|
|
313
|
+
end
|
|
319
314
|
end
|
|
320
315
|
when 'list'
|
|
321
316
|
OptionParser.new do |opt|
|
|
@@ -324,7 +319,9 @@ when /customers?/
|
|
|
324
319
|
opt.on('--explore', 'explore table in nushell') { |_v| params[:output] = 'explore' }
|
|
325
320
|
opt.on('-o', '--output VAL', 'output serialized data') { |v| params[:output] = v }
|
|
326
321
|
args = opt.parse(ARGV)
|
|
327
|
-
LucaCmd
|
|
322
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
323
|
+
LucaCmd::Customer.list(args, params)
|
|
324
|
+
end
|
|
328
325
|
end
|
|
329
326
|
when 'describe'
|
|
330
327
|
OptionParser.new do |opt|
|
|
@@ -332,10 +329,14 @@ when /customers?/
|
|
|
332
329
|
opt.on('--nu', 'show table in nushell') { |_v| params[:output] = 'nu' }
|
|
333
330
|
opt.on('-o', '--output VAL', 'output serialized data') { |v| params[:output] = v }
|
|
334
331
|
args = opt.parse(ARGV)
|
|
335
|
-
LucaCmd
|
|
332
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
333
|
+
LucaCmd::Customer.describe(args, params)
|
|
334
|
+
end
|
|
336
335
|
end
|
|
337
336
|
when 'delete'
|
|
338
|
-
LucaCmd
|
|
337
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
338
|
+
LucaCmd::Customer.delete(ARGV)
|
|
339
|
+
end
|
|
339
340
|
else
|
|
340
341
|
puts 'Proper subcommand needed.'
|
|
341
342
|
puts
|
|
@@ -356,7 +357,9 @@ when /contracts?/
|
|
|
356
357
|
params['category'] = 'sales_fee'
|
|
357
358
|
end
|
|
358
359
|
args = opt.parse(ARGV)
|
|
359
|
-
LucaCmd
|
|
360
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
361
|
+
LucaCmd::Contract.create(args, params)
|
|
362
|
+
end
|
|
360
363
|
end
|
|
361
364
|
when 'describe'
|
|
362
365
|
OptionParser.new do |opt|
|
|
@@ -364,10 +367,14 @@ when /contracts?/
|
|
|
364
367
|
opt.on('--nu', 'show table in nushell') { |_v| params[:output] = 'nu' }
|
|
365
368
|
opt.on('-o', '--output VAL', 'output serialized data') { |v| params[:output] = v }
|
|
366
369
|
args = opt.parse(ARGV)
|
|
367
|
-
LucaCmd
|
|
370
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
371
|
+
LucaCmd::Contract.describe(args, params)
|
|
372
|
+
end
|
|
368
373
|
end
|
|
369
374
|
when 'delete'
|
|
370
|
-
LucaCmd
|
|
375
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
376
|
+
LucaCmd::Contract.delete(ARGV)
|
|
377
|
+
end
|
|
371
378
|
else
|
|
372
379
|
puts 'Proper subcommand needed.'
|
|
373
380
|
puts
|
|
@@ -378,7 +385,9 @@ when /contracts?/
|
|
|
378
385
|
exit 1
|
|
379
386
|
end
|
|
380
387
|
when 'export'
|
|
381
|
-
LucaCmd
|
|
388
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
389
|
+
LucaCmd::Invoice.export(ARGV)
|
|
390
|
+
end
|
|
382
391
|
when /invoices?/, 'i'
|
|
383
392
|
subcmd = ARGV.shift
|
|
384
393
|
case subcmd
|
|
@@ -389,10 +398,14 @@ when /invoices?/, 'i'
|
|
|
389
398
|
opt.on('--monthly', 'generate monthly data') { |_v| params[:mode] = 'monthly' }
|
|
390
399
|
opt.on('--with-fee', 'generate sales fee data after monthly invoice creation') { |_v| params[:fee] = true }
|
|
391
400
|
args = opt.parse(ARGV)
|
|
392
|
-
LucaCmd
|
|
401
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
402
|
+
LucaCmd::Invoice.create(args, params)
|
|
403
|
+
end
|
|
393
404
|
end
|
|
394
405
|
when 'delete'
|
|
395
|
-
LucaCmd
|
|
406
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
407
|
+
LucaCmd::Invoice.delete(ARGV)
|
|
408
|
+
end
|
|
396
409
|
when 'list'
|
|
397
410
|
OptionParser.new do |opt|
|
|
398
411
|
opt.banner = 'Usage: luca-deal invoices list [options] year month [date]'
|
|
@@ -402,7 +415,9 @@ when /invoices?/, 'i'
|
|
|
402
415
|
opt.on('--mail', 'send payment list by email') { |_v| params[:mail] = true }
|
|
403
416
|
opt.on('--full', 'add settlement info') { |_v| params[:mode] = 'full' }
|
|
404
417
|
args = opt.parse(ARGV)
|
|
405
|
-
LucaCmd
|
|
418
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
419
|
+
LucaCmd::Invoice.list(args, params)
|
|
420
|
+
end
|
|
406
421
|
end
|
|
407
422
|
when 'mail'
|
|
408
423
|
OptionParser.new do |opt|
|
|
@@ -416,7 +431,9 @@ when /invoices?/, 'i'
|
|
|
416
431
|
opt.banner = 'Usage: luca-deal invoices print [options] <invoice_id | year month>'
|
|
417
432
|
opt.on('--pdf', 'output PDF invoices. wkhtmlpdf is required') { |_v| params[:output] = :pdf }
|
|
418
433
|
args = opt.parse(ARGV)
|
|
419
|
-
LucaCmd
|
|
434
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
435
|
+
LucaCmd::Invoice.print(args, params)
|
|
436
|
+
end
|
|
420
437
|
end
|
|
421
438
|
when 'settle'
|
|
422
439
|
params[:term] = 1
|
|
@@ -424,7 +441,9 @@ when /invoices?/, 'i'
|
|
|
424
441
|
opt.banner = 'Usage: luca-deal invoices settle [filepath]'
|
|
425
442
|
opt.on('--search-term VAL', 'search invoice N months before payment date. default: 1') { |v| params[:term] = v.to_i }
|
|
426
443
|
args = opt.parse(ARGV)
|
|
427
|
-
LucaCmd
|
|
444
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
445
|
+
LucaCmd::Invoice.settle(args, params)
|
|
446
|
+
end
|
|
428
447
|
end
|
|
429
448
|
else
|
|
430
449
|
puts 'Proper subcommand needed.'
|
|
@@ -452,7 +471,9 @@ when /reports?/, 'r'
|
|
|
452
471
|
opt.on('--detail', 'show detail info') { |_v| params[:detail] = true }
|
|
453
472
|
opt.on('--force-due', 'respect due date over actual payment') { |_v| params[:due] = true }
|
|
454
473
|
args = opt.parse(ARGV)
|
|
455
|
-
LucaCmd
|
|
474
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
475
|
+
LucaCmd::Invoice.report(args, params)
|
|
476
|
+
end
|
|
456
477
|
end
|
|
457
478
|
else
|
|
458
479
|
puts 'Proper subcommand needed.'
|
|
@@ -476,12 +497,18 @@ when /fee/
|
|
|
476
497
|
opt.banner = 'Usage: luca-deal fee create [options] year month [date]'
|
|
477
498
|
opt.on('--monthly', 'generate monthly data') { |_v| params[:mode] = 'monthly' }
|
|
478
499
|
args = opt.parse(ARGV)
|
|
479
|
-
LucaCmd
|
|
500
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
501
|
+
LucaCmd::Fee.create(args, params)
|
|
502
|
+
end
|
|
480
503
|
end
|
|
481
504
|
when 'delete'
|
|
482
|
-
LucaCmd
|
|
505
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
506
|
+
LucaCmd::Fee.delete(ARGV)
|
|
507
|
+
end
|
|
483
508
|
when 'export'
|
|
484
|
-
LucaCmd
|
|
509
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
510
|
+
LucaCmd::Fee.export(ARGV)
|
|
511
|
+
end
|
|
485
512
|
when 'list'
|
|
486
513
|
OptionParser.new do |opt|
|
|
487
514
|
opt.banner = 'Usage: luca-deal fee list [options] year month [date]'
|
|
@@ -490,14 +517,18 @@ when /fee/
|
|
|
490
517
|
opt.on('-o', '--output VAL', 'output serialized data') { |v| params[:output] = v }
|
|
491
518
|
opt.on('--html', 'output html invoices') { |_v| params[:html] = 'monthly' }
|
|
492
519
|
args = opt.parse(ARGV)
|
|
493
|
-
LucaCmd
|
|
520
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
521
|
+
LucaCmd::Fee.list(args, params)
|
|
522
|
+
end
|
|
494
523
|
end
|
|
495
524
|
when 'mail'
|
|
496
525
|
OptionParser.new do |opt|
|
|
497
526
|
opt.banner = 'Usage: luca-deal fee mail [options] year month [date]'
|
|
498
527
|
opt.on('--preview', 'send to preview user') { |_v| params['mode'] = 'preview' }
|
|
499
528
|
args = opt.parse(ARGV)
|
|
500
|
-
LucaCmd
|
|
529
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
|
530
|
+
LucaCmd::Fee.mail(args, params)
|
|
531
|
+
end
|
|
501
532
|
end
|
|
502
533
|
else
|
|
503
534
|
puts 'Proper subcommand needed.'
|
|
@@ -509,6 +540,9 @@ when /fee/
|
|
|
509
540
|
puts ' mail: send mail with report'
|
|
510
541
|
exit 1
|
|
511
542
|
end
|
|
543
|
+
when 'version'
|
|
544
|
+
puts "luca-deal: version #{LucaDeal::VERSION}"
|
|
545
|
+
exit 0
|
|
512
546
|
else
|
|
513
547
|
puts 'Proper subcommand needed.'
|
|
514
548
|
puts
|
data/lib/luca_deal/fee.rb
CHANGED
|
@@ -5,7 +5,6 @@ require 'json'
|
|
|
5
5
|
require 'yaml'
|
|
6
6
|
require 'pathname'
|
|
7
7
|
require 'bigdecimal'
|
|
8
|
-
require 'luca_support/config'
|
|
9
8
|
require 'luca_support/mail'
|
|
10
9
|
require 'luca_deal'
|
|
11
10
|
|
|
@@ -67,7 +66,7 @@ module LucaDeal
|
|
|
67
66
|
end
|
|
68
67
|
|
|
69
68
|
def deliver_mail(attachment_type = nil, mode: nil, skip_no_item: true)
|
|
70
|
-
attachment_type =
|
|
69
|
+
attachment_type = CONST.config.dig('fee', 'attachment') || :html
|
|
71
70
|
fees = self.class.asof(@date.year, @date.month)
|
|
72
71
|
raise "No report for #{@date.year}/#{@date.month}" if fees.count.zero?
|
|
73
72
|
|
|
@@ -76,7 +75,7 @@ module LucaDeal
|
|
|
76
75
|
next if skip_no_item && dat['items'].empty?
|
|
77
76
|
|
|
78
77
|
mail = compose_mail(dat, mode: mode, attachment: attachment_type.to_sym)
|
|
79
|
-
LucaSupport::Mail.new(mail,
|
|
78
|
+
LucaSupport::Mail.new(mail, CONST.pjdir).deliver
|
|
80
79
|
self.class.add_status!(path, 'mail_delivered') if mode.nil?
|
|
81
80
|
end
|
|
82
81
|
end
|
|
@@ -101,9 +100,9 @@ module LucaDeal
|
|
|
101
100
|
|
|
102
101
|
mail = Mail.new
|
|
103
102
|
mail.to = dat.dig('customer', 'to') if mode.nil?
|
|
104
|
-
mail.subject =
|
|
103
|
+
mail.subject = CONST.config.dig('fee', 'mail_subject') || 'Your Report is available'
|
|
105
104
|
if mode == :preview
|
|
106
|
-
mail.cc =
|
|
105
|
+
mail.cc = CONST.config.dig('mail', 'preview') || CONST.config.dig('mail', 'from')
|
|
107
106
|
mail.subject = '[preview] ' + mail.subject
|
|
108
107
|
end
|
|
109
108
|
mail.text_part = Mail::Part.new(body: render_erb(search_template('fee-report-mail.txt.erb')), charset: 'UTF-8')
|
|
@@ -224,10 +223,10 @@ module LucaDeal
|
|
|
224
223
|
__dir__
|
|
225
224
|
end
|
|
226
225
|
|
|
227
|
-
# TODO: load labels from
|
|
226
|
+
# TODO: load labels from CONST.config before country defaults
|
|
228
227
|
#
|
|
229
228
|
def export_labels
|
|
230
|
-
case
|
|
229
|
+
case CONST.confg['country']
|
|
231
230
|
when 'jp'
|
|
232
231
|
{
|
|
233
232
|
debit: { fee: '支払手数料', tax: '支払手数料', deduction: '未払費用' },
|
|
@@ -245,9 +244,9 @@ module LucaDeal
|
|
|
245
244
|
#
|
|
246
245
|
def set_company
|
|
247
246
|
{}.tap do |h|
|
|
248
|
-
h['name'] =
|
|
249
|
-
h['address'] =
|
|
250
|
-
h['address2'] =
|
|
247
|
+
h['name'] = CONST.config.dig('company', 'name')
|
|
248
|
+
h['address'] = CONST.config.dig('company', 'address')
|
|
249
|
+
h['address2'] = CONST.config.dig('company', 'address2')
|
|
251
250
|
end
|
|
252
251
|
end
|
|
253
252
|
|
|
@@ -281,9 +280,9 @@ module LucaDeal
|
|
|
281
280
|
# load Tax Rate from config.
|
|
282
281
|
#
|
|
283
282
|
def load_tax_rate(name)
|
|
284
|
-
return 0 if
|
|
283
|
+
return 0 if CONST.config.dig('tax_rate', name).nil?
|
|
285
284
|
|
|
286
|
-
BigDecimal(take_current(
|
|
285
|
+
BigDecimal(take_current(CONST.config['tax_rate'], name).to_s)
|
|
287
286
|
end
|
|
288
287
|
|
|
289
288
|
# Fees are unique contract_id in each month
|
data/lib/luca_deal/invoice.rb
CHANGED
|
@@ -6,7 +6,6 @@ require 'yaml'
|
|
|
6
6
|
require 'pathname'
|
|
7
7
|
require 'bigdecimal'
|
|
8
8
|
require 'luca_support/code'
|
|
9
|
-
require 'luca_support/config'
|
|
10
9
|
require 'luca_support/mail'
|
|
11
10
|
require 'luca_deal/contract'
|
|
12
11
|
require 'luca_record'
|
|
@@ -69,9 +68,9 @@ module LucaDeal
|
|
|
69
68
|
|
|
70
69
|
mail = Mail.new
|
|
71
70
|
mail.to = dat.dig('customer', 'to') if mode.nil?
|
|
72
|
-
mail.subject =
|
|
71
|
+
mail.subject = LucaRecord::CONST.config.dig('invoice', 'mail_subject') || 'Your Invoice is available'
|
|
73
72
|
if mode == :preview
|
|
74
|
-
mail.cc =
|
|
73
|
+
mail.cc = LucaRecord::CONST.config.dig('mail', 'preview') || LucaRecord::CONST.config.dig('mail', 'from')
|
|
75
74
|
mail.subject = '[preview] ' + mail.subject
|
|
76
75
|
end
|
|
77
76
|
mail.text_part = Mail::Part.new(body: render_erb(search_template('invoice-mail.txt.erb')), charset: 'UTF-8')
|
|
@@ -284,7 +283,7 @@ module LucaDeal
|
|
|
284
283
|
end
|
|
285
284
|
@invoices = res.values
|
|
286
285
|
end
|
|
287
|
-
@company =
|
|
286
|
+
@company = LucaRecord::CONST.config.dig('company', 'name')
|
|
288
287
|
@legend = if mode == 'full'
|
|
289
288
|
'[S] Settled, [P] Partially settled, [O] Overpaid'
|
|
290
289
|
else
|
|
@@ -297,10 +296,10 @@ module LucaDeal
|
|
|
297
296
|
end
|
|
298
297
|
|
|
299
298
|
mail = Mail.new
|
|
300
|
-
mail.to =
|
|
299
|
+
mail.to = LucaRecord::CONST.config.dig('mail', 'preview') || LucaRecord::CONST.config.dig('mail', 'from')
|
|
301
300
|
mail.subject = 'Check monthly payment list'
|
|
302
301
|
mail.html_part = Mail::Part.new(body: render_erb(search_template('monthly-payment-list.html.erb')), content_type: 'text/html; charset=UTF-8')
|
|
303
|
-
LucaSupport::Mail.new(mail,
|
|
302
|
+
LucaSupport::Mail.new(mail, LucaRecord::CONST.pjdir).deliver
|
|
304
303
|
end
|
|
305
304
|
|
|
306
305
|
def export_json
|
|
@@ -421,9 +420,9 @@ module LucaDeal
|
|
|
421
420
|
end
|
|
422
421
|
|
|
423
422
|
def deliver_one(invoice, path, mode: nil, attachment_type: nil)
|
|
424
|
-
attachment_type ||=
|
|
423
|
+
attachment_type ||= LucaRecord::CONST.config.dig('invoice', 'attachment') || :html
|
|
425
424
|
mail = compose_mail(invoice, mode: mode, attachment: attachment_type.to_sym)
|
|
426
|
-
LucaSupport::Mail.new(mail,
|
|
425
|
+
LucaSupport::Mail.new(mail, LucaRecord::CONST.pjdir).deliver
|
|
427
426
|
self.class.add_status!(path, 'mail_delivered') if mode.nil?
|
|
428
427
|
end
|
|
429
428
|
|
|
@@ -431,10 +430,10 @@ module LucaDeal
|
|
|
431
430
|
__dir__
|
|
432
431
|
end
|
|
433
432
|
|
|
434
|
-
# TODO: load labels from
|
|
433
|
+
# TODO: load labels from LucaRecord::CONST.config before country defaults
|
|
435
434
|
#
|
|
436
435
|
def export_labels
|
|
437
|
-
case
|
|
436
|
+
case LucaRecord::CONST.config['country']
|
|
438
437
|
when 'jp'
|
|
439
438
|
{
|
|
440
439
|
debit: { items: '売掛金', tax: '売掛金' },
|
|
@@ -452,9 +451,9 @@ module LucaDeal
|
|
|
452
451
|
#
|
|
453
452
|
def set_company
|
|
454
453
|
{}.tap do |h|
|
|
455
|
-
h['name'] =
|
|
456
|
-
h['address'] =
|
|
457
|
-
h['address2'] =
|
|
454
|
+
h['name'] = LucaRecord::CONST.config.dig('company', 'name')
|
|
455
|
+
h['address'] = LucaRecord::CONST.config.dig('company', 'address')
|
|
456
|
+
h['address2'] = LucaRecord::CONST.config.dig('company', 'address2')
|
|
458
457
|
end
|
|
459
458
|
end
|
|
460
459
|
|
|
@@ -477,9 +476,9 @@ module LucaDeal
|
|
|
477
476
|
# load Tax Rate from config.
|
|
478
477
|
#
|
|
479
478
|
def load_tax_rate(name)
|
|
480
|
-
return 0 if
|
|
479
|
+
return 0 if LucaRecord::CONST.config.dig('tax_rate', name).nil?
|
|
481
480
|
|
|
482
|
-
BigDecimal(take_current(
|
|
481
|
+
BigDecimal(take_current(LucaRecord::CONST.config['tax_rate'], name).to_s)
|
|
483
482
|
end
|
|
484
483
|
|
|
485
484
|
def attachment_name(dat, type)
|
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.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chuma Takahiro
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-01-10 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.
|
|
19
|
+
version: 0.7.0
|
|
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.
|
|
26
|
+
version: 0.7.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: bundler
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -103,7 +103,7 @@ metadata:
|
|
|
103
103
|
homepage_uri: https://github.com/chumaltd/luca/tree/master/lucadeal
|
|
104
104
|
source_code_uri: https://github.com/chumaltd/luca/tree/master/lucadeal
|
|
105
105
|
changelog_uri: https://github.com/chumaltd/luca/tree/master/lucadeal/CHANGELOG.md
|
|
106
|
-
post_install_message:
|
|
106
|
+
post_install_message:
|
|
107
107
|
rdoc_options: []
|
|
108
108
|
require_paths:
|
|
109
109
|
- lib
|
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
119
119
|
version: '0'
|
|
120
120
|
requirements: []
|
|
121
121
|
rubygems_version: 3.4.10
|
|
122
|
-
signing_key:
|
|
122
|
+
signing_key:
|
|
123
123
|
specification_version: 4
|
|
124
124
|
summary: Deal with contracts
|
|
125
125
|
test_files: []
|