Metadata-Version: 2.1
Name: odoo-addon-frappe_etax_service
Version: 18.0.1.0.0.5
Requires-Python: >=3.10
Requires-Dist: odoo-addon-l10n_th_account_tax==18.0.*
Requires-Dist: odoo-addon-l10n_th_partner==18.0.*
Requires-Dist: odoo-addon-usability_api_connector==18.0.*
Requires-Dist: odoo==18.0.*
Summary: Integrate Odoo with Frappe e-Tax service
Home-page: https://github.com/ecosoft-odoo/ecosoft-addons
License: AGPL-3
Author: Kitti U., Ecosoft
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 18.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Description-Content-Type: text/x-rst

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

================================
Connector to Frappe eTax service
================================

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

.. |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/license-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-ecosoft--odoo%2Fecosoft--addons-lightgray.png?logo=github
    :target: https://github.com/ecosoft-odoo/ecosoft-addons/tree/18.0/frappe_etax_service
    :alt: ecosoft-odoo/ecosoft-addons

|badge1| |badge2| |badge3|

This module integrates Odoo with the Frappe e-Tax Service (INET) to sign and retrieve certified e-Tax documents.

Key features:

* **Sign e-Tax Invoice** - Send a posted customer invoice/tax invoice to Frappe server and receive the signed PDF and XML attachments back.
* **Sign Debit Note** - Send a posted debit note (ใบเพิ่มหนี้) to Frappe server.
* **Sign Credit Note** - Send a posted credit note (ใบลดหนี้) to Frappe server, with purpose code selection.
* **Replacement e-Tax Invoice** - Create a replacement document for an already-signed invoice and re-sign with Frappe.
* **e-Tax Status Tracking** - Track signing status (Success, Processing, Error, Replaced) on each invoice.
* **Purpose Code** - Select an INET-standard purpose code when creating credit notes or debit notes.

Workflow:

#. Post a customer invoice, debit note, or credit note.
#. Click the **e-Tax Invoice** button on the document.
#. Select the e-Tax document type (e.g. ใบกำกับภาษี, ใบแจ้งหนี้/ใบกำกับภาษี) and confirm.
#. The system sends the document to Frappe server for signing.
#. Check the **e-Tax Status** on the e-Tax Info tab - when ``Success``, the signed PDF and XML are attached automatically.
#. If a signed invoice needs correction, use **Create Replacement** to create a replacement document, then sign the replacement.

**Table of contents**

.. contents::
   :local:

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

**1. API Connection**

Go to **Invoicing -> Configurations -> Settings**, section **Ecosoft e-Tax Services**:

* **Frappe Server URL** - URL of the Frappe server where the e-Tax Service is installed.
* **Frappe Auth Token** - Token generated from the Frappe server.

Contact your e-Tax Service provider for these values.

**2. Document Type Code (etax.doctype.code)**

Standard INET document type codes are pre-loaded:

.. list-table::
   :header-rows: 1

   * - Code
     - Description
   * - 380
     - ใบแจ้งหนี้
   * - 388
     - ใบกำกับภาษี
   * - T01
     - ใบรับ (ใบเสร็จรับเงิน)
   * - T02
     - ใบแจ้งหนี้/ใบกำกับภาษี
   * - T03
     - ใบเสร็จรับเงิน/ใบกำกับภาษี
   * - T04
     - ใบส่งของ/ใบกำกับภาษี
   * - T05
     - ใบกำกับภาษีอย่างย่อ
   * - 80
     - ใบเพิ่มหนี้
   * - 81
     - ใบลดหนี้

Go to **Invoicing -> Configurations -> e-Tax Service -> Document Type Code** to view or add codes.

**3. e-Tax Document Type (etax.doctype)**

Map each Odoo document type to its INET document type code and report template.

Go to **Invoicing -> Configurations -> e-Tax Service -> e-Tax Doctype** and create records:

* **Form Name** - Name of the Odoo/Frappe form template (must match exactly).
* **Type** - Odoo document type: Customer Invoice, Credit Note, Debit Note, or Payment.
* **Invoice Template Source** - ``odoo`` (render PDF from Odoo) or ``frappe`` (use Frappe template).
* **Document Type Code** - Select the matching INET code (e.g. T02 for ใบแจ้งหนี้/ใบกำกับภาษี).

Example setup:

.. list-table::
   :header-rows: 1

   * - Form Name
     - Type
     - Code
   * - ใบกำกับภาษี
     - Customer Invoice
     - 388
   * - ใบแจ้งหนี้/ใบกำกับภาษี
     - Customer Invoice
     - T02
   * - ใบเพิ่มหนี้
     - Customer Debit Note
     - 80
   * - ใบลดหนี้
     - Customer Credit Note
     - 81

**4. Purpose Code (etax.purpose.code)**

Purpose codes are pre-loaded following INET convention and are linked to applicable document type codes.

Go to **Invoicing -> Configurations -> e-Tax Service -> Purpose Code** to view all codes.

Key groups:

* **TIVC** - Tax Invoice replacement (applicable to 388, T02, T03, T04, T05)
* **DBNG / DBNS** - Debit Note Goods/Services (applicable to 80)
* **CDNG / CDNS** - Credit Note Goods/Services (applicable to 81)
* **RCTC** - Receipt replacement (applicable to T01)

Purpose codes are automatically filtered by document type when creating a credit note or debit note.

**5. Replacement Lock Date**

Go to **Invoicing -> Configurations -> Settings**, section **Ecosoft e-Tax Services**:

* **Replacement Lock Date** - Day of month after which creating a replacement e-Tax document is no longer allowed (counted from the 1st of the following month). Default is ``1``.

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

Bugs are tracked on `GitHub Issues <https://github.com/ecosoft-odoo/ecosoft-addons/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/ecosoft-odoo/ecosoft-addons/issues/new?body=module:%20frappe_etax_service%0Aversion:%2018.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
~~~~~~~

* Kitti U.
* Ecosoft

Contributors
~~~~~~~~~~~~

* `Ecosoft <http://ecosoft.co.th>`__:

  * Kitti U. <kittiu@ecosoft.co.th>
  * Saran Lim. <saranl@ecosoft.co.th>
  * Theerayut A. <theerayuta@ecosoft.co.th>

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

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

Current maintainer:

|maintainer-Saran440| 

This module is part of the `ecosoft-odoo/ecosoft-addons <https://github.com/ecosoft-odoo/ecosoft-addons/tree/18.0/frappe_etax_service>`_ project on GitHub.

You are welcome to contribute.
