lucadeal 0.5.1 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/exe/luca-deal +4 -1
- data/lib/luca_deal/invoice.rb +4 -4
- data/lib/luca_deal/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0329c8026c849f9e1733b61b74228df9caf32aaa4cdadeeae1d37c53e26f0bf
|
4
|
+
data.tar.gz: 9375bc8234c762adc5e4217e8d818efd2dd03c4e364ece5f10e749d7e1b3fba6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc530b4d7f9972508fdc646a3922866945744941a23f7e59d8f0316d1068bb5b510b7ae46f3add178894c226634226b0ab757d4b071a2c9b6c7e1e8be7dea39b
|
7
|
+
data.tar.gz: 8d4400303ad62490e2772e45d1199e2772dd098e6f598f0f5a178681af54bf443463cdd1fc638ebf8aa64e0bc117e6bb4a6ce920f73866526ff64631af052752
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## LucaDeal 0.5.3
|
2
|
+
|
3
|
+
* Implement `luca-deal invoices print --sample` option.
|
4
|
+
|
5
|
+
## LucaDeal 0.5.2
|
6
|
+
|
7
|
+
* Fix: Setup project dir for `luca-deal invoice mail`
|
8
|
+
|
1
9
|
## LucaDeal 0.5.1
|
2
10
|
|
3
11
|
* Refine `luca-deal customer list` output: Limit columns to name, address and id.
|
data/exe/luca-deal
CHANGED
@@ -424,12 +424,15 @@ when /invoices?/, 'i'
|
|
424
424
|
opt.banner = 'Usage: luca-deal invoices mail [options] year month [date]'
|
425
425
|
opt.on('--preview', 'send to preview user') { |_v| params['mode'] = 'preview' }
|
426
426
|
args = opt.parse(ARGV)
|
427
|
-
LucaCmd
|
427
|
+
LucaCmd.check_dir(REQUIRED_DIR) do
|
428
|
+
LucaCmd::Invoice.mail(args, params)
|
429
|
+
end
|
428
430
|
end
|
429
431
|
when 'print'
|
430
432
|
OptionParser.new do |opt|
|
431
433
|
opt.banner = 'Usage: luca-deal invoices print [options] <invoice_id | year month>'
|
432
434
|
opt.on('--pdf', 'output PDF invoices. wkhtmlpdf is required') { |_v| params[:output] = :pdf }
|
435
|
+
opt.on('--sample', 'Replace recepient info with issuer info') { |_v| params[:sample] = true }
|
433
436
|
args = opt.parse(ARGV)
|
434
437
|
LucaCmd.check_dir(REQUIRED_DIR) do
|
435
438
|
LucaCmd::Invoice.print(args, params)
|
data/lib/luca_deal/invoice.rb
CHANGED
@@ -47,14 +47,14 @@ module LucaDeal
|
|
47
47
|
if id
|
48
48
|
dat = self.class.find(id)
|
49
49
|
@company = set_company
|
50
|
-
invoice_vars(dat)
|
50
|
+
invoice_vars(dat, params[:sample])
|
51
51
|
File.open(attachment_name(dat, filetype), 'w') do |f|
|
52
52
|
f.puts render_invoice(filetype)
|
53
53
|
end
|
54
54
|
else
|
55
55
|
self.class.asof(@date.year, @date.month) do |dat, _|
|
56
56
|
@company = set_company
|
57
|
-
invoice_vars(dat)
|
57
|
+
invoice_vars(dat, params[:sample])
|
58
58
|
File.open(attachment_name(dat, filetype), 'w') do |f|
|
59
59
|
f.puts render_invoice(filetype)
|
60
60
|
end
|
@@ -410,8 +410,8 @@ module LucaDeal
|
|
410
410
|
|
411
411
|
# set variables for ERB template
|
412
412
|
#
|
413
|
-
def invoice_vars(invoice_dat)
|
414
|
-
@customer = invoice_dat['customer']
|
413
|
+
def invoice_vars(invoice_dat, sample = false)
|
414
|
+
@customer = sample ? @company : invoice_dat['customer']
|
415
415
|
@items = readable(invoice_dat['items'])
|
416
416
|
@subtotal = readable(invoice_dat['subtotal'])
|
417
417
|
@issue_date = invoice_dat['issue_date']
|
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.3
|
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-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lucarecord
|