Class: ProcessDeclIva::ProcessExpenses::EFatura
- Inherits:
-
Object
- Object
- ProcessDeclIva::ProcessExpenses::EFatura
- Defined in:
- lib/process_decl_iva/process_expenses/e_fatura.rb
Instance Attribute Summary collapse
-
#csv ⇒ Object
readonly
Returns the value of attribute csv.
-
#total ⇒ Object
Returns the value of attribute total.
-
#total_vat ⇒ Object
Returns the value of attribute total_vat.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(csv) ⇒ EFatura
constructor
A new instance of EFatura.
Constructor Details
#initialize(csv) ⇒ EFatura
Returns a new instance of EFatura.
31 32 33 34 35 36 37 38 39 |
# File 'lib/process_decl_iva/process_expenses/e_fatura.rb', line 31 def initialize(csv) @csv = CSV.parse( csv, headers: true, converters: %i[numeric_with_currency numeric], liberal_parsing: true, col_sep: ";" ) end |
Instance Attribute Details
#csv ⇒ Object (readonly)
Returns the value of attribute csv.
41 42 43 |
# File 'lib/process_decl_iva/process_expenses/e_fatura.rb', line 41 def csv @csv end |
#total ⇒ Object
Returns the value of attribute total.
42 43 44 |
# File 'lib/process_decl_iva/process_expenses/e_fatura.rb', line 42 def total @total end |
#total_vat ⇒ Object
Returns the value of attribute total_vat.
42 43 44 |
# File 'lib/process_decl_iva/process_expenses/e_fatura.rb', line 42 def total_vat @total_vat end |
Instance Method Details
#call ⇒ Object
44 45 46 47 48 49 |
# File 'lib/process_decl_iva/process_expenses/e_fatura.rb', line 44 def call transform_credit_notes @total = sum_by("Total") @total_vat = sum_by("IVA") end |