Class: ShellDataReportingApIs::InvoicesSummaries

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

Overview

InvoicesSummaries Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(amount_due = SKIP, amount_not_overdue = SKIP, amount_overdue = SKIP, amount_paid = SKIP, billing_currency_code = SKIP, billing_currency_symbol = SKIP, outstanding_balance = SKIP, payment_due_date = SKIP, summary_document_date = SKIP, total_billing_documents = SKIP, total_gross_amount_billing_currency = SKIP, total_net_amount_billing_currency = SKIP, total_summary_documents = SKIP, total_vat_amount_billing_currency = SKIP) ⇒ InvoicesSummaries

Returns a new instance of InvoicesSummaries.



134
135
136
137
138
139
140
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
# File 'lib/shell_data_reporting_ap_is/models/invoices_summaries.rb', line 134

def initialize(amount_due = SKIP, amount_not_overdue = SKIP,
               amount_overdue = SKIP, amount_paid = SKIP,
               billing_currency_code = SKIP, billing_currency_symbol = SKIP,
               outstanding_balance = SKIP, payment_due_date = SKIP,
               summary_document_date = SKIP, total_billing_documents = SKIP,
               total_gross_amount_billing_currency = SKIP,
               total_net_amount_billing_currency = SKIP,
               total_summary_documents = SKIP,
               total_vat_amount_billing_currency = SKIP)
  @amount_due = amount_due unless amount_due == SKIP
  @amount_not_overdue = amount_not_overdue unless amount_not_overdue == SKIP
  @amount_overdue = amount_overdue unless amount_overdue == SKIP
  @amount_paid = amount_paid unless amount_paid == SKIP
  @billing_currency_code = billing_currency_code unless billing_currency_code == SKIP
  @billing_currency_symbol = billing_currency_symbol unless billing_currency_symbol == SKIP
  @outstanding_balance = outstanding_balance unless outstanding_balance == SKIP
  @payment_due_date = payment_due_date unless payment_due_date == SKIP
  @summary_document_date = summary_document_date unless summary_document_date == SKIP
  @total_billing_documents = total_billing_documents unless total_billing_documents == SKIP
  unless total_gross_amount_billing_currency == SKIP
    @total_gross_amount_billing_currency =
      total_gross_amount_billing_currency
  end
  unless total_net_amount_billing_currency == SKIP
    @total_net_amount_billing_currency =
      total_net_amount_billing_currency
  end
  @total_summary_documents = total_summary_documents unless total_summary_documents == SKIP
  unless total_vat_amount_billing_currency == SKIP
    @total_vat_amount_billing_currency =
      total_vat_amount_billing_currency
  end
end

Instance Attribute Details

#amount_dueFloat

Amount due from last summary document date.

Returns:

  • (Float)


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

def amount_due
  @amount_due
end

#amount_not_overdueFloat

Amount that are due from past summary documents.

Returns:

  • (Float)


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

def amount_not_overdue
  @amount_not_overdue
end

#amount_overdueFloat

Amount that are overdue from past summary documents.

Returns:

  • (Float)


22
23
24
# File 'lib/shell_data_reporting_ap_is/models/invoices_summaries.rb', line 22

def amount_overdue
  @amount_overdue
end

#amount_paidFloat

Total amount paid in billing currency.

Returns:

  • (Float)


26
27
28
# File 'lib/shell_data_reporting_ap_is/models/invoices_summaries.rb', line 26

def amount_paid
  @amount_paid
end

#billing_currency_codeString

Billing currency ISO code.

Returns:

  • (String)


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

def billing_currency_code
  @billing_currency_code
end

#billing_currency_symbolString

Billing currency symbol. Example: €

Returns:

  • (String)


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

def billing_currency_symbol
  @billing_currency_symbol
end

#outstanding_balanceFloat

Current outstanding balance amount

Returns:

  • (Float)


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

def outstanding_balance
  @outstanding_balance
end

#payment_due_dateString

Payment due date. Format: YYYYMMDD

Returns:

  • (String)


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

def payment_due_date
  @payment_due_date
end

#summary_document_dateString

Summary document date. Format: YYYYMMDD

Returns:

  • (String)


49
50
51
# File 'lib/shell_data_reporting_ap_is/models/invoices_summaries.rb', line 49

def summary_document_date
  @summary_document_date
end

#total_billing_documentsInteger

Total number of invoices generated on this date.

Returns:

  • (Integer)


53
54
55
# File 'lib/shell_data_reporting_ap_is/models/invoices_summaries.rb', line 53

def total_billing_documents
  @total_billing_documents
end

#total_gross_amount_billing_currencyFloat

Total gross amount in billing currency.

Returns:

  • (Float)


57
58
59
# File 'lib/shell_data_reporting_ap_is/models/invoices_summaries.rb', line 57

def total_gross_amount_billing_currency
  @total_gross_amount_billing_currency
end

#total_net_amount_billing_currencyFloat

Total net amount in billing currency.

Returns:

  • (Float)


