Greenter: Electronic Invoicing for Peru

repository·master·Indexed 43 days ago

https://github.com/thegreenter/greenter

A PHP library for implementing SUNAT-compliant electronic invoicing in Peru. It automates UBL XML generation, digital signing, communication with SUNAT web services, and CDR processing. The ecosystem includes specialized packages for CPE validation, XML parsing, HTML-to-PDF report generation, and a lightweight 'Greenter Lite' version. Requires PHP 7.4+ and extensions including soap, zlib, openssl, and curl.

Tokens
9.6K
Snippets
24
Records
42
Agent score
56%

What's inside Greenter

  1. What is CPE Validator

    master
    CPE Validator is a tool designed to validate electronic documents based on the CPE (Comprobante de Pago Electrónico) Validation Rules defined by SUNAT (Superintendencia Nacional de Aduanas y de Administración Tributaria). It ensures that electronic documents comply with the technical specifications required by the Peruvian tax authority.
  2. Overview of Greenter for Electronic Invoicing in Peru

    master

    Greenter is a PHP library designed to implement Electronic Invoicing (Facturación Electrónica) in Peru, compliant with SUNAT regulations. It automates the core components of the invoicing process, including:

    • Generating XML files according to the UBL standard.
    • Signing XML files using a digital certificate.
    • Sending invoices to SUNAT web services.
    • Processing the CDR (Comprobante de Recepción).
    • Providing various utility tools for the invoicing lifecycle.

    For a practical implementation reference, you can view the @greenter/demo repository.

  3. What is Greenter Lite?

    master
    Greenter Lite is a lightweight version of the Greenter library. It includes only the minimum required packages necessary to generate and send electronic receipts (comprobantes electrónicos). Use this version if you want to minimize dependencies while maintaining core functionality.
  4. Overview of Greenter WebServices

    master
    The ws package provides the connection logic required to communicate with SUNAT (Superintendencia Nacional de Aduanas y de Administración Tributaria) web services. It is specifically designed for the transmission of electronic documents (comprobantes electrónicos) to the Peruvian tax authority.
  5. Overview of XML Parser - Greenter

    master
    The xml-parser package is a component of the Greenter ecosystem designed to convert XML data from electronic receipts (comprobantes electrónicos) into structured PHP classes. This allows developers to interact with XML data using object-oriented patterns instead of manual XML parsing.
  6. Identify SUNAT error codes and descriptions with XCodes

    master
    XCodes is a resource provided by Greenter that contains the error codes and their corresponding descriptions originating from SUNAT (Superintendencia Nacional de Aduanas y de Administración Tributaria) web services. It serves as a reference for developers to understand and handle errors returned during electronic invoicing processes in Peru.
  7. Use Documents Data for testing

    master
    The packages/data package provides invoice entities (Entidades de facturas) designed specifically to be used as examples for writing tests. Instead of manually constructing complex invoice objects, you can use these pre-defined entities to ensure your test suites are working with realistic data structures.