| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) • Contacts (contacts) |
| Community Apps Dependencies | Show |
| Lines of code | 6156 |
| Technical Name |
ple_diary_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 | 6156 |
| Technical Name |
ple_diary_book |
| License | OPL-1 |
| Website | https://www.ganemo.co |
Electronic Journal
PLE Libro Diario — SUNAT Perú
Automatically generate the Electronic Journal (Libro Diario) required by SUNAT. Produces TXT files (5.1, 5.2, 5.3, 5.4) and a comprehensive Excel report ready for submission through SUNAT's PLE application.
What We're Solving
----------------
Multiple PLE Books
Generate all required journal books in one click: 5.1 Journal, 5.2 Simplified Journal, 5.3 Chart of Accounts (with values), and 5.4 Chart of Accounts (without values). Each file follows SUNAT's exact naming convention and format specifications.
Ready-to-Upload TXT
The generated TXT files are ready to upload directly to SUNAT's PLE application without any manual formatting or modification. The file naming follows SUNAT's standard: LE + RUC + Period + Book Code + Flags.
Excel Report
A comprehensive Excel report is generated alongside the TXT files for internal review and audit purposes. All accounting data is presented in a structured spreadsheet format with proper headers and formatting.
SIRE Compatibility
Automatically handles the transition between pre-SIRE (before October 2023) and post-SIRE structured data formats. The system detects the report period and applies the correct format automatically.
Setup & User Manual
Step-by-Step implementation
1. Prerequisites
Ensure these modules are installed before using the Electronic Journal:
- ple_sale_book — Provides the base PLE report model and core SQL functions.
- invoice_type_document — Provides series and correlative number propagation to journal entries.
- ple_purchase_book — Provides complementary purchase data fields.
- Company VAT must be configured (Settings → Companies → NIF/RUC).
2. Company Configuration
Configure your company for SUNAT compliance before generating reports:
- Go to Settings → Companies and select your company.
- Fill in the NIF/RUC field with your 11-digit RUC number (e.g.,
20557912879). This is mandatory — the module will block report generation if missing. - Ensure the Country is set to Peru.
- Set the PLE Contributor Type to CUO (most common) or M-RLE depending on your contributor category. This controls the journal correlative format in the TXT files.
- Configure the Code Prefix to match SUNAT's Chart of Accounts Table 17 classification. This prefix is used for reports 5.3 and 5.4.
3. Creating & Generating Reports
Complete workflow from creation to SUNAT submission:
Step A: Create New Report
Navigate to Accounting → PLE Reports → Electronic Journal. Click New. The system automatically fills:
- Period = Previous month (Start → End).
- Company = Your active company.
- Reporting Status = "Operating Entity".
No manual date entry needed for the most common use case.
Step B: Adjust Period (if needed)
If you need a different period, change the Start
Date.
The End Date automatically updates to the last day of that
month. Example: set Start Date to March 1 → End Date
auto-fills to March 31.
The system validates that End Date is never before Start Date.
Step C: Generate Files
Click "Generate Report". The system extracts all posted journal entries for the period and produces:
- 1 Excel file (internal audit)
- TXT 5.1 — Main Electronic Journal
- TXT 5.2 — Simplified Journal
- TXT 5.3 — Chart of Accounts (with/without values)
- TXT 5.4 — Chart of Accounts (simplified, with/without values)
Step D: Download & Upload to SUNAT
Download the TXT files from the form. Upload them directly
to SUNAT's PLE application. The filename already follows
SUNAT's naming convention (LE + RUC + Period + BookCode +
Flags), so no renaming is needed.
Step E: Declare to SUNAT
After uploading the TXT files, click "Declare to SUNAT" to mark the report as officially declared. This locks the report, preventing accidental modifications. The state changes to "Declared".
Step F: Rollback (if needed)
Need to regenerate? Click "Rollback" to clear all generated files and return to Draft state. Then re-run "Generate Report" with updated data.
4. Search, Filter & Group
Quickly find and organize your reports using the built-in search view:
Quick Filters
- Draft — Reports not yet generated.
- Generated — Files ready for download.
- Declared — Officially submitted to SUNAT.
Search By
- Company — Filter by company name.
- Period — Search by start date.
Group By
- Company — Group across entities.
- State — See draft vs declared.
- Period (month) — Organize by month.
5. Multi-Company Isolation
Reports are strictly isolated per company:
- You will only see reports belonging to the company you are currently logged into.
- If you switch companies using the company selector, the report list automatically updates to show only that company's data.
- Each company must have its own RUC, Chart of Accounts prefix, and PLE contributor type configured independently.
Field Mapping Reference
Detailed Column-by-Column Documentation
TXT 5.1 / 5.2 — Electronic Journal (Libro Diario)
Each row represents one journal entry line
(account.move.line).
Fields are separated by the pipe character |. Row order: date descending,
then
move name descending, then line ID ascending.
| # | SUNAT Field Name | Source | Completion Logic |
|---|---|---|---|
| 1 | Periodo | account_move_line.date |
Formatted as YYYYMM00 using the journal entry line date.
The
last two digits are always 00 as required by SUNAT for
monthly
period identification. Example: 20260200 for February 2026.
|
| 2 | CUO (Código Único de Operación) |
account_move.name |
The journal entry name with all /, -, and
spaces
stripped. Example: INV/2026/00001 becomes
INV202600001. Serves as the unique operation identifier for
SUNAT.
|
| 3 | Número Correlativo del Asiento |
SQL UDF: get_journal_correlative() |
Computed via a PostgreSQL UDF. Depends on the company's PLE
Contributor
Type:
|
| 4 | Código Cuenta Contable | account_account.code_store |
The account code extracted from the JSONB code_store field
using
the active company's root_id as key. All /,
-, and . separators are stripped. Example:
60.1.1.01 → 6011101.
|
| 5 | Código Unidad de Operación | Hardcoded empty | Always empty (''). This field is optional per SUNAT and not
used
in the current implementation. |
| 6 | Código Centro de Costo | account_move_line.analytic_distribution |
Derived from the analytic distribution of the journal
entry line. The system:
|
| 7 | Tipo de Moneda | res_currency.name |
The ISO 4217 currency code from the journal entry line's currency.
Defaults
to PEN if no currency is set. Common values:
PEN, USD, EUR.
|
| 8 | Tipo Doc. Identidad Emisor | l10n_latam_identification_type.l10n_pe_vat_code |
The SUNAT identification type code of the partner (issuer). Sourced from
the
partner's LATAM identification type. Common values:
6 = RUC, 1 = DNI, 4 = Carnet
Extranjería.
Empty if the partner has no identification type.
|
| 9 | Número Doc. Identidad Emisor | res_partner.vat |
The partner's VAT/RUC/DNI number. Post-processing:
if the number exceeds 11 characters, only the
last 11 characters are kept (to handle prefixed
formats like PE20557912879 → 20557912879).
|
| 10 | Tipo Comprobante de Pago | l10n_latam_document_type.code |
The SUNAT document type code from the LATAM document type. Examples:
01 = Factura, 03 = Boleta,
07 = Nota de Crédito, 08 = Nota de Débito.
Fallback: defaults to 00 if not set
(miscellaneous entries).
|
| 11 | Serie Comprobante | account_move_line.serie_correlative |
The document series, resolved using conditional logic by journal
type:
00000000 if empty after
processing.
|
| 12 | Número Comprobante | account_move_line.serie_correlative |
The document correlative number. Same conditional logic by
journal
type as field 11, but extracting part 2
(after the - separator):
0000 if empty after processing.
|
| 13 | Fecha Contable | account_move.date |
The accounting date of the journal entry, formatted as
DD/MM/YYYY. Example: 15/02/2026.
|
| 14 | Fecha de Vencimiento | account_move.invoice_date_due |
The invoice due date, formatted as DD/MM/YYYY. Empty if not
applicable (e.g., non-invoice journal entries). |
| 15 | Fecha de Operación / Emisión | account_move.date |
Same as field 13 (Fecha Contable). Uses the journal entry's accounting date as the operation date. |
| 16 | Glosa de la Operación | account_move_line.name |
The journal entry line's description/label. Newlines replaced by spaces.
Truncated to 200 characters. Falls back to the move
name if the line label is empty. Validated via SQL UDF
validate_string().
|
| 17 | Glosa Referencial | Conditional source | Depends on the move type:
|
| 18 | Debe (Debit) |
account_move_line.debit |
The debit amount of the journal entry line in company currency.
Formatted
with 2 decimal places. Example: 1500.00.
|
| 19 | Haber (Credit) |
account_move_line.credit |
The credit amount of the journal entry line in company currency.
Formatted
with 2 decimal places. Example: 1500.00.
|
| 20 | Dato Estructurado | Conditional logic |
⚠ SIRE Transition Logic:
If period ≤ September 2023 (pre-SIRE):
Uses SQL UDF get_data_structured_diary() which builds a
legacy string with & separators based on:
journal type, ple_no_include flag, non-domiciled
status,
move name, and date.
If period ≥ October 2023 (post-SIRE):
Concatenation of 4 zero-padded values: {partner_doc_number(11)}{doc_type_code(2)}{serie(4)}{correlative(10)}
Example: 20557912879010001000000123
|
| 21 | Estado de la Operación | Hardcoded | Always 1. Indicates the entry is an active/valid operation
(not cancelled or deleted). Required by SUNAT's format specification.
|
TXT 5.3 / 5.4 — Chart of Accounts (Plan Contable)
Each row represents one account (account.account)
belonging to
the company. Fields are separated by |. Sorted by account code ascending.
5.3 includes all accounts; 5.4 is the companion for
the simplified journal. The "without values" variant is always empty.
| # | SUNAT Field Name | Source | Completion Logic |
|---|---|---|---|
| 1 | Periodo | account_account.ple_date_account |
Formatted as YYYYMMDD using the account's PLE registration
date. If not set, the field is empty. Example:
20260101.
|
| 2 | Código Cuenta | account_account.code |
The account code with all . separators stripped. Example:
10.4.1.01 → 1041101. Sorted ascending to
ensure consistent ordering.
|
| 3 | Nombre Cuenta | account_account.name |
The account name. Truncated to 100 characters. |
| 4 | Código Prefijo Plan Contable | res_company.code_prefix |
The chart of accounts classification code configured at the company
level.
Must match SUNAT's Table 17 (e.g., 01 for
PCGE 2019). Same value for all rows in the report. Empty if not
configured. |
| 5 | Nombre del Grupo | account_account.group_id.name |
The name of the account's group (classification). Newlines are removed. Truncated to 60 characters. Empty if the account has no group assigned. |
| 6 | Empty fields | — | Two empty pipe-separated fields (columns 6 and 7 in the TXT). Reserved by SUNAT for future use. |
| 7 | Estado Cuenta | account_account.ple_state_account |
The account's PLE state. Indicates whether the account is active or
deprecated per SUNAT classification. Common values: 1 =
Active, 0 = Inactive. |
TXT Filename Convention
All generated filenames follow SUNAT's standard naming pattern:
LE{RUC}{YYYY}{MM}000{BOOK_CODE}0000{STATE_SEND}{HAS_INFO}{CURRENCY}1.txt
- LE — Fixed prefix (Libro Electrónico)
- RUC — Company's 11-digit RUC
- YYYY/MM — Year and month of the period
- BOOK_CODE —
5010(5.1),5020(5.2),5030(5.3),5040(5.4)
- STATE_SEND —
1(Operating Entity) or0(Inactive / Ceased) - HAS_INFO —
1if data exists,0if empty - CURRENCY —
1(PEN) or2(other) - 1 — Fixed suffix (version identifier)
Generated Files Reference
PLE Output Documentation
TXT 5.1 — Journal
The main Electronic Journal file containing all posted journal entries with their debit/credit amounts, account codes, partner information, document types, and structured data. This is the primary report for SUNAT submission.
TXT 5.2 — Simplified
The Simplified Journal version for companies under the RER (Régimen Especial) regime. Contains the same data structure as 5.1 but adapted for simplified contributors.
TXT 5.3 — Chart (with values)
The Chart of Accounts with values, listing all accounts used during the period with their codes, names, account groups, and the company's chart prefix according to SUNAT's Table 17.
TXT 5.4 — Chart (no values)
The Chart of Accounts without associated transactional values. Lists the account structure for reference purposes alongside the main journal report.
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: Generate Full Report
- Go to Accounting → PLE Reports → Electronic Journal.
- Create a new report for the current month.
- Ensure the company has a valid RUC/VAT.
- Click "Generar".
- Result: All 7 files should be generated (1 Excel + 6 TXT files for 5.1, 5.2, 5.3, 5.4 with/without values).
Scenario 2: Rollback & Regenerate
- Generate a report as in Scenario 1.
- Click "Rollback".
- Result: All generated files should be cleared. State returns to "Draft".
- Click "Generar" again.
- Result: Files are regenerated successfully.
Scenario 3: Pre-SIRE Period (Before Oct 2023)
- Create a report for a period before October 2023 (e.g., September 2023).
- Ensure there are posted journal entries in that period.
- Result: The "Structured Data" column in the TXT should use the
legacy format with
&separators.
Scenario 4: Missing VAT Validation
- Remove the VAT/RUC from the company (Settings → Companies).
- Attempt to generate a report.
- Result: A clear validation error should appear instructing the user to configure the VAT.
Scenario 5: Date Constraint Validation
- Create a new report.
- Manually set End Date to a date before the Start Date.
- Result: A validation error should appear: "The end date cannot be earlier than the start date."
- Correct the End Date to be after the Start Date.
- Result: You can save successfully.
Scenario 6: Smart Period Defaults
- Create a new report.
- Result: Start Date should be the 1st of the previous month and End Date should be the last day of the previous month.
- Change the Start Date to June 1, 2025.
- Result: End Date should automatically update to June 30, 2025.
Scenario 7: Multi-Company Isolation
- Switch to Company A using the company selector.
- Create and generate a report for Company A.
- Switch to Company B.
- Result: The report created for Company A should not be visible. Only Company B reports should appear.
- Create a report for Company B.
- Result: Both reports exist independently, each under its respective company.
Scenario 8: Search, Filter & Grouping
- Go to the Electronic Journal list view.
- Activate the "Draft" quick filter.
- Result: Only reports in Draft state should be displayed.
- Use the "Group by → Period" option.
- Result: Reports should be grouped by month (e.g., "January 2026", "February 2026").
FAQ & Troubleshooting
Common Resolutions
Empty report / no data?
Reason: No posted journal entries exist for the selected period and company.
Fix: Ensure your invoices and journal entries are in "Posted" state for the selected date range.
VAT/RUC validation error?
Reason: The company's VAT field is empty.
Fix: Go to Settings → Companies → select your company → fill in the NIF/RUC field with your 11-digit RUC.
Chart of Accounts prefix missing in 5.3/5.4?
Reason: The company's Code Prefix is not configured.
Fix: Go to Settings → Companies → select your company → set the "Code Prefix" field to match SUNAT's Table 17 for your Chart of Accounts.
Can I regenerate a report?
Answer: Yes! Use the Rollback feature.
Detail: Click "Rollback" to clear all files and return to draft. Then click "Generar" again to produce updated reports with the latest posted data.
I can't see reports from another company?
Reason: Reports are isolated per company via record rules.
Fix: Switch to the correct company using the company selector in the top navigation bar. Reports only appear for the active company.
"End date cannot be earlier than start date" error?
Reason: The End Date was manually set to a date before the Start Date.
Fix: Ensure the End Date is on or after the Start Date. Changing the Start Date will automatically update the End Date to the last day of that month.
Why does the TXT format change for older periods?
Reason: SUNAT changed the Structured Data format in October 2023 (SIRE transition).
Detail:
Periods before October 2023 use the legacy & separator format. Periods
from October 2023 onward use the new SIRE structure. The module detects this
automatically.
Does this module work on Odoo Online?
Answer: No. This module uses custom PostgreSQL UDFs (User-Defined Functions).
Detail: Odoo Online does not allow custom code or database functions. This module is compatible with Odoo.SH, Ganemo Online, and self-hosted Enterprise installations only.
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.
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