perioada luna anterioara finalizata

This commit is contained in:
2026-02-16 14:12:03 +02:00
parent bc05d02319
commit 85423cfe94
5 changed files with 299 additions and 157 deletions

View File

@@ -14,16 +14,42 @@ python -m venv .venv
source .venv/bin/activate # Linux/WSL
pip install -r requirements.txt
# Run report (default: last 12 months)
# Run report (default: last 12 months, previous complete month)
python main.py
# Custom period
# Custom period duration
python main.py --months 6
# Custom end month (report through January 2026)
python main.py --end-month 2026-01
# Combined: 6 months through December 2025
python main.py --months 6 --end-month 2025-12
# Docker alternative
docker-compose run --rm report-generator
```
## Configurable Reporting Period
**Default behavior**: Reports cover data through the **last complete month** (excludes current incomplete month).
- Example: If today is 2026-02-16, default reports data through 2026-01-31
**Override with CLI**:
```bash
python main.py --end-month 2026-01 # Report through January 2026
```
**Override with environment variable**:
```bash
export REPORT_END_MONTH=2026-01
python main.py
```
**Internals**: All SQL queries receive `:data_referinta` as an Oracle DATE bind variable (= first day of month AFTER end-month).
- Ensures consistent period boundaries across all queries (sales, balances, aging, etc.)
- YoY comparisons auto-adjust based on configured period
## Oracle Connection
| Environment | ORACLE_HOST value |