| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) • Contacts (contacts) |
| Community Apps Dependencies | Show |
| Lines of code | 5983 |
| Technical Name |
ple_ledger_book |
| License | OPL-1 |
| Website | https://www.ganemo.co |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) • Contacts (contacts) |
| Community Apps Dependencies | Show |
| Lines of code | 5983 |
| Technical Name |
ple_ledger_book |
| License | OPL-1 |
| Website | https://www.ganemo.co |
General Ledger
PLE Record 6.1 — SUNAT Peru
Generate the electronic General Ledger required by SUNAT. Download ready-to-upload TXT files and detailed Excel reports directly from Odoo — no manual formatting needed.
What We're Solving
----------------
Dual Format Support
Automatically generates the correct output format based on period: PLE format for periods before October 2023, and the new SIRE format for periods from October 2023 onwards. No manual switching required.
Ready-to-Upload Files
Generates .txt files with SUNAT's exact naming convention and column structure, ready to upload directly to the PLE application. Also produces .xlsx Excel files for internal review, audit, and archiving.
Setup & User Manual
Step-by-Step implementation
1. Configuration Guide
Follow these steps to prepare your system before generating reports:
Step 1: Install the Module
Go to Apps, search for "ple_ledger_book" and click Install. The following dependencies are auto-installed — no separate setup needed:
-
ple_sale_book — Base PLE report model
(
ple.report.base), menu structure, and shared report logic (state machine, filename conventions). -
ple_purchase_book — Adds the
is_nodomiciliedfield toaccount.move, which controls the data_structured column in PLE format.
-
invoice_type_document — Propagates
serie_correlativeandl10n_latam_document_type_idfrom invoices to their related journal entry lines. Critical for accurate Serie/Correlativo data. - l10n_pe — Peruvian localization with SUNAT document types and identification type codes.
Step 2: Verify Company RUC
Navigate to Settings → General Settings → Companies and verify:
- The Tax ID (RUC) field has the company's 11-digit RUC number.
This is embedded
in the TXT filename:
LE{RUC}{period}060100... - The PLE Contributor Type (
ple_type_contributor) is set correctly. This determines the journal correlative format:CUOfor general contributers,RERfor simplified regime.
Step 3: SQL Functions (Auto-Installed)
The module installs 4 PostgreSQL functions automatically during setup. These are used by the main query to format data for SUNAT compliance:
get_data_structured_ledger— Generates the data_structured field for PLE format (pre-Oct 2023) based on journal type and domiciled status.get_data_structured_sire— Generates the data_structured field for SIRE format (post-Oct 2023) using partner VAT, document type, series, and correlative.
get_journal_correlative— Determines the journal correlative based on contributor type (CUO or RER).UDF_numeric_char_ledger— Formats numeric values to 2 decimal places as strings.string_ref— Cleans special characters (newlines, multiple spaces) from text fields.
Step 4: Pre-Generation Checklist
Before generating a report, confirm these items for the target period:
- All relevant invoices are in Posted state. Draft or cancelled entries are excluded from the report.
- Partners have valid Identification Type and VAT/DNI numbers. These populate columns 8-9 of the TXT.
- Sale invoices have valid Document Type (e.g., Factura 01, Boleta 03) assigned. This populates column 10 of the TXT.
- Purchase invoices have
the
Supplier Invoice Number (
ref) filled in. The system uses this as a fallback for Serie/Correlativo on purchase entries. - For non-domiciled suppliers, verify the "No domiciliado" checkbox is marked on the invoice. This affects the PLE-format structured data field.
2. Operating Manual (Workflow)
Complete step-by-step guide to generate and declare your General Ledger:
Step A: Create Record
Navigate to Accounting → PLE → Libros Mensuales → Libro Mayor. Click Create. Fill in:
- Company: Select the company whose RUC will appear in the filename.
- Start Date: First day of the reporting month (e.g., 01/01/2024).
- End Date: Last day of the reporting month (e.g., 31/01/2024).
The record starts in Draft state.
Step B: Generate Report
Click "Generar Reporte". The system:
- Executes a SQL query extracting all posted journal entry lines for the selected period and company.
- Formats each line with 20+ data fields (account code, dates, amounts, document data).
- Generates a .txt file (SUNAT format) and a .xlsx file (internal audit format).
State changes to Loaded. Download links appear below the buttons.
Step C: Download & Review
Two download links appear:
- TXT File: Named
LE{RUC}{YYYYMM00}060100{flags}.txt. Upload this directly to SUNAT's PLE application. - Excel File: Named
ledger_{YYYYMMDD}.xlsx. Use this for internal auditing, cross-referencing, and record-keeping.
Always review the Excel before uploading the TXT. Verify amounts and document types match your records.
Step D: Declare to SUNAT
After reviewing and uploading to SUNAT, click "Declarar a SUNAT". This:
- Changes the state to Closed.
- Locks the record to prevent accidental modifications.
- Serves as an audit trail confirming the period was officially reported.
Step E: Rollback (Optional)
Need to fix data and regenerate? Click "Regresar a Borrador":
- State returns to Draft.
- Previous TXT and Excel files are permanently deleted.
- You can correct invoices/entries and regenerate.
Files cannot be recovered after rollback — download them before clicking this button.
3. Serie & Correlativo Priority Logic
Understanding how the system determines Serie and Correlativo for each line:
The TXT file columns 11-12 (Serie and Correlativo) are populated differently depending on the journal type and move type:
Sale Invoices
- Primary:
serie_correlativefield (propagated from invoice) - Fallback:
move_name(journal entry name, e.g., INV/2024/0001) - Default:
0000-00000000
Purchase Invoices
- Primary:
serie_correlativefield (propagated from invoice) - Fallback:
reffield (supplier invoice number) - Default:
0000-00000000
Cash/Bank/General
- Primary:
serie_correlativefield (if available) - Fallback: None (not applicable for non-invoice entries)
- Default:
0000-00000000
serie_correlative for best
results.
4. PLE vs SIRE Format (data_structured Column)
The last data column in the TXT file changes based on the reporting period:
PLE Format (≤ Sept 2023)
For periods ending on or before September
30, 2023,
the data_structured column is populated based on:
- Journal type (sale, purchase, cash/bank/general)
- "No domiciliado" flag on the invoice
Uses SQL function:
get_data_structured_ledger
SIRE Format (≥ Oct 2023)
For periods ending after September 30,
2023,
the data_structured column is left empty in
the TXT
output. SUNAT's SIRE system handles this data differently.
The cutoff date is hardcoded as
2023-09-30.
No configuration is needed — the switch is automatic.
5. TXT Column Reference (Record 6.1)
Each line in the TXT file contains these pipe-separated fields:
| # | Field | Source |
|---|---|---|
| 1 | Period | YYYYMM00 from entry date |
| 2 | CUO (Journal Entry ID) | move_name cleaned |
| 3 | Correlative Line | get_journal_correlative() |
| 4 | Account Code | account_account.code |
| 5 | Unit Operation Code | Empty (reserved) |
| 6 | Cost Center Code | Analytic account name |
| 7 | Currency | PEN or foreign currency |
| 8 | Partner ID Type | l10n_pe_vat_code |
| 9 | Partner ID Number | partner.vat |
| 10 | Document Type Code | l10n_latam_document_type.code |
| 11 | Serie | Priority logic (see above) |
| 12 | Correlative | Priority logic (see above) |
| 13 | Accounting Date | move_line.date |
| 14 | Due Date | move_line.date_maturity |
| 15 | Issue Date | move.invoice_date |
| 16 | Operation Description | move_line.name (200 chars max) |
| 17 | Reference Description | ref/payment_reference (200 chars max) |
| 18 | Debit | Formatted to 2 decimals |
| 19 | Credit | Formatted to 2 decimals |
| 20 | Data Structured | PLE function or empty (SIRE) |
| 21 | State | Always "1" (active) |
Global Ready | Multi-Language Support
This module is fully translated into English and Spanish (en_US, es_ES, es_PE, es_MX), ensuring a professional experience for international organizations.
Why Choose Ganemo?
----------------
Ganemo is the world's leading Odoo App developer and a multi-award-winning Gold Partner. For over 5 years, we have been recognized as the #1 seller of high-quality apps on the Odoo App Store. Trusted as the "Best Partner" in USA, Mexico, Chile, Spain, Colombia, Ecuador, and Peru, we deliver robust, secure, and localization-compliant solutions for global businesses.
Get a Quote & Resolve Commercial Doubts
Join thousands of satisfied clients on Odoo. Contact our sales team directly.
Official WhatsApp
Fastest response time.
LINK
+1 (828) 672-6150
Book a Demo
Let's explore your needs.
LINK
Schedule Meeting
Need More? We Do It All
Professional Odoo Services
ERP Implementation
Transform your business with a full Odoo implementation. We analyze, configure, and train your team to maximize productivity. From Accounting to Inventory, we handle the complexity so you can focus on growth.
Module Dev & Migration
Need a custom feature? Or stuck on an older version? We develop high-performance custom modules and migrate your existing code to Odoo 19 with zero data loss. Expert developers at your service.
QA / User Testing Scenarios
Enterprise Validation Plan
Scenario 1: Basic Report Generation
- Navigate to Accounting → PLE → Libros Mensuales → Libro Mayor.
- Click Create. Select company, start date, and end date.
- Click "Generar Reporte".
- Test: Both Excel and TXT download links MUST appear.
- Test: The TXT filename MUST follow SUNAT convention:
LE{RUC}{period}060100{indicators}.txt
Scenario 2: PLE vs SIRE Format
- Create a report for a period before October 2023 (e.g., Sept 2023).
- Test: The TXT file MUST contain PLE-style structured data.
- Create another report for a period from October 2023 onwards.
- Test: The TXT file MUST contain SIRE-style structured data with partner VAT, document type, series, and correlative.
Scenario 3: State Workflow
- Generate a report (state moves to Loaded).
- Click "Declarar a SUNAT" (state moves to Closed).
- Click "Regresar a Borrador".
- Test: State MUST return to Draft and download links MUST be cleared.
Scenario 4: Empty Period (No Posted Entries)
- Create a new record for a period with no posted invoices or entries.
- Click "Generar Reporte".
- Test: The TXT file MUST be generated (not fail with an error).
- Test: The
error_dialogfield MUST show the warning message "No hay contenido para presentar..." - Test: The Excel file MUST be generated with headers only (no data rows).
Scenario 5: Multi-Currency Entries
- Create and post a purchase invoice in USD for a period.
- Create and post a sale invoice in PEN for the same period.
- Generate the Libro Mayor report.
- Test: The TXT file must show
USDfor the purchase lines andPENfor the sale lines in column 7 (Currency). - Test: Debit and Credit amounts MUST be in the company's functional currency (PEN).
Scenario 6: Multi-Company Isolation
- Switch to Company A. Post 3 invoices in January 2024.
- Switch to Company B. Post 2 invoices in January 2024.
- Generate Libro Mayor for Company A, January 2024.
- Test: The TXT file MUST contain ONLY Company A's entries. Company B's entries must NOT appear.
- Test: The filename must contain Company A's RUC.
Scenario 7: Non-Domiciled Supplier (PLE Format)
- Create a vendor (partner) with a foreign identification type and mark as non-domiciled.
- Create and post a purchase invoice from this vendor for a period before Oct 2023.
- Generate the Libro Mayor report.
- Test: The
data_structuredcolumn (col 20) MUST contain the PLE-format value appropriate for non-domiciled suppliers.
Scenario 8: Regenerate After Data Fix
- Generate a report for January 2024.
- Notice an invoice has the wrong
serie_correlative. - Click "Regresar a Borrador". Confirm files are deleted.
- Fix the invoice's
serie_correlativeand re-post if needed. - Click "Generar Reporte" again.
- Test: The new TXT file MUST reflect the corrected Serie/Correlativo.
FAQ & Troubleshooting
Common Resolutions
Empty TXT file generated?
Reason: No posted journal entries exist for the selected period and company.
Fix: Verify that invoices and journal entries are in Posted state for the selected date range. Draft entries are excluded.
Serie/Correlativo showing wrong data?
Reason: The invoice_type_document
module may not be propagating serie_correlative correctly to related
entries.
Fix:
Verify that the source invoice has a valid serie_correlative value. The
Libro Mayor uses multiple fallback sources (move name, ref) as backup.
Can I regenerate a declared period?
Answer: Yes, use the "Regresar a Borrador" button.
Fix: This clears the existing files and resets the state to Draft, allowing you to generate fresh reports with updated data.
Is this compatible with Multi-company?
Answer: Yes!
Detail: Each report record is linked to a specific company. The SQL query filters by company_id to ensure only relevant journal entries are included.
What does "Estado de la operación = 1" mean?
Answer: The state column is always set to
1 (active) for all lines.
Detail: SUNAT expects 1 for active operations.
Cancelled entries are excluded at query level (only state = 'posted' is
included), so no lines with state 0 or 9 will appear.
TXT file has wrong column count?
Reason: Special characters (pipes
|,
newlines) in the operation description or reference fields.
Fix: The
module
sanitizes data using the string_ref SQL function, which removes newlines
and
extra spaces. If you still see issues, check the source invoice's name or
ref field for unusual characters and clean them manually.
Analytic account column shows unexpected data?
Reason: The cost center column (col 6) reads
from
analytic_distribution on journal items.
Fix: Verify the analytic account names assigned to your journal entries. The module maps the analytic distribution JSON keys to account names. If an analytic account was renamed or deleted, the column may show empty or incorrect data.
Does it work with Odoo.SH and Ganemo Online?
Answer: Yes, fully compatible!
Detail: The module uses standard Odoo ORM and PostgreSQL functions. It is tested and deployed on Odoo.SH, Ganemo Online, and Ganemo.SH environments. No server-level configuration or special permissions are needed.
Commercial & Sales
For inquiries about licenses, demos, or partnerships.
Official WhatsApp
Fastest response time.
LINK
+1 (828) 672-6150
Book a Demo
Let's explore your needs.
LINK
Technical Support
Existing customers regarding module functionality.
© 2026 Ganemo. All rights reserved. visit ganemo.com
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module