diff --git a/Gemfile b/Gemfile index 3a3e8cb..b7a21de 100644 --- a/Gemfile +++ b/Gemfile @@ -70,7 +70,7 @@ end gem 'docusign_admin', '~> 1.3.0' gem 'docusign_click', '~> 1.4.0' -gem 'docusign_esign', '~> 3.25.0' +gem 'docusign_esign', '~> 3.27.0.rc1' gem 'docusign_maestro', '~> 1.0.0.rc1' gem 'docusign_monitor', '~> 1.2.0' gem 'docusign_rooms', '~> 1.3.0' diff --git a/Gemfile.lock b/Gemfile.lock index aa7bfb2..8df3efd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -110,7 +110,7 @@ GEM json (~> 2.1, >= 2.1.0) jwt (~> 2.2, >= 2.2.1) typhoeus (~> 1.0, >= 1.0.1) - docusign_esign (3.25.0) + docusign_esign (3.27.0.rc1) addressable (~> 2.7, >= 2.7.0) json (~> 2.1, >= 2.1.0) jwt (~> 2.2, >= 2.2.1) @@ -349,7 +349,7 @@ DEPENDENCIES coffee-rails (~> 5.0.0) docusign_admin (~> 1.3.0) docusign_click (~> 1.4.0) - docusign_esign (~> 3.25.0) + docusign_esign (~> 3.27.0.rc1) docusign_maestro (~> 1.0.0.rc1) docusign_monitor (~> 1.2.0) docusign_rooms (~> 1.3.0) diff --git a/app/controllers/e_sign/eeg042_document_generation_controller.rb b/app/controllers/e_sign/eeg042_document_generation_controller.rb index 5e1d502..3a12f3f 100644 --- a/app/controllers/e_sign/eeg042_document_generation_controller.rb +++ b/app/controllers/e_sign/eeg042_document_generation_controller.rb @@ -13,8 +13,9 @@ def create manager_name: param_gsub(params['manager_name']), job_title: param_gsub(params['job_title']), salary: param_gsub(params['salary']), + rsus: param_gsub(params['rsus']), start_date: param_gsub(params['start_date']), - doc_file: File.join('data', Rails.application.config.doc_offer_letter) + doc_file: File.join('data', Rails.application.config.offer_letter_dynamic_table) } args = { account_id: session['ds_account_id'], diff --git a/app/services/e_sign/eg042_document_generation_service.rb b/app/services/e_sign/eg042_document_generation_service.rb index f91a6db..0b2a3c1 100644 --- a/app/services/e_sign/eg042_document_generation_service.rb +++ b/app/services/e_sign/eg042_document_generation_service.rb @@ -113,7 +113,7 @@ def recipient_tabs anchorYOffset: '-22' ) date_signed = DocuSign_eSign::DateSigned.new( - anchorString: 'Date', + anchorString: 'Date Signed', anchorUnits: 'pixels', anchorYOffset: '-22' ) @@ -144,6 +144,8 @@ def make_envelope(template_id, args) #ds-snippet-start:eSign42Step7 def form_fields(args, document_id_guid) + bonus_value = '20%' + candidate_name_field = DocuSign_eSign::DocGenFormField.new( name: 'Candidate_Name', value: args[:candidate_name] @@ -156,16 +158,54 @@ def form_fields(args, document_id_guid) name: 'Job_Title', value: args[:job_title] ) - salary_field = DocuSign_eSign::DocGenFormField.new( - name: 'Salary', - value: args[:salary] - ) start_date_field = DocuSign_eSign::DocGenFormField.new( name: 'Start_Date', value: args[:start_date] ) + + salary_row = DocuSign_eSign::DocGenFormFieldRowValue.new( + docGenFormFieldList: [ + DocuSign_eSign::DocGenFormField.new( + name: 'Compensation_Component', + value: 'Salary' + ), + DocuSign_eSign::DocGenFormField.new( + name: 'Details', + value: "$#{args[:salary]}" + ) + ] + ) + bonus_row = DocuSign_eSign::DocGenFormFieldRowValue.new( + docGenFormFieldList: [ + DocuSign_eSign::DocGenFormField.new( + name: 'Compensation_Component', + value: 'Bonus' + ), + DocuSign_eSign::DocGenFormField.new( + name: 'Details', + value: bonus_value + ) + ] + ) + rsus_row = DocuSign_eSign::DocGenFormFieldRowValue.new( + docGenFormFieldList: [ + DocuSign_eSign::DocGenFormField.new( + name: 'Compensation_Component', + value: 'RSUs' + ), + DocuSign_eSign::DocGenFormField.new( + name: 'Details', + value: args[:rsus] + ) + ] + ) + compensation_package = DocuSign_eSign::DocGenFormField.new( + name: 'Compensation_Package', + type: 'TableRow', + rowValues: [salary_row, bonus_row, rsus_row] + ) doc_gen_form_fields_list = [ - candidate_name_field, manager_name_field, salary_field, job_title_field, start_date_field + candidate_name_field, manager_name_field, job_title_field, start_date_field, compensation_package ] doc_gen_form_fields = DocuSign_eSign::DocGenFormFields.new( diff --git a/app/views/e_sign/eeg042_document_generation/get.html.erb b/app/views/e_sign/eeg042_document_generation/get.html.erb index d20f81d..9ba7f3e 100644 --- a/app/views/e_sign/eeg042_document_generation/get.html.erb +++ b/app/views/e_sign/eeg042_document_generation/get.html.erb @@ -7,6 +7,7 @@ <% job_title_index = 3 %> <% salary_index = 4 %> <% start_date_index = 5 %> +<% rsus_index = 6 %>
<% if @example["Forms"][form_index]["FormName"] %> @@ -34,8 +35,7 @@
@@ -43,6 +43,11 @@
+
+ + +