From 04f6238f8429c0ff187bbafec99394904bfcb0f7 Mon Sep 17 00:00:00 2001 From: evansmith Date: Wed, 10 Apr 2024 16:19:43 -0400 Subject: [PATCH] Ndbex 80288 currency appearance (#16266) * method to prepend amt govt contribution so that it fits on the right hand boxes in the pdf * rubocop * use rjust --- lib/pdf_fill/forms/va21p530v2.rb | 8 ++++++++ spec/fixtures/pdf_fill/21P-530V2/kitchen_sink.json | 2 +- spec/fixtures/pdf_fill/21P-530V2/merge_fields.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/pdf_fill/forms/va21p530v2.rb b/lib/pdf_fill/forms/va21p530v2.rb index 86014532749..fdc8bca7f13 100644 --- a/lib/pdf_fill/forms/va21p530v2.rb +++ b/lib/pdf_fill/forms/va21p530v2.rb @@ -678,6 +678,12 @@ def combine_previous_names_and_service(previous_names) end.join('; ') end + def format_currency_spacing + return if @form_data['amountGovtContribution'].blank? + + @form_data['amountGovtContribution'] = @form_data['amountGovtContribution'].rjust(5) + end + def set_state_to_no_if_national national = @form_data['nationalOrFederal'] @form_data['cemetaryLocationQuestion'] = 'none' if national @@ -758,6 +764,8 @@ def merge_fields(_options = {}) convert_location_of_death + format_currency_spacing + %w[ nationalOrFederal govtContributions diff --git a/spec/fixtures/pdf_fill/21P-530V2/kitchen_sink.json b/spec/fixtures/pdf_fill/21P-530V2/kitchen_sink.json index 6662d6946c4..b46b6d1052d 100644 --- a/spec/fixtures/pdf_fill/21P-530V2/kitchen_sink.json +++ b/spec/fixtures/pdf_fill/21P-530V2/kitchen_sink.json @@ -2,7 +2,7 @@ "transportationExpenses":true, "plotExpenseResponsibility":true, "govtContributions":true, - "amountGovtContribution":"50000", + "amountGovtContribution":"5000", "nationalOrFederal":true, "name":"name of cemetery", "finalRestingPlace":{"location":"other", "other":"other"}, diff --git a/spec/fixtures/pdf_fill/21P-530V2/merge_fields.json b/spec/fixtures/pdf_fill/21P-530V2/merge_fields.json index 951fcd309ae..6d10245e9ea 100644 --- a/spec/fixtures/pdf_fill/21P-530V2/merge_fields.json +++ b/spec/fixtures/pdf_fill/21P-530V2/merge_fields.json @@ -2,7 +2,7 @@ "transportationExpenses":true, "plotExpenseResponsibility":true, "govtContributions":true, - "amountGovtContribution":"50000", + "amountGovtContribution":" 5000", "nationalOrFederal":true, "name":"name of cemetery", "finalRestingPlace":{"location":{"cemetery":"Off", "privateResidence":"Off", "mausoleum":"Off", "other":"On"}, "other":"other"},