Skip to content

Commit

Permalink
Revert "AP-5368 cash income and outgoings bug (#7458)" (#7471)
Browse files Browse the repository at this point in the history
This reverts commit f4bfc9a.
  • Loading branch information
RoseSAK authored Nov 25, 2024
1 parent f4bfc9a commit a2ca0d6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
5 changes: 1 addition & 4 deletions app/controllers/providers/means/cash_incomes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ module Means
class CashIncomesController < ProviderBaseController
before_action :setup_variables, only: %i[show update]

def show
@none_selected = legal_aid_application.no_cash_income?
end
def show; end

def update
if aggregated_cash_income.update(form_params)
update_no_cash_income(form_params)
go_forward
else
@none_selected = form_params[:none_selected] == "true"
render :show
end
end
Expand Down
5 changes: 1 addition & 4 deletions app/controllers/providers/means/cash_outgoings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ module Means
class CashOutgoingsController < ProviderBaseController
before_action :setup_cash_outgoings, only: %i[show update]

def show
@none_selected = legal_aid_application.no_cash_outgoings?
end
def show; end

def update
if aggregated_cash_outgoings.update(form_params)
update_no_cash_outgoings(form_params)
go_forward
else
@none_selected = form_params[:none_selected] == "true"
render :show
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/means/_cash_income.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</div>

<%= form.govuk_radio_divider %>
<%= form.govuk_check_box :none_selected, true, "", multiple: false, label: { text: none_of_the_above }, checked: @none_selected %>
<%= form.govuk_check_box :none_selected, true, "", multiple: false, label: { text: none_of_the_above }, checked: type.no_cash_income? %>
<% end %>

<%= next_action_buttons(
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/means/_cash_outgoing.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</div>

<%= form.govuk_radio_divider %>
<%= form.govuk_check_box :none_selected, true, "", multiple: false, label: { text: t("generic.none_of_the_above") }, checked: @none_selected %>
<%= form.govuk_check_box :none_selected, true, "", multiple: false, label: { text: t("generic.none_of_the_above") }, checked: type.no_cash_outgoings? %>
<% end %>

<%= next_action_buttons(
Expand Down

0 comments on commit a2ca0d6

Please sign in to comment.