Crea una app web que genere el archivo txt que necesita AFIP/ARCA cuando presentamos el libro de iva compras digitalmente. Que permita cargar varios comprobantes y luego exportar el archivo txt.
Assistant
I will create a web application called "ARCA/AFIP - Generador Libro IVA Compras" that allows users to manually enter purchase invoices and export the required .txt file for the "Libro de IVA Digital" (AFIP).
The application will include:
Form to add invoices: Date, Type of Invoice (A, B, C, etc.), Point of Sale, Number, CUIT of Seller, Net Amount, VAT (IVA), and Total.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Export Logic: Generates a text file following the fixed-width format required by AFIP's import system.
First, I will install lucide-react for icons and date-fns for date handling.
Step 1: Install dependencies and set up the project structure.
I will now update the application title in index.html.
I'll read the index.html file to find the correct title tag.
I will update the title in index.html.
I will create the src/types.ts file to define the data structures for invoices and the necessary constants for AFIP types.
I will create a utility file src/utils/afipFormatter.ts to handle the logic of generating the fixed-width text file required by AFIP (Libro IVA Compras - Comprobantes).
Note: AFIP requires specific record lengths (e.g., 8 digits for date, 5 for POS, etc.) padded with zeros or spaces.
I will now create the main src/App.tsx component, including the invoice entry form, the table, and the logic to download the files.
I will now build the project to ensure everything is correct.
The application is ready. I've created a tool that:
Allows manual entry of purchase invoices with all fields required by AFIP (Date, Type, Point of Sale, Number, CUIT, Net, and VAT).
Automatically calculates VAT and the Total Amount based on the selected rate.
Displays a table with all loaded records.
Generates and downloads the 2 mandatory .txt files for AFIP's "Libro de IVA Digital":