Report Types
Bar Galileo supports seven report types:Sales Reports
Total sales, invoice counts, averages, and detailed transaction lists
Expense Reports
Total expenses by category, averages, and itemized expense details
Payroll Reports
Active employees, salary totals, contract distribution, and employee details
Inventory Reports
Inventory value, low stock alerts, and complete product listings
Product Reports
Product catalog by category, pricing, margins, and stock levels
Table & Order Reports
Order history, billing statistics, and detailed order breakdowns
General Reports
Comprehensive financial overview: sales vs. expenses, profit margins, and daily summaries
Creating Reports
Fill Report Form
- Name: Descriptive title (e.g., “October 2025 Sales”)
- Type: Select from 7 report types
- Period: Daily, Weekly, Monthly, Quarterly, Annual, or Custom
- Date Range: Start and end dates
- Format: PDF, Excel, or CSV
- Description: Optional notes
Reports use a caching system. Data is stored as JSON after generation, so you can export multiple formats without re-querying the database.
Report Model
Fields
| Field | Type | Description |
|---|---|---|
nombre | CharField(200) | Report name |
tipo | CharField(20) | Report type (choices below) |
periodo | CharField(20) | Period type (diario, semanal, etc.) |
formato | CharField(10) | Export format (pdf, excel, csv) |
descripcion | TextField | Optional description |
creado_por | ForeignKey | User who created the report |
fecha_creacion | DateTimeField | Creation timestamp |
fecha_inicio | DateField | Report start date |
fecha_fin | DateField | Report end date |
archivo | FileField | Exported file (stored in reportes/) |
generado | BooleanField | Whether data has been generated |
datos_json | TextField | Cached report data as JSON |
ultima_generacion | DateTimeField | Last generation timestamp |
Report Type Choices
ventas: Sales reportsinventario: Inventory reportsgastos: Expense reportsnominas: Payroll reportsproductos: Product reportsmesas: Table and order reportsgeneral: General financial reports
Period Choices
diario: Dailysemanal: Weeklymensual: Monthlytrimestral: Quarterlyanual: Annualpersonalizado: Custom date range
Export Formats
PDF Reports
Professional documents with:- Header: Bar Galileo branding with report type
- Info Section: Report name, period, duration, creator, generation date
- Summary Tables: Key metrics with color-coded headers
- Detailed Tables: Complete data listings with borders and formatting
- Totals Section: Consolidated final figures
- Colors: Corporate gold (#A68932) and blue (#366092) theme
PDF reports use ReportLab with custom styling. Generated files are printer-ready and suitable for management presentations.
Excel Reports
Formatted spreadsheets with:- Title Row: Merged cells with corporate gold background
- Info Section: Styled report metadata
- Summary Section: Color-coded metrics
- Detailed Data: Bordered tables with header styling
- Totals Section: Bold summary figures
- Auto-sized Columns: Optimal width for readability
Excel files use OpenPyXL and include cell formatting, borders, and colors. Perfect for further analysis and filtering.
CSV Reports
Plain-text exports with:- UTF-8 BOM: Ensures proper character encoding
- Clear Structure: Section headers (===) for easy parsing
- Info Header: Report metadata
- Summary: Key metrics in key-value format
- Details: Tabular data with column headers
- Totals: Final summary figures
CSV files are compatible with Excel, Google Sheets, and any data processing tool. Use for importing to external systems.
Report Contents by Type
Sales Reports (ventas)
Summary:- Total sales amount
- Number of invoices
- Average invoice value
- Invoice number
- Date
- Table number
- Item count
- Total amount
Expense Reports (gastos)
Summary:- Total expenses
- Top 5 categories with amounts
- Average expense
- Date
- Category
- Description
- Recorded by (user)
- Amount
Payroll Reports (nominas)
Summary:- Total active employees
- Total salaries
- Distribution by contract type
- Employee name
- Position
- Contract type
- Base salary
- Years of service
Inventory Reports (inventario)
Summary:- Total inventory value
- Low stock items count
- Out of stock items count
- Product name
- Category
- Supplier
- Stock quantity
- Unit price
- Purchase price
- Total value
Product Reports (productos)
Summary:- Total active products
- Products by category
- Average profit margin
- Product name
- Category
- Brand
- Stock
- Unit price
- Purchase price
- Profit margin %
Table & Order Reports (mesas)
Summary:- Total orders
- Invoiced orders count
- Cancelled orders count
- Total billed amount
- Order number
- Table
- Date
- Status
- Item count
- Total amount
General Reports (general)
Summary:- Total sales
- Total expenses
- Gross profit
- Profit margin %
- Active products
- Active employees
- Date
- Daily sales
- Daily expenses
- Daily profit
Data Caching System
How It Works
- Click Generate Report to fetch and process data
- Data is serialized to JSON and stored in
datos_jsonfield ultima_generaciontimestamp is updatedgeneradoflag is set toTrue- Export formats read from cached JSON for fast rendering
Regenerating Reports
Report Properties
duracion_dias
Calculates the period length:
esta_vencido
Indicates if a report is over 30 days old:
Best Practices
Use Descriptive Names
Use Descriptive Names
Name reports clearly with period and type (e.g., “October 2025 Sales Report”) for easy identification in lists.
Generate Before Exporting
Generate Before Exporting
Always click Generate Report before exporting to ensure data is current. The cache persists between exports.
Choose Appropriate Periods
Choose Appropriate Periods
- Daily: For operational monitoring
- Weekly: For short-term trends
- Monthly: For standard financial reporting
- Quarterly/Annual: For strategic planning
Export Multiple Formats
Export Multiple Formats
Generate once, then export to PDF for sharing, Excel for analysis, and CSV for archival or integration.
Regenerate Periodically
Regenerate Periodically
If data changes frequently, regenerate reports daily or weekly to keep information current.
Archive Old Reports
Archive Old Reports
Delete or archive reports older than your retention policy (check
esta_vencido property).Permissions
The reports module defines custom permissions:view_reporte: Can view reportsadd_reporte: Can create new reportschange_reporte: Can edit report configurationsdelete_reporte: Can delete reportsexportar_reporte: Can export reports to filesgenerar_reporte: Can generate report data
Ensure users have appropriate permissions for their role. Reports can contain sensitive financial data.
Dependencies
The reports module requires:- openpyxl (v3.1.5+): For Excel export
- reportlab (v4.2.5+): For PDF generation
requirements.txt.
Troubleshooting
Report Shows No Data
Report Shows No Data
Verify that records exist in the selected date range. Check
fecha_inicio and fecha_fin against actual data dates.Export Button Disabled
Export Button Disabled
PDF/Excel Export Errors
PDF/Excel Export Errors
Confirm
openpyxl and reportlab are installed. Run pip install -r requirements.txt to verify.Data Outdated
Data Outdated
Regenerate the report by clicking Generate Report to fetch the latest information from the database.
CSV Not Opening Correctly in Excel
CSV Not Opening Correctly in Excel
The file uses UTF-8 with BOM. In Excel, use Data > From Text/CSV and select UTF-8 encoding.
Example Use Cases
Monthly Financial Review
- Create General Report for the past month
- Generate data to see sales vs. expenses
- Export to PDF for management meeting
- Export to Excel for detailed trend analysis
Inventory Audit
- Create Inventory Report for current date
- Generate to capture current stock levels
- Export to Excel
- Use Excel filters to identify low stock items
- Share CSV with procurement team
Payroll Processing
- Create Payroll Report for pay period
- Generate to include all active employees
- Export to PDF for HR records
- Export to CSV for payroll software import
Expense Analysis
- Create Expense Report for fiscal quarter
- Generate to aggregate all expenses
- Export to Excel
- Create pivot tables to analyze spending by category
Reports can be created multiple times with different date ranges to compare periods (e.g., month-over-month or year-over-year).
Next Steps: Learn about Automated Backups to protect your data.
