From 8ec4d98510dede7eacb7d28f730aedf7e0b283cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 24 Jul 2024 11:59:27 +0200 Subject: [PATCH] Update documentation of account cash rounding --- modules/account_cash_rounding/CHANGELOG | 5 ++ modules/account_cash_rounding/doc/design.rst | 85 +++++++++++++++++++ modules/account_cash_rounding/doc/index.rst | 13 ++- .../account_cash_rounding/doc/releases.rst | 7 ++ modules/account_cash_rounding/setup.py | 7 +- 5 files changed, 107 insertions(+), 10 deletions(-) create mode 100644 modules/account_cash_rounding/doc/design.rst create mode 100644 modules/account_cash_rounding/doc/releases.rst diff --git a/modules/account_cash_rounding/CHANGELOG b/modules/account_cash_rounding/CHANGELOG index 63f6ff4b7f..220fe27676 100644 --- a/modules/account_cash_rounding/CHANGELOG +++ b/modules/account_cash_rounding/CHANGELOG @@ -20,19 +20,24 @@ Version 6.6.0 - 2022-10-31 * Bug fixes (see mercurial logs for details) Version 6.4.0 - 2022-05-02 +-------------------------- * Bug fixes (see mercurial logs for details) * Add support for Python 3.10 * Remove support for Python 3.6 Version 6.2.0 - 2021-11-01 +-------------------------- * Bug fixes (see mercurial logs for details) Version 6.0.0 - 2021-05-03 +-------------------------- * Bug fixes (see mercurial logs for details) Version 5.8.0 - 2020-11-02 +-------------------------- * Bug fixes (see mercurial logs for details) * Remove support for Python 3.5 Version 5.6.0 - 2020-05-04 +-------------------------- * Initial release diff --git a/modules/account_cash_rounding/doc/design.rst b/modules/account_cash_rounding/doc/design.rst new file mode 100644 index 0000000000..3aae3f4430 --- /dev/null +++ b/modules/account_cash_rounding/doc/design.rst @@ -0,0 +1,85 @@ +****** +Design +****** + +The *Account Cash Rounding Module* extends the following concepts: + +.. _model-account.configuration: + +Account Configuration +===================== + +The *Account Configuration* is extended with a checkbox to round the cash +amounts and with two accounts to post the credited or debited amount due to the +rounding. + +.. seealso:: + + The `Account Configuration ` concept is + introduced by the :doc:`Account Module `. + +.. _model-currency.currency: + +Currency +======== + +When the *Account Cash Rounding Module* is activated, the *Currency* receives a +:guilabel:`Cash Rounding Factor` that represents the currency's smallest +available coin. + +.. seealso:: + + The `Currency ` concept is introduced by + the :doc:`Currency Module `. + +.. _model-account.invoice: + +Invoice +======= + +When the *Account Cash Rounding Module* is activated, the *Invoice* receives a +:guilabel:`Cash Rounding` checkbox. +For customer invoices, the checkbox is automatically checked according to the +`Account Configuration `. +For supplier invoices, it is up to the user to decide whether to check it or +not. +If the checkbox is checked then the total amount is rounded based on the +`Currency ` and any remaining amount is +posted to the corresponding accounts found in the *Account Configuration*. + +.. seealso:: + + The `Invoice ` concept is introduced + by the :doc:`Account Invoice Module `. + +.. _model-purchase.purchase: + +Purchase +======== + +When the *Account Cash Rounding Module* is activated, the *Purchase* receives a +:guilabel:`Cash Rounding` checkbox which by default is set to the value of the +last purchase from the same supplier. +When the checkbox is checked then the total amount is rounded based on the +`Currency ` and the *Purchase* transfers the +:guilabel:`Cash Rounding` setting to the created `Invoices +`. + +.. seealso:: + + The `Purchase ` concept is introduced by + the :doc:`Purchase Module `. + +.. _model-sale.sale: + +Sale +==== + +When the *Account Cash Rounding Module* is activated, the *Sale* rounds the +total amount according to the `Account Configuration +`. + +.. seealso:: + + The `Sale ` concept is introduced by the :doc:`Sale + Module `. diff --git a/modules/account_cash_rounding/doc/index.rst b/modules/account_cash_rounding/doc/index.rst index e774a81724..c74f7c4e60 100644 --- a/modules/account_cash_rounding/doc/index.rst +++ b/modules/account_cash_rounding/doc/index.rst @@ -1,12 +1,11 @@ +############################ Account Cash Rounding Module ############################ -The account_cash_rounding module allows cash amounts to be rounded using the -cash rounding factor of the currency. +The *Account Cash Rounding Module* round cash amounts by currency. -When the invoice has to round the lines to pay, the exceeded amount is debited -or credited to the accounts defined on the accounting configuration. +.. toctree:: + :maxdepth: 2 -Sales and invoices have the rounding activated by default based on the -accounting configuration flag. Purchase use the last purchase for the supplier -as the default value and transfer the value to the created invoices. + design + releases diff --git a/modules/account_cash_rounding/doc/releases.rst b/modules/account_cash_rounding/doc/releases.rst new file mode 100644 index 0000000000..21b13c4745 --- /dev/null +++ b/modules/account_cash_rounding/doc/releases.rst @@ -0,0 +1,7 @@ +.. _releases-index: + +============= +Release notes +============= + +.. include:: ../CHANGELOG diff --git a/modules/account_cash_rounding/setup.py b/modules/account_cash_rounding/setup.py index ea052b1a67..15a80d62b5 100755 --- a/modules/account_cash_rounding/setup.py +++ b/modules/account_cash_rounding/setup.py @@ -14,8 +14,8 @@ def read(fname, slice=None): content = io.open( os.path.join(os.path.dirname(__file__), fname), 'r', encoding='utf-8').read() - if slice: - content = '\n'.join(content.splitlines()[slice]) + content = re.sub( + r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) return content @@ -64,7 +64,8 @@ setup(name=name, download_url=download_url, project_urls={ "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', + "Documentation": ( + 'https://docs.tryton.org/latest/modules-account-cash-rounding'), "Forum": 'https://www.tryton.org/forum', "Source Code": 'https://code.tryton.org/tryton', },