Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1655] Fix SSD #726

Merged
merged 4 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/open_inwoner/conf/fixtures/django-admin-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,14 @@
"openzaak",
"zaaktypeinformatieobjecttypeconfig"
],
[
"soap",
"soapservice"
],
[
"ssd",
"ssdconfig"
],
[
"zgw_consumers",
"certificate"
Expand Down
9 changes: 9 additions & 0 deletions src/open_inwoner/scss/pdf/_jaaropgave.scss
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,14 @@

.section__toelichting .subsection {
line-height: 1.6;
font-size: 11px;

h1,
h2 {
font-size: 12px;
}
h1 {
text-transform: uppercase;
}
}
}
2 changes: 1 addition & 1 deletion src/open_inwoner/scss/pdf/pdf_portrait.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import './overwrites';
// @import './overwrites';
@import './export';
@import './portrait';
@import './maandspecificatie';
Expand Down
8 changes: 1 addition & 7 deletions src/open_inwoner/ssd/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from abc import ABC, abstractmethod
from datetime import datetime
from pathlib import Path
from typing import Optional, get_type_hints
from typing import Optional
from uuid import uuid4

from django.template import loader
Expand All @@ -20,12 +20,6 @@
BASE_DIR = Path(__file__).absolute().parent.parent


# Endpoints for maand/jaarspecificatie
# https://2secure-test.enschede.nl/ENSC/Intern/SSD/UitkeringsSpecificatieClient-v0600
# https://2secure-test.enschede.nl/ENSC/Intern/SSD/JaarOpgaveClient-v0400
# Test with 900038937


class SSDBaseClient(ABC):
"""Base class for SSD SOAP client"""

Expand Down
3 changes: 2 additions & 1 deletion src/open_inwoner/ssd/forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from datetime import date, datetime

from django import forms
from django.template.defaultfilters import date as django_date

from dateutil.relativedelta import relativedelta

Expand Down Expand Up @@ -31,7 +32,7 @@ def get_monthly_report_dates() -> list[tuple[date, str]]:

choices = []
for report_date in dates:
formatted = report_date.strftime("%B %Y")
formatted = django_date(report_date, "M Y")
choices.append((report_date.date(), formatted))

return choices
Expand Down
60 changes: 60 additions & 0 deletions src/open_inwoner/ssd/migrations/0004_auto_20230808_1043.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Generated by Django 3.2.15 on 2023-08-08 08:43

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("ssd", "0003_auto_20230802_1635"),
]

operations = [
migrations.AlterField(
model_name="ssdconfig",
name="jaaropgave_display_text",
field=models.TextField(
blank=True,
help_text="The text displayed as overview of the 'Jaaropgave' tab",
verbose_name="Display text",
),
),
migrations.AlterField(
model_name="ssdconfig",
name="jaaropgave_endpoint",
field=models.CharField(
default="JaarOpgaveClient-v0400",
help_text="Endpoint for the jaaropgave request",
max_length=256,
verbose_name="Jaaropgave endpoint",
),
),
migrations.AlterField(
model_name="ssdconfig",
name="maandspecificatie_display_text",
field=models.TextField(
blank=True,
help_text="The text displayed as overview of the 'Maandspecificatie' tab",
verbose_name="Display text",
),
),
migrations.AlterField(
model_name="ssdconfig",
name="maandspecificatie_endpoint",
field=models.CharField(
default="UitkeringsSpecificatieClient-v0600",
help_text="Endpoint for the maandspecificatie request",
max_length=256,
verbose_name="Maandspecificatie endpoint",
),
),
migrations.AlterField(
model_name="ssdconfig",
name="mijn_uitkeringen_text",
field=models.TextField(
blank=True,
help_text="The text displayed as overview of the 'Mijn Uikeringen' section.",
verbose_name="Overview text",
),
),
]
11 changes: 4 additions & 7 deletions src/open_inwoner/ssd/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class SSDConfig(SingletonModel):
)
maandspecificatie_endpoint = models.CharField(
_("Maandspecificatie endpoint"),
max_length=32,
blank=True,
max_length=256,
default=("UitkeringsSpecificatieClient-v0600"),
help_text=_("Endpoint for the maandspecificatie request"),
)
jaaropgave_endpoint = models.CharField(
_("Jaaropgave endpoint"),
max_length=32,
blank=True,
max_length=256,
default=("JaarOpgaveClient-v0400"),
help_text=_("Endpoint for the jaaropgave request"),
)
applicatie_naam = models.CharField(
Expand All @@ -57,7 +57,6 @@ class SSDConfig(SingletonModel):
)
mijn_uitkeringen_text = models.TextField(
_("Overview text"),
max_length=704,
blank=True,
help_text=_("The text displayed as overview of the 'Mijn Uikeringen' section."),
)
Expand All @@ -80,7 +79,6 @@ class SSDConfig(SingletonModel):
)
jaaropgave_display_text = models.TextField(
_("Display text"),
max_length=704,
blank=True,
help_text=_("The text displayed as overview of the 'Jaaropgave' tab"),
)
Expand All @@ -107,7 +105,6 @@ class SSDConfig(SingletonModel):
)
maandspecificatie_display_text = models.TextField(
_("Display text"),
max_length=704,
blank=True,
help_text=_("The text displayed as overview of the 'Maandspecificatie' tab"),
)
Expand Down
5 changes: 1 addition & 4 deletions src/open_inwoner/ssd/templates/jaaropgave.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,8 @@ <h2 class="h2">Participatiewet</h2>
<br/>
<!-- TOELICHTING -->
<section class="section section__toelichting extra-margin">
<div class="heading">
<h3 class="h3">Toelichting</h3>
</div>
<div class="subsection extra-margin">
<p class="yearly-report__p">{{ jaaropgave_comments|markdown|safe }}</p>
<p class="yearly-report__p yearly-report__comments" >{{ jaaropgave_comments|markdown|safe }}</p>
</div>
</section>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/open_inwoner/ssd/tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_get_monthly_choices(self, mock_solo):
self.assertEqual(date.month, 1)

date_repr = choices[0][1]
self.assertEqual(date_repr, "January 1985")
self.assertEqual(date_repr, "Jan 1985")

@freeze_time("1985-01-25")
@patch("open_inwoner.ssd.forms.SSDConfig.get_solo")
Expand All @@ -50,7 +50,7 @@ def test_current_month_not_yet_available(self, m):
self.assertEqual(date.month, 12)

date_repr = choices[0][1]
self.assertEqual(date_repr, "December 1984")
self.assertEqual(date_repr, "Dec 1984")

@patch("open_inwoner.ssd.forms.SSDConfig.get_solo")
def test_monthly_reports_not_enabled(self, mock_solo):
Expand Down