The billing module covers the financial end of every shift. It progresses through three stages: invoice generation (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Henry4ndrew/saborGestion/llms.txt
Use this file to discover all available pages before exploring further.
facturas), payment registration (pagos), and daily cash register closing (cierres).
Facturas
Generate a pre-invoice or final invoice from a completed order.
Pagos
Register cash, card, transfer, or other payment methods against an invoice.
Cierre de Caja
Summarize daily totals by payment method and record any observations.
End-of-day workflow
Step-by-step guide to close out a full shift.
Invoices (facturas)
Database schema
Defined indatabase/migrations/2026_03_21_012544_create_facturas_table.php:
| Column | Type | Notes |
|---|---|---|
id | bigint (PK) | Auto-increment |
pedido_id | bigint (FK) | References pedidos.id; cascades on delete |
total | decimal(10,2) | Invoice total amount |
fecha | timestamp | Invoice date; defaults to CURRENT_TIMESTAMP |
estado | enum | prefactura (draft) or facturado (finalised); defaults to prefactura |
created_at / updated_at | timestamp | Laravel timestamps |
Invoice statuses
| Status | Description |
|---|---|
prefactura | Draft invoice, pending customer confirmation or payment |
facturado | Invoice has been finalised and issued |
Routes
| Method | URI | Action |
|---|---|---|
GET | /facturas | index — list all invoices |
GET | /facturas/create | create — show creation form |
POST | /facturas | store — generate a new invoice |
GET | /facturas/{factura} | show — view invoice detail |
GET | /facturas/{factura}/edit | edit — show edit form |
PUT/PATCH | /facturas/{factura} | update — apply changes |
DELETE | /facturas/{factura} | destroy — delete an invoice |
Payments (pagos)
Database schema
Defined indatabase/migrations/2026_03_21_012545_create_pagos_table.php:
| Column | Type | Notes |
|---|---|---|
id | bigint (PK) | Auto-increment |
factura_id | bigint (FK) | References facturas.id; cascades on delete |
monto | decimal(10,2) | Amount paid in this transaction |
metodo | enum | Payment method (see below) |
fecha | timestamp | Payment date; defaults to CURRENT_TIMESTAMP |
created_at / updated_at | timestamp | Laravel timestamps |
Payment methods
| Method | Description |
|---|---|
efectivo | Cash payment |
tarjeta | Credit or debit card |
transferencia | Bank transfer |
otro | Any other method |
Routes
| Method | URI | Action |
|---|---|---|
GET | /pagos | index — list all payments |
GET | /pagos/create | create — show creation form |
POST | /pagos | store — register a payment |
GET | /pagos/{pago} | show — view payment detail |
GET | /pagos/{pago}/edit | edit — show edit form |
PUT/PATCH | /pagos/{pago} | update — apply changes |
DELETE | /pagos/{pago} | destroy — delete a payment |
A single invoice can have multiple
pago records, for example when a customer splits payment between cash and card. Sum all monto values for a given factura_id to determine the total amount collected.Cash register closing (cierre de caja)
Thecierre_cajas table stores a daily summary of sales broken down by payment method. The cashier creates one record at the end of each shift.
Database schema
Defined indatabase/migrations/2026_03_21_012546_create_cierre_cajas_table.php:
| Column | Type | Notes |
|---|---|---|
id | bigint (PK) | Auto-increment |
fecha | timestamp | Closing date and time; defaults to CURRENT_TIMESTAMP |
total_ventas | decimal(10,2) | Grand total of all sales for the period; defaults to 0 |
total_efectivo | decimal(10,2) | Total collected in cash; defaults to 0 |
total_tarjeta | decimal(10,2) | Total collected by card; defaults to 0 |
total_otros | decimal(10,2) | Total collected by transfer or other methods; defaults to 0 |
observaciones | text (nullable) | Free-text notes (discrepancies, incidents, etc.) |
created_at / updated_at | timestamp | Laravel timestamps |
Routes
| Method | URI | Action |
|---|---|---|
GET | /cierres | index — list all closing records |
GET | /cierres/create | create — show creation form |
POST | /cierres | store — record a new closing |
GET | /cierres/{cierre} | show — view closing detail |
GET | /cierres/{cierre}/edit | edit — show edit form |
PUT/PATCH | /cierres/{cierre} | update — apply corrections |
DELETE | /cierres/{cierre} | destroy — delete a closing record |
End-of-day workflow
Confirm all orders are closed
Review
/pedidos and ensure all active orders have estado = entregado or cancelado. No order should remain in pendiente or preparando before closing.Generate invoices for completed orders
For each delivered order that does not yet have an invoice, go to
/facturas/create, select the pedido_id, enter the total, and set estado to prefactura. Review the amounts with the customer and then update estado to facturado.Register payments
For each finalised invoice, go to
/pagos/create. Select the factura_id, enter the monto, and choose the metodo (efectivo, tarjeta, transferencia, or otro). Repeat if the payment is split across multiple methods.Tally totals by method
Sum all
pagos.monto records for the shift, grouped by metodo, to get your efectivo, tarjeta, and otros subtotals.