Skip to main content

Overview

The Factura Afecta (Code 33) is the standard electronic invoice used for commercial transactions subject to VAT (Impuesto al Valor Agregado) in Chile. This is the most common document type for B2B transactions.
Official Name: Factura electrónica
Document Code: 33
Enum Constant: CodigoDocumento::FACTURA_AFECTA
Interface: FacturaAfectaInterface

When to Use

Use a Factura Afecta when:
  • Selling goods or services subject to VAT
  • Issuing invoices to other businesses (B2B)
  • The customer requires a tax-deductible document
  • Transactions involve taxable items

Document Properties

Basic Information

codigo
int
required
Document code: 33
nombre
string
required
Full document name: “Factura electrónica”
nombreCorto
string
required
Short name: “Factura”
alias
string
required
Programmatic alias: “factura_afecta”

Code Example

use libredte\lib\Core\Package\Billing\Component\Document\Enum\CodigoDocumento;
use libredte\lib\Core\Package\Billing\Component\Document\Contract\Document\FacturaAfectaInterface;

// Access the document type
$documentType = CodigoDocumento::FACTURA_AFECTA;

// Get document code
$codigo = $documentType->getCodigo(); // 33

// Get document name
$nombre = $documentType->getNombre(); // "Factura electrónica"

// Get short name
$nombreCorto = $documentType->getNombreCorto(); // "Factura"

// Get alias
$alias = $documentType->getAlias(); // "factura_afecta"

// Get interface class
$interface = $documentType->getInterface(); // FacturaAfectaInterface::class
  • Factura Exenta (34): For tax-exempt invoices
  • Nota de Crédito (61): To reverse or correct a Factura Afecta
  • Nota de Débito (56): To add charges to a Factura Afecta
  • Factura de Compra (46): Purchase invoice variant

Implementation

The Factura Afecta implements the FacturaAfectaInterface, which extends the base DocumentInterface. This ensures type safety and allows for document-specific behavior.
namespace libredte\lib\Core\Package\Billing\Component\Document\Contract\Document;

interface FacturaAfectaInterface extends DocumentInterface
{
    // Document-specific methods and properties
}

Build docs developers (and LLMs) love