add new billing details page

contains both signed in and signed out versions (when signed in you can
see bank details etc)
This commit is contained in:
Leo Hemsted
2021-08-27 11:44:19 +01:00
parent 85f6881a56
commit a0adf3c63c
8 changed files with 193 additions and 3 deletions

View File

@@ -81,6 +81,19 @@ def how_to_pay():
)
@main.route('/pricing/billing-details')
def billing_details():
if current_user.is_authenticated:
return render_template(
'views/pricing/billing-details.html',
navigation_links=pricing_nav(),
)
return render_template(
'views/pricing/billing-details-signed-out.html',
navigation_links=pricing_nav(),
)
@main.route('/delivery-and-failure')
@main.route('/features/messages-status')
def delivery_and_failure():

View File

@@ -47,6 +47,10 @@ def pricing_nav():
"name": "How to pay",
"link": "main.how_to_pay",
},
{
"name": "Billing details",
"link": "main.billing_details",
},
]

View File

@@ -59,6 +59,7 @@ class HeaderNavigation(Navigation):
'pricing': {
'pricing',
'how_to_pay',
'billing_details',
},
'documentation': {
'documentation',

View File

@@ -225,6 +225,10 @@
{
"href": url_for("main.how_to_pay"),
"text": "How to pay"
},
{
"href": url_for("main.billing_details"),
"text": "Billing details"
}
]
},

View File

@@ -0,0 +1,26 @@
{% extends "content_template.html" %}
{% from "components/page-header.html" import page_header %}
{% block per_page_title %}
Billing details
{% endblock %}
{% block content_column_content %}
{{ page_header('Billing details') }}
<p class="govuk-body">
<a class="govuk-link" href="{{ url_for('.sign_in', next=url_for('.billing_details')) }}">Sign in</a> to see our:
</p>
<ul class="govuk-list govuk-list--bullet">
<li>supplier details</li>
<li>bank details</li>
<li>invoice address</li>
</ul>
<p class="govuk-body">
You can use this information to add the Cabinet Office as a supplier. Your organisation may need to do this before you can raise a purchase order.
</p>
{% endblock %}

View File

@@ -0,0 +1,128 @@
{% extends "content_template.html" %}
{% from "components/page-header.html" import page_header %}
{% from "components/copy-to-clipboard.html" import copy_to_clipboard %}
{% block per_page_title %}
Billing details
{% endblock %}
{% block content_column_content %}
{{ page_header('Billing details') }}
<p class="govuk-body">
You can use the information on this page to add the Cabinet Office as a supplier. Your organisation may need to do this before you can raise a purchase order (PO).
</p>
<p class="govuk-body">
<a class="govuk-link govuk-link--no-visited-state" href="{{ support_link }}">Contact us</a> if you need any other details.
</p>
<h2 class="heading-medium govuk-!-margin-top-7">
Supplier details
</h2>
<p class="govuk-body">
Cabinet Office
</p>
<p class="govuk-body">
The White Chapel Building <br>
10 Whitechapel High Street <br>
London <br>
E1 8QS
</p>
<h3 class="heading-small">
Email addresses
</h3>
<ul class="govuk-list govuk-list--bullet">
<li>
generic@digital.cabinet-office.gov.uk
</li>
<li>
first.last@digital.cabinet-office.gov.uk
</li>
</ul>
<h3 class="heading-small">
<abbr title="Value Added Tax">VAT</abbr> number
</h3>
<div class="govuk-!-margin-bottom-4">
{{ copy_to_clipboard(
'GB 88 88 010 80',
name=None,
thing='<abbr title="Value Added Tax">VAT</abbr> number',
) }}
</div>
<h2 class="heading-medium govuk-!-margin-top-7">
Bank details
</h2>
<p class="govuk-body">
National Westminster Bank PLC (part of RBS group) <br>
Government Banking Services Branch <br>
2nd Floor <br>
280 Bishopsgate <br>
London <br>
EC2M 4RB
</p>
<h3 class="heading-small">
Account name
</h3>
<p class="govuk-body">
Cabinet Office
</p>
<div class="govuk-!-margin-bottom-4">
{{ copy_to_clipboard(
'98765432',
name='Account number',
thing='account number',
) }}
</div>
<div class="govuk-!-margin-bottom-4">
{{ copy_to_clipboard(
'01-23-45',
name='Sort code',
thing='sort code',
) }}
</div>
<div class="govuk-!-margin-bottom-4">
{{ copy_to_clipboard(
'GB33BUKB20201555555555',
name='IBAN',
thing='IBAN',
) }}
</div>
<div class="govuk-!-margin-bottom-4">
{{ copy_to_clipboard(
'ABCDEF12',
name='Swift code',
thing='Swift code',
) }}
</div>
<h2 class="heading-medium govuk-!-margin-top-7">
Invoice address
</h2>
<p class="govuk-body">
SSCL Accounts Receivable <br>
PO Box 221 <br>
Thornton-Cleveleys <br>
Blackpool <br>
Lancashire <br>
FY1 9JN
</p>
{% endblock %}

View File

@@ -100,6 +100,7 @@ def test_hiding_pages_from_search_engines(
'guidance_index', 'branding_and_customisation',
'create_and_send_messages', 'edit_and_format_messages',
'send_files_by_email', 'upload_a_letter', 'who_can_use_notify',
'billing_details',
])
def test_static_pages(
client_request,

View File

@@ -31,6 +31,7 @@ EXCLUDED_ENDPOINTS = tuple(map(Navigation.get_endpoint_with_blueprint, {
'archive_user',
'bat_phone',
'begin_tour',
'billing_details',
'branding_and_customisation',
'branding_request',
'broadcast',
@@ -371,7 +372,11 @@ navigation_instances = (
)
@pytest.mark.parametrize('navigation_instance', navigation_instances)
@pytest.mark.parametrize(
'navigation_instance',
navigation_instances,
ids=(x.__class__.__name__ for x in navigation_instances)
)
def test_navigation_items_are_properly_defined(navigation_instance):
for endpoint in navigation_instance.endpoints_with_navigation:
assert (
@@ -399,7 +404,11 @@ def test_excluded_navigation_items_are_properly_defined():
), f'{endpoint} found more than once in EXCLUDED_ENDPOINTS'
@pytest.mark.parametrize('navigation_instance', navigation_instances)
@pytest.mark.parametrize(
'navigation_instance',
navigation_instances,
ids=(x.__class__.__name__ for x in navigation_instances)
)
def test_all_endpoints_are_covered(navigation_instance):
covered_endpoints = (
navigation_instance.endpoints_with_navigation +
@@ -411,7 +420,11 @@ def test_all_endpoints_are_covered(navigation_instance):
assert endpoint in covered_endpoints, f'{endpoint} is not listed or excluded'
@pytest.mark.parametrize('navigation_instance', navigation_instances)
@pytest.mark.parametrize(
'navigation_instance',
navigation_instances,
ids=(x.__class__.__name__ for x in navigation_instances)
)
@pytest.mark.xfail(raises=KeyError)
def test_raises_on_invalid_navigation_item(
client_request, navigation_instance