Skip to content

Commit

Permalink
Merge pull request #586 from uktrade/feature/change-non-export-to-bus…
Browse files Browse the repository at this point in the history
…iness-success

Replace 'Non-export' with 'Business success'
  • Loading branch information
cgsunkel authored Apr 18, 2023
2 parents 73a52ec + 41ab075 commit 5b65f5f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions wins/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class WinForm(BootstrappedForm, metaclass=WinReflectiveFormMetaclass):
date = forms.fields.CharField(max_length=7, label="Date won")
types_all = forms.fields.BooleanField(required=False) # just used to hang error on
type_export = forms.fields.BooleanField(required=False, label="Export")
type_non_export = forms.fields.BooleanField(required=False, label="Non-export")
type_non_export = forms.fields.BooleanField(required=False, label="Business success")
type_odi = forms.fields.BooleanField(required=False, label="Outward Direct Investment")

# specify fields from the serializer to exclude from the form
Expand Down Expand Up @@ -260,12 +260,12 @@ def clean(self):
# have to have checked at least one type of win
value_types_names = [
('type_export', 'Export'),
('type_non_export', 'Non-export'),
('type_non_export', 'Business success'),
('type_odi', 'Outward Direct Investment'),
]
if not any(cleaned.get(v) for v, n in value_types_names):
self._errors['types_all'] = self.error_class([
"""You must choose at least one of Export, Non-export and
"""You must choose at least one of Export, Business success and
Outward Direct Investment"""
])

Expand Down Expand Up @@ -323,7 +323,7 @@ def clean(self):

if not export_value and not non_export_value and not odi_value:
raise forms.ValidationError(
"""Wins must have total expected export, non-export
"""Wins must have total expected export, business success
or ODI value of more than £0.
"""
)
Expand All @@ -335,7 +335,7 @@ def clean(self):

if sum(non_export_breakdowns) != non_export_value:
raise forms.ValidationError(
"""Value of non-export breakdowns over 5 years must equal
"""Value of business success breakdowns over 5 years must equal
total"""
)

Expand Down
2 changes: 1 addition & 1 deletion wins/templates/wins/confirmation-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h2 class="pad-top">Details of your recent success</h2>

{% if win.total_expected_non_export_value %}

<dt>Non-export value expected over the next 5 years</dt>
<dt>Business success value expected over the next 5 years</dt>
<dd>&pound;{{ win.total_expected_non_export_value|intcomma }}</dd>

{% endif %}
Expand Down
8 changes: 4 additions & 4 deletions wins/templates/wins/partials/win-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ <h3 class="form-section-heading">Win details</h3>
<p>
These questions help us to understand the &pound; value of the customer's win
over a five year period. How much of that &pound; value is UK exports and how
much is non-export value. We will use these aggregated values to help
much is business success value. We will use these aggregated values to help
demonstrate the contribution to the Government's &pound;1 trillion by 2020
export target.
<br>
Expand All @@ -160,9 +160,9 @@ <h4>Export value</h4>
<p class="export-year-value">Total: &pound;{{ win.total_expected_export_value | intcomma }}</p>


<h4 class="non-export-heading">Non-export value</h4>
<h4 class="business-success-heading">Business success value</h4>
<p>
Total non export value over the next 5 years.
Total business success value over the next 5 years.
</p>
{% include "wins/partials/win-value-table-complete.html" with fields=win.breakdowns.nonexports %}
<p class="export-year-value">Total: &pound;{{ win.total_expected_non_export_value | intcomma }}</p>
Expand Down Expand Up @@ -217,7 +217,7 @@ <h4>Export value over next 5 years</h4>

<div id="non-export-content" class="win-values">

<h4>Non-export value over next 5 years</h4>
<h4>Business success value over next 5 years</h4>
<p class="help-text">(round to nearest &pound;)</p>
{% include "wins/partials/win-value-table.html" with field_0=form.breakdown_non_exports_0 field_1=form.breakdown_non_exports_1 field_2=form.breakdown_non_exports_2 field_3=form.breakdown_non_exports_3 field_4=form.breakdown_non_exports_4 %}
{% include "wins/partials/win-field.html" with field=form.total_expected_non_export_value help="The total expected value should be the sum of the annual values of the win." class="restrict-width-xsm" %}
Expand Down
2 changes: 1 addition & 1 deletion wins/templates/wins/win-complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<li class="list-group-item"><span>Kind of business deal that best describes the win</span> {{ win.business_type }}</li>
<li class="list-group-item"><span>How the company was supported in achieving the win</span> {{ win.description }}</li>
<li class="list-group-item"><span>Export value</span> &pound;{{ win.total_expected_export_value | intcomma }}</li>
<li class="list-group-item"><span>Non-export value</span> &pound;{{ win.total_expected_non_export_value | intcomma }}</li>
<li class="list-group-item"><span>Business success value</span> &pound;{{ win.total_expected_non_export_value | intcomma }}</li>
<li class="list-group-item"><span>Outward Direct Investment value</span> &pound;{{ win.total_expected_odi_value | intcomma }}</li>
</ul>

Expand Down
4 changes: 2 additions & 2 deletions wins/templates/wins/win-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ <h4>Export value</h4>
</div>

<div class="col-sm-6">
<h4 class="non-export-heading">Non-export value</h4>
<h4 class="business-success-heading">Business success value</h4>

<p>
Total non export value over the next 5 years.
Total business success value over the next 5 years.
</p>

{# this should show all 5 years even if we don't have data... #}
Expand Down

0 comments on commit 5b65f5f

Please sign in to comment.