ComptaClub/comptabilite/urls.py

63 lines
1.8 KiB
Python

# from django.conf.urls import path
from django.urls import path, re_path
from .views import (
year_listing,
transaction_details,
comptability_export,
generate_pdf_for_spf,
export_year_spf_finance,
transaction_by_year_listing,
transaction_listing_for_year_and_type,
transaction_create_or_update
)
app_name = "annualcomptability"
urlpatterns = [
path(r"", year_listing, name="year_listing"),
re_path(
r"^listing/(?P<accounting_year>[0-9]{4})/(?P<transaction_kind>[A-Za-z]+)/$",
transaction_by_year_listing,
name="by_year_bank",
),
re_path(
r"^listing/(?P<accounting_year>[0-9]{4})/(?P<transaction_kind>[A-Za-z]+)/$",
transaction_by_year_listing,
name="by_year_box",
),
path(
r"listing/<int:accounting_year>/<int:transaction_type_id>/",
transaction_listing_for_year_and_type,
name="transaction_listing_for_year_and_type",
),
# http://127.0.0.1:8000/comptability/annual/listing/2017/3
path(
r"listing/<int:accounting_year>/",
transaction_by_year_listing,
name="by_year",
),
path(
r"details/<int:transaction_id>/",
transaction_details,
name="transaction_details",
),
path(
r"export/simple/<int:accounting_year>/",
export_year_spf_finance,
name="export_simple",
),
re_path(
r"^export/(?P<accounting_year>[0-9]{4})/(?P<export_type>\w+)/$",
comptability_export,
name="export",
),
path(
r"export/pdf/<int:accounting_year>/",
generate_pdf_for_spf,
name="pdf_export",
),
path(r"create/", transaction_create_or_update, name="transaction_create"),
path(r"update/<int:transaction_id>/", transaction_create_or_update, name="transaction_update"),
]