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-07-30 00:10:11 +08:00
|
|
|
from django.views.decorators.http import require_GET
|
|
|
|
from django.views.generic import RedirectView
|
2020-06-30 20:59:24 +08:00
|
|
|
|
2020-07-09 23:19:48 +08:00
|
|
|
from mia_core import views as mia_core_views
|
2020-07-30 00:12:13 +08:00
|
|
|
from mia_core.digest_auth import login_required
|
2020-07-23 14:17:05 +08:00
|
|
|
from . import converters, views
|
2020-06-30 20:59:24 +08:00
|
|
|
|
2020-07-23 01:22:11 +08:00
|
|
|
register_converter(converters.PeriodConverter, "period")
|
2020-07-23 08:33:53 +08:00
|
|
|
register_converter(converters.CashAccountConverter, "cash-account")
|
|
|
|
register_converter(converters.LedgerAccountConverter, "ledger-account")
|
2020-07-23 22:02:26 +08:00
|
|
|
register_converter(converters.TransactionTypeConverter, "txn-type")
|
|
|
|
register_converter(converters.TransactionConverter, "txn")
|
2020-07-23 23:01:19 +08:00
|
|
|
register_converter(converters.DateConverter, "date")
|
2020-07-21 22:05:39 +08:00
|
|
|
|
2020-06-30 20:59:24 +08:00
|
|
|
app_name = "accounting"
|
|
|
|
urlpatterns = [
|
2020-07-30 00:12:13 +08:00
|
|
|
path("", require_GET(login_required(RedirectView.as_view(
|
2020-08-02 00:08:53 +08:00
|
|
|
query_string=True,
|
|
|
|
pattern_name="accounting:cash.home",
|
2020-07-30 00:10:11 +08:00
|
|
|
))), name="home"),
|
|
|
|
path("cash",
|
|
|
|
views.CashDefaultView.as_view(), name="cash.home"),
|
2020-07-23 08:33:53 +08:00
|
|
|
path("cash/<cash-account:account>/<period:period>",
|
2020-07-23 14:17:05 +08:00
|
|
|
views.cash, name="cash"),
|
2020-07-11 07:12:53 +08:00
|
|
|
path("cash-summary",
|
2020-07-30 00:10:11 +08:00
|
|
|
views.CashSummaryDefaultView.as_view(), name="cash-summary.home"),
|
2020-07-23 08:33:53 +08:00
|
|
|
path("cash-summary/<cash-account:account>",
|
2020-07-23 14:17:05 +08:00
|
|
|
views.cash_summary, name="cash-summary"),
|
2020-07-11 07:12:53 +08:00
|
|
|
path("ledger",
|
2020-07-30 00:10:11 +08:00
|
|
|
views.LedgerDefaultView.as_view(), name="ledger.home"),
|
2020-07-23 08:33:53 +08:00
|
|
|
path("ledger/<ledger-account:account>/<period:period>",
|
2020-07-23 14:17:05 +08:00
|
|
|
views.ledger, name="ledger"),
|
2020-07-11 07:12:53 +08:00
|
|
|
path("ledger-summary",
|
2020-07-30 00:10:11 +08:00
|
|
|
views.LedgerSummaryDefaultView.as_view(), name="ledger-summary.home"),
|
2020-07-23 08:33:53 +08:00
|
|
|
path("ledger-summary/<ledger-account:account>",
|
2020-07-23 14:17:05 +08:00
|
|
|
views.ledger_summary, name="ledger-summary"),
|
2020-07-11 07:12:53 +08:00
|
|
|
path("journal",
|
2020-07-30 00:10:11 +08:00
|
|
|
views.JournalDefaultView.as_view(), name="journal.home"),
|
2020-07-21 22:05:39 +08:00
|
|
|
path("journal/<period:period>",
|
2020-07-23 14:17:05 +08:00
|
|
|
views.journal, name="journal"),
|
2020-07-11 07:12:53 +08:00
|
|
|
path("trial-balance",
|
2020-07-30 00:10:11 +08:00
|
|
|
views.TrialBalanceDefaultView.as_view(), name="trial-balance.home"),
|
2020-07-21 22:05:39 +08:00
|
|
|
path("trial-balance/<period:period>",
|
2020-07-23 14:17:05 +08:00
|
|
|
views.trial_balance, name="trial-balance"),
|
2020-07-11 07:12:53 +08:00
|
|
|
path("income-statement",
|
2020-07-30 00:10:11 +08:00
|
|
|
views.IncomeStatementDefaultView.as_view(),
|
|
|
|
name="income-statement.home"),
|
2020-07-21 22:05:39 +08:00
|
|
|
path("income-statement/<period:period>",
|
2020-07-23 14:17:05 +08:00
|
|
|
views.income_statement, name="income-statement"),
|
2020-07-11 07:12:53 +08:00
|
|
|
path("balance-sheet",
|
2020-07-30 00:10:11 +08:00
|
|
|
views.BalanceSheetDefaultView.as_view(), name="balance-sheet.home"),
|
2020-07-21 22:05:39 +08:00
|
|
|
path("balance-sheet/<period:period>",
|
2020-07-23 14:17:05 +08:00
|
|
|
views.balance_sheet, name="balance-sheet"),
|
2020-07-09 23:19:48 +08:00
|
|
|
path("search",
|
2020-07-23 14:17:05 +08:00
|
|
|
views.search, name="search"),
|
2020-07-29 15:06:23 +08:00
|
|
|
path("transactions/<txn-type:txn_type>/create",
|
2020-08-02 03:08:26 +08:00
|
|
|
views.txn_edit, name="transactions.create"),
|
2020-07-29 15:06:23 +08:00
|
|
|
path("transactions/<txn-type:txn_type>/store",
|
2020-08-02 03:08:26 +08:00
|
|
|
views.txn_store, name="transactions.store"),
|
2020-08-02 03:00:23 +08:00
|
|
|
path("transactions/<txn-type:txn_type>/<txn:txn>",
|
2020-08-02 03:08:26 +08:00
|
|
|
views.txn_show, name="transactions.show"),
|
2020-08-02 03:00:23 +08:00
|
|
|
path("transactions/<txn-type:txn_type>/<txn:txn>/edit",
|
2020-08-02 03:08:26 +08:00
|
|
|
views.txn_edit, name="transactions.edit"),
|
2020-08-02 03:00:23 +08:00
|
|
|
path("transactions/<txn-type:txn_type>/<txn:txn>/update",
|
2020-08-02 03:08:26 +08:00
|
|
|
views.txn_store, name="transactions.update"),
|
2020-08-02 03:00:23 +08:00
|
|
|
path("transactions/<txn:txn>/delete",
|
2020-08-05 08:23:20 +08:00
|
|
|
views.txn_delete, name="transactions.delete"),
|
2020-08-04 09:18:28 +08:00
|
|
|
# TODO: To be done
|
2020-07-23 23:01:19 +08:00
|
|
|
path("transactions/sort/<date:date>",
|
|
|
|
mia_core_views.todo, name="transactions.sort"),
|
2020-08-04 09:18:28 +08:00
|
|
|
# TODO: To be done
|
2020-07-21 10:38:47 +08:00
|
|
|
path("accounts",
|
|
|
|
mia_core_views.todo, name="accounts"),
|
2020-08-04 09:18:28 +08:00
|
|
|
# TODO: To be done
|
2020-07-21 10:38:47 +08:00
|
|
|
path("accounts/create",
|
|
|
|
mia_core_views.todo, name="accounts.create"),
|
2020-08-04 09:18:28 +08:00
|
|
|
# TODO: To be done
|
2020-07-21 10:38:47 +08:00
|
|
|
path("accounts/store",
|
|
|
|
mia_core_views.todo, name="accounts.store"),
|
2020-08-03 00:02:51 +08:00
|
|
|
path("accounts/options",
|
|
|
|
views.account_options, name="accounts.options"),
|
2020-08-04 09:18:28 +08:00
|
|
|
# TODO: To be done
|
2020-07-21 10:38:47 +08:00
|
|
|
path("accounts/<str:account_code>",
|
2020-07-23 22:02:26 +08:00
|
|
|
mia_core_views.todo, name="accounts.show"),
|
2020-08-04 09:18:28 +08:00
|
|
|
# TODO: To be done
|
2020-07-21 10:38:47 +08:00
|
|
|
path("accounts/<str:account_code>/edit",
|
|
|
|
mia_core_views.todo, name="accounts.edit"),
|
2020-08-04 09:18:28 +08:00
|
|
|
# TODO: To be done
|
2020-07-21 10:38:47 +08:00
|
|
|
path("accounts/<str:account_code>/update",
|
|
|
|
mia_core_views.todo, name="accounts.update"),
|
2020-08-04 09:18:28 +08:00
|
|
|
# TODO: To be done
|
2020-07-21 10:38:47 +08:00
|
|
|
path("accounts/<str:account_code>/delete",
|
|
|
|
mia_core_views.todo, name="accounts.delete"),
|
2020-06-30 20:59:24 +08:00
|
|
|
]
|