Visual improvements, add navbar

This commit is contained in:
RunasSudo 2022-12-24 16:57:53 +11:00
parent b34ec8473e
commit cf92c9b638
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
10 changed files with 316 additions and 272 deletions

View File

@ -80,6 +80,9 @@ class TrialBalancer:
# TODO: Keep a record of internal transactions?
if source_account not in self.accounts:
return
if destination_account not in self.accounts:
self.accounts[destination_account] = Amount(0, '$') # FIXME: Other commodities

View File

@ -25,6 +25,17 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.2/font/bootstrap-icons.css" integrity="sha256-4RctOgogjPAdwGbwq+rxfwAmSpZhWaafcZR9btzUk18=" crossorigin="anonymous">
</head>
<body>
{% block body %}{% endblock %}
{% block body %}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="/">DrCr</a>
</div>
</nav>
<div class="container">
{% block content %}{% endblock %}
</div>
{% endblock %}
{% block scripts %}{% endblock %}
</body>
</html>

View File

@ -18,9 +18,8 @@
{% extends 'base.html' %}
{% block title %}General journal{% endblock %}
{% block body %}
<div class="container">
<h1 class="h2 mt-4 mb-4">General journal</h1>
{% block content %}
<h1 class="h2 my-4">General journal</h1>
<table class="table">
<thead>
@ -51,5 +50,4 @@
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}

View File

@ -18,9 +18,8 @@
{% extends 'base.html' %}
{% block title %}General ledger{% endblock %}
{% block body %}
<div class="container">
<h1 class="h2 mt-4 mb-4">General ledger</h1>
{% block content %}
<h1 class="h2 my-4">General ledger</h1>
<table class="table">
<thead>
@ -51,5 +50,4 @@
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}

38
drcr/templates/index.html Normal file
View File

@ -0,0 +1,38 @@
{# DrCr: Web-based double-entry bookkeeping framework
Copyright (C) 2022 Lee Yingtong Li (RunasSudo)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
#}
{% extends 'base.html' %}
{% block title %}DrCr{% endblock %}
{% block content %}
<h1 class="h2 my-4">Data sources</h1>
<ul>
<li><a href="/general-journal">General journal</a></li>
<li><a href="/statement-lines">Statement lines</a></li>
</ul>
<h1 class="h2 my-4">General reports</h1>
<ul>
<li><a href="/general-ledger">General ledger</a></li>
<li><a href="/trial-balance">Trial balance</a></li>
</ul>
<h1 class="h2 my-4">Advanced reports</h1>
<ul>
<li><a href="/reports/balance-sheet">Balance sheet</a></li>
</ul>
{% endblock %}

View File

@ -18,9 +18,8 @@
{% extends 'base.html' %}
{% block title %}Edit statement line charge{% endblock %}
{% block body %}
<div class="container">
<h1 class="h2 mt-4 mb-4">Statement line</h1>
{% block content %}
<h1 class="h2 my-4">Statement line</h1>
<table class="table">
<thead>
@ -109,8 +108,9 @@
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
</div>
{% endblock %}
{% block scripts %}
<script>
function addPosting(el) {
let trPosting = el.parentNode.parentNode;

View File

@ -18,9 +18,8 @@
{% extends 'base.html' %}
{% block title %}Statement lines{% endblock %}
{% block body %}
<div class="container">
<h1 class="h2 mt-4 mb-4">Statement lines</h1>
{% block content %}
<h1 class="h2 my-4">Statement lines</h1>
<form method="POST">
<div class="mb-2">
@ -65,8 +64,9 @@
</tbody>
</table>
</form>
</div>
{% endblock %}
{% block scripts %}
<script>
function classifyLine(lineId) {
let chargeAccount = prompt('Charge to:');

View File

@ -18,9 +18,8 @@
{% extends 'base.html' %}
{% block title %}Account transactions{% endblock %}
{% block body %}
<div class="container">
<h1 class="h2 mt-4 mb-4">Account transactions</h1>
{% block content %}
<h1 class="h2 my-4">Account transactions</h1>
<table class="table">
<thead>
@ -85,5 +84,4 @@
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}

View File

@ -18,9 +18,8 @@
{% extends 'base.html' %}
{% block title %}Trial balance{% endblock %}
{% block body %}
<div class="container">
<h1 class="h2 mt-4 mb-4">Trial balance</h1>
{% block content %}
<h1 class="h2 my-4">Trial balance</h1>
<table class="table">
<thead>
@ -45,5 +44,4 @@
</tr>
</tbody>
</table>
</div>
{% endblock %}

View File

@ -21,7 +21,7 @@ from .webapp import all_transactions, app
@app.route('/')
def index():
return '<a href="/general-journal">General journal</a><br><a href="/statement-lines">Statement lines</a><br><a href="/general-ledger">General ledger</a><br><a href="/trial-balance">Trial balance</a>'
return render_template('index.html')
@app.route('/general-ledger')
def general_ledger():