61
62
63
# File 'lib/shell_data_reporting_ap_is/models/invoices_summaries.rb', line 61

def total_net_amount_billing_currency
  @total_net_amount_billing_currency
end

#total_summary_documentsInteger

Total number of summary documents generated on this date.

Returns:

  • (Integer)


65
66
67
# File 'lib/shell_data_reporting_ap_is/models/invoices_summaries.rb', line 65

def total_summary_documents
  @total_summary_documents
end

#total_vat_amount_billing_currencyFloat

Total VAT amount in billing currency.

Returns:

  • (Float)


69
70
71
# File 'lib/shell_data_reporting_ap_is/models/invoices_summaries.rb', line 69

def total_vat_amount_billing_currency
  @total_vat_amount_billing_currency
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
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/invoices_summaries.rb', line 169

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  amount_due = hash.key?('AmountDue') ? hash['AmountDue'] : SKIP
  amount_not_overdue =
    hash.key?('AmountNotOverdue') ? hash['AmountNotOverdue'] : SKIP
  amount_overdue = hash.key?('AmountOverdue') ? hash['AmountOverdue'] : SKIP
  amount_paid = hash.key?('AmountPaid') ? hash['AmountPaid'] : SKIP
  billing_currency_code =
    hash.key?('BillingCurrencyCode') ? hash['BillingCurrencyCode'] : SKIP
  billing_currency_symbol =
    hash.key?('BillingCurrencySymbol') ? hash['BillingCurrencySymbol'] : SKIP
  outstanding_balance =
    hash.key?('OutstandingBalance') ? hash['OutstandingBalance'] : SKIP
  payment_due_date =
    hash.key?('PaymentDueDate') ? hash['PaymentDueDate'] : SKIP
  summary_document_date =
    hash.key?('SummaryDocumentDate') ? hash['SummaryDocumentDate'] : SKIP
  total_billing_documents =
    hash.key?('TotalBillingDocuments') ? hash['TotalBillingDocuments'] : SKIP
  total_gross_amount_billing_currency =
    hash.key?('TotalGrossAmountBillingCurrency') ? hash['TotalGrossAmountBillingCurrency'] : SKIP
  total_net_amount_billing_currency =
    hash.key?('TotalNetAmountBillingCurrency') ? hash['TotalNetAmountBillingCurrency'] : SKIP
  total_summary_documents =
    hash.key?('TotalSummaryDocuments') ? hash['TotalSummaryDocuments'] : SKIP
  total_vat_amount_billing_currency =
    hash.key?('TotalVATAmountBillingCurrency') ? hash['TotalVATAmountBillingCurrency'] : SKIP

  # Create object from extracted values.
  InvoicesSummaries.new(amount_due,
                        amount_not_overdue,
                        amount_overdue,
                        amount_paid,
                        billing_currency_code,
                        billing_currency_symbol,
                        outstanding_balance,
                        payment_due_date,
                        summary_document_date,
                        total_billing_documents,
                        total_gross_amount_billing_currency,
                        total_net_amount_billing_currency,
                        total_summary_documents,
                        total_vat_amount_billing_currency)
end

.namesObject

A mapping from model property names to API property names.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/shell_data_reporting_ap_is/models/invoices_summaries.rb', line 72

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['amount_due'] = 'AmountDue'
  @_hash['amount_not_overdue'] = 'AmountNotOverdue'
  @_hash['amount_overdue'] = 'AmountOverdue'
  @_hash['amount_paid'] = 'AmountPaid'
  @_hash['billing_currency_code'] = 'BillingCurrencyCode'
  @_hash['billing_currency_symbol'] = 'BillingCurrencySymbol'
  @_hash['outstanding_balance'] = 'OutstandingBalance'
  @_hash['payment_due_date'] = 'PaymentDueDate'
  @_hash['summary_document_date'] = 'SummaryDocumentDate'
  @_hash['total_billing_documents'] = 'TotalBillingDocuments'
  @_hash['total_gross_amount_billing_currency'] =
    'TotalGrossAmountBillingCurrency'
  @_hash['total_net_amount_billing_currency'] =
    'TotalNetAmountBillingCurrency'
  @_hash['total_summary_documents'] = 'TotalSummaryDocuments'
  @_hash['total_vat_amount_billing_currency'] =
    'TotalVATAmountBillingCurrency'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  %w[
    amount_due
    amount_not_overdue
    amount_overdue
    amount_paid
    billing_currency_code
    billing_currency_symbol
    outstanding_balance
    payment_due_date
    summary_document_date
    total_billing_documents
    total_gross_amount_billing_currency
    total_net_amount_billing_currency
    total_summary_documents
    total_vat_amount_billing_currency
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    amount_due
    amount_not_overdue
    amount_overdue
    amount_paid
    billing_currency_code
    billing_currency_symbol
    outstanding_balance
    payment_due_date
    summary_document_date
    total_billing_documents
    total_gross_amount_billing_currency
    total_net_amount_billing_currency
    total_summary_documents
    total_vat_amount_billing_currency
  ]
end