Class: ShellDataReportingApIs::InvoiceSearchAdditionalDocument

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/invoice_search_additional_document.rb

Overview

Invoice document reference number for the additional invoice files such as KSeF file (Poland). This field is optional, and it will be missing if additional documents are not applicable. Also, it will not be populated if the invoice date is older than 13 months.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(reference = SKIP, type = SKIP, is_applicable = SKIP) ⇒ InvoiceSearchAdditionalDocument

Returns a new instance of InvoiceSearchAdditionalDocument.



57
58
59
60
61
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_additional_document.rb', line 57

def initialize(reference = SKIP, type = SKIP, is_applicable = SKIP)
  @reference = reference unless reference == SKIP
  @type = type unless type == SKIP
  @is_applicable = is_applicable unless is_applicable == SKIP
end

Instance Attribute Details

#is_applicableString

True if a KSeF PDF will be produced for the customer.

Returns:

  • (String)


28
29
30
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_additional_document.rb', line 28

def is_applicable
  @is_applicable
end

#referenceString

Unique ID for the additional invoice document.

Returns:

  • (String)


17
18
19
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_additional_document.rb', line 17

def reference
  @reference
end

#typeString

Type of the additional document. Mandatory Possible values: • KSeF - Applicable for Poland market.

Returns:

  • (String)


24
25
26
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_additional_document.rb', line 24

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_additional_document.rb', line 64

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  reference = hash.key?('Reference') ? hash['Reference'] : SKIP
  type = hash.key?('Type') ? hash['Type'] : SKIP
  is_applicable = hash.key?('IsApplicable') ? hash['IsApplicable'] : SKIP

  # Create object from extracted values.
  InvoiceSearchAdditionalDocument.new(reference,
                                      type,
                                      is_applicable)
end

.namesObject

A mapping from model property names to API property names.



31
32
33
34
35
36
37
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_additional_document.rb', line 31

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['reference'] = 'Reference'
  @_hash['type'] = 'Type'
  @_hash['is_applicable'] = 'IsApplicable'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
52
53
54
55
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_additional_document.rb', line 49

def self.nullables
  %w[
    reference
    type
    is_applicable
  ]
end

.optionalsObject

An array for optional fields



40
41
42
43
44
45
46
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_additional_document.rb', line 40

def self.optionals
  %w[
    reference
    type
    is_applicable
  ]
end