Skip to content

Commit

Permalink
Ndbex 80288 currency appearance (#16266)
Browse files Browse the repository at this point in the history
* method to prepend amt govt contribution so that it fits on the right hand boxes in the pdf

* rubocop

* use rjust
  • Loading branch information
evansmith authored Apr 10, 2024
1 parent 13a7843 commit 04f6238
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions lib/pdf_fill/forms/va21p530v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -758,6 +764,8 @@ def merge_fields(_options = {})

convert_location_of_death

format_currency_spacing

%w[
nationalOrFederal
govtContributions
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/pdf_fill/21P-530V2/kitchen_sink.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/pdf_fill/21P-530V2/merge_fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down

0 comments on commit 04f6238

Please sign in to comment.