Class: ShellDataReportingApIs::BonusHistory

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

Overview

BonusHistory Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(payer_id = SKIP, payer_number = SKIP, payer_short_name = SKIP, payer_full_name = SKIP, account_id = SKIP, account_number = SKIP, account_short_name = SKIP, account_full_name = SKIP, invoice_account_id = SKIP, invoice_account_number = SKIP, invoice_account_short_name = SKIP, invoice_account_full_name = SKIP, fee_rule_id = SKIP, fee_rule_description = SKIP, from_date = SKIP, to_date = SKIP, bonus_paid_to = SKIP, fee_item_id = SKIP, fee_rule_basis = SKIP, fee_item_currency_code = SKIP, fee_item_currency_symbol = SKIP, prorated_volume = SKIP, total_volume = SKIP, fee_product = SKIP, invoice_gross_amount = SKIP, invoice_net_amount = SKIP, invoice_vat_amount = SKIP, is_fee_cancelled = SKIP, fee_item_tier_prorated_volume = SKIP, fee_item_tier_total_volume = SKIP, tier_minimum = SKIP, tier_rate = SKIP) ⇒ BonusHistory

Returns a new instance of BonusHistory.



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
333
334
335
336
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 275

def initialize(payer_id = SKIP, payer_number = SKIP,
               payer_short_name = SKIP, payer_full_name = SKIP,
                = SKIP,  = SKIP,
                = SKIP,  = SKIP,
                = SKIP,  = SKIP,
                = SKIP,
                = SKIP, fee_rule_id = SKIP,
               fee_rule_description = SKIP, from_date = SKIP,
               to_date = SKIP, bonus_paid_to = SKIP, fee_item_id = SKIP,
               fee_rule_basis = SKIP, fee_item_currency_code = SKIP,
               fee_item_currency_symbol = SKIP, prorated_volume = SKIP,
               total_volume = SKIP, fee_product = SKIP,
               invoice_gross_amount = SKIP, invoice_net_amount = SKIP,
               invoice_vat_amount = SKIP, is_fee_cancelled = SKIP,
               fee_item_tier_prorated_volume = SKIP,
               fee_item_tier_total_volume = SKIP, tier_minimum = SKIP,
               tier_rate = SKIP)
  @payer_id = payer_id unless payer_id == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @payer_short_name = payer_short_name unless payer_short_name == SKIP
  @payer_full_name = payer_full_name unless payer_full_name == SKIP
  @account_id =  unless  == SKIP
  @account_number =  unless  == SKIP
  @account_short_name =  unless  == SKIP
  @account_full_name =  unless  == SKIP
  @invoice_account_id =  unless  == SKIP
  @invoice_account_number =  unless  == SKIP
  unless  == SKIP
    @invoice_account_short_name =
      
  end
  unless  == SKIP
    @invoice_account_full_name =
      
  end
  @fee_rule_id = fee_rule_id unless fee_rule_id == SKIP
  @fee_rule_description = fee_rule_description unless fee_rule_description == SKIP
  @from_date = from_date unless from_date == SKIP
  @to_date = to_date unless to_date == SKIP
  @bonus_paid_to = bonus_paid_to unless bonus_paid_to == SKIP
  @fee_item_id = fee_item_id unless fee_item_id == SKIP
  @fee_rule_basis = fee_rule_basis unless fee_rule_basis == SKIP
  @fee_item_currency_code = fee_item_currency_code unless fee_item_currency_code == SKIP
  @fee_item_currency_symbol = fee_item_currency_symbol unless fee_item_currency_symbol == SKIP
  @prorated_volume = prorated_volume unless prorated_volume == SKIP
  @total_volume = total_volume unless total_volume == SKIP
  @fee_product = fee_product unless fee_product == SKIP
  @invoice_gross_amount = invoice_gross_amount unless invoice_gross_amount == SKIP
  @invoice_net_amount = invoice_net_amount unless invoice_net_amount == SKIP
  @invoice_vat_amount = invoice_vat_amount unless invoice_vat_amount == SKIP
  @is_fee_cancelled = is_fee_cancelled unless is_fee_cancelled == SKIP
  unless fee_item_tier_prorated_volume == SKIP
    @fee_item_tier_prorated_volume =
      fee_item_tier_prorated_volume
  end
  unless fee_item_tier_total_volume == SKIP
    @fee_item_tier_total_volume =
      fee_item_tier_total_volume
  end
  @tier_minimum = tier_minimum unless tier_minimum == SKIP
  @tier_rate = tier_rate unless tier_rate == SKIP
