Skip to content

Commit

Permalink
Change confirmed maximum price pdf to show absolute date instead of r…
Browse files Browse the repository at this point in the history
…elative in case of three months expiry
  • Loading branch information
indigane committed Dec 16, 2024
1 parent c447f7b commit abd72a1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions backend/hitas/services/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def render_confirmed_max_price_calculation_pdf(
"body_parts": pdf_body.texts,
"title": filename,
"date_today": datetime.date.strftime(timezone.now().date(), "%d.%m.%Y"),
"three_months_after_date_today": (timezone.now() + datetime.timedelta(days=90)).date(),
}
pdf = render_to_pdf(template="confirmed_maximum_price.jinja", context=context)
return filename, pdf
Expand Down
2 changes: 1 addition & 1 deletion backend/hitas/templates/confirmed_maximum_price.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
{% if is_surface_area_maximum %}
Enimmäismyyntihinta on vahvistettu rajahinnan perusteella ja laskelma on voimassa {{ maximum_price_calculation.valid_until|format_date }} asti.
{% else %}
Enimmäismyyntihinta on voimassa kolme kuukautta laskelman päiväyksestä.
Enimmäismyyntihinta on voimassa {{ three_months_after_date_today|format_date }} asti.
{% endif %}
</p>
<div class="plain-text">{{ body_parts.0|linebreaks }}</div>
Expand Down
1 change: 1 addition & 0 deletions backend/hitas/views/apartment.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,7 @@ def download_latest_confirmed_prices(self, request, **kwargs) -> HttpResponse:
"maximum_price_calculation": mpc,
"user": request.user,
"body_parts": body_parts,
"three_months_after_date_today": (timezone.now() + datetime.timedelta(days=90)).date(),
}
pdf = get_pdf_response(filename=filename, template="confirmed_maximum_price.jinja", context=context)

Expand Down

0 comments on commit abd72a1

Please sign in to comment.