Class: ShellDataReportingApIs::SearchStatementOfAccount

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

Overview

SearchStatementOfAccount Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(statement_of_account_id = SKIP, so_a_reference_number = SKIP, statement_date = SKIP, payer_id = SKIP, payer_number = SKIP, amount_due = SKIP, amount_overdue = SKIP, currency_code = SKIP, currency_symbol = SKIP, due_date = SKIP, invoiced_on_behalf_of = SKIP, status = SKIP, gross_amount_customer_currency = SKIP, document_reference_number = SKIP) ⇒ SearchStatementOfAccount

Returns a new instance of SearchStatementOfAccount.



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 141

def initialize( = SKIP, so_a_reference_number = SKIP,
               statement_date = SKIP, payer_id = SKIP, payer_number = SKIP,
               amount_due = SKIP, amount_overdue = SKIP,
               currency_code = SKIP, currency_symbol = SKIP,
               due_date = SKIP, invoiced_on_behalf_of = SKIP, status = SKIP,
               gross_amount_customer_currency = SKIP,
               document_reference_number = SKIP)
  @statement_of_account_id =  unless  == SKIP
  @so_a_reference_number = so_a_reference_number unless so_a_reference_number == SKIP
  @statement_date = statement_date unless statement_date == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @amount_due = amount_due unless amount_due == SKIP
  @amount_overdue = amount_overdue unless amount_overdue == SKIP
  @currency_code = currency_code unless currency_code == SKIP
  @currency_symbol = currency_symbol unless currency_symbol == SKIP
  @due_date = due_date unless due_date == SKIP
  @invoiced_on_behalf_of = invoiced_on_behalf_of unless invoiced_on_behalf_of == SKIP
  @status = status unless status == SKIP
  unless gross_amount_customer_currency == SKIP
    @gross_amount_customer_currency =
      gross_amount_customer_currency
  end
  unless document_reference_number == SKIP
    @document_reference_number =
      document_reference_number
  end
end

Instance Attribute Details

#amount_dueFloat

Invoiced amount and due for payment

Returns:

  • (Float)


35
36
37
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 35

def amount_due
  @amount_due
end

#amount_overdueFloat

Invoiced amount and overdue for payment.

Returns:

  • (Float)


39
40
41
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 39

def amount_overdue
  @amount_overdue
end

#currency_codeString

ISO code of SOA currency.

Returns:

  • (String)


43
44
45
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 43

def currency_code
  @currency_code
end

#currency_symbolString

Symbol of SOA currency. Example: €

Returns:

  • (String)


48
49
50
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 48

def currency_symbol
  @currency_symbol
end

#document_reference_numberString

Document reference number fetched

Returns:

  • (String)


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

def document_reference_number
  @document_reference_number
end

#due_dateString

Due date for payment. Format: yyyyMMdd Note: • Clients to convert this to appropriate DateTime type. • SoA due date is considered as the latest due date of the invoices within the SoA

Returns:

  • (String)


56
57
58
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 56

def due_date
  @due_date
end

#gross_amount_customer_currencyFloat

Total gross amount in customer currency.

Returns:

  • (Float)


75
76
77
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 75

def gross_amount_customer_currency
  @gross_amount_customer_currency
end

#invoiced_on_behalf_ofString

ISO code of the country i.e., UK, DE, MY, etc. This is the value of the first invoice within the SoA. It may not be same for all the invoices within the SoA.

Returns:

  • (String)


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

def invoiced_on_behalf_of
  @invoiced_on_behalf_of
end

#payer_idInteger

Payment customer id of the customer.

Returns:

  • (Integer)


27
28
29
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 27

def payer_id
  @payer_id
end

#payer_numberString

Payment customer number.

Returns:

  • (String)


31
32
33
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 31

def payer_number
  @payer_number
end

#so_a_reference_numberString

Statement of account reference

Returns:

  • (String)


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

def so_a_reference_number
  @so_a_reference_number
end

#statement_dateString

Date on which the SOA was generated. Format: yyyyMMdd

