Class: ShellDataReportingApIs::SearchDocumentsInvoice

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

Overview

SearchDocumentsInvoice Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(document_reference = SKIP, invoice_number = SKIP, payer_name = SKIP, account_number = SKIP, account_name = SKIP, document_type = SKIP, gross_amount = SKIP, net_amount = SKIP, tax_amount = SKIP, currency_code = SKIP, invoice_status = SKIP, invoice_date = SKIP, due_date = SKIP, vat_country_iso_code = SKIP) ⇒ SearchDocumentsInvoice

Returns a new instance of SearchDocumentsInvoice.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 135

def initialize(document_reference = SKIP, invoice_number = SKIP,
               payer_name = SKIP,  = SKIP,
                = SKIP, document_type = SKIP,
               gross_amount = SKIP, net_amount = SKIP, tax_amount = SKIP,
               currency_code = SKIP, invoice_status = SKIP,
               invoice_date = SKIP, due_date = SKIP,
               vat_country_iso_code = SKIP)
  @document_reference = document_reference unless document_reference == SKIP
  @invoice_number = invoice_number unless invoice_number == SKIP
  @payer_name = payer_name unless payer_name == SKIP
  @account_number =  unless  == SKIP
  @account_name =  unless  == SKIP
  @document_type = document_type unless document_type == SKIP
  @gross_amount = gross_amount unless gross_amount == SKIP
  @net_amount = net_amount unless net_amount == SKIP
  @tax_amount = tax_amount unless tax_amount == SKIP
  @currency_code = currency_code unless currency_code == SKIP
  @invoice_status = invoice_status unless invoice_status == SKIP
  @invoice_date = invoice_date unless invoice_date == SKIP
  @due_date = due_date unless due_date == SKIP
  @vat_country_iso_code = vat_country_iso_code unless vat_country_iso_code == SKIP
end

Instance Attribute Details

#account_nameString

Invoice account name

Returns:

  • (String)


34
35
36
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 34

def 
  @account_name
end

#account_numberString

Account Number Example: GB99215176

Returns:

  • (String)


30
31
32
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 30

def 
  @account_number
end

#currency_codeString

Included tax amount in the invoice

Returns:

  • (String)


58
59
60
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 58

def currency_code
  @currency_code
end

#document_referenceInteger

Unique Invoice Reference id of the invoice for downloading the zip file containing PDF and proofing elements. Example: 123456

Returns:

  • (Integer)


16
17
18
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 16

def document_reference
  @document_reference
end

#document_typeString

Document type String containing one of the following values: • NAT (National) • INT (International) • SOA (Statement of Account)

Returns:

  • (String)


42
43
44
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 42

def document_type
  @document_type
end

#due_dateString

Included tax amount in the invoice

Returns:

  • (String)


70
71
72
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 70

def due_date
  @due_date
end

#gross_amountFloat

Included tax amount in the invoice

Returns:

  • (Float)


46
47
48
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 46

def gross_amount
  @gross_amount
end

#invoice_dateString

Included tax amount in the invoice

Returns:

  • (String)


66
67
68
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 66

def invoice_date
  @invoice_date
end

#invoice_numberString

Payment customer number. Example: GB000000123

Returns:

  • (String)


21
22
23
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 21

def invoice_number
  @invoice_number
end

#invoice_statusString

Included tax amount in the invoice

Returns:

  • (String)


62
63
64
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 62

def invoice_status
  @invoice_status
end

#net_amountFloat

Included tax amount in the invoice

Returns:

  • (Float)


50
51
52
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 50

def net_amount
  @net_amount
end

#payer_nameString

Customer payer name

Returns:

  • (String)


25
26
27
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 25

def payer_name
  @payer_name
end

#tax_amountFloat

Included tax amount in the invoice

Returns:

  • (Float)


54
55
56
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 54

def tax_amount
  @tax_amount
end

#vat_country_iso_codeString

Included tax amount in the invoice

Returns:

  • (String)


74
75
76
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 74

def vat_country_iso_code
  @vat_country_iso_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 159

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  document_reference =
    hash.key?('DocumentReference') ? hash['DocumentReference'] : SKIP
  invoice_number = hash.key?('InvoiceNumber') ? hash['InvoiceNumber'] : SKIP
  payer_name = hash.key?('PayerName') ? hash['PayerName'] : SKIP
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
   = hash.key?('AccountName') ? hash['AccountName'] : SKIP
  document_type = hash.key?('DocumentType') ? hash['DocumentType'] : SKIP
  gross_amount = hash.key?('GrossAmount') ? hash['GrossAmount'] : SKIP
  net_amount = hash.key?('NetAmount') ? hash['NetAmount'] : SKIP
  tax_amount = hash.key?('TaxAmount') ? hash['TaxAmount'] : SKIP
  currency_code = hash.key?('CurrencyCode') ? hash['CurrencyCode'] : SKIP
  invoice_status = hash.key?('InvoiceStatus') ? hash['InvoiceStatus'] : SKIP
  invoice_date = hash.key?('InvoiceDate') ? hash['InvoiceDate'] : SKIP
  due_date = hash.key?('DueDate') ? hash['DueDate'] : SKIP
  vat_country_iso_code =
    hash.key?('VATCountryISOCode') ? hash['VATCountryISOCode'] : SKIP

  # Create object from extracted values.
  SearchDocumentsInvoice.new(document_reference,
                             invoice_number,
                             payer_name,
                             ,
                             ,
                             document_type,
                             gross_amount,
                             net_amount,
                             tax_amount,
                             currency_code,
                             invoice_status,
                             invoice_date,
                             due_date,
                             vat_country_iso_code)
end

.namesObject

A mapping from model property names to API property names.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 77

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['document_reference'] = 'DocumentReference'
  @_hash['invoice_number'] = 'InvoiceNumber'
  @_hash['payer_name'] = 'PayerName'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['account_name'] = 'AccountName'
  @_hash['document_type'] = 'DocumentType'
  @_hash['gross_amount'] = 'GrossAmount'
  @_hash['net_amount'] = 'NetAmount'
  @_hash['tax_amount'] = 'TaxAmount'
  @_hash['currency_code'] = 'CurrencyCode'
  @_hash['invoice_status'] = 'InvoiceStatus'
  @_hash['invoice_date'] = 'InvoiceDate'
  @_hash['due_date'] = 'DueDate'
  @_hash['vat_country_iso_code'] = 'VATCountryISOCode'
  @_hash
end

.nullablesObject

An array for nullable fields



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 117

def self.nullables
  %w[
    invoice_number
    payer_name
    account_number
    account_name
    document_type
    gross_amount
    net_amount
    tax_amount
    currency_code
    invoice_status
    invoice_date
    due_date
    vat_country_iso_code
  ]
end

.optionalsObject

An array for optional fields



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb', line 97

def self.optionals
  %w[
    document_reference
    invoice_number
    payer_name
    account_number
    account_name
    document_type
    gross_amount
    net_amount
    tax_amount
    currency_code
    invoice_status
    invoice_date
    due_date
    vat_country_iso_code
  ]
end