Skip to content

Commit

Permalink
[ADD] 14.0 account_move_cutoff: deferred revenu/expenses
Browse files Browse the repository at this point in the history
Using this module cuttoff happens while posting
entries based on start/end date defined on invoice lines
  • Loading branch information
petrus-v committed Jul 31, 2023
1 parent 437fb52 commit 3a223a1
Show file tree
Hide file tree
Showing 33 changed files with 4,867 additions and 0 deletions.
193 changes: 193 additions & 0 deletions account_move_cutoff/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
====================
Account Move Cut-off
====================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--closing-lightgray.png?logo=github
:target: https://github.com/OCA/account-closing/tree/14.0/account_move_cutoff
:alt: OCA/account-closing
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-closing-14-0/account-closing-14-0-account_move_cutoff
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/89/14.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to generate cu-toff entries automatically when posting former
entries.

This module is based on `account_invoice_start_end_dates`
which allows to define start end end dates on invoice line (`account.move.line`).


Following assumption have been made before developing this module::

- New method to compute cutoff amounts can be add by business modules


.. note::

This module as been developed with some opinionated design
do not depends on `account_cutoff_base`. Because::

- we don't want rely on user nor async task at the end of
each month (period)
- link entries to understand the history without merging amounts
in order to be able to keep details on deferred account
move line (analytics, partners, accounts and so on)

**Table of contents**

.. contents::
:local:

Configuration
=============

Deferred journal(s)
~~~~~~~~~~~~~~~~~~~

In accounting configuration you should set
Deferred Revenue and Expense journal to be used
on generated entries.

.. note::

Journal will be used according the kind of
journal used by the former entry: `sale` or `purchase`


Deferred account(s)
~~~~~~~~~~~~~~~~~~~

On each Revenue/Expense account you can set the deferred
Revenue/Expense account.

Only invoice lines linked to account with a deferred account set
will generate deferred Revenue/Expense.


Cut-off Method
~~~~~~~~~~~~~~

In the first version of this module, two cut-off computation methods are
supported and can be configured using the ``account_move_cutoff.default_cutoff_method``
key. The currently possible values are ``monthly_prorata_temporis`` or ``equal``.

Before defining these values, let's provide some context by using an example to
illustrate the definitions. Consider a sales invoice that is posted on January
16th for a service that spans from the 8th to the 15th of March. So, there are
24 days in January, 1 full month in February, and 15 days in March. The product
is sold for 1000 for a month, so the invoice line amount (excluding VAT) is
calculated as follows::

24/31 * 1000 + 1000 + 15/31 * 1000 = 2258.06

* **monthly_prorata_temporis** (the default if not set): This method splits amounts
over the rate of the month the product has been used. The results would be as
follows:

- January: **774.19** (`2258.06 - 1000 - 483.87`) (Subtraction is used here to avoid
rounding discrepancies.)
- February: **1000.00** (`1 * 2258.06 / (24/31 + 1 + 15/31)`)
- March: **483.87** (`15/31 * 2258.06 / (24/31 + 1 + 15/31)`)

* **equal**: With this method, the same amount is split over the months of service.

- January: **752.68** (`2258.06 - 752.69 - 752.69`)
- February: **752.69** (2258.06 / 3)
- March: **752.69** (2258.06 / 3)

Please note that this information is subject to change based on updates to the
module. Always refer to the latest documentation for accurate details.

Usage
=====


To handle deferred accounting, follow these steps:

1. Set the start and end date, where the end date is at least set to
the month after the current entry posted date.

2. Ensure that the account (the `account.account` configuration)
in use is linked to a deferred account.

3. Post the entry.

4. After posting, check deferred entries have been generated, posted, and
reconciled if needed.

.. note::

This module only defers amounts in periods subsequent to the accounting period
date. For example, if an invoice is posted on March 2nd for a service from
January 1st to March 31st at 1000€ per month, the deferred amount will be
only 1000€ for March, leaving 2000€ in February. We never add accounting items
in periods previous to the current entry date.

Known issues / Roadmap
======================

- Make the is_deferrable_line a storable field to allow end user to not
deferred a given line while posting entry. (but should raise if
it's not possible to force the value to true)
- allow to change/configure cutoff frequency (weekly/monthly/...)
today only monthly is implemented
- allow to configure cutoff computation method in different
place (product / invoice lines /...)

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-closing/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-closing/issues/new?body=module:%20account_move_cutoff%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Pierre Verkest <pierreverkest84@gmail.com>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-petrus-v| image:: https://github.com/petrus-v.png?size=40px
:target: https://github.com/petrus-v
:alt: petrus-v

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-petrus-v|

This module is part of the `OCA/account-closing <https://github.com/OCA/account-closing/tree/14.0/account_move_cutoff>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions account_move_cutoff/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions account_move_cutoff/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2022 Foodles (http://www.foodles.co).
# @author Pierre Verkest <pierreverkest84@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Move Cut-off",
"version": "14.0.0.0.1",
"category": "Accounting & Finance",
"license": "AGPL-3",
"summary": "Account move Cut-offs, manage Deferred Revenues/Expenses",
"author": "Pierre Verkest <pierreverkest84@gmail.com>, Odoo Community Association (OCA)",
"maintainers": ["petrus-v"],
"website": "https://github.com/OCA/account-closing",
"depends": ["account", "account_invoice_start_end_dates"],
"data": [
"views/account_account.xml",
"views/account_move_line.xml",
"views/account_move.xml",
"views/res_config_settings.xml",
],
"installable": True,
}
Loading

0 comments on commit 3a223a1

Please sign in to comment.