end

Instance Attribute Details

#account_full_nameString

Account full name.

Returns:

  • (String)


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

def 
  @account_full_name
end

#account_idInteger

Account Id

Returns:

  • (Integer)


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

def 
  @account_id
end

#account_numberString

Account Number of the selected payer.

Returns:

  • (String)


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

def 
  @account_number
end

#account_short_nameString

Account short name.

Returns:

  • (String)


38
39
40
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 38

def 
  @account_short_name
end

#bonus_paid_toString

Specifies how the bonus was paid back. Format: ID-Description Example: 1-Pay to Payer 2-Pay to invoice levels before the payer 3-Pay to specific customer 4-Pay to Association Customer 5-Pay to Associated Customers

Returns:

  • (String)


88
89
90
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 88

def bonus_paid_to
  @bonus_paid_to
end

#fee_item_currency_codeString

ISO currency code of the currency in which Bonus is paid. Example: GBP

Returns:

  • (String)


106
107
108
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 106

def fee_item_currency_code
  @fee_item_currency_code
end

#fee_item_currency_symbolString

Currency symbol of the currency in which Bonus is paid.

Returns:

  • (String)


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

def fee_item_currency_symbol
  @fee_item_currency_symbol
end

#fee_item_idInteger

Bonus fee item identifier.

Returns:

  • (Integer)


92
93
94
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 92

def fee_item_id
  @fee_item_id
end

#fee_item_tier_prorated_volumeFloat

Prorated volume in the bonus fee item tier.

Returns:

  • (Float)


147
148
149
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 147

def fee_item_tier_prorated_volume
  @fee_item_tier_prorated_volume
end

#fee_item_tier_total_volumeFloat

Total volume in the bonus fee item tier.

Returns:

  • (Float)


151
152
153
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 151

def fee_item_tier_total_volume
  @fee_item_tier_total_volume
end

#fee_productString

Product as shown in the invoice for the bonus paid. Format: ID-Description Example: 1562-Bonus diesel Shell Netherlands on agreed site(s)

Returns:

  • (String)


125
126
127
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 125

def fee_product
  @fee_product
end

#fee_rule_basisString

Fee Rule Basis of the bonus fee item. Format: ID-Description Example: 1-Currency Per Unit 2-Percentage of Uplift 3-Lump Sum

Returns:

  • (String)


101
102
103
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 101

def fee_rule_basis
  @fee_rule_basis
end

#fee_rule_descriptionString

Bonus or association bonus configuration description that is associated to the bonus fee item

Returns:

  • (String)


67
68
69
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 67

def fee_rule_description
  @fee_rule_description
end

#fee_rule_idString

Bonus or association bonus configuration identifier

Returns:

  • (String)


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

def fee_rule_id
  @fee_rule_id
end

#from_dateString

Bonus was calculated from this date. Format: YYYYMMDD

Returns:

  • (String)


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

def from_date
  @from_date
end

#invoice_account_full_nameString

Invoice Account full name.

Returns:

  • (String)


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

def 
  @invoice_account_full_name
end

#invoice_account_idInteger

Invoice Account Id

Returns:

  • (Integer)


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

def 
  @invoice_account_id
end

#invoice_account_numberString

Invoice Account Number of the selected payer.

Returns:

  • (String)


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

def 
  @invoice_account_number
end

#invoice_account_short_nameString

Invoice Account short name.

Returns:

  • (String)


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

def 
  @invoice_account_short_name
end

#invoice_gross_amountFloat

Gross Amount – Bonus Paid including VAT as shown on the Invoice

Returns:

  • (Float)


129
130
131
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 129

def invoice_gross_amount
  @invoice_gross_amount
end

#invoice_net_amountFloat

Net Amount – Bonus Paid excluding VAT as shown on the Invoice

Returns:

  • (Float)


133
134
135
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 133

def invoice_net_amount
  @invoice_net_amount
end

#invoice_vat_amountFloat

VAT calculated for the bonus paid as shown on the Invoice

Returns:

  • (Float)


137
138
139
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 137

def invoice_vat_amount
  @invoice_vat_amount
end

#is_fee_cancelledTrueClass | FalseClass

True/False True if bonus is generated but cancelled. When true, consider this as not paid.

Returns:

  • (TrueClass | FalseClass)


143
144
145
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 143

def is_fee_cancelled
  @is_fee_cancelled
end

#payer_full_nameString

Payer full name.

Returns:

  • (String)


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

def payer_full_name
  @payer_full_name
end

#payer_idInteger

Payer Id

Returns:

  • (Integer)


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

