Skip to content

Commit f918885

Browse files
committed
Merge branch 'develop'
2 parents 85594ca + 216fb7c commit f918885

35 files changed

+954
-246
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-20.04
1313
environment: test
1414
strategy:
1515
matrix:

CHANGELOG.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.2.0] - 2024-08-30
11+
12+
### Added
13+
14+
- Add VAT and VAT-amount to Refund-model ([d4e72f8](https://github.com/City-of-Helsinki/parking-permits/commit/d4e72f80d6ac20fc85b69c47e843d55f8bbbb31b))
15+
- Add VAT to Refund in Django Admin ([273018b](https://github.com/City-of-Helsinki/parking-permits/commit/273018bd9c34c5456b1d52c0fd83ce91e9fbd1ed))
16+
17+
### Changed
18+
19+
- Update low-emission criteria evaluation rules ([08aeef5](https://github.com/City-of-Helsinki/parking-permits/commit/08aeef571eab6228830ced83c9c4d2028023b5d9))
20+
- Explicitly use Ubuntu 20.04 base image with GitHub Actions ([8c29d7a](https://github.com/City-of-Helsinki/parking-permits/commit/8c29d7a3aa4038350bec140d4f6baa83d9f506e3))
21+
- Update VAT-percentages from Talpa-endpoints ([f79f9dd](https://github.com/City-of-Helsinki/parking-permits/commit/f79f9dda6b258823ec689da2ac8a48b533a87766))
22+
- Update VAT-percentages for Refund ([4afdb80](https://github.com/City-of-Helsinki/parking-permits/commit/4afdb80edf6f1f1fc339a24fa39f43c3fc43a4c2))
23+
- Use AWS ECR Docker image repository ([c7ef79d](https://github.com/City-of-Helsinki/parking-permits/commit/c7ef79d7dd9ca830297a7fd0da2ff301b576db79))
24+
- Change Refund VAT to be dynamic ([8e7ca2f](https://github.com/City-of-Helsinki/parking-permits/commit/8e7ca2fa716569815813bcb31b5e951aa1672f48))
25+
- Change Refund creation to be VAT-based ([1ce4469](https://github.com/City-of-Helsinki/parking-permits/commit/1ce44694eff95ff4a42c3d8012d1242da30c067c))
26+
27+
### Fixed
28+
29+
- Fix price calculation for first days of the month ([f96ebd6](https://github.com/City-of-Helsinki/parking-permits/commit/f96ebd69a737acad40e52df9332d4c257b38f2b0))
30+
- Fix find_next_date-utility function ([326da62](https://github.com/City-of-Helsinki/parking-permits/commit/326da625d2fb8d46ebb1cc918854b35af24d890e))
31+
1032
## [1.1.0] - 2024-06-19
1133

1234
### Added
1335

14-
- Add changelog to project
36+
- Add changelog to project ([2d4300a](https://github.com/City-of-Helsinki/parking-permits/commit/2d4300a6bc329533474e33b861d2e73cc887460c))
1537

1638
### Changed
1739

18-
- Update Python version to 3.11 from CI
19-
- Update application packages
20-
- Update fi/sv/en translations
21-
- Update Azure CI-settings
40+
- Update Python version to 3.11 from CI ([dd07848](https://github.com/City-of-Helsinki/parking-permits/commit/dd0784825344cdf09081b6a7dad937241e1c65d5))
41+
- Update application packages ([f0e2e5c](https://github.com/City-of-Helsinki/parking-permits/commit/f0e2e5c3dd72cfc8102d2e888651b5e60b3d6019))
42+
- Update fi/sv/en translations ([f60e86d](https://github.com/City-of-Helsinki/parking-permits/commit/f60e86d659daf8bf342e294c6c53ddd41becfee5))
43+
- Update Azure CI-settings ([456ddf4](https://github.com/City-of-Helsinki/parking-permits/commit/456ddf40b77952101877d9b7375c596fae4c447d))
2244

2345
### Removed
2446

25-
- Remove obsolete Docker Compose version
47+
- Remove obsolete Docker Compose version ([8e3b8ab](https://github.com/City-of-Helsinki/parking-permits/commit/8e3b8ab3d8173b575dc8d55313469b438238cbb0))
2648

2749
## [1.0.0] - 2024-06-12
2850

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04 as base
1+
FROM public.ecr.aws/ubuntu/ubuntu:20.04 as base
22

33
WORKDIR /app
44

parking_permits/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ class RefundAdmin(admin.ModelAdmin):
210210
"status",
211211
"created_at",
212212
"accepted_at",
213+
"vat",
213214
)
214215
list_select_related = ("order",)
215216
ordering = ("-created_at",)

parking_permits/admin_resolvers.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from parking_permits.services.parkkihubi import sync_with_parkkihubi
4141
from users.models import ParkingPermitGroups
4242

43-
from .constants import EventFields, Origin
43+
from .constants import DEFAULT_VAT, EventFields, Origin
4444
from .decorators import (
4545
is_customer_service,
4646
is_inspectors,
@@ -817,14 +817,19 @@ def resolve_update_resident_permit(
817817
order=order,
818818
amount=-customer_total_price_change,
819819
iban=iban,
820+
vat=(
821+
order.order_items.first().vat
822+
if order.order_items.exists()
823+
else DEFAULT_VAT
824+
),
820825
description=f"Refund for updating permit: {permit.id}",
821826
)
822827
refund.permits.add(permit)
823828
logger.info(f"Refund for lowered permit price created: {refund}")
824829
ParkingPermitEventFactory.make_create_refund_event(
825830
permit, refund, created_by=request.user
826831
)
827-
send_refund_email(RefundEmailType.CREATED, customer, refund)
832+
send_refund_email(RefundEmailType.CREATED, customer, [refund])
828833

829834
bypass_traficom_validation = permit_info.get("bypass_traficom_validation", False)
830835

@@ -1004,7 +1009,6 @@ def resolve_end_permit(
10041009
request.user,
10051010
permit,
10061011
end_type=end_type,
1007-
payment_type=OrderPaymentType.CASHIER_PAYMENT,
10081012
iban=iban,
10091013
)
10101014
return {"success": True}

parking_permits/constants.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
from decimal import Decimal
2+
3+
DEFAULT_VAT = Decimal(0.255)
14
SECONDARY_VEHICLE_PRICE_INCREASE = 50
2-
VAT_PERCENTAGE = 24
35

46

57
class Origin:

parking_permits/customer_permit.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@ def end(
390390
user,
391391
*permits,
392392
end_type=end_type,
393-
payment_type=OrderPaymentType.ONLINE_PAYMENT,
394393
iban=iban,
395394
subscription_cancel_reason=subscription_cancel_reason,
396395
cancel_from_talpa=cancel_from_talpa,

parking_permits/exporters.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ def get_refund_content(refund):
313313
_("Customer")
314314
+ ": "
315315
+ f"{refund.order.customer.first_name} {refund.order.customer.last_name}",
316-
_("Amount") + ": " + f"{refund.amount} e (" + _("incl. VAT") + " 24%)",
316+
_("Amount")
317+
+ ": "
318+
+ f"{refund.amount} e ({_('incl. VAT')} {_format_percentage(refund.vat_percent)} %)",
317319
_("IBAN") + ": " + f"{refund.iban}",
318320
_("Status") + ": " + f"{refund.get_status_display()}",
319321
_("Extra info") + ": " + f"{refund.description}",

parking_permits/management/commands/create_parking_zone_products.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def handle(self, *args, **options):
7171
"type": ProductType.RESIDENT,
7272
"unit_price": zone_price
7373
* Decimal(options["price_increment_factor_old_zone"]),
74-
"vat": Decimal(0.24),
74+
"vat": Decimal(0.255),
7575
"low_emission_discount": Decimal(
7676
options["low_emission_discount_old_zone"]
7777
),
@@ -90,7 +90,7 @@ def handle(self, *args, **options):
9090
"type": ProductType.RESIDENT,
9191
"unit_price": zone_price
9292
* Decimal(options["price_increment_factor_new_zone"]),
93-
"vat": Decimal(0.24),
93+
"vat": Decimal(0.255),
9494
"low_emission_discount": Decimal(
9595
options["low_emission_discount_new_zone"]
9696
),
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 5.0.6 on 2024-08-09 04:50
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("parking_permits", "0058_alter_vehicle_vehicle_class"),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name="refund",
15+
name="vat",
16+
field=models.DecimalField(
17+
decimal_places=4, default=0.24, max_digits=6, verbose_name="VAT"
18+
),
19+
),
20+
]

0 commit comments

Comments
 (0)