2020-06-30 20:59:24 +08:00
|
|
|
# The accounting application of the Mia project.
|
|
|
|
# by imacat <imacat@mail.imacat.idv.tw>, 2020/6/30
|
|
|
|
|
|
|
|
# Copyright (c) 2020 imacat.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
"""The route settings of the accounting application.
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
2020-06-30 23:49:21 +08:00
|
|
|
from django.urls import path, register_converter
|
2020-06-30 20:59:24 +08:00
|
|
|
|
|
|
|
from . import views
|
2020-07-09 23:19:48 +08:00
|
|
|
from mia_core import views as mia_core_views
|
2020-06-30 20:59:24 +08:00
|
|
|
|
2020-06-30 23:49:21 +08:00
|
|
|
|
|
|
|
class TransactionTypeConverter:
|
|
|
|
"""The path converter for the transaction types."""
|
|
|
|
regex = "income|expense|transfer"
|
|
|
|
|
|
|
|
def to_python(self, value):
|
|
|
|
return value
|
|
|
|
|
|
|
|
def to_url(self, value):
|
|
|
|
return value
|
|
|
|
|
|
|
|
|
|
|
|
register_converter(TransactionTypeConverter, "txn-type")
|
|
|
|
|
2020-06-30 20:59:24 +08:00
|
|
|
app_name = "accounting"
|
|
|
|
urlpatterns = [
|
|
|
|
path("", views.home, name="home"),
|
|
|
|
path("cash", views.cash_home, name="cash.home"),
|
2020-07-02 09:45:11 +08:00
|
|
|
path("cash/<str:subject_code>/<str:period_spec>",
|
2020-07-11 17:23:38 +08:00
|
|
|
views.cash, name="cash"),
|
2020-07-11 07:12:53 +08:00
|
|
|
path("cash-summary",
|
|
|
|
mia_core_views.todo, name="cash-summary.home"),
|
2020-07-09 23:19:48 +08:00
|
|
|
path("cash-summary/<str:subject_code>",
|
2020-07-16 00:28:50 +08:00
|
|
|
views.cash_summary, name="cash-summary"),
|
2020-07-11 07:12:53 +08:00
|
|
|
path("ledger",
|
|
|
|
mia_core_views.todo, name="ledger.home"),
|
2020-07-09 23:19:48 +08:00
|
|
|
path("ledger/<str:subject_code>/<str:period_spec>",
|
2020-07-16 22:12:59 +08:00
|
|
|
views.ledger, name="ledger"),
|
2020-07-11 07:12:53 +08:00
|
|
|
path("ledger-summary",
|
|
|
|
mia_core_views.todo, name="ledger-summary.home"),
|
2020-07-09 23:19:48 +08:00
|
|
|
path("ledger-summary/<str:subject_code>",
|
2020-07-17 00:12:30 +08:00
|
|
|
views.ledger_summary, name="ledger-summary"),
|
2020-07-11 07:12:53 +08:00
|
|
|
path("journal",
|
|
|
|
mia_core_views.todo, name="journal.home"),
|
2020-07-09 23:19:48 +08:00
|
|
|
path("journal/<str:period_spec>",
|
2020-07-17 23:27:49 +08:00
|
|
|
views.journal, name="journal"),
|
2020-07-11 07:12:53 +08:00
|
|
|
path("trial-balance",
|
|
|
|
mia_core_views.todo, name="trial-balance.home"),
|
2020-07-09 23:19:48 +08:00
|
|
|
path("trial-balance/<str:period_spec>",
|
2020-07-19 18:50:56 +08:00
|
|
|
views.trial_balance, name="trial-balance"),
|
2020-07-11 07:12:53 +08:00
|
|
|
path("income-statement",
|
|
|
|
mia_core_views.todo, name="income-statement.home"),
|
2020-07-09 23:19:48 +08:00
|
|
|
path("income-statement/<str:period_spec>",
|
|
|
|
mia_core_views.todo, name="income-statement"),
|
2020-07-11 07:12:53 +08:00
|
|
|
path("balance-sheet",
|
|
|
|
mia_core_views.todo, name="balance-sheet.home"),
|
2020-07-09 23:19:48 +08:00
|
|
|
path("balance-sheet/<str:period_spec>",
|
|
|
|
mia_core_views.todo, name="balance-sheet"),
|
|
|
|
path("search",
|
|
|
|
mia_core_views.todo, name="search"),
|
|
|
|
path("transactions/<txn-type:type>/create",
|
|
|
|
mia_core_views.todo, name="transactions.create"),
|
|
|
|
path("transactions/<txn-type:type>/store",
|
|
|
|
mia_core_views.todo, name="transactions.store"),
|
2020-07-02 09:45:11 +08:00
|
|
|
path("transactions/<txn-type:type>/<int:pk>",
|
2020-07-09 23:19:48 +08:00
|
|
|
mia_core_views.todo, name="transactions.view"),
|
2020-07-02 09:45:11 +08:00
|
|
|
path("transactions/<txn-type:type>/<int:pk>/edit",
|
2020-07-09 23:19:48 +08:00
|
|
|
mia_core_views.todo, name="transactions.edit"),
|
|
|
|
path("transactions/<txn-type:type>/<int:pk>/update",
|
|
|
|
mia_core_views.todo, name="transactions.update"),
|
|
|
|
path("transactions/<int:pk>/delete",
|
|
|
|
mia_core_views.todo, name="transactions.delete"),
|
|
|
|
path("subjects",
|
|
|
|
mia_core_views.todo, name="subjects"),
|
|
|
|
path("subjects/create",
|
|
|
|
mia_core_views.todo, name="subjects.create"),
|
|
|
|
path("subjects/store",
|
|
|
|
mia_core_views.todo, name="subjects.store"),
|
|
|
|
path("subjects/<str:subject_code>",
|
|
|
|
mia_core_views.todo, name="subjects.view"),
|
|
|
|
path("subjects/<str:subject_code>/edit",
|
|
|
|
mia_core_views.todo, name="subjects.edit"),
|
|
|
|
path("subjects/<str:subject_code>/update",
|
|
|
|
mia_core_views.todo, name="subjects.update"),
|
|
|
|
path("subjects/<str:subject_code>/delete",
|
|
|
|
mia_core_views.todo, name="subjects.delete"),
|
2020-06-30 20:59:24 +08:00
|
|
|
]
|