Class: Fiscalizer::Invoice

Inherits:
Object
  • Object
show all
Defined in:
lib/fiscalizer/data_objects/invoice.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid:, time_sent:, pin:, in_vat_system:, time_issued:, consistance_mark:, issued_number:, issued_office:, issued_machine:, summed_total:, payment_method:, operator_pin:, subsequent_delivery:, tax_vat: [], tax_spending: [], tax_other: [], value_tax_liberation: nil, value_tax_margin: nil, value_non_taxable: nil, fees: [], paragon_label: nil, specific_purpose: nil) ⇒ Invoice

rubocop:disable Metrics/ParameterLists, Metrics/AbcSize, Metrics/MethodLength



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fiscalizer/data_objects/invoice.rb', line 4

def initialize(uuid:, time_sent:, pin:, in_vat_system:, time_issued:, consistance_mark:,
               issued_number:, issued_office:, issued_machine:, summed_total:,
               payment_method:, operator_pin:, subsequent_delivery:,
               tax_vat: [], tax_spending: [], tax_other: [],
               value_tax_liberation: nil, value_tax_margin: nil, value_non_taxable: nil,
               fees: [], paragon_label: nil, specific_purpose: nil)

  @uuid = uuid
  @time_sent = time_sent
  @pin = pin
  @in_vat_system = in_vat_system
  @time_issued = time_issued
  @consistance_mark = consistance_mark
  @issued_number = issued_number
  @issued_office = issued_office
  @issued_machine = issued_machine
  @tax_vat = tax_vat
  @tax_spending = tax_spending
  @tax_other = tax_other
  @value_tax_liberation = value_tax_liberation
  @value_tax_margin = value_tax_margin
  @value_non_taxable = value_non_taxable
  @fees = fees
  @summed_total = summed_total
  @payment_method = payment_method
  @operator_pin = operator_pin
  @subsequent_delivery = subsequent_delivery
  @paragon_label = paragon_label
  @specific_purpose = specific_purpose
end

Instance Attribute Details

#consistance_markObject (readonly)

Returns the value of attribute consistance_mark.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def consistance_mark
  @consistance_mark
end

#feesObject (readonly)

Returns the value of attribute fees.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def fees
  @fees
end

#generated_xmlObject

Returns the value of attribute generated_xml.



44
45
46
# File 'lib/fiscalizer/data_objects/invoice.rb', line 44

def generated_xml
  @generated_xml
end

#in_vat_systemObject (readonly)

Returns the value of attribute in_vat_system.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def in_vat_system
  @in_vat_system
end

#issued_machineObject (readonly)

Returns the value of attribute issued_machine.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def issued_machine
  @issued_machine
end

#issued_numberObject (readonly)

Returns the value of attribute issued_number.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def issued_number
  @issued_number
end

#issued_officeObject (readonly)

Returns the value of attribute issued_office.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def issued_office
  @issued_office
end

#operator_pinObject (readonly)

Returns the value of attribute operator_pin.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def operator_pin
  @operator_pin
end

#paragon_labelObject (readonly)

Returns the value of attribute paragon_label.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def paragon_label
  @paragon_label
end

#payment_methodObject (readonly)

Returns the value of attribute payment_method.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def payment_method
  @payment_method
end

#pinObject (readonly)

Returns the value of attribute pin.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def pin
  @pin
end

#security_codeObject

Returns the value of attribute security_code.



44
45
46
# File 'lib/fiscalizer/data_objects/invoice.rb', line 44

def security_code
  @security_code
end

#specific_purposeObject (readonly)

Returns the value of attribute specific_purpose.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def specific_purpose
  @specific_purpose
end

#subsequent_deliveryObject (readonly)

Returns the value of attribute subsequent_delivery.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def subsequent_delivery
  @subsequent_delivery
end

#summed_totalObject (readonly)

Returns the value of attribute summed_total.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def summed_total
  @summed_total
end

#tax_otherObject (readonly)

Returns the value of attribute tax_other.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def tax_other
  @tax_other
end

#tax_spendingObject (readonly)

Returns the value of attribute tax_spending.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def tax_spending
  @tax_spending
end

#tax_vatObject (readonly)

Returns the value of attribute tax_vat.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def tax_vat
  @tax_vat
end

#time_issuedObject (readonly)

Returns the value of attribute time_issued.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def time_issued
  @time_issued
end

#time_sentObject (readonly)

Returns the value of attribute time_sent.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def time_sent
  @time_sent
end

#uuidObject (readonly)

Returns the value of attribute uuid.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def uuid
  @uuid
end

#value_non_taxableObject (readonly)

Returns the value of attribute value_non_taxable.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def value_non_taxable
  @value_non_taxable
end

#value_tax_liberationObject (readonly)

Returns the value of attribute value_tax_liberation.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def value_tax_liberation
  @value_tax_liberation
end

#value_tax_marginObject (readonly)

Returns the value of attribute value_tax_margin.



35
36
37
# File 'lib/fiscalizer/data_objects/invoice.rb', line 35

def value_tax_margin
  @value_tax_margin
end

Instance Method Details

#summed_total_strObject



54
55
56
# File 'lib/fiscalizer/data_objects/invoice.rb', line 54

def summed_total_str
  format_decimal(summed_total)
end

#time_issued_str(separator = 'T') ⇒ Object



46
47
48
# File 'lib/fiscalizer/data_objects/invoice.rb', line 46

def time_issued_str(separator = 'T')
  time_issued.strftime("%d.%m.%Y#{separator}%H:%M:%S")
end

#time_sent_str(separator = 'T') ⇒ Object



50
51
52
# File 'lib/fiscalizer/data_objects/invoice.rb', line 50

def time_sent_str(separator = 'T')
  time_sent.strftime("%d.%m.%Y#{separator}%H:%M:%S")
end

#value_non_taxable_strObject



68
69
70
71
# File 'lib/fiscalizer/data_objects/invoice.rb', line 68

def value_non_taxable_str
  return if value_non_taxable.nil?
  format_decimal(value_non_taxable.round(2))
end

#value_tax_liberation_strObject



58
59
60
61
# File 'lib/fiscalizer/data_objects/invoice.rb', line 58

def value_tax_liberation_str
  return if value_tax_liberation.nil?
  format_decimal(value_tax_liberation.round(2))
end

#value_tax_margin_strObject



63
64
65
66
# File 'lib/fiscalizer/data_objects/invoice.rb', line 63

def value_tax_margin_str
  return if value_tax_margin.nil?
  format_decimal(value_tax_margin.round(2))
end