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"},