Skip to content

Commit

Permalink
Merge pull request #2590 from bitzesty/proportional-value-fix-staging
Browse files Browse the repository at this point in the history
Proportional value fix [staging]
  • Loading branch information
Lubosky authored Sep 7, 2023
2 parents 3134221 + 89ec923 commit 87efa44
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions app/assets/javascripts/application.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,12 @@ jQuery ->
referenceValue = parseFloat(referenceCell?.value) or 0
if type == 'disadvantaged'
proportionInput?.value = ((referenceValue / colSums[cell.cellIndex]) * 100).toFixed(2)
if isNaN(parseFloat(proportionInput?.value))
proportionInput?.value = "0"

else if type == 'others'
proportionInput?.value = ( colSums[cell.cellIndex] / (colSums[cell.cellIndex] + referenceValue) * 100).toFixed(2)

if isNaN(parseFloat(proportionInput?.value))
proportionInput?.value = "0"

calculateRowsToExcludeFromBottom = (table, className) ->
rows = table.querySelectorAll('tr');
Expand Down
10 changes: 6 additions & 4 deletions app/views/qae_form/_queen_award_applications_question.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ a.govuk-button.govuk-button--secondary.js-button-add.if-no-js-hide href="#" aria

.question-block.help-block
.govuk-form-group
p class="govuk-body govuk-!-font-weight-bold hide" id="current-holder"
| As you currently hold a King's Award for International Trade, you cannot apply for another Award. You may apply in future years but can only use one year's financial performance from your Award winning application.
p class="govuk-body govuk-!-font-weight-bold hide" id="recent-winner"
| As you currently hold a King's Award in International Trade, you can only apply for the Outstanding Achievement Award (3 years).
- if @form_answer.trade?
p[class="govuk-body govuk-!-font-weight-bold hide" id="current-holder"]
| As you currently hold a King's Award for International Trade, you cannot apply for another Award. You may apply in future years but can only use one year's financial performance from your Award winning application.

p[class="govuk-body govuk-!-font-weight-bold hide" id="recent-winner"]
| As you currently hold a King's Award in International Trade, you can only apply for the Outstanding Achievement Award (3 years).

0 comments on commit 87efa44

Please sign in to comment.