Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Feature/personio to datev #90

Merged
merged 5 commits into from
Nov 30, 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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ jobs:

- uses: moneymeets/moneymeets-composite-actions/lint-python@master

- run: poetry run pytest --cov --cov-fail-under=50
env:
DJANGO_DEBUG: 1

build-image:
runs-on: ubuntu-22.04
timeout-minutes: 30
Expand Down
7 changes: 7 additions & 0 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import os
from pathlib import Path

from django.contrib.messages import constants as message_constants

# Build paths inside the project like this: BASE_DIR / "..."
BASE_DIR = Path(__file__).resolve().parent.parent

Expand Down Expand Up @@ -113,3 +115,8 @@
STATIC_URL = "static/"

STATIC_ROOT = BASE_DIR / "staticfiles"


MESSAGE_TAGS = {
message_constants.ERROR: "danger", # Bootstrap error class
}
333 changes: 324 additions & 9 deletions poetry.lock

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,30 @@ openpyxl = "*"
schwifty = "*"
sepaxml = "*"

pydantic = "*"

[tool.poetry.dev-dependencies]
django-debug-toolbar = "*"
pytest-django = "*"
pytest-cov = "*"

ruff = "*"

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "config.settings"
filterwarnings = [
"ignore:No directory at.*staticfiles:UserWarning",
]

[tool.coverage.run]
branch = true
source = ["."]
omit = [
"*/migrations/*",
"*/test_*.py",
"manage.py"
]

[build-system]
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Expand Down
2 changes: 2 additions & 0 deletions sepacetamol/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

<main role="main" class="container">

<h1>SEPAcetamol</h1>

{% block content %}
{% endblock %}

Expand Down
43 changes: 43 additions & 0 deletions sepacetamol/templates/datev.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{% extends "base.html" %}

{% load static %}


{% block content %}
<h2>Personio accounting</h2>

{% for message in messages %}
<div class="alert alert-{{ message.level_tag }}" role="alert">{{ message }}</div>
{% endfor %}

<form class="mb-3" method="post" enctype="multipart/form-data">

{% csrf_token %}

<div class="row mb-3">
<label for="consultant-number" class="col-sm-2 col-form-label">Consultant number</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="consultant-number" name="consultant-number"
placeholder="843719" required>
</div>
</div>

<div class="row mb-3">
<label for="client-number" class="col-sm-2 col-form-label">Client number</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="client-number" name="client-number"
placeholder="10487" required>
</div>
</div>

<div class="col-auto mb-3">
<input type="file" class="form-control" id="personio-file" name="personio-file"
accept=".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" required>
</div>

<div class="col-auto">
<button type="submit" class="btn btn-primary">Convert file</button>
</div>

</form>
{% endblock %}
4 changes: 3 additions & 1 deletion sepacetamol/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
{% load static %}

{% block content %}
<h1>SEPAcetamol</h1>
<div class="alert alert-info" role="alert">
For Personio → DATEV converter, <a href="{% url "personio-datev" %}">follow along</a>.
</div>

<p>
Download the <a href="{% static "sepa-xml-template.xlsx" %}">wire table template</a>,
Expand Down
7 changes: 4 additions & 3 deletions sepacetamol/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from django.urls import path

from . import views
from .views import datev, sepa

urlpatterns = [
path("", views.index, name="index"),
path("generate/", views.generate, name="generate"),
path("", sepa.index, name="index"),
path("generate/", sepa.generate, name="generate"),
path("personio-datev/", datev.index, name="personio-datev"),
]
Empty file added sepacetamol/views/__init__.py
Empty file.
Loading