Metadata-Version: 2.1
Name: trytond_account_statement_rule
Version: 7.0.1
Summary: Tryton module to automate statement import with rules
Home-page: http://www.tryton.org/
Download-URL: http://downloads.tryton.org/7.0/
Author: Tryton
Author-email: foundation@tryton.org
License: GPL-3
Project-URL: Bug Tracker, https://bugs.tryton.org/
Project-URL: Documentation, https://docs.tryton.org/
Project-URL: Forum, https://www.tryton.org/forum
Project-URL: Source Code, https://code.tryton.org/tryton
Keywords: tryton statement import rule
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Plugins
Classifier: Framework :: Tryton
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Legal Industry
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Natural Language :: Bulgarian
Classifier: Natural Language :: Catalan
Classifier: Natural Language :: Chinese (Simplified)
Classifier: Natural Language :: Czech
Classifier: Natural Language :: Dutch
Classifier: Natural Language :: English
Classifier: Natural Language :: Finnish
Classifier: Natural Language :: French
Classifier: Natural Language :: German
Classifier: Natural Language :: Hungarian
Classifier: Natural Language :: Indonesian
Classifier: Natural Language :: Italian
Classifier: Natural Language :: Persian
Classifier: Natural Language :: Polish
Classifier: Natural Language :: Portuguese (Brazilian)
Classifier: Natural Language :: Romanian
Classifier: Natural Language :: Russian
Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Natural Language :: Turkish
Classifier: Natural Language :: Ukrainian
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Office/Business
Requires-Python: >=3.8
License-File: LICENSE
Requires-Dist: trytond_account<7.1,>=7.0
Requires-Dist: trytond_account_invoice<7.1,>=7.0
Requires-Dist: trytond_account_statement<7.1,>=7.0
Requires-Dist: trytond_company<7.1,>=7.0
Requires-Dist: trytond_party<7.1,>=7.0
Requires-Dist: trytond<7.1,>=7.0
Provides-Extra: test
Requires-Dist: proteus<7.1,>=7.0; extra == "test"
Requires-Dist: trytond_bank<7.1,>=7.0; extra == "test"

Account Statement Rule Module
#############################

The account_statement_rule module allows rules to be defined to complete
statement lines from imported files.
When the "Apply Rule" button is clicked on a statement, each rule is tested in
order against each origin that does not have any lines until one is found that
matches. Then the rule found is used to create the statement lines linked to
the origin.

Rule
****

A rule is composed of two parts: matching criteria and lines.

Criteria
--------

The criteria are matched with each origin of the statement:

    * Company
    * Journal
    * Amount: Check if the amount is between two values
    * Description: `A regular expression
      <https://docs.python.org/library/re.html#regular-expression-syntax>`_ to
      search for a match in the origin description.
    * Information rules:

        * Key: the statement information key on which the rule applies
        * The matching value depending of the type of the key:

            * Boolean
            * Numeric: A range of value.
            * Char: A regular expression.
            * Selection

The regular expression can register the group names ``party``, ``bank_account``
and ``invoice`` which are later used to search for a party and an invoice.

Lines
-----

They define how to create the statement lines from the matching origin:

    * Amount: A Python expression evaluated with:
        * ``amount``: the amount of the origin.
        * ``pending``: the amount from which previous lines have been deducted.
    * Party
    * Account

If the party is not filled in, one will be searched for using the
``bank_account`` or the ``party`` group names from the regular expressions.
If the ``invoice`` group name appears in a regular expression, it will be used
to find an invoice to link with.
