Skip to content

Commit

Permalink
feat: include alterations in application admin view (#2898)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiliaMakelaVincit committed Apr 3, 2024
1 parent 07c28a3 commit bd08f18
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 18 deletions.
23 changes: 23 additions & 0 deletions backend/benefit/applications/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
AhjoDecisionText,
AhjoSetting,
Application,
ApplicationAlteration,
ApplicationBasis,
ApplicationBatch,
ApplicationLogEntry,
Expand Down Expand Up @@ -42,13 +43,35 @@ class AttachmentInline(admin.StackedInline):
readonly_fields = ("created_at",)


class ApplicationAlterationInline(admin.StackedInline):
model = ApplicationAlteration
fk_name = "application"
extra = 0
fields = (
"state",
"alteration_type",
"end_date",
"resume_date",
"reason",
"contact_person_name",
"recovery_start_date",
"recovery_end_date",
"recovery_amount",
"use_einvoice",
"einvoice_provider_name",
"einvoice_provider_identifier",
"einvoice_address",
)


class ApplicationAdmin(admin.ModelAdmin):
inlines = (
EmployeeInline,
DeMinimisAidInline,
ApplicationBasisInline,
AttachmentInline,
CalculationInline,
ApplicationAlterationInline,
)
list_filter = ("status", "application_origin", "company")
list_display = (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.23 on 2024-03-26 10:40

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('applications', '0061_auto_20240312_1150'),
]

operations = [
migrations.AlterField(
model_name='applicationalteration',
name='recovery_amount',
field=models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True, verbose_name='amount of unwarranted benefit to be collected'),
),
]
1 change: 1 addition & 0 deletions backend/benefit/applications/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,7 @@ class ApplicationAlteration(TimeStampedModel):
decimal_places=2,
verbose_name=_("amount of unwarranted benefit to be collected"),
null=True,
blank=True,
)

use_einvoice = models.BooleanField(
Expand Down
11 changes: 7 additions & 4 deletions backend/benefit/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-27 15:46+0200\n"
"POT-Creation-Date: 2024-03-26 12:21+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -162,7 +162,7 @@ msgid "E-invoice address"
msgstr ""

#, python-brace-format
msgid "{field} must be filled if using an alternative e-invoice address"
msgid "{field} must be filled if using an e-invoice address"
msgstr ""

msgid "Alteration cannot start before first benefit day"
Expand Down Expand Up @@ -765,8 +765,8 @@ msgid "amount of unwarranted benefit to be collected"
msgstr ""

msgid ""
"whether to use a separate e-invoice address from the one of the applicant "
"organization"
"whether to use handle billing with an e-invoice instead of a bill sent to a "
"physical address"
msgstr ""

msgid "name of the e-invoice provider"
Expand All @@ -778,6 +778,9 @@ msgstr ""
msgid "e-invoice address"
msgstr ""

msgid "contact person"
msgstr ""

msgid "Not found"
msgstr ""

Expand Down
22 changes: 12 additions & 10 deletions backend/benefit/locale/fi/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-27 15:46+0200\n"
"POT-Creation-Date: 2024-03-26 12:21+0200\n"
"PO-Revision-Date: 2022-11-01 10:45+0200\n"
"Last-Translator: Kari Salminen <kari.salminen@anders.com>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -168,9 +168,9 @@ msgstr "Verkkolaskuoperaattorin tunnus"
msgid "E-invoice address"
msgstr "Verkkolaskuosoite"

#, python-brace-format
msgid "{field} must be filled if using an alternative e-invoice address"
msgstr "{field} on pakollinen tieto, mikäli käytössä on poikkeava verkkolaskutunnus"
msgid "{field} must be filled if using an e-invoice address"
msgstr ""
"{field} on pakollinen tieto, mikäli lasku lähetetään verkkolaskuna"

msgid "Alteration cannot start before first benefit day"
msgstr "Muutos työsuhteessa ei voi alkaa ennen tukijakson alkua"
Expand All @@ -179,7 +179,8 @@ msgid "Alteration cannot start after last benefit day"
msgstr "Muutos työsuhteessa ei voi alkaa tukijakson päättymisen jälkeen"

msgid "Alteration cannot end after last benefit day"
msgstr "Muutosjakson päättymispäivämäärä ei voi olla tukijakson päättymisen jälkeen"
msgstr ""
"Muutosjakson päättymispäivämäärä ei voi olla tukijakson päättymisen jälkeen"

msgid "Alteration end date cannot be before start date"
msgstr "Muutosjakson päättymispäivä ei voi olla aiemmin kuin aloituspäivä"
Expand Down Expand Up @@ -840,11 +841,9 @@ msgid "amount of unwarranted benefit to be collected"
msgstr "Takaisinperittävä summa"

msgid ""
"whether to use a separate e-invoice address from the one of the applicant "
"organization"
msgstr ""
"Käytetäänkö eri verkkolaskuosoitetta kuin hakijaorganisaation "
"verkkolaskuosoitetta?"
"whether to use handle billing with an e-invoice instead of a bill sent to a "
"physical address"
msgstr "Lähetetäänkö lasku verkkolaskuna kirjelaskun sijaan?"

msgid "name of the e-invoice provider"
msgstr "Verkkolaskuoperaattorin nimi"
Expand All @@ -855,6 +854,9 @@ msgstr "Välittäjän tunnus"
msgid "e-invoice address"
msgstr "Verkkolaskuosoite"

msgid "contact person"
msgstr "Yhteyshenkilö"

#, fuzzy
#| msgid "File not found."
msgid "Not found"
Expand Down
13 changes: 9 additions & 4 deletions backend/benefit/locale/sv/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-27 15:46+0200\n"
"POT-Creation-Date: 2024-03-26 12:21+0200\n"
"PO-Revision-Date: 2022-11-01 10:47+0200\n"
"Last-Translator: Kari Salminen <kari.salminen@anders.com>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -169,7 +169,7 @@ msgid "E-invoice address"
msgstr "Leveransadress"

#, python-brace-format
msgid "{field} must be filled if using an alternative e-invoice address"
msgid "{field} must be filled if using an e-invoice address"
msgstr ""

msgid "Alteration cannot start before first benefit day"
Expand Down Expand Up @@ -860,8 +860,8 @@ msgid "amount of unwarranted benefit to be collected"
msgstr "understödsbelopp som beviljats, beräknat av systemet"

msgid ""
"whether to use a separate e-invoice address from the one of the applicant "
"organization"
"whether to use handle billing with an e-invoice instead of a bill sent to a "
"physical address"
msgstr ""

#, fuzzy
Expand All @@ -877,6 +877,11 @@ msgstr ""
msgid "e-invoice address"
msgstr "Leveransadress"

#, fuzzy
#| msgid "company contact person's email"
msgid "contact person"
msgstr "kontaktpersonens e-postadress"

#, fuzzy
#| msgid "File not found."
msgid "Not found"
Expand Down

0 comments on commit bd08f18

Please sign in to comment.