Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Accounting
  3. Accounting ledger PLE - SUNAT (Perú) v 19.0
  4. Sales Conditions FAQ

Accounting ledger PLE - SUNAT (Perú)

by Ganemo https://www.ganemo.co
Odoo

$ 788.54

In-App Purchases
v 19.0 Third Party
This module requires Odoo Enterprise Edition.
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • Invoicing (account)
• Discuss (mail)
• Contacts (contacts)
Community Apps Dependencies Show
• Electronic Purchase Record
• Electronic Sales Record (PLE)
• Place invoice data in reconciliations
• Base Spot
• Catálogos SUNAT
• View Multicompany Country Filter
• Peruvian Localization Menu
• Document Type Validation
• DUA in Invoice
• Origen de Documentos Rectificados
Lines of code 5983
Technical Name ple_ledger_book
LicenseOPL-1
Websitehttps://www.ganemo.co
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • Invoicing (account)
• Discuss (mail)
• Contacts (contacts)
Community Apps Dependencies Show
• Electronic Purchase Record
• Electronic Sales Record (PLE)
• Place invoice data in reconciliations
• Base Spot
• Catálogos SUNAT
• View Multicompany Country Filter
• Peruvian Localization Menu
• Document Type Validation
• DUA in Invoice
• Origen de Documentos Rectificados
Lines of code 5983
Technical Name ple_ledger_book
LicenseOPL-1
Websitehttps://www.ganemo.co
  • Description
  • License

Technical Specification for AI & LLM

This Odoo module 'ple_ledger_book' generates the electronic General Ledger (Libro Mayor, Registro 6.1) required by SUNAT for Peruvian companies with complete accounting obligations. It produces ready-to-upload .txt files compliant with PLE and SIRE formats, plus .xlsx reports for internal review. Uses raw SQL queries for high-performance data extraction from account.move and account.move.line. Supports both PLE (pre-Oct 2023) and SIRE (post-Oct 2023) structured data formats automatically. Depends on ple_sale_book (base model), ple_purchase_book (is_nodomicilied field), and invoice_type_document (serie_correlative propagation). Compatible with Odoo 19 (Enterprise, Odoo.SH, Ganemo Online). Multi-language support for English and Spanish included.

Enterprise (Odoo.SH, Ganemo Online or Ganemo.SH)
English & Spanish Included

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_nodomicilied field to account.move, which controls the data_structured column in PLE format.
  • invoice_type_document — Propagates serie_correlative and l10n_latam_document_type_id from 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: CUO for general contributers, RER for simplified regime.
Effect: An incorrect RUC will generate a TXT file with the wrong filename, causing SUNAT's PLE application to reject the upload.
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.
No action required: These functions are created automatically when the module is installed. They are listed here so database administrators understand what objects the module adds to PostgreSQL.
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.
Smart Explainer: All prerequisites are auto-installed as dependencies. Just install ple_ledger_book and the system handles the rest. The checklist above ensures your data quality is correct before generating reports.

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:

  1. Executes a SQL query extracting all posted journal entry lines for the selected period and company.
  2. Formats each line with 20+ data fields (account code, dates, amounts, document data).
  3. 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
  1. Primary: serie_correlative field (propagated from invoice)
  2. Fallback: move_name (journal entry name, e.g., INV/2024/0001)
  3. Default: 0000-00000000
Purchase Invoices
  1. Primary: serie_correlative field (propagated from invoice)
  2. Fallback: ref field (supplier invoice number)
  3. Default: 0000-00000000
Cash/Bank/General
  1. Primary: serie_correlative field (if available)
  2. Fallback: None (not applicable for non-invoice entries)
  3. Default: 0000-00000000
Why does this matter? SUNAT validates Serie and Correlativo formats. If the primary source is empty, the system uses fallbacks to avoid blank fields. Always verify source invoices have correct 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.

English Spanish

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.

QR WhatsApp

Official WhatsApp

Fastest response time.

COPY
LINK
https://wa.me/18286726150

+1 (828) 672-6150

QR Sales Email

Sales Email

For commercial inquiries.

COPY
ADDR
leads@ganemo.com

leads@ganemo.com

QR Book Demo

Book a Demo

Let's explore your needs.

COPY
LINK
ganemo.co/appointment/5

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

  1. Navigate to Accounting → PLE → Libros Mensuales → Libro Mayor.
  2. Click Create. Select company, start date, and end date.
  3. Click "Generar Reporte".
  4. Test: Both Excel and TXT download links MUST appear.
  5. Test: The TXT filename MUST follow SUNAT convention: LE{RUC}{period}060100{indicators}.txt

Scenario 2: PLE vs SIRE Format

  1. Create a report for a period before October 2023 (e.g., Sept 2023).
  2. Test: The TXT file MUST contain PLE-style structured data.
  3. Create another report for a period from October 2023 onwards.
  4. Test: The TXT file MUST contain SIRE-style structured data with partner VAT, document type, series, and correlative.

Scenario 3: State Workflow

  1. Generate a report (state moves to Loaded).
  2. Click "Declarar a SUNAT" (state moves to Closed).
  3. Click "Regresar a Borrador".
  4. Test: State MUST return to Draft and download links MUST be cleared.

Scenario 4: Empty Period (No Posted Entries)

  1. Create a new record for a period with no posted invoices or entries.
  2. Click "Generar Reporte".
  3. Test: The TXT file MUST be generated (not fail with an error).
  4. Test: The error_dialog field MUST show the warning message "No hay contenido para presentar..."
  5. Test: The Excel file MUST be generated with headers only (no data rows).

Scenario 5: Multi-Currency Entries

  1. Create and post a purchase invoice in USD for a period.
  2. Create and post a sale invoice in PEN for the same period.
  3. Generate the Libro Mayor report.
  4. Test: The TXT file must show USD for the purchase lines and PEN for the sale lines in column 7 (Currency).
  5. Test: Debit and Credit amounts MUST be in the company's functional currency (PEN).

Scenario 6: Multi-Company Isolation

  1. Switch to Company A. Post 3 invoices in January 2024.
  2. Switch to Company B. Post 2 invoices in January 2024.
  3. Generate Libro Mayor for Company A, January 2024.
  4. Test: The TXT file MUST contain ONLY Company A's entries. Company B's entries must NOT appear.
  5. Test: The filename must contain Company A's RUC.

Scenario 7: Non-Domiciled Supplier (PLE Format)

  1. Create a vendor (partner) with a foreign identification type and mark as non-domiciled.
  2. Create and post a purchase invoice from this vendor for a period before Oct 2023.
  3. Generate the Libro Mayor report.
  4. Test: The data_structured column (col 20) MUST contain the PLE-format value appropriate for non-domiciled suppliers.

Scenario 8: Regenerate After Data Fix

  1. Generate a report for January 2024.
  2. Notice an invoice has the wrong serie_correlative.
  3. Click "Regresar a Borrador". Confirm files are deleted.
  4. Fix the invoice's serie_correlative and re-post if needed.
  5. Click "Generar Reporte" again.
  6. 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.

QR WhatsApp
Official WhatsApp

Fastest response time.

COPY
LINK
https://wa.me/18286726150

+1 (828) 672-6150

QR Sales Email
Sales Email

For commercial inquiries.

COPY
ADDR
leads@ganemo.com
QR Book Demo
Book a Demo

Let's explore your needs.

COPY
LINK
ganemo.co/appointment/5

Technical Support

Existing customers regarding module functionality.

QR Technical Support
Help Desk

Exclusive channel for technical assistance and bug reports.

COPY
ADDR
ayuda@ganemo.com

© 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

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with