Metadata-Version: 2.1
Name: odoo-addon-l10n_es_genci_sale
Version: 16.0.1.0.0.1
Summary: Gestión tarifas GENCI - Ventas
Home-page: https://github.com/sygel-technology/sy-l10n-spain
Author: Sygel
License: AGPL-3
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 16.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Requires-Python: >=3.10
Requires-Dist: odoo-addon-account-invoice-margin-sale<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n-es-genci-account<16.1dev,>=16.0dev
Requires-Dist: odoo<16.1dev,>=16.0a

===================
Tasa Genci - Ventas
===================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:e4aea25eee0b989b88080701da55611e229f46cb64bbf52427cb1f494752a4d4
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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-sygel--technology%2Fsy--l10n--spain-lightgray.png?logo=github
    :target: https://github.com/sygel-technology/sy-l10n-spain/tree/16.0/l10n_es_genci_sale
    :alt: sygel-technology/sy-l10n-spain

|badge1| |badge2| |badge3|

This module extends ``l10n_es_genci_account`` to integrate GENCI
functionality into the Sales workflow.

It automatically creates GENCI rate lines in sale orders when products
subject to GENCI are added, and ensures correct transfer of GENCI
amounts to customer invoices.

Key Features
============

- "Apply GENCI" checkbox on sale orders to control GENCI application
- Automatic creation of GENCI lines based on product rules and
  quantities
- Consolidation of multiple products with the same rule into single
  GENCI lines
- Display of GENCI amounts on sale order reports (when enabled in
  company settings)

**Table of contents**

.. contents::
   :local:

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

To install this module, you need to:

- Only install

Usage
=====

Prerequisites
=============

Before using this module, ensure that the base module
**``l10n_es_genci_account``** is properly configured:

- Company GENCI is enabled *(Settings → Companies → GENCI tab)*
- GENCI rules are created with validity dates if necessary
- Products are configured as **"Subject to GENCI"** with linked rules
- Partners have **"Subject to GENCI"** checked (default)

**Important:**

For GENCI fee lines to compute and update their invoiced quantities
correctly, ensure that the “Tasa GENCI” product is configured with the
invoicing policy “Based on ordered quantities.” GENCI lines are not
driven by delivered quantities; they must always follow the product’s
ordered quantity invoicing logic.

For detailed configuration instructions, refer to the
**``l10n_es_genci_account``** module documentation.

1. Create a Sale Order
======================

1. Go to **Sales → Orders → Quotations → Create**
2. Select a partner that has **"Subject to GENCI"** enabled

2. Apply GENCI Checkbox
=======================

- The **"Apply GENCI"** checkbox appears in the order header *(only when
  company GENCI is enabled)*
- If the partner is GENCI-subject, check this box to apply GENCI rates
- If it remains unchecked, **GENCI lines will not be created**, even if
  products require it

3. Add Products
===============

- Add products that are configured as **"Subject to GENCI"**
- Products must have a valid GENCI rule assigned
- The rule’s validity dates must include the order date

4. Automatic GENCI Line Creation
================================

GENCI lines are automatically generated when:

- You save the order
- Or you modify order lines

Behavior:

- **One GENCI line is created per distinct GENCI rule**
- **Quantity = sum of all product quantities using that rule**

Application Logic
=================

**Conditions for GENCI Application**

- Company has GENCI enabled
- "Apply GENCI" checkbox is checked on the order
- Partner is subject to GENCI
- Fiscal position (if set) allows GENCI
- Products have valid GENCI rules for the order date

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

Pending Features:

- **Product GENCI flag type** The ``genci_subject`` field on products is
  currently a selection (``yes`` / ``no``), inherited from
  ``l10n_es_genci_account``. Once this field is migrated to a Boolean in
  the parent module, this module should be updated accordingly to use a
  Boolean flag.

- **GENCI logic reuse** Purchase and Sale modules currently share very
  similar GENCI logic. As a future improvement or during a migration,
  this logic should be extracted into a shared mixin to reduce
  duplication and improve maintainability.

- **Units of Measure handling for GENCI calculations** GENCI amounts are
  currently computed per purchased unit (product_qty), without applying
  any Unit of Measure (UoM) conversion. This is an intentional design
  decision, as GENCI rules are defined per product unit. If future
  requirements introduce UoM-dependent GENCI rules (e.g. weight or
  volume based), this logic should be reviewed and adapted accordingly.

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

Bugs are tracked on `GitHub Issues <https://github.com/sygel-technology/sy-l10n-spain/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/sygel-technology/sy-l10n-spain/issues/new?body=module:%20l10n_es_genci_sale%0Aversion:%2016.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
-------

* Sygel

Contributors
------------

- `Sygel <https://www.sygel.es>`__:

  - Ángel Rivas
  - Valentín Vinagre

Maintainers
-----------

This module is part of the `sygel-technology/sy-l10n-spain <https://github.com/sygel-technology/sy-l10n-spain/tree/16.0/l10n_es_genci_sale>`_ project on GitHub.

You are welcome to contribute.
