Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BIG][16.0] account_banking_fr_lcr: add support for paper LCR, billet à ordre, Dailly, escompte, etc... #560

Open
wants to merge 4 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 38 additions & 11 deletions account_banking_fr_lcr/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,62 @@ French Letter of Change

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

This module adds support for French Letters of Change (in French:
*Lettre de Change Relevé* aka LCR). This module supports direct LCR
(in French, *LCR Directe*) and not paper LCR.
This module adds support for French Letters of Change. This module supports:

This payment type is still in use in France and it is *not* replaced by SEPA
one-off Direct Debits.
* **Direct letter of change** (in French : *Lettre de change directe* or *LCR directe*),
* **Accepted letter of change** (in French : *Lettre de change acceptée* ; I call it *paper letter of change*),
* **Promissory note** (in French : *Billet à ordre*),

With this module, you can generate an LCR CFONB file to send to your
bank. Then, your customer will be notified by their bank about the debit
(amount, date of debit). Eventually, the debit will take place at the
planned date.
It supports cash discounts debit orders and Dailly convention.

This module has 2 main features:

* for **Accepted Letter of Change**, generate a paper letter of change as PDF following the official layout NF K 11-030-1.
* generate of LCR (or BOR) CFONB files to send to your bank.

This module follows the specifications published on the `CFONB website <https://www.cfonb.org/>`_, section *Espace documentaire > Instruments de paiement > Effet de commerce* (document version of September 2002).

**Table of contents**

.. contents::
:local:

Installation
============

This module requires 2 Python libs:

* `pypdf <https://pypi.org/project/pypdf/>`_ version 3.10 or above,
* `unidecode <https://pypi.org/project/Unidecode/>`_ (any version).

In order to have the SIREN of the company and of the customer set in the CFONB file (optional field) and printed on the paper letter of exchange, the OCA module **l10n_fr_siret** must be installed. The installation of the module **l10n_fr_siret** is optional (because the SIREN field in the CFONB file is optional).

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

To configure this module, you need to create a new payment mode linked
to the payment method *Lettre de Change Relevé* that is automatically
created when you install this module.

Once you selected this payment method, you will have a new section *Bill of Exchange* on the payment mode where you will have to configure:

* the *LCR type*: *Lettre de change non acceptée (LCR directe)*, *Lettre de change acceptée* or *Billet à ordre*,
* the *Default Collection Option*,
* if you have a *Dailly Convention*,
* in case you have a Dailly convention, you will be able to configure the *Default Dailly Option* and the *Convention Type*.

Usage
=====

To use this module, you need to create a new Debit Order and
select the LCR payment mode.
This module adds a new field *Bill of Exchange Bank Account* on customer invoices to select the bank account of the customer that will be debited by the letter of exchange. This bank account must be a french IBAN.

If you configured the payment mode for **Accepted Letter of Change**, you will have a button *Print Bill of Exchange* on customer invoices to get the letter of change as PDF.

This module uses the standard workflow of debit orders as implemented in the OCA module **account_payment_order**. A debit order linked to a payment mode with the payment method *Lettre de change relevé* has a few additionnal constraints:

* all payment lines must be in euro currency,
* the bank accounts on the payment lines must be french IBANs,
* if the payment order is configured with cash discount, you must configure the value date on the payment order (new field added by this module).

