Class: ShellDataReportingApIs::InvoiceSearchRequestFilters

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

Overview

InvoiceSearchRequestFilters Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(col_co_id = SKIP, payer_id = SKIP, payer_number = SKIP, invoice_id = SKIP, invoice_number = SKIP, from_date = SKIP, to_date = SKIP, invoice_date = SKIP, summary_document_id = SKIP, summary_document_number = SKIP, statement_of_account_id = SKIP, so_a_reference_number = SKIP, period = SKIP, invoice_status = SKIP, invoiced_on_behalf_of = SKIP, include_e_invoice_details = SKIP, col_co_code = SKIP, accounts = SKIP, type = SKIP) ⇒ InvoiceSearchRequestFilters

Returns a new instance of InvoiceSearchRequestFilters.



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 239

def initialize(col_co_id = SKIP, payer_id = SKIP, payer_number = SKIP,
               invoice_id = SKIP, invoice_number = SKIP, from_date = SKIP,
               to_date = SKIP, invoice_date = SKIP,
               summary_document_id = SKIP, summary_document_number = SKIP,
                = SKIP, so_a_reference_number = SKIP,
               period = SKIP, invoice_status = SKIP,
               invoiced_on_behalf_of = SKIP,
               include_e_invoice_details = SKIP, col_co_code = SKIP,
               accounts = SKIP, type = SKIP)
  @col_co_id = col_co_id unless col_co_id == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @invoice_id = invoice_id unless invoice_id == SKIP
  @invoice_number = invoice_number unless invoice_number == SKIP
  @from_date = from_date unless from_date == SKIP
  @to_date = to_date unless to_date == SKIP
  @invoice_date = invoice_date unless invoice_date == SKIP
  @summary_document_id = summary_document_id unless summary_document_id == SKIP
  @summary_document_number = summary_document_number unless summary_document_number == SKIP
  @statement_of_account_id =  unless  == SKIP
  @so_a_reference_number = so_a_reference_number unless so_a_reference_number == SKIP
  @period = period unless period == SKIP
  @invoice_status = invoice_status unless invoice_status == SKIP
  @invoiced_on_behalf_of = invoiced_on_behalf_of unless invoiced_on_behalf_of == SKIP
  unless include_e_invoice_details == SKIP
    @include_e_invoice_details =
      include_e_invoice_details
  end
  @col_co_code = col_co_code unless col_co_code == SKIP
  @accounts = accounts unless accounts == SKIP
  @type = type unless type == SKIP
end

Instance Attribute Details

#accountsArray[Accounts]

Collecting Company Code of the selected payer. Mandatory - It is mandatory field to external source ATOS for E-invoicing.

Example: 86-Philippines 5-UK

Returns:



154
155
156
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 154

def accounts
  @accounts
end

#col_co_codeInteger

Collecting Company Code of the selected payer. Mandatory - It is mandatory field to external source ATOS for E-invoicing.

Example: 86-Philippines 5-UK

Returns:

  • (Integer)


145
146
147
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 145

def col_co_code
  @col_co_code
end

#col_co_idInteger

Collecting Company Id of the selected payer. Optional. Example: 1-Philippines 5-UK

Returns:

  • (Integer)


18
19
20
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 18

def col_co_id
  @col_co_id
end

#from_dateString

Invoice date searched from this date. Optional. This input is a search criterion, if given. Date format: yyyyMMdd Example: 20170830 Note: This criterion is ignored if ‘Period’ is given. Also, this criterion is ignored if ‘ToDate’ is not provided.

Returns:

  • (String)


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

def from_date
  @from_date
end

#include_e_invoice_detailsTrueClass | FalseClass

Whether to include the additional invoice details in the API response. Optional. Default value “False”. The parameters that are populated • DocumentReference • AdditionalDocuments The above fields will not be present in the response when the respective data is not available in the source system.

Returns:

  • (TrueClass | FalseClass)


136
137
138
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 136

