Class: WorkingTimes::Invoice
- Inherits:
-
Object
- Object
- WorkingTimes::Invoice
- Includes:
- Config
- Defined in:
- lib/working_times/invoice.rb
Overview
Class about creating invoice This class is designed to build data_dir/invoices/current_term/invoice.tex from data_dir/invoices/template.tex
Constant Summary collapse
- WDAYS =
%w[日 月 火 水 木 金 土].freeze
Instance Attribute Summary collapse
-
#company ⇒ Object
readonly
Returns the value of attribute company.
-
#path_template ⇒ Object
readonly
Returns the value of attribute path_template.
-
#salary_per_hour ⇒ Object
readonly
Returns the value of attribute salary_per_hour.
-
#tax_rate ⇒ Object
readonly
Returns the value of attribute tax_rate.
Instance Method Summary collapse
- #build ⇒ Object
- #generate ⇒ Object
-
#initialize ⇒ Invoice
constructor
path_template : String salary_per_hour : Integer tax_rate : Float company : String.
Constructor Details
#initialize ⇒ Invoice
path_template : String salary_per_hour : Integer tax_rate : Float company : String
17 18 19 20 21 22 23 24 |
# File 'lib/working_times/invoice.rb', line 17 def initialize h_invoice_info = invoice_info @path_template = h_invoice_info['template'] @salary_per_hour = h_invoice_info['salaryPerHour'] @tax_rate = h_invoice_info['taxRate'] @company = h_invoice_info['company'] end |
Instance Attribute Details
#company ⇒ Object (readonly)
Returns the value of attribute company.
7 8 9 |
# File 'lib/working_times/invoice.rb', line 7 def company @company end |
#path_template ⇒ Object (readonly)
Returns the value of attribute path_template.
7 8 9 |
# File 'lib/working_times/invoice.rb', line 7 def path_template @path_template end |
#salary_per_hour ⇒ Object (readonly)
Returns the value of attribute salary_per_hour.
7 8 9 |
# File 'lib/working_times/invoice.rb', line 7 def salary_per_hour @salary_per_hour end |
#tax_rate ⇒ Object (readonly)
Returns the value of attribute tax_rate.
7 8 9 |
# File 'lib/working_times/invoice.rb', line 7 def tax_rate @tax_rate end |
Instance Method Details
#build ⇒ Object
32 33 34 35 |
# File 'lib/working_times/invoice.rb', line 32 def build puts 'Currently, it is not available to build pdf with latexmk.' puts 'Wait for new version!' end |
#generate ⇒ Object
26 27 28 29 30 |
# File 'lib/working_times/invoice.rb', line 26 def generate create_dir_invoice_current_term makeup_worktable generate_invoice_from_template end |