Bug Tracker
===========
Expand Down
9 changes: 7 additions & 2 deletions account_banking_fr_lcr/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@
"website": "https://github.com/OCA/l10n-france",
"category": "French localisation",
"depends": ["account_payment_order"],
"external_dependencies": {"python": ["unidecode"]},
"data": ["data/account_payment_method.xml"],
"external_dependencies": {"python": ["unidecode", "pypdf>=3.1.0"]},
"data": [
"data/account_payment_method.xml",
"views/account_payment_mode.xml",
"views/account_payment_order.xml",
"views/account_move.xml",
],
"demo": ["demo/lcr_demo.xml"],
"post_init_hook": "lcr_set_unece",
"installable": True,
Expand Down
2 changes: 1 addition & 1 deletion account_banking_fr_lcr/data/account_payment_method.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<field name="code">fr_lcr</field>
<field name="payment_type">inbound</field>
<field name="bank_account_required" eval="True" />
<field name="payment_order_only" eval="True" />
<field name="payment_order_ok" eval="True" />
</record>
</odoo>
223 changes: 221 additions & 2 deletions account_banking_fr_lcr/i18n/account_banking_fr_lcr.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,163 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-27 10:38+0000\n"
"PO-Revision-Date: 2024-08-27 10:38+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: account_banking_fr_lcr
#: model:ir.model,name:account_banking_fr_lcr.model_res_partner_bank
msgid "Bank Accounts"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields,help:account_banking_fr_lcr.field_account_bank_statement_line__fr_lcr_partner_bank_id
#: model:ir.model.fields,help:account_banking_fr_lcr.field_account_move__fr_lcr_partner_bank_id
#: model:ir.model.fields,help:account_banking_fr_lcr.field_account_payment__fr_lcr_partner_bank_id
msgid ""
"Bank account of the customer that will be debited by the bill of exchange. "
"By default, Odoo selects the first French IBAN bank account of the partner."
msgstr ""

#. module: account_banking_fr_lcr
#: model_terms:ir.ui.view,arch_db:account_banking_fr_lcr.account_payment_mode_form
msgid "Bill of Exchange"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_bank_statement_line__fr_lcr_attachment_id
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_move__fr_lcr_attachment_id
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_payment__fr_lcr_attachment_id
msgid "Bill of Exchange Attachment"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_bank_statement_line__fr_lcr_partner_bank_id
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_move__fr_lcr_partner_bank_id
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_payment__fr_lcr_partner_bank_id
msgid "Bill of Exchange Bank Account"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_bank_statement_line__fr_lcr_attachment_datas
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_move__fr_lcr_attachment_datas
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_payment__fr_lcr_attachment_datas
msgid "Bill of Exchange File"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_bank_statement_line__fr_lcr_attachment_name
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_move__fr_lcr_attachment_name
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_payment__fr_lcr_attachment_name
msgid "Bill of Exchange Filename"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_bank_statement_line__payment_mode_fr_lcr_type
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_move__payment_mode_fr_lcr_type
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_payment__payment_mode_fr_lcr_type
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_payment_mode__fr_lcr_type
msgid "Bill of Exchange Type"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields.selection,name:account_banking_fr_lcr.selection__account_payment_mode__fr_lcr_type__promissory_note
msgid "Billet à ordre"
msgstr ""

#. module: account_banking_fr_lcr
#. odoo-python
#: code:addons/account_banking_fr_lcr/models/res_partner_bank.py:0
#, python-format
msgid ""
"Bills of exchange can only use French bank accounts. The IBAN "
"'%(acc_number)s' of partner '%(partner)s' is not a French IBAN."
msgstr ""

#. module: account_banking_fr_lcr
#. odoo-python
#: code:addons/account_banking_fr_lcr/models/res_partner_bank.py:0
#, python-format
msgid ""
"Bills of exchange can only use IBAN bank accounts. Bank account "
"'%(acc_number)s' of partner '%(partner)s' is not an IBAN."
msgstr ""

#. module: account_banking_fr_lcr
#. odoo-python
#: code:addons/account_banking_fr_lcr/models/account_payment_order.py:0
#, python-format
msgid "Cannot convert the field '%s' to ASCII"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_payment_order__fr_lcr_collection_option
msgid "Collection Option"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_payment_mode__fr_lcr_convention_type
msgid "Convention Type"
msgstr ""

#. module: account_banking_fr_lcr
#. odoo-python
#: code:addons/account_banking_fr_lcr/models/account_move.py:0
#, python-format
msgid ""
"Customer invoice '%(move)s' is configured with payment mode "
"'%(payment_mode)s' which require a bill of exchange bank account."
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_payment_mode__fr_lcr_dailly
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_payment_order__fr_lcr_dailly
msgid "Dailly Convention"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_payment_order__fr_lcr_dailly_option
msgid "Dailly Option"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_payment_mode__fr_lcr_default_collection_option
msgid "Default Collection Option"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_payment_mode__fr_lcr_default_dailly_option
msgid "Default Dailly Option"
msgstr ""