Returns:

  • (String)


23
24
25
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 23

def statement_date
  @statement_date
end

#statement_of_account_idInteger

Statement of account identifier

Returns:

  • (Integer)


14
15
16
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 14

def 
  @statement_of_account_id
end

#statusString

Status of the document. Valid values –

  1. Paid – Fully paid all Invoices with in the SOA.

  2. Overdue – At least one invoice payment due date is less than current

date with in the SOA.

  1. Due – At least one invoice is due for payment and is within the due

date. There is no invoice overdue for payment.

Returns:

  • (String)


71
72
73
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 71

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 171

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   =
    hash.key?('StatementOfAccountId') ? hash['StatementOfAccountId'] : SKIP
  so_a_reference_number =
    hash.key?('SoAReferenceNumber') ? hash['SoAReferenceNumber'] : SKIP
  statement_date = hash.key?('StatementDate') ? hash['StatementDate'] : SKIP
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
  amount_due = hash.key?('AmountDue') ? hash['AmountDue'] : SKIP
  amount_overdue = hash.key?('AmountOverdue') ? hash['AmountOverdue'] : SKIP
  currency_code = hash.key?('CurrencyCode') ? hash['CurrencyCode'] : SKIP
  currency_symbol =
    hash.key?('CurrencySymbol') ? hash['CurrencySymbol'] : SKIP
  due_date = hash.key?('DueDate') ? hash['DueDate'] : SKIP
  invoiced_on_behalf_of =
    hash.key?('InvoicedOnBehalfOf') ? hash['InvoicedOnBehalfOf'] : SKIP
  status = hash.key?('Status') ? hash['Status'] : SKIP
  gross_amount_customer_currency =
    hash.key?('GrossAmountCustomerCurrency') ? hash['GrossAmountCustomerCurrency'] : SKIP
  document_reference_number =
    hash.key?('DocumentReferenceNumber') ? hash['DocumentReferenceNumber'] : SKIP

  # Create object from extracted values.
  SearchStatementOfAccount.new(,
                               so_a_reference_number,
                               statement_date,
                               payer_id,
                               payer_number,
                               amount_due,
                               amount_overdue,
                               currency_code,
                               currency_symbol,
                               due_date,
                               invoiced_on_behalf_of,
                               status,
                               gross_amount_customer_currency,
                               document_reference_number)
end

.namesObject

A mapping from model property names to API property names.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 82

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['statement_of_account_id'] = 'StatementOfAccountId'
  @_hash['so_a_reference_number'] = 'SoAReferenceNumber'
  @_hash['statement_date'] = 'StatementDate'
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['amount_due'] = 'AmountDue'
  @_hash['amount_overdue'] = 'AmountOverdue'
  @_hash['currency_code'] = 'CurrencyCode'
  @_hash['currency_symbol'] = 'CurrencySymbol'
  @_hash['due_date'] = 'DueDate'
  @_hash['invoiced_on_behalf_of'] = 'InvoicedOnBehalfOf'
  @_hash['status'] = 'Status'
  @_hash['gross_amount_customer_currency'] = 'GrossAmountCustomerCurrency'
  @_hash['document_reference_number'] = 'DocumentReferenceNumber'
  @_hash
end

.nullablesObject

An array for nullable fields



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 122

def self.nullables
  %w[
    statement_of_account_id
    so_a_reference_number
    statement_date
    payer_id
    payer_number
    amount_due
    amount_overdue
    currency_code
    currency_symbol
    due_date
    invoiced_on_behalf_of
    status
    gross_amount_customer_currency
    document_reference_number
  ]
end

.optionalsObject

An array for optional fields



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb', line 102

def self.optionals
  %w[
    statement_of_account_id
    so_a_reference_number
    statement_date
    payer_id
    payer_number
    amount_due
    amount_overdue
    currency_code
    currency_symbol
    due_date
    invoiced_on_behalf_of
    status
    gross_amount_customer_currency
    document_reference_number
  ]
end