def include_e_invoice_details
  @include_e_invoice_details
end

#invoice_dateString

Date of invoicing. Optional. This input is a search criterion, if given. Date format: yyyyMMdd Example: 20170830

Returns:

  • (String)


72
73
74
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 72

def invoice_date
  @invoice_date
end

#invoice_idInteger

Invoice id. Optional. This input is a search criterion, if given. Example: 1

Returns:

  • (Integer)


37
38
39
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 37

def invoice_id
  @invoice_id
end

#invoice_numberString

Invoice number. Optional. This input is a search criterion, if given. Example: 0123456789

Returns:

  • (String)


44
45
46
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 44

def invoice_number
  @invoice_number
end

#invoice_statusString

Status of the invoice. Valid values – • Due – Invoices due for payment and is within the due date. • Paid – Fully paid Invoices. • Overdue – Invoices due of payment and has crossed the due date. • CreditNote – Credit notes • CreditStatement Optional. This input is a search criterion, if given.

Returns:

  • (String)


121
122
123
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 121

def invoice_status
  @invoice_status
end

#invoiced_on_behalf_ofString

ISO code of the country i.e., UK, DE, MY, etc. Optional

Returns:

  • (String)


126
127
128
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 126

def invoiced_on_behalf_of
  @invoiced_on_behalf_of
end

#payer_idInteger

Payer Id of the selected payer. Optional if PayerNumber is passed else Mandatory Example: 123456

Returns:

  • (Integer)


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

def payer_id
  @payer_id
end

#payer_numberString

Payer Number of the selected payer. Optional if PayerId is passed else Mandatory Example: GB000000123

Returns:

  • (String)


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

def payer_number
  @payer_number
end

#periodInteger

Invoice date search period. Valid values –

  1. Last 7 days – Issued in last 7 days.

  2. Last 30 days – Issued in last 30 days.

  3. Last 90 days – Issued in last 90 days.

Optional. This input is a search criterion, if given. Example: 1

Returns:

  • (Integer)


110
111
112
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 110

def period
  @period
end

#so_a_reference_numberString

Statement of Account reference number of the payment customer. Optional. This input is a search criterion, if given. Example: 123

Returns:

  • (String)


100
101
102
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 100

def so_a_reference_number
  @so_a_reference_number
end

#statement_of_account_idString

Statement of Account Id of the payment customer. Optional. This input is a search criterion, if given. Example: 1

Returns:

  • (String)


93
94
95
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 93

def 
  @statement_of_account_id
end

#summary_document_idInteger

Summary document id Optional. This input is a search criterion, if given. Example: 1

Returns:

  • (Integer)


79
80
81
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 79

def summary_document_id
  @summary_document_id
end

#summary_document_numberString

Summary document number Optional. This input is a search criterion, if given. Example: ‘0/CZ0000000123456/2017’

Returns:

  • (String)


86
87
88
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 86

def summary_document_number
  @summary_document_number
end

#to_dateString

Invoice date searched until this date. Optional. This input is a search criterion, if given. Date format: yyyyMMdd Example: 20170830 Note: This criterion is ignored if ‘Period’ is given. Also, this criterion is ignored if ‘FromDate’ is not provided.

Returns:

  • (String)


64
65
66
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 64

def to_date
  @to_date
end

#typeString

Invoice type. Allowed values – • Original – Original document. • Reversal – Reversed document. • Replacement – Replaced document. Optional. (When not passed all invoice, types are considered for search) This input is a search criterion, if given. Example: Original

Returns:

  • (String)


