Report Categories
Financial Reports
Balance sheets, profit & loss, and financial statements
Sales Analytics
Sales reports, customer analysis, and performance metrics
Inventory Reports
Stock levels, movements, and warehouse analytics
Accounting Reports
Trial balance, journal reports, and tax declarations
Data Access for Reports
FacturaScripts provides multiple ways to access data for reporting:Model Queries
All models support flexible querying:Date Range Queries
Database Access
Direct SQL queries for complex reports:Financial Reports
Balance Sheet
Assets, liabilities, and equity reporting: Key Accounts:- Assets: Cash, accounts receivable, inventory
- Liabilities: Accounts payable, loans
- Equity: Capital, retained earnings
Cuentamodel for account structureSubcuentamodel for detailed balancesAsientoandPartidafor transactions
Profit & Loss Statement
Income and expense analysis: Components:- Revenue: Sales, services
- Cost of Goods Sold: Product costs, purchases
- Operating Expenses: Salaries, rent, utilities
- Financial Results: Interest, exchange rates
- Extraordinary Results: One-time items
Trial Balance
Listing of all accounts with debit and credit totals:Sales Reports
Sales by Period
Top Customers
Sales by Product
Sales by Agent
Inventory Reports
Stock Levels
Low Stock Alert
Stock Valuation
Stock Movements
Track stock changes over time by analyzing document lines:Accounting Reports
Journal Report
List of all accounting entries:Account Ledger
Transactions for a specific account:Tax Reports (VAT)
Aged Receivables/Payables
Customer Aging
Supplier Aging
Custom Reports
Creating Custom Reports
You can create custom reports by:- Extending Report Classes: Create classes extending base report functionality
- Direct Database Queries: Use complex SQL for specific needs
- Model Aggregation: Combine data from multiple models
- Export to Excel/PDF: Generate downloadable reports
Example Custom Report
Report Filters
Common filters for reports:- Date ranges: From/to dates
- Fiscal exercise: Accounting period
- Warehouse: Specific location
- Customer/Supplier: Specific entity
- Product/Family: Product filters
- Agent: Sales person
- Document series: Invoice series
- Status: Paid/unpaid, open/closed
Export Formats
Reports can be exported to:- PDF: Formatted reports
- Excel/CSV: Data analysis
- XML: Tax declarations
- JSON: API integration
Performance Considerations
Query Optimization
Best Practices
Date Ranges
Date Ranges
Always specify date ranges for reports to limit data volume. Default to current fiscal period.
Result Limits
Result Limits
Implement pagination or result limits for large datasets. Don’t try to display thousands of rows at once.
Aggregation
Aggregation
Perform aggregation in SQL rather than in application code for better performance.
Caching
Caching
Cache report results when appropriate, especially for dashboard summaries that don’t need real-time data.
Export Options
Export Options
Always provide export options for reports so users can analyze data in their preferred tools.
Dashboard Widgets
Create summary widgets for dashboards:- Total sales today/week/month
- Outstanding receivables
- Low stock alerts
- Profit margin trends
- Top customers
- Agent performance
Related Documentation
Invoicing
Sales document data sources
Accounting
Financial reporting data
Inventory
Stock reporting data
CRM
Customer analytics data
Next Steps
- Explore existing reports in the Reports menu
- Create custom report classes for specific needs
- Set up scheduled report generation
- Configure dashboard widgets
- Export reports for external analysis

