mia-accounting/docs/source/intro.rst

3.9 KiB

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> </head>

Introduction

Mia! Accounting is an accounting module for Flask applications. It implements double-entry bookkeeping, and generates the following accounting reports:

  • Trial balance
  • Income statement
  • Balance sheet

In addition, Mia! Accounting tracks offsets for unpaid payables and receivables.

Installation

Install Mia! Accounting with pip:

pip install mia-accounting

You may also download the from the PyPI project page or the release page on the Git repository.

Test Site and Live Demonstration

You may find a working example in the test site in the source distribution. It is the simplest website that works with Mia! Accounting. It is used in the automatic tests. It is the same code run for live demonstration.

If you do not have a running Flask application or do not know how to start one, you may start with the test site.

Prerequisites

You need a running Flask application with database user login. The primary key of the user data model must be integer.

The following front-end JavaScript libraries must be loaded. You may download it locally or use CDN.

Configuration

You need to pass the Flask app and an implementation of :py:class:`accounting.utils.user.UserUtilityInterface` to the :py:func:`accounting.init_app` function. UserUtilityInterface contains everything Mia! Accounting needs.

System Message: ERROR/3 (<stdin>, line 59); backlink

Unknown interpreted text role "py:class".

System Message: ERROR/3 (<stdin>, line 59); backlink

Unknown interpreted text role "py:func".

See an example in :ref:`example-userutils`.

System Message: ERROR/3 (<stdin>, line 64); backlink

Unknown interpreted text role "ref".

Database Initialization

After the configuration, you need to run flask_sqlalchemy.SQLAlchemy.create_all to create the database tables that Mia! Accounting uses.

Mia! Accounting adds three console commands:

  • accounting-init-base
  • accounting-init-accounts
  • accounting-init-currencies

After database tables are created, run accounting-init-base first, and then the other two commands.

% flask --app myapp accounting-init-base
% flask --app myapp accounting-init-accounts
% flask --app myapp accounting-init-currencies

Navigation Menu

Include the navigation menu in the Bootstrap navigation bar in your base template:

<nav class="navbar navbar-expand-lg bg-body-tertiary bg-dark navbar-dark">
  <div class="container-fluid">
    ...
    <div id="collapsible-navbar" class="collapse navbar-collapse">
      <ul class="navbar-nav me-auto mb-2 mb-lg-0">
        ...
        {% include "accounting/include/nav.html" %}
        ...
      </ul>
      ...
    </div>
  </div>
</nav>

Check your Flask application and see how it works.

Documentation

Refer to the documentation on Read the Docs.

</html>