164
165
166
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 164

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 273

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : SKIP
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
  invoice_id = hash.key?('InvoiceId') ? hash['InvoiceId'] : SKIP
  invoice_number = hash.key?('InvoiceNumber') ? hash['InvoiceNumber'] : SKIP
  from_date = hash.key?('FromDate') ? hash['FromDate'] : SKIP
  to_date = hash.key?('ToDate') ? hash['ToDate'] : SKIP
  invoice_date = hash.key?('InvoiceDate') ? hash['InvoiceDate'] : SKIP
  summary_document_id =
    hash.key?('SummaryDocumentId') ? hash['SummaryDocumentId'] : SKIP
  summary_document_number =
    hash.key?('SummaryDocumentNumber') ? hash['SummaryDocumentNumber'] : SKIP
   =
    hash.key?('StatementOfAccountId') ? hash['StatementOfAccountId'] : SKIP
  so_a_reference_number =
    hash.key?('SoAReferenceNumber') ? hash['SoAReferenceNumber'] : SKIP
  period = hash.key?('Period') ? hash['Period'] : SKIP
  invoice_status = hash.key?('InvoiceStatus') ? hash['InvoiceStatus'] : SKIP
  invoiced_on_behalf_of =
    hash.key?('InvoicedOnBehalfOf') ? hash['InvoicedOnBehalfOf'] : SKIP
  include_e_invoice_details =
    hash.key?('IncludeEInvoiceDetails') ? hash['IncludeEInvoiceDetails'] : SKIP
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : SKIP
  # Parameter is an array, so we need to iterate through it
  accounts = nil
  unless hash['Accounts'].nil?
    accounts = []
    hash['Accounts'].each do |structure|
      accounts << (Accounts.from_hash(structure) if structure)
    end
  end

  accounts = SKIP unless hash.key?('Accounts')
  type = hash.key?('Type') ? hash['Type'] : SKIP

  # Create object from extracted values.
  InvoiceSearchRequestFilters.new(col_co_id,
                                  payer_id,
                                  payer_number,
                                  invoice_id,
                                  invoice_number,
                                  from_date,
                                  to_date,
                                  invoice_date,
                                  summary_document_id,
                                  summary_document_number,
                                  ,
                                  so_a_reference_number,
                                  period,
                                  invoice_status,
                                  invoiced_on_behalf_of,
                                  include_e_invoice_details,
                                  col_co_code,
                                  accounts,
                                  type)
end

.namesObject

A mapping from model property names to API property names.



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 167

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['invoice_id'] = 'InvoiceId'
  @_hash['invoice_number'] = 'InvoiceNumber'
  @_hash['from_date'] = 'FromDate'
  @_hash['to_date'] = 'ToDate'
  @_hash['invoice_date'] = 'InvoiceDate'
  @_hash['summary_document_id'] = 'SummaryDocumentId'
  @_hash['summary_document_number'] = 'SummaryDocumentNumber'
  @_hash['statement_of_account_id'] = 'StatementOfAccountId'
  @_hash['so_a_reference_number'] = 'SoAReferenceNumber'
  @_hash['period'] = 'Period'
  @_hash['invoice_status'] = 'InvoiceStatus'
  @_hash['invoiced_on_behalf_of'] = 'InvoicedOnBehalfOf'
  @_hash['include_e_invoice_details'] = 'IncludeEInvoiceDetails'
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['accounts'] = 'Accounts'
  @_hash['type'] = 'Type'
  @_hash
end

.nullablesObject

An array for nullable fields



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 217

def self.nullables
  %w[
    col_co_id
    payer_id
    payer_number
    invoice_id
    invoice_number
    from_date
    to_date
    invoice_date
    summary_document_id
    summary_document_number
    statement_of_account_id
    so_a_reference_number
    period
    invoice_status
    invoiced_on_behalf_of
    include_e_invoice_details
    col_co_code
  ]
end

.optionalsObject

An array for optional fields



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb', line 192

def self.optionals
  %w[
    col_co_id
    payer_id
    payer_number
    invoice_id
    invoice_number
    from_date
    to_date
    invoice_date
    summary_document_id
    summary_document_number
    statement_of_account_id
    so_a_reference_number
    period
    invoice_status
    invoiced_on_behalf_of
    include_e_invoice_details
    col_co_code
    accounts
    type
  ]
end