def payer_id
  @payer_id
end

#payer_numberString

Payer Number of the selected payer

Returns:

  • (String)


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

def payer_number
  @payer_number
end

#payer_short_nameString

Payer short name.

Returns:

  • (String)


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

def payer_short_name
  @payer_short_name
end

#prorated_volumeFloat

Prorated volume considered under the account as configured for the bonus association.

Returns:

  • (Float)


115
116
117
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 115

def prorated_volume
  @prorated_volume
end

#tier_minimumInteger

Tier minimum value considered for calculation

Returns:

  • (Integer)


155
156
157
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 155

def tier_minimum
  @tier_minimum
end

#tier_rateFloat

Tier rate considered for calculation

Returns:

  • (Float)


159
160
161
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 159

def tier_rate
  @tier_rate
end

#to_dateString

Bonus was calculated till this date. Format: YYYYMMDD

Returns:

  • (String)


77
78
79
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 77

def to_date
  @to_date
end

#total_volumeFloat

Total volume considered for calculating the bonus.

Returns:

  • (Float)


119
120
121
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 119

def total_volume
  @total_volume
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 339

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
  payer_short_name =
    hash.key?('PayerShortName') ? hash['PayerShortName'] : SKIP
  payer_full_name =
    hash.key?('PayerFullName') ? hash['PayerFullName'] : SKIP
   = hash.key?('AccountId') ? hash['AccountId'] : SKIP
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
   =
    hash.key?('AccountShortName') ? hash['AccountShortName'] : SKIP
   =
    hash.key?('AccountFullName') ? hash['AccountFullName'] : SKIP
   =
    hash.key?('InvoiceAccountId') ? hash['InvoiceAccountId'] : SKIP
   =
    hash.key?('InvoiceAccountNumber') ? hash['InvoiceAccountNumber'] : SKIP
   =
    hash.key?('InvoiceAccountShortName') ? hash['InvoiceAccountShortName'] : SKIP
   =
    hash.key?('InvoiceAccountFullName') ? hash['InvoiceAccountFullName'] : SKIP
  fee_rule_id = hash.key?('FeeRuleId') ? hash['FeeRuleId'] : SKIP
  fee_rule_description =
    hash.key?('FeeRuleDescription') ? hash['FeeRuleDescription'] : SKIP
  from_date = hash.key?('FromDate') ? hash['FromDate'] : SKIP
  to_date = hash.key?('ToDate') ? hash['ToDate'] : SKIP
  bonus_paid_to = hash.key?('BonusPaidTo') ? hash['BonusPaidTo'] : SKIP
  fee_item_id = hash.key?('FeeItemId') ? hash['FeeItemId'] : SKIP
  fee_rule_basis = hash.key?('FeeRuleBasis') ? hash['FeeRuleBasis'] : SKIP
  fee_item_currency_code =
    hash.key?('FeeItemCurrencyCode') ? hash['FeeItemCurrencyCode'] : SKIP
  fee_item_currency_symbol =
    hash.key?('FeeItemCurrencySymbol') ? hash['FeeItemCurrencySymbol'] : SKIP
  prorated_volume =
    hash.key?('ProratedVolume') ? hash['ProratedVolume'] : SKIP
  total_volume = hash.key?('TotalVolume') ? hash['TotalVolume'] : SKIP
  fee_product = hash.key?('FeeProduct') ? hash['FeeProduct'] : SKIP
  invoice_gross_amount =
    hash.key?('InvoiceGrossAmount') ? hash['InvoiceGrossAmount'] : SKIP
  invoice_net_amount =
    hash.key?('InvoiceNetAmount') ? hash['InvoiceNetAmount'] : SKIP
  invoice_vat_amount =
    hash.key?('InvoiceVATAmount') ? hash['InvoiceVATAmount'] : SKIP
  is_fee_cancelled =
    hash.key?('IsFeeCancelled') ? hash['IsFeeCancelled'] : SKIP
  fee_item_tier_prorated_volume =
    hash.key?('FeeItemTierProratedVolume') ? hash['FeeItemTierProratedVolume'] : SKIP
  fee_item_tier_total_volume =
    hash.key?('FeeItemTierTotalVolume') ? hash['FeeItemTierTotalVolume'] : SKIP
  tier_minimum = hash.key?('TierMinimum') ? hash['TierMinimum'] : SKIP
  tier_rate = hash.key?('TierRate') ? hash['TierRate'] : SKIP

  # Create object from extracted values.
  BonusHistory.new(payer_id,
                   payer_number,
                   payer_short_name,
                   payer_full_name,
                   ,
                   ,
                   ,
                   ,
                   ,
                   ,
                   ,
                   ,
                   fee_rule_id,
                   fee_rule_description,
                   from_date,
                   to_date,
                   bonus_paid_to,
                   fee_item_id,
                   fee_rule_basis,
                   fee_item_currency_code,
                   fee_item_currency_symbol,
                   prorated_volume,
                   total_volume,
                   fee_product,
                   invoice_gross_amount,
                   invoice_net_amount,
                   invoice_vat_amount,
                   is_fee_cancelled,
                   fee_item_tier_prorated_volume,
                   fee_item_tier_total_volume,
                   tier_minimum,
                   tier_rate)
