Class: BudgetPersonnelObject
- Inherits:
-
Object
- Object
- BudgetPersonnelObject
- Includes:
- DataFactory, Foundry, Navigation, StringFactory, Utilities
- Defined in:
- lib/kuality-coeus/data_objects/budget/personnel.rb
Instance Attribute Summary collapse
-
#appointment_type ⇒ Object
Returns the value of attribute appointment_type.
-
#base_salary ⇒ Object
Returns the value of attribute base_salary.
-
#calculated_fringe ⇒ Object
Returns the value of attribute calculated_fringe.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#job_code ⇒ Object
Returns the value of attribute job_code.
-
#name ⇒ Object
Returns the value of attribute name.
-
#object_code_name ⇒ Object
Returns the value of attribute object_code_name.
-
#percent_charged ⇒ Object
Returns the value of attribute percent_charged.
-
#percent_effort ⇒ Object
Returns the value of attribute percent_effort.
-
#period_type ⇒ Object
Returns the value of attribute period_type.
-
#requested_salary ⇒ Object
Returns the value of attribute requested_salary.
-
#salary_anniversary_date ⇒ Object
Returns the value of attribute salary_anniversary_date.
-
#salary_effective_date ⇒ Object
Returns the value of attribute salary_effective_date.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(browser, opts = {}) ⇒ BudgetPersonnelObject
constructor
TODO: Add more variables here - “apply inflation”, “submit cost sharing”, etc.
Methods included from Utilities
#get, #make_user, #random_percentage, #set, #snake_case
Methods included from Navigation
#doc_search, #fill_out, #fill_out_item, #on_document?, #on_page?, #open_document
Constructor Details
#initialize(browser, opts = {}) ⇒ BudgetPersonnelObject
TODO: Add more variables here - “apply inflation”, “submit cost sharing”, etc.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 16 def initialize(browser, opts={}) @browser = browser defaults = { # Note: 'type' must be one of: # 'employee', 'non_employee', or 'to_be_named' type: 'employee', base_salary: random_dollar_value(1000000), appointment_type: '12M DURATION', object_code_name: '::random::', percent_effort: random_percentage, period_type: '::random::' } (defaults.merge(opts)) @percent_charged ||= (@percent_effort.to_f/2).round(2) end |
Instance Attribute Details
#appointment_type ⇒ Object
Returns the value of attribute appointment_type.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def appointment_type @appointment_type end |
#base_salary ⇒ Object
Returns the value of attribute base_salary.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def base_salary @base_salary end |
#calculated_fringe ⇒ Object
Returns the value of attribute calculated_fringe.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def calculated_fringe @calculated_fringe end |
#end_date ⇒ Object
Returns the value of attribute end_date.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def end_date @end_date end |
#job_code ⇒ Object
Returns the value of attribute job_code.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def job_code @job_code end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def name @name end |
#object_code_name ⇒ Object
Returns the value of attribute object_code_name.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def object_code_name @object_code_name end |
#percent_charged ⇒ Object
Returns the value of attribute percent_charged.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def percent_charged @percent_charged end |
#percent_effort ⇒ Object
Returns the value of attribute percent_effort.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def percent_effort @percent_effort end |
#period_type ⇒ Object
Returns the value of attribute period_type.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def period_type @period_type end |
#requested_salary ⇒ Object
Returns the value of attribute requested_salary.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def requested_salary @requested_salary end |
#salary_anniversary_date ⇒ Object
Returns the value of attribute salary_anniversary_date.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def salary_anniversary_date @salary_anniversary_date end |
#salary_effective_date ⇒ Object
Returns the value of attribute salary_effective_date.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def salary_effective_date @salary_effective_date end |
#start_date ⇒ Object
Returns the value of attribute start_date.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def start_date @start_date end |
#type ⇒ Object
Returns the value of attribute type.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 9 def type @type end |
Instance Method Details
#create ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/kuality-coeus/data_objects/budget/personnel.rb', line 34 def create # Navigation is handled by the BudgetVersionsObject method if on(Personnel).job_code(@name).present? # The person is already listed so do nothing else get_person end set_job_code on Personnel do |page| @salary_effective_date ||= page.salary_effective_date(@name).value fill_out_item @name, page, :appointment_type, :base_salary, :salary_effective_date, :salary_anniversary_date page.save page. page.person.select "#{@name} - #{@job_code}" sleep 1 # this is required because the select list contents get updated when the person is selected. page.object_code_name.pick! @object_code_name page.add_details page. set_dates page fill_out_item @name, page, :percent_effort, :percent_charged, :period_type page.calculate @name @requested_salary=page.requested_salary @name @calculated_fringe=page.calculated_fringe @name page.save end end |