How krppd/betterstock works
BetterStock is a local-first point-of-sale and inventory application for small shops. The main workflow starts in the desktop app, proceeds through product and sale management, and persists business records in SQLite; the README also documents cash shifts, customer credit, reporting, CSV import, backups, and receipt printing. Paths and links for unsampled capabilities are based on the tree and README, so their internal wiring is left unasserted. The source excerpts and index support the specific implementation links shown.
Main entry points: gestor_ventas.py Sales management · gestor_fiado.py Customer credit · sqlite.py SQLite database · app.py Application entry
Components 26
Desktop experience
- Application entry
app.py - Customer accounts
views/ventana_clientes.py - Customer form
views/formulario_cliente.py - Sales dashboard
views/ventana_dashboard.py - Sales interface
views/ventana_ventas.py - Checkout
views/ventana_cobro.py
Sales and operations
- Sales management
services/gestor_ventas.py - Stock management
services/gestor_stock.py - Customer credit
services/gestor_fiado.py - Shift management
services/turnos.py - Cash register
services/caja.py - Returns
services/devoluciones.py - CSV import
services/importador/servicio.py - Sales statistics
services/estadisticas_ventas.py
Domain and persistence
- Product domain
models/producto.py - Recorded sale
models/venta_registrada.py - SQLite database
repositories/sqlite.py - Product repository
repositories/producto_repositorio.py - Sales repository
repositories/venta_repositorio.py - Customer repository
repositories/cliente_repositorio.py - Credit repository
repositories/cuenta_repositorio.py
Business support
- Local backups
services/backup.py - Receipt printing
services/impresion.py - Authentication
services/autenticacion.py - Shop settings
views/ventana_configuracion.py
Other components
- Shop operator
Connections 30
- Shop operator → Application entry: launches
- Application entry → Sales management: initializes
app.py - Sales interface → Checkout: opens
- Checkout → Sales management: records sale
- Sales management → Stock management: updates stock
services/gestor_ventas.py - Sales management → Customer credit: uses credit
services/gestor_ventas.py - Sales management → Sales statistics: updates statistics
services/gestor_ventas.py - Sales management → Recorded sale: builds sale
services/gestor_ventas.py - Product repository → Product domain: maps products
repositories/producto_repositorio.py - Product repository → SQLite database: reads and writes
repositories/producto_repositorio.py - Sales repository → Recorded sale: maps sales
repositories/venta_repositorio.py - Sales repository → SQLite database: reads and writes
repositories/venta_repositorio.py - Customer repository → SQLite database: reads and writes
repositories/cliente_repositorio.py - Credit repository → SQLite database: reads and writes
repositories/cuenta_repositorio.py - Customer credit → Customer repository: manages clients
services/gestor_fiado.py - Customer credit → Credit repository: manages balances
services/gestor_fiado.py - Customer accounts → Customer credit: loads accounts
views/ventana_clientes.py - Customer accounts → Customer form: opens editor
views/ventana_clientes.py - Customer form → Customer credit: saves customer
views/formulario_cliente.py - Sales dashboard → Sales statistics: reads statistics
views/ventana_dashboard.py - Sales dashboard → Customer credit: reads balances
views/ventana_dashboard.py - Sales dashboard → Stock management: reads stock
views/ventana_dashboard.py - Sales statistics → Sales repository: queries sales
services/estadisticas_ventas.py - Returns → SQLite database: reads records
services/devoluciones.py - CSV import → Product repository: imports products
services/importador/servicio.py - CSV import → Local backups: requests backup
services/importador/servicio.py - Shift management → Sales repository: reads sales
services/turnos.py - Shift management → Credit repository: reads account
services/turnos.py - Application entry → Authentication: configures
app.py - Application entry → Cash register: configures
app.py