#. module: account_banking_fr_lcr
#. odoo-python
#: code:addons/account_banking_fr_lcr/models/account_payment_order.py:0
#, python-format
msgid ""
"Error in the generation of the CFONB file: '%(field)s' should be a string, "
"but it is %(value_type)s (value: %(value)s)."
msgstr ""

#. module: account_banking_fr_lcr
#. odoo-python
#: code:addons/account_banking_fr_lcr/models/account_payment_order.py:0
#, python-format
msgid ""
"Error in the generation of the CFONB file: the field '%s' is empty or 0. It "
"should have a non-null value."
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields,help:account_banking_fr_lcr.field_account_payment_mode__fr_lcr_convention_type
msgid "Field C1 'Convention Type' in CFONB header line, 6 characters maximum."
msgstr ""

#. module: account_banking_fr_lcr
#. odoo-python
#: code:addons/account_banking_fr_lcr/models/account_payment_order.py:0
Expand All @@ -30,8 +173,8 @@ msgid ""
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model,name:account_banking_fr_lcr.model_account_move_line
msgid "Journal Item"
#: model:ir.model,name:account_banking_fr_lcr.model_account_move
msgid "Journal Entry"
msgstr ""

#. module: account_banking_fr_lcr
Expand All @@ -53,16 +196,71 @@ msgstr ""
msgid "Lettre de Change Relevé"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields.selection,name:account_banking_fr_lcr.selection__account_payment_mode__fr_lcr_type__accepted
msgid "Lettre de change acceptée"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields.selection,name:account_banking_fr_lcr.selection__account_payment_mode__fr_lcr_type__not_accepted
msgid "Lettre de change non acceptée (LCR directe)"
msgstr ""

#. module: account_banking_fr_lcr
#. odoo-python
#: code:addons/account_banking_fr_lcr/models/account_payment_order.py:0
#, python-format
msgid ""
"On debit order '%(order)s', the value date has been set to %(value_date)s: "
"it must be in the future."
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model,name:account_banking_fr_lcr.model_account_payment_line
msgid "Payment Lines"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model,name:account_banking_fr_lcr.model_account_payment_method
msgid "Payment Methods"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model,name:account_banking_fr_lcr.model_account_payment_mode
msgid "Payment Modes"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model,name:account_banking_fr_lcr.model_account_payment_order
msgid "Payment Order"
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model,name:account_banking_fr_lcr.model_account_payment
msgid "Payments"
msgstr ""

#. module: account_banking_fr_lcr
#: model_terms:ir.ui.view,arch_db:account_banking_fr_lcr.view_move_form
msgid "Print Bill of Exchange"
msgstr ""

#. module: account_banking_fr_lcr
#. odoo-python
#: code:addons/account_banking_fr_lcr/models/account_payment_order.py:0
#, python-format
msgid "The Collection Option is not set on debit order '%s'."
msgstr ""

#. module: account_banking_fr_lcr
#. odoo-python
#: code:addons/account_banking_fr_lcr/models/account_payment_line.py:0
#, python-format
msgid ""
"The currency of payment line '%(payment_line)s' is %(currency)s. To be "
"included in a french bill of exchange, the currency must be EUR."
msgstr ""

#. module: account_banking_fr_lcr
#. odoo-python
#: code:addons/account_banking_fr_lcr/models/account_payment_order.py:0
Expand All @@ -78,3 +276,24 @@ msgstr ""
#, python-format
msgid "The field '%s' is empty or 0. It should have a non-null value."
msgstr ""

#. module: account_banking_fr_lcr
#. odoo-python
#: code:addons/account_banking_fr_lcr/models/account_payment_mode.py:0
#, python-format
msgid "The field 'Bill of Exchange Type' must be set on payment mode '%s'."
msgstr ""

#. module: account_banking_fr_lcr
#: model:ir.model.fields,field_description:account_banking_fr_lcr.field_account_payment_order__fr_lcr_value_date
msgid "Value Date"
msgstr ""

#. module: account_banking_fr_lcr
#. odoo-python
#: code:addons/account_banking_fr_lcr/models/account_payment_order.py:0
#, python-format
msgid ""
"Value date is not set on debit order '%s'. It is required on letters of "
"exchange with cash discount."
msgstr ""
Loading
Loading