Module: Clinvoice
- Defined in:
- lib/clinvoice.rb,
lib/clinvoice/data.rb,
lib/clinvoice/helper.rb,
lib/clinvoice/version.rb,
lib/clinvoice/generate_pdf.rb,
lib/clinvoice/render_items.rb,
lib/clinvoice/render_notes.rb,
lib/clinvoice/render_title.rb,
lib/clinvoice/render_total.rb,
lib/clinvoice/render_basic_info.rb,
lib/clinvoice/initialize_template.rb,
lib/clinvoice/generate_next_template.rb,
lib/clinvoice/render_name_and_address.rb
Defined Under Namespace
Modules: GenerateNextTemplate, GeneratePDF, Helper, InitializeTemplate, RenderBasicInfo, RenderItems, RenderNameAndAddress, RenderNotes, RenderTitle, RenderTotal
Classes: Data
Constant Summary
collapse
- VERSION =
'2.4.0'
Class Method Summary
collapse
Class Method Details
.show_usage_and_exit! ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/clinvoice.rb', line 27
def self.show_usage_and_exit!
puts <<~USAGE
Usage:
clinvoice init <datafile> # starts a new template with id 1 and empty entries.
clinvoice new <filename> # generates a pdf invoice based on a data file `yml`.
clinvoice next <datafile> # generates the next data file `yml`, based on the last one.
Args:
- datafile: the yaml template without number and extention, example 'doge' ('doge-*.yml' templates)
- filename: the yaml template with number but without extention, example 'doge-3' ('doge-3.yml' templates)
Examples / Flow:
1 - First lets create a new client template:
`$ clinvoice init doge-client`
This will create a `doge-client-1.yml` data file, lets edit it and generate our pdf invoice.
2 - Edit the data file:
`$ vim doge-client-1.yml`
3 - Now we can generate our pdf invoice based on the data file
`$ clinvoice new doge-client-1`
This will create a `doge-client-1.pdf` file based on the data file `doge-client-1.yml`.
4 - Generate a next datafile
`$ clinvoice next doge-client`
This will create a `doge-client-2.yml` data file, based on the last data file: id is incremented,
`issue_date` and `due_date` are advanced by one month, and any "Mon YYYY" occurrences in item
descriptions (example: "Aug 2026") are advanced by one month too. Everything else is copied as is.
The new file is opened in $EDITOR, if set.
USAGE
exit
end
|