ivas-preplisted
Install: claude install-skill markbaindesign/bain-studio
# IVA Prep
Prepares the quarterly IVA packet for the gestor. Run once per quarter before the 20th.
## Usage
```
/ivas-prep — current quarter
/ivas-prep Q2 2026 — specific quarter
/ivas-prep --dry-run — preview only
```
---
## Step 1 — Determine quarter
Parse args. Default to the quarter just ended based on today's date:
- Jan-Mar → Q1, Apr-Jun → Q2, Jul-Sep → Q3, Oct-Dec → Q4
- If invoked in the first 20 days of a new quarter, default to the quarter just ended.
Quarter folder: `/media/data/Dropbox/Work/Admin/Financial/XOR i MB/{YEAR}/T{Q}-{YEAR}/`
---
## Step 2 — Run the prep script
```bash
python3 /media/data/dev/bain-studio/studio/tools/ivas-prep/ivas-prep.py \
--quarter {Q} --year {YEAR} --gmail
```
This handles:
- Creating `Vendes/` and `Compres/{subfolders}/`
- Downloading Harvest invoice PDFs → `Vendes/`
- Sorting any loose PDFs in the quarter root
- Downloading Gmail invoice attachments to `Compres/{supplier}/` via Gmail API
Report what was created/downloaded/moved.
If `--gmail` fails with "credentials.json not found", see Step 3.
---
## Step 3 — Gmail setup (one-time, if credentials.json is missing)
Gmail download uses OAuth2 and requires a one-time setup:
1. Open Google Cloud Console: console.cloud.google.com (project: bain-studio)
2. Enable Gmail API if not already enabled
3. APIs & Services → Credentials → Create Credentials → OAuth 2.0 Client ID → Desktop app
4. Download the JSON and save it as:
`studio/tools/ivas-prep/cr