xero-ruby 12.4.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/xero-ruby/api/accounting_api.rb +3 -0
- data/lib/xero-ruby/api/finance_api.rb +0 -299
- data/lib/xero-ruby/api/payroll_au_v2_api.rb +751 -0
- data/lib/xero-ruby/models/accounting/prepayment.rb +11 -1
- data/lib/xero-ruby/models/payroll_au/earnings_rate.rb +11 -1
- data/lib/xero-ruby/models/payroll_au/employee.rb +1 -13
- data/lib/xero-ruby/models/payroll_au/leave_line.rb +11 -1
- data/lib/xero-ruby/models/payroll_au/leave_type.rb +14 -4
- data/lib/xero-ruby/models/payroll_au/opening_balance_leave_line.rb +232 -0
- data/lib/xero-ruby/models/payroll_au/opening_balances.rb +1 -1
- data/lib/xero-ruby/models/payroll_au/tax_declaration.rb +14 -4
- data/lib/xero-ruby/models/payroll_au_v2/invalid_field.rb +232 -0
- data/lib/xero-ruby/models/payroll_au_v2/pagination.rb +252 -0
- data/lib/xero-ruby/models/payroll_au_v2/problem.rb +275 -0
- data/lib/xero-ruby/models/payroll_au_v2/timesheet.rb +361 -0
- data/lib/xero-ruby/models/payroll_au_v2/timesheet_line.rb +277 -0
- data/lib/xero-ruby/models/payroll_au_v2/timesheet_line_object.rb +242 -0
- data/lib/xero-ruby/models/payroll_au_v2/timesheet_object.rb +242 -0
- data/lib/xero-ruby/models/payroll_au_v2/timesheets.rb +244 -0
- data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +3 -2
- data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb +3 -2
- data/lib/xero-ruby/version.rb +2 -2
- data/lib/xero-ruby.rb +10 -10
- data/spec/finance/api/finance_api_spec.rb +0 -53
- metadata +386 -396
- data/spec/finance/models/account_usage_response_spec.rb +0 -58
- data/spec/finance/models/account_usage_spec.rb +0 -112
- data/spec/finance/models/history_record_response_spec.rb +0 -64
- data/spec/finance/models/lock_history_model_spec.rb +0 -52
- data/spec/finance/models/lock_history_response_spec.rb +0 -52
- data/spec/finance/models/practice_response_spec.rb +0 -64
- data/spec/finance/models/report_history_model_spec.rb +0 -52
- data/spec/finance/models/report_history_response_spec.rb +0 -52
- data/spec/finance/models/user_activities_response_spec.rb +0 -52
- data/spec/finance/models/user_response_spec.rb +0 -106
|
@@ -53,6 +53,9 @@ module XeroRuby::Accounting
|
|
|
53
53
|
# Returns Invoice number field. Reference field isn't available.
|
|
54
54
|
attr_accessor :reference
|
|
55
55
|
|
|
56
|
+
# Returns Invoice number for prepayment receive document only.
|
|
57
|
+
attr_accessor :invoice_number
|
|
58
|
+
|
|
56
59
|
# UTC timestamp of last update to the prepayment
|
|
57
60
|
attr_accessor :updated_date_utc
|
|
58
61
|
|
|
@@ -118,6 +121,7 @@ module XeroRuby::Accounting
|
|
|
118
121
|
:'total_tax' => :'TotalTax',
|
|
119
122
|
:'total' => :'Total',
|
|
120
123
|
:'reference' => :'Reference',
|
|
124
|
+
:'invoice_number' => :'InvoiceNumber',
|
|
121
125
|
:'updated_date_utc' => :'UpdatedDateUTC',
|
|
122
126
|
:'currency_code' => :'CurrencyCode',
|
|
123
127
|
:'prepayment_id' => :'PrepaymentID',
|
|
@@ -144,6 +148,7 @@ module XeroRuby::Accounting
|
|
|
144
148
|
:'total_tax' => :'BigDecimal',
|
|
145
149
|
:'total' => :'BigDecimal',
|
|
146
150
|
:'reference' => :'String',
|
|
151
|
+
:'invoice_number' => :'String',
|
|
147
152
|
:'updated_date_utc' => :'DateTime',
|
|
148
153
|
:'currency_code' => :'CurrencyCode',
|
|
149
154
|
:'prepayment_id' => :'String',
|
|
@@ -214,6 +219,10 @@ module XeroRuby::Accounting
|
|
|
214
219
|
self.reference = attributes[:'reference']
|
|
215
220
|
end
|
|
216
221
|
|
|
222
|
+
if attributes.key?(:'invoice_number')
|
|
223
|
+
self.invoice_number = attributes[:'invoice_number']
|
|
224
|
+
end
|
|
225
|
+
|
|
217
226
|
if attributes.key?(:'updated_date_utc')
|
|
218
227
|
self.updated_date_utc = attributes[:'updated_date_utc']
|
|
219
228
|
end
|
|
@@ -315,6 +324,7 @@ module XeroRuby::Accounting
|
|
|
315
324
|
total_tax == o.total_tax &&
|
|
316
325
|
total == o.total &&
|
|
317
326
|
reference == o.reference &&
|
|
327
|
+
invoice_number == o.invoice_number &&
|
|
318
328
|
updated_date_utc == o.updated_date_utc &&
|
|
319
329
|
currency_code == o.currency_code &&
|
|
320
330
|
prepayment_id == o.prepayment_id &&
|
|
@@ -336,7 +346,7 @@ module XeroRuby::Accounting
|
|
|
336
346
|
# Calculates hash code according to all attributes.
|
|
337
347
|
# @return [Integer] Hash code
|
|
338
348
|
def hash
|
|
339
|
-
[type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, reference, updated_date_utc, currency_code, prepayment_id, currency_rate, remaining_credit, allocations, payments, applied_amount, has_attachments, attachments].hash
|
|
349
|
+
[type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, reference, invoice_number, updated_date_utc, currency_code, prepayment_id, currency_rate, remaining_credit, allocations, payments, applied_amount, has_attachments, attachments].hash
|
|
340
350
|
end
|
|
341
351
|
|
|
342
352
|
# Builds the object from hash
|
|
@@ -34,6 +34,9 @@ module XeroRuby::PayrollAu
|
|
|
34
34
|
# Boolean to determine if the earnings rate is reportable or exempt from W1
|
|
35
35
|
attr_accessor :is_reportable_as_w1
|
|
36
36
|
|
|
37
|
+
# Optional Boolean to determine if the earnings rate is considered as qualifying earnings for superannuation guarantee calculations. When not specified value is calculated based on earnings type and superannuation settings
|
|
38
|
+
attr_accessor :is_qualifying_earnings
|
|
39
|
+
|
|
37
40
|
# Boolean to determine if the allowance earnings rate contributes towards annual leave rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT
|
|
38
41
|
attr_accessor :allowance_contributes_to_annual_leave_rate
|
|
39
42
|
|
|
@@ -85,6 +88,7 @@ module XeroRuby::PayrollAu
|
|
|
85
88
|
:'is_exempt_from_tax' => :'IsExemptFromTax',
|
|
86
89
|
:'is_exempt_from_super' => :'IsExemptFromSuper',
|
|
87
90
|
:'is_reportable_as_w1' => :'IsReportableAsW1',
|
|
91
|
+
:'is_qualifying_earnings' => :'IsQualifyingEarnings',
|
|
88
92
|
:'allowance_contributes_to_annual_leave_rate' => :'AllowanceContributesToAnnualLeaveRate',
|
|
89
93
|
:'allowance_contributes_to_overtime_rate' => :'AllowanceContributesToOvertimeRate',
|
|
90
94
|
:'earnings_type' => :'EarningsType',
|
|
@@ -111,6 +115,7 @@ module XeroRuby::PayrollAu
|
|
|
111
115
|
:'is_exempt_from_tax' => :'Boolean',
|
|
112
116
|
:'is_exempt_from_super' => :'Boolean',
|
|
113
117
|
:'is_reportable_as_w1' => :'Boolean',
|
|
118
|
+
:'is_qualifying_earnings' => :'Boolean',
|
|
114
119
|
:'allowance_contributes_to_annual_leave_rate' => :'Boolean',
|
|
115
120
|
:'allowance_contributes_to_overtime_rate' => :'Boolean',
|
|
116
121
|
:'earnings_type' => :'EarningsType',
|
|
@@ -167,6 +172,10 @@ module XeroRuby::PayrollAu
|
|
|
167
172
|
self.is_reportable_as_w1 = attributes[:'is_reportable_as_w1']
|
|
168
173
|
end
|
|
169
174
|
|
|
175
|
+
if attributes.key?(:'is_qualifying_earnings')
|
|
176
|
+
self.is_qualifying_earnings = attributes[:'is_qualifying_earnings']
|
|
177
|
+
end
|
|
178
|
+
|
|
170
179
|
if attributes.key?(:'allowance_contributes_to_annual_leave_rate')
|
|
171
180
|
self.allowance_contributes_to_annual_leave_rate = attributes[:'allowance_contributes_to_annual_leave_rate']
|
|
172
181
|
end
|
|
@@ -278,6 +287,7 @@ module XeroRuby::PayrollAu
|
|
|
278
287
|
is_exempt_from_tax == o.is_exempt_from_tax &&
|
|
279
288
|
is_exempt_from_super == o.is_exempt_from_super &&
|
|
280
289
|
is_reportable_as_w1 == o.is_reportable_as_w1 &&
|
|
290
|
+
is_qualifying_earnings == o.is_qualifying_earnings &&
|
|
281
291
|
allowance_contributes_to_annual_leave_rate == o.allowance_contributes_to_annual_leave_rate &&
|
|
282
292
|
allowance_contributes_to_overtime_rate == o.allowance_contributes_to_overtime_rate &&
|
|
283
293
|
earnings_type == o.earnings_type &&
|
|
@@ -303,7 +313,7 @@ module XeroRuby::PayrollAu
|
|
|
303
313
|
# Calculates hash code according to all attributes.
|
|
304
314
|
# @return [Integer] Hash code
|
|
305
315
|
def hash
|
|
306
|
-
[name, account_code, type_of_units, is_exempt_from_tax, is_exempt_from_super, is_reportable_as_w1, allowance_contributes_to_annual_leave_rate, allowance_contributes_to_overtime_rate, earnings_type, earnings_rate_id, rate_type, rate_per_unit, multiplier, accrue_leave, amount, employment_termination_payment_type, updated_date_utc, current_record, allowance_type, allowance_category].hash
|
|
316
|
+
[name, account_code, type_of_units, is_exempt_from_tax, is_exempt_from_super, is_reportable_as_w1, is_qualifying_earnings, allowance_contributes_to_annual_leave_rate, allowance_contributes_to_overtime_rate, earnings_type, earnings_rate_id, rate_type, rate_per_unit, multiplier, accrue_leave, amount, employment_termination_payment_type, updated_date_utc, current_record, allowance_type, allowance_category].hash
|
|
307
317
|
end
|
|
308
318
|
|
|
309
319
|
# Builds the object from hash
|
|
@@ -121,9 +121,6 @@ module XeroRuby::PayrollAu
|
|
|
121
121
|
attr_accessor :leave_balances
|
|
122
122
|
|
|
123
123
|
|
|
124
|
-
attr_accessor :leave_lines
|
|
125
|
-
|
|
126
|
-
|
|
127
124
|
attr_accessor :super_memberships
|
|
128
125
|
|
|
129
126
|
|
|
@@ -191,7 +188,6 @@ module XeroRuby::PayrollAu
|
|
|
191
188
|
:'country_of_residence' => :'CountryOfResidence',
|
|
192
189
|
:'is_stp2_qualified' => :'IsSTP2Qualified',
|
|
193
190
|
:'leave_balances' => :'LeaveBalances',
|
|
194
|
-
:'leave_lines' => :'LeaveLines',
|
|
195
191
|
:'super_memberships' => :'SuperMemberships',
|
|
196
192
|
:'status' => :'Status',
|
|
197
193
|
:'updated_date_utc' => :'UpdatedDateUTC',
|
|
@@ -233,7 +229,6 @@ module XeroRuby::PayrollAu
|
|
|
233
229
|
:'country_of_residence' => :'CountryOfResidence',
|
|
234
230
|
:'is_stp2_qualified' => :'Boolean',
|
|
235
231
|
:'leave_balances' => :'Array<LeaveBalance>',
|
|
236
|
-
:'leave_lines' => :'Array<LeaveLine>',
|
|
237
232
|
:'super_memberships' => :'Array<SuperMembership>',
|
|
238
233
|
:'status' => :'EmployeeStatus',
|
|
239
234
|
:'updated_date_utc' => :'DateTime',
|
|
@@ -384,12 +379,6 @@ module XeroRuby::PayrollAu
|
|
|
384
379
|
end
|
|
385
380
|
end
|
|
386
381
|
|
|
387
|
-
if attributes.key?(:'leave_lines')
|
|
388
|
-
if (value = attributes[:'leave_lines']).is_a?(Array)
|
|
389
|
-
self.leave_lines = value
|
|
390
|
-
end
|
|
391
|
-
end
|
|
392
|
-
|
|
393
382
|
if attributes.key?(:'super_memberships')
|
|
394
383
|
if (value = attributes[:'super_memberships']).is_a?(Array)
|
|
395
384
|
self.super_memberships = value
|
|
@@ -499,7 +488,6 @@ module XeroRuby::PayrollAu
|
|
|
499
488
|
country_of_residence == o.country_of_residence &&
|
|
500
489
|
is_stp2_qualified == o.is_stp2_qualified &&
|
|
501
490
|
leave_balances == o.leave_balances &&
|
|
502
|
-
leave_lines == o.leave_lines &&
|
|
503
491
|
super_memberships == o.super_memberships &&
|
|
504
492
|
status == o.status &&
|
|
505
493
|
updated_date_utc == o.updated_date_utc &&
|
|
@@ -515,7 +503,7 @@ module XeroRuby::PayrollAu
|
|
|
515
503
|
# Calculates hash code according to all attributes.
|
|
516
504
|
# @return [Integer] Hash code
|
|
517
505
|
def hash
|
|
518
|
-
[first_name, last_name, date_of_birth, home_address, start_date, title, middle_names, email, gender, phone, mobile, twitter_user_name, is_authorised_to_approve_leave, is_authorised_to_approve_timesheets, job_title, classification, ordinary_earnings_rate_id, payroll_calendar_id, employee_group_name, employee_id, termination_date, termination_reason, bank_accounts, pay_template, opening_balances, tax_declaration, income_type, employment_type, country_of_residence, is_stp2_qualified, leave_balances,
|
|
506
|
+
[first_name, last_name, date_of_birth, home_address, start_date, title, middle_names, email, gender, phone, mobile, twitter_user_name, is_authorised_to_approve_leave, is_authorised_to_approve_timesheets, job_title, classification, ordinary_earnings_rate_id, payroll_calendar_id, employee_group_name, employee_id, termination_date, termination_reason, bank_accounts, pay_template, opening_balances, tax_declaration, income_type, employment_type, country_of_residence, is_stp2_qualified, leave_balances, super_memberships, status, updated_date_utc, validation_errors].hash
|
|
519
507
|
end
|
|
520
508
|
|
|
521
509
|
# Builds the object from hash
|
|
@@ -31,6 +31,9 @@ module XeroRuby::PayrollAu
|
|
|
31
31
|
# amount of leave line
|
|
32
32
|
attr_accessor :include_superannuation_guarantee_contribution
|
|
33
33
|
|
|
34
|
+
# Optional Boolean to determine if the earnings rate is considered as qualifying earnings for superannuation guarantee calculations. When not specified value is calculated based on superannuation settings
|
|
35
|
+
attr_accessor :is_qualifying_earnings
|
|
36
|
+
|
|
34
37
|
# Number of units for leave line.
|
|
35
38
|
attr_accessor :number_of_units
|
|
36
39
|
|
|
@@ -48,6 +51,7 @@ module XeroRuby::PayrollAu
|
|
|
48
51
|
:'entitlement_final_pay_payout_type' => :'EntitlementFinalPayPayoutType',
|
|
49
52
|
:'employment_termination_payment_type' => :'EmploymentTerminationPaymentType',
|
|
50
53
|
:'include_superannuation_guarantee_contribution' => :'IncludeSuperannuationGuaranteeContribution',
|
|
54
|
+
:'is_qualifying_earnings' => :'IsQualifyingEarnings',
|
|
51
55
|
:'number_of_units' => :'NumberOfUnits',
|
|
52
56
|
:'annual_number_of_units' => :'AnnualNumberOfUnits',
|
|
53
57
|
:'full_time_number_of_units_per_period' => :'FullTimeNumberOfUnitsPerPeriod'
|
|
@@ -62,6 +66,7 @@ module XeroRuby::PayrollAu
|
|
|
62
66
|
:'entitlement_final_pay_payout_type' => :'EntitlementFinalPayPayoutType',
|
|
63
67
|
:'employment_termination_payment_type' => :'EmploymentTerminationPaymentType',
|
|
64
68
|
:'include_superannuation_guarantee_contribution' => :'Boolean',
|
|
69
|
+
:'is_qualifying_earnings' => :'Boolean',
|
|
65
70
|
:'number_of_units' => :'BigDecimal',
|
|
66
71
|
:'annual_number_of_units' => :'BigDecimal',
|
|
67
72
|
:'full_time_number_of_units_per_period' => :'BigDecimal'
|
|
@@ -103,6 +108,10 @@ module XeroRuby::PayrollAu
|
|
|
103
108
|
self.include_superannuation_guarantee_contribution = attributes[:'include_superannuation_guarantee_contribution']
|
|
104
109
|
end
|
|
105
110
|
|
|
111
|
+
if attributes.key?(:'is_qualifying_earnings')
|
|
112
|
+
self.is_qualifying_earnings = attributes[:'is_qualifying_earnings']
|
|
113
|
+
end
|
|
114
|
+
|
|
106
115
|
if attributes.key?(:'number_of_units')
|
|
107
116
|
self.number_of_units = attributes[:'number_of_units']
|
|
108
117
|
end
|
|
@@ -139,6 +148,7 @@ module XeroRuby::PayrollAu
|
|
|
139
148
|
entitlement_final_pay_payout_type == o.entitlement_final_pay_payout_type &&
|
|
140
149
|
employment_termination_payment_type == o.employment_termination_payment_type &&
|
|
141
150
|
include_superannuation_guarantee_contribution == o.include_superannuation_guarantee_contribution &&
|
|
151
|
+
is_qualifying_earnings == o.is_qualifying_earnings &&
|
|
142
152
|
number_of_units == o.number_of_units &&
|
|
143
153
|
annual_number_of_units == o.annual_number_of_units &&
|
|
144
154
|
full_time_number_of_units_per_period == o.full_time_number_of_units_per_period
|
|
@@ -153,7 +163,7 @@ module XeroRuby::PayrollAu
|
|
|
153
163
|
# Calculates hash code according to all attributes.
|
|
154
164
|
# @return [Integer] Hash code
|
|
155
165
|
def hash
|
|
156
|
-
[leave_type_id, calculation_type, entitlement_final_pay_payout_type, employment_termination_payment_type, include_superannuation_guarantee_contribution, number_of_units, annual_number_of_units, full_time_number_of_units_per_period].hash
|
|
166
|
+
[leave_type_id, calculation_type, entitlement_final_pay_payout_type, employment_termination_payment_type, include_superannuation_guarantee_contribution, is_qualifying_earnings, number_of_units, annual_number_of_units, full_time_number_of_units_per_period].hash
|
|
157
167
|
end
|
|
158
168
|
|
|
159
169
|
# Builds the object from hash
|
|
@@ -49,6 +49,9 @@ module XeroRuby::PayrollAu
|
|
|
49
49
|
# Set this to indicate that the leave type is exempt from superannuation guarantee contribution
|
|
50
50
|
attr_accessor :sgc_exempt
|
|
51
51
|
|
|
52
|
+
# Optional Boolean to determine if the earnings rate is considered as qualifying earnings for superannuation guarantee calculations. When not specified value is calculated based on earnings type and superannuation settings
|
|
53
|
+
attr_accessor :is_qualifying_earnings
|
|
54
|
+
|
|
52
55
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
53
56
|
def self.attribute_map
|
|
54
57
|
{
|
|
@@ -62,7 +65,8 @@ module XeroRuby::PayrollAu
|
|
|
62
65
|
:'show_on_payslip' => :'ShowOnPayslip',
|
|
63
66
|
:'current_record' => :'CurrentRecord',
|
|
64
67
|
:'leave_category_code' => :'LeaveCategoryCode',
|
|
65
|
-
:'sgc_exempt' => :'SGCExempt'
|
|
68
|
+
:'sgc_exempt' => :'SGCExempt',
|
|
69
|
+
:'is_qualifying_earnings' => :'IsQualifyingEarnings'
|
|
66
70
|
}
|
|
67
71
|
end
|
|
68
72
|
|
|
@@ -79,7 +83,8 @@ module XeroRuby::PayrollAu
|
|
|
79
83
|
:'show_on_payslip' => :'Boolean',
|
|
80
84
|
:'current_record' => :'Boolean',
|
|
81
85
|
:'leave_category_code' => :'LeaveCategoryCode',
|
|
82
|
-
:'sgc_exempt' => :'Boolean'
|
|
86
|
+
:'sgc_exempt' => :'Boolean',
|
|
87
|
+
:'is_qualifying_earnings' => :'Boolean'
|
|
83
88
|
}
|
|
84
89
|
end
|
|
85
90
|
|
|
@@ -141,6 +146,10 @@ module XeroRuby::PayrollAu
|
|
|
141
146
|
if attributes.key?(:'sgc_exempt')
|
|
142
147
|
self.sgc_exempt = attributes[:'sgc_exempt']
|
|
143
148
|
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'is_qualifying_earnings')
|
|
151
|
+
self.is_qualifying_earnings = attributes[:'is_qualifying_earnings']
|
|
152
|
+
end
|
|
144
153
|
end
|
|
145
154
|
|
|
146
155
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -186,7 +195,8 @@ module XeroRuby::PayrollAu
|
|
|
186
195
|
show_on_payslip == o.show_on_payslip &&
|
|
187
196
|
current_record == o.current_record &&
|
|
188
197
|
leave_category_code == o.leave_category_code &&
|
|
189
|
-
sgc_exempt == o.sgc_exempt
|
|
198
|
+
sgc_exempt == o.sgc_exempt &&
|
|
199
|
+
is_qualifying_earnings == o.is_qualifying_earnings
|
|
190
200
|
end
|
|
191
201
|
|
|
192
202
|
# @see the `==` method
|
|
@@ -198,7 +208,7 @@ module XeroRuby::PayrollAu
|
|
|
198
208
|
# Calculates hash code according to all attributes.
|
|
199
209
|
# @return [Integer] Hash code
|
|
200
210
|
def hash
|
|
201
|
-
[name, type_of_units, leave_type_id, normal_entitlement, leave_loading_rate, updated_date_utc, is_paid_leave, show_on_payslip, current_record, leave_category_code, sgc_exempt].hash
|
|
211
|
+
[name, type_of_units, leave_type_id, normal_entitlement, leave_loading_rate, updated_date_utc, is_paid_leave, show_on_payslip, current_record, leave_category_code, sgc_exempt, is_qualifying_earnings].hash
|
|
202
212
|
end
|
|
203
213
|
|
|
204
214
|
# Builds the object from hash
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Xero Payroll AU API
|
|
3
|
+
|
|
4
|
+
#This is the Xero Payroll API for orgs in Australia region.
|
|
5
|
+
|
|
6
|
+
Contact: api@xero.com
|
|
7
|
+
Generated by: https://openapi-generator.tech
|
|
8
|
+
OpenAPI Generator version: 4.3.1
|
|
9
|
+
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'time'
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module XeroRuby::PayrollAu
|
|
16
|
+
require 'bigdecimal'
|
|
17
|
+
|
|
18
|
+
class OpeningBalanceLeaveLine
|
|
19
|
+
# Xero leave type identifier
|
|
20
|
+
attr_accessor :leave_type_id
|
|
21
|
+
|
|
22
|
+
# Number of units for leave line.
|
|
23
|
+
attr_accessor :number_of_units
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'leave_type_id' => :'LeaveTypeID',
|
|
29
|
+
:'number_of_units' => :'NumberOfUnits'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Attribute type mapping.
|
|
34
|
+
def self.openapi_types
|
|
35
|
+
{
|
|
36
|
+
:'leave_type_id' => :'String',
|
|
37
|
+
:'number_of_units' => :'BigDecimal'
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Initializes the object
|
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
43
|
+
def initialize(attributes = {})
|
|
44
|
+
if (!attributes.is_a?(Hash))
|
|
45
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::OpeningBalanceLeaveLine` initialize method"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
49
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
50
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
51
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::OpeningBalanceLeaveLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
52
|
+
end
|
|
53
|
+
h[k.to_sym] = v
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if attributes.key?(:'leave_type_id')
|
|
57
|
+
self.leave_type_id = attributes[:'leave_type_id']
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
if attributes.key?(:'number_of_units')
|
|
61
|
+
self.number_of_units = attributes[:'number_of_units']
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
66
|
+
# @return Array for valid properties with the reasons
|
|
67
|
+
def list_invalid_properties
|
|
68
|
+
invalid_properties = Array.new
|
|
69
|
+
invalid_properties
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Check to see if the all the properties in the model are valid
|
|
73
|
+
# @return true if the model is valid
|
|
74
|
+
def valid?
|
|
75
|
+
true
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Checks equality by comparing each attribute.
|
|
79
|
+
# @param [Object] Object to be compared
|
|
80
|
+
def ==(o)
|
|
81
|
+
return true if self.equal?(o)
|
|
82
|
+
self.class == o.class &&
|
|
83
|
+
leave_type_id == o.leave_type_id &&
|
|
84
|
+
number_of_units == o.number_of_units
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# @see the `==` method
|
|
88
|
+
# @param [Object] Object to be compared
|
|
89
|
+
def eql?(o)
|
|
90
|
+
self == o
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Calculates hash code according to all attributes.
|
|
94
|
+
# @return [Integer] Hash code
|
|
95
|
+
def hash
|
|
96
|
+
[leave_type_id, number_of_units].hash
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Builds the object from hash
|
|
100
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
101
|
+
# @return [Object] Returns the model itself
|
|
102
|
+
def self.build_from_hash(attributes)
|
|
103
|
+
new.build_from_hash(attributes)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Builds the object from hash
|
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
108
|
+
# @return [Object] Returns the model itself
|
|
109
|
+
def build_from_hash(attributes)
|
|
110
|
+
return nil unless attributes.is_a?(Hash)
|
|
111
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
112
|
+
if type =~ /\AArray<(.*)>/i
|
|
113
|
+
# check to ensure the input is an array given that the attribute
|
|
114
|
+
# is documented as an array but the input is not
|
|
115
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
116
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
117
|
+
end
|
|
118
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
119
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
120
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
self
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Deserializes the data based on type
|
|
127
|
+
# @param string type Data type
|
|
128
|
+
# @param string value Value to be deserialized
|
|
129
|
+
# @return [Object] Deserialized data
|
|
130
|
+
def _deserialize(type, value)
|
|
131
|
+
case type.to_sym
|
|
132
|
+
when :DateTime
|
|
133
|
+
DateTime.parse(parse_date(value))
|
|
134
|
+
when :Date
|
|
135
|
+
Date.parse(parse_date(value))
|
|
136
|
+
when :String
|
|
137
|
+
value.to_s
|
|
138
|
+
when :Integer
|
|
139
|
+
value.to_i
|
|
140
|
+
when :Float
|
|
141
|
+
value.to_f
|
|
142
|
+
when :BigDecimal
|
|
143
|
+
BigDecimal(value.to_s)
|
|
144
|
+
when :Boolean
|
|
145
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
146
|
+
true
|
|
147
|
+
else
|
|
148
|
+
false
|
|
149
|
+
end
|
|
150
|
+
when :Object
|
|
151
|
+
# generic object (usually a Hash), return directly
|
|
152
|
+
value
|
|
153
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
154
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
155
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
156
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
157
|
+
k_type = Regexp.last_match[:k_type]
|
|
158
|
+
v_type = Regexp.last_match[:v_type]
|
|
159
|
+
{}.tap do |hash|
|
|
160
|
+
value.each do |k, v|
|
|
161
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
else # model
|
|
165
|
+
XeroRuby::PayrollAu.const_get(type).build_from_hash(value)
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Returns the string representation of the object
|
|
170
|
+
# @return [String] String presentation of the object
|
|
171
|
+
def to_s
|
|
172
|
+
to_hash.to_s
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
176
|
+
# @return [Hash] Returns the object in the form of hash
|
|
177
|
+
def to_body
|
|
178
|
+
to_hash
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Returns the object in the form of hash
|
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
|
183
|
+
def to_hash(downcase: false)
|
|
184
|
+
hash = {}
|
|
185
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
186
|
+
value = self.send(attr)
|
|
187
|
+
next if value.nil?
|
|
188
|
+
key = downcase ? attr : param
|
|
189
|
+
hash[key] = _to_hash(value, downcase: downcase)
|
|
190
|
+
end
|
|
191
|
+
hash
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Returns the object in the form of hash with snake_case
|
|
195
|
+
def to_attributes
|
|
196
|
+
to_hash(downcase: true)
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Outputs non-array value in the form of hash
|
|
200
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
201
|
+
# @param [Object] value Any valid value
|
|
202
|
+
# @return [Hash] Returns the value in the form of hash
|
|
203
|
+
def _to_hash(value, downcase: false)
|
|
204
|
+
if value.is_a?(Array)
|
|
205
|
+
value.map do |v|
|
|
206
|
+
v.to_hash(downcase: downcase)
|
|
207
|
+
end
|
|
208
|
+
elsif value.is_a?(Hash)
|
|
209
|
+
{}.tap do |hash|
|
|
210
|
+
value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
|
|
211
|
+
end
|
|
212
|
+
elsif value.respond_to? :to_hash
|
|
213
|
+
value.to_hash(downcase: downcase)
|
|
214
|
+
else
|
|
215
|
+
value
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
def parse_date(datestring)
|
|
220
|
+
if datestring.include?('Date')
|
|
221
|
+
date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
|
|
222
|
+
original, date, timezone = *date_pattern.match(datestring)
|
|
223
|
+
date = (date.to_i / 1000)
|
|
224
|
+
Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
|
|
225
|
+
elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
|
|
226
|
+
Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
|
|
227
|
+
else # handle date 'types' for small subset of payroll API's
|
|
228
|
+
Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
end
|
|
@@ -63,7 +63,7 @@ module XeroRuby::PayrollAu
|
|
|
63
63
|
:'deduction_lines' => :'Array<DeductionLine>',
|
|
64
64
|
:'super_lines' => :'Array<SuperLine>',
|
|
65
65
|
:'reimbursement_lines' => :'Array<ReimbursementLine>',
|
|
66
|
-
:'leave_lines' => :'Array<
|
|
66
|
+
:'leave_lines' => :'Array<OpeningBalanceLeaveLine>',
|
|
67
67
|
:'paid_leave_earnings_lines' => :'Array<PaidLeaveEarningsLine>'
|
|
68
68
|
}
|
|
69
69
|
end
|
|
@@ -79,6 +79,9 @@ module XeroRuby::PayrollAu
|
|
|
79
79
|
# Last modified timestamp
|
|
80
80
|
attr_accessor :updated_date_utc
|
|
81
81
|
|
|
82
|
+
# Optional Boolean to determine if leave loading is considered as qualifying earnings for superannuation guarantee calculations
|
|
83
|
+
attr_accessor :include_leave_loading_in_qualifying_earnings
|
|
84
|
+
|
|
82
85
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
83
86
|
def self.attribute_map
|
|
84
87
|
{
|
|
@@ -102,7 +105,8 @@ module XeroRuby::PayrollAu
|
|
|
102
105
|
:'approved_withholding_variation_percentage' => :'ApprovedWithholdingVariationPercentage',
|
|
103
106
|
:'has_student_startup_loan' => :'HasStudentStartupLoan',
|
|
104
107
|
:'has_loan_or_student_debt' => :'HasLoanOrStudentDebt',
|
|
105
|
-
:'updated_date_utc' => :'UpdatedDateUTC'
|
|
108
|
+
:'updated_date_utc' => :'UpdatedDateUTC',
|
|
109
|
+
:'include_leave_loading_in_qualifying_earnings' => :'IncludeLeaveLoadingInQualifyingEarnings'
|
|
106
110
|
}
|
|
107
111
|
end
|
|
108
112
|
|
|
@@ -129,7 +133,8 @@ module XeroRuby::PayrollAu
|
|
|
129
133
|
:'approved_withholding_variation_percentage' => :'Float',
|
|
130
134
|
:'has_student_startup_loan' => :'Boolean',
|
|
131
135
|
:'has_loan_or_student_debt' => :'Boolean',
|
|
132
|
-
:'updated_date_utc' => :'DateTime'
|
|
136
|
+
:'updated_date_utc' => :'DateTime',
|
|
137
|
+
:'include_leave_loading_in_qualifying_earnings' => :'Boolean'
|
|
133
138
|
}
|
|
134
139
|
end
|
|
135
140
|
|
|
@@ -231,6 +236,10 @@ module XeroRuby::PayrollAu
|
|
|
231
236
|
if attributes.key?(:'updated_date_utc')
|
|
232
237
|
self.updated_date_utc = attributes[:'updated_date_utc']
|
|
233
238
|
end
|
|
239
|
+
|
|
240
|
+
if attributes.key?(:'include_leave_loading_in_qualifying_earnings')
|
|
241
|
+
self.include_leave_loading_in_qualifying_earnings = attributes[:'include_leave_loading_in_qualifying_earnings']
|
|
242
|
+
end
|
|
234
243
|
end
|
|
235
244
|
|
|
236
245
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -271,7 +280,8 @@ module XeroRuby::PayrollAu
|
|
|
271
280
|
approved_withholding_variation_percentage == o.approved_withholding_variation_percentage &&
|
|
272
281
|
has_student_startup_loan == o.has_student_startup_loan &&
|
|
273
282
|
has_loan_or_student_debt == o.has_loan_or_student_debt &&
|
|
274
|
-
updated_date_utc == o.updated_date_utc
|
|
283
|
+
updated_date_utc == o.updated_date_utc &&
|
|
284
|
+
include_leave_loading_in_qualifying_earnings == o.include_leave_loading_in_qualifying_earnings
|
|
275
285
|
end
|
|
276
286
|
|
|
277
287
|
# @see the `==` method
|
|
@@ -283,7 +293,7 @@ module XeroRuby::PayrollAu
|
|
|
283
293
|
# Calculates hash code according to all attributes.
|
|
284
294
|
# @return [Integer] Hash code
|
|
285
295
|
def hash
|
|
286
|
-
[employee_id, employment_basis, tfn_exemption_type, tax_file_number, abn, australian_resident_for_tax_purposes, residency_status, tax_scale_type, work_condition, senior_marital_status, tax_free_threshold_claimed, tax_offset_estimated_amount, has_help_debt, has_sfss_debt, has_trade_support_loan_debt, upward_variation_tax_withholding_amount, eligible_to_receive_leave_loading, approved_withholding_variation_percentage, has_student_startup_loan, has_loan_or_student_debt, updated_date_utc].hash
|
|
296
|
+
[employee_id, employment_basis, tfn_exemption_type, tax_file_number, abn, australian_resident_for_tax_purposes, residency_status, tax_scale_type, work_condition, senior_marital_status, tax_free_threshold_claimed, tax_offset_estimated_amount, has_help_debt, has_sfss_debt, has_trade_support_loan_debt, upward_variation_tax_withholding_amount, eligible_to_receive_leave_loading, approved_withholding_variation_percentage, has_student_startup_loan, has_loan_or_student_debt, updated_date_utc, include_leave_loading_in_qualifying_earnings].hash
|
|
287
297
|
end
|
|
288
298
|
|
|
289
299
|
# Builds the object from hash
|