end

.namesObject

A mapping from model property names to API property names.



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
196
197
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 162

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['payer_short_name'] = 'PayerShortName'
  @_hash['payer_full_name'] = 'PayerFullName'
  @_hash['account_id'] = 'AccountId'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['account_short_name'] = 'AccountShortName'
  @_hash['account_full_name'] = 'AccountFullName'
  @_hash['invoice_account_id'] = 'InvoiceAccountId'
  @_hash['invoice_account_number'] = 'InvoiceAccountNumber'
  @_hash['invoice_account_short_name'] = 'InvoiceAccountShortName'
  @_hash['invoice_account_full_name'] = 'InvoiceAccountFullName'
  @_hash['fee_rule_id'] = 'FeeRuleId'
  @_hash['fee_rule_description'] = 'FeeRuleDescription'
  @_hash['from_date'] = 'FromDate'
  @_hash['to_date'] = 'ToDate'
  @_hash['bonus_paid_to'] = 'BonusPaidTo'
  @_hash['fee_item_id'] = 'FeeItemId'
  @_hash['fee_rule_basis'] = 'FeeRuleBasis'
  @_hash['fee_item_currency_code'] = 'FeeItemCurrencyCode'
  @_hash['fee_item_currency_symbol'] = 'FeeItemCurrencySymbol'
  @_hash['prorated_volume'] = 'ProratedVolume'
  @_hash['total_volume'] = 'TotalVolume'
  @_hash['fee_product'] = 'FeeProduct'
  @_hash['invoice_gross_amount'] = 'InvoiceGrossAmount'
  @_hash['invoice_net_amount'] = 'InvoiceNetAmount'
  @_hash['invoice_vat_amount'] = 'InvoiceVATAmount'
  @_hash['is_fee_cancelled'] = 'IsFeeCancelled'
  @_hash['fee_item_tier_prorated_volume'] = 'FeeItemTierProratedVolume'
  @_hash['fee_item_tier_total_volume'] = 'FeeItemTierTotalVolume'
  @_hash['tier_minimum'] = 'TierMinimum'
  @_hash['tier_rate'] = 'TierRate'
  @_hash
end

.nullablesObject

An array for nullable fields



238
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
271
272
273
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 238

def self.nullables
  %w[
    payer_id
    payer_number
    payer_short_name
    payer_full_name
    account_id
    account_number
    account_short_name
    account_full_name
    invoice_account_id
    invoice_account_number
    invoice_account_short_name
    invoice_account_full_name
    fee_rule_id
    fee_rule_description
    from_date
    to_date
    bonus_paid_to
    fee_item_id
    fee_rule_basis
    fee_item_currency_code
    fee_item_currency_symbol
    prorated_volume
    total_volume
    fee_product
    invoice_gross_amount
    invoice_net_amount
    invoice_vat_amount
    is_fee_cancelled
    fee_item_tier_prorated_volume
    fee_item_tier_total_volume
    tier_minimum
    tier_rate
  ]
end

.optionalsObject

An array for optional fields



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/shell_data_reporting_ap_is/models/bonus_history.rb', line 200

def self.optionals
  %w[
    payer_id
    payer_number
    payer_short_name
    payer_full_name
    account_id
    account_number
    account_short_name
    account_full_name
    invoice_account_id
    invoice_account_number
    invoice_account_short_name
    invoice_account_full_name
    fee_rule_id
    fee_rule_description
    from_date
    to_date
    bonus_paid_to
    fee_item_id
    fee_rule_basis
    fee_item_currency_code
    fee_item_currency_symbol
    prorated_volume
    total_volume
    fee_product
    invoice_gross_amount
    invoice_net_amount
    invoice_vat_amount
    is_fee_cancelled
    fee_item_tier_prorated_volume
    fee_item_tier_total_volume
    tier_minimum
    tier_rate
  ]
end