ADR-019: Billing Folder Structure for Contractors¶
Status: Accepted
Date: 2026-01-21
Authors: Wolfram Laube, Claude
Tags: infrastructure, billing, gdrive, contractors
Supersedes: Partially extends ADR-017 (Buchhaltung section)
Context¶
BLAUWEISS EDV LLC operates as a consulting firm with multiple contractors (Wolfram, Ian, potentially more). Each contractor:
- Works for different clients at different rates
- Submits individual timesheets and honorar notes to the LLC
- May work for multiple clients simultaneously
The LLC then: 1. Consolidates contractor timesheets into a team summary 2. Issues a single invoice to the client (hiding individual rates) 3. Manages internal contractor payments
Requirements¶
| Requirement | Reason |
|---|---|
| Rate Privacy | Clients should not see individual contractor rates |
| Consolidated View | Client receives one team timesheet, not individual files |
| Audit Trail | Internal records must track per-contractor hours |
| Multi-Client Support | Contractors may work for multiple clients per month |
| Scalability | Structure must support adding new contractors |
Decision¶
Implement a two-tier folder structure within Buchhaltung/:
Buchhaltung/
โ
โโโ clients/ # โโโโโโ EXTERNAL (to customers) โโโโโโ
โ โโโ {client}/
โ โโโ {year}/
โ โโโ {month}/
โ โโโ invoice_AR_{nr}.pdf # Invoice to client
โ โโโ timesheet_consolidated.pdf # Team hours (no rates)
โ
โโโ contractors/ # โโโโโโ INTERNAL (LLC records) โโโโโโ
โโโ {person}/
โโโ {year}/
โโโ {month}/
โโโ {client}/
โโโ timesheet.pdf # Individual hours
โโโ honorar.pdf # Contractor's invoice to LLC
Example: January 2026¶
Buchhaltung/
โโโ clients/
โ โโโ nemensis/
โ โโโ 2026/
โ โโโ 01/
โ โโโ invoice_AR_001.pdf # โฌ15,000 invoice
โ โโโ timesheet_consolidated.pdf # 120h total
โ
โโโ contractors/
โโโ wolfram/
โ โโโ 2026/
โ โโโ 01/
โ โโโ nemensis/
โ โโโ timesheet.pdf # 80h
โ โโโ honorar.pdf # โฌX (internal)
โ
โโโ ian/
โโโ 2026/
โโโ 01/
โโโ nemensis/
โ โโโ timesheet.pdf # 40h
โ โโโ honorar.pdf # โฌY (internal)
โ
โโโ other_client/ # Ian also works here
โโโ timesheet.pdf
โโโ honorar.pdf
Document Flow¶
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ BLAUWEISS EDV LLC โ
โ โ
โ Wolfram โโโบ timesheet + honorar โโโ โ
โ โ โ
โ Ian โโโโโโโบ timesheet + honorar โโโผโโโบ consolidate_timesheets.py โ
โ โ โ โ
โ (future) โโบ timesheet + honorar โโโ โผ โ
โ timesheet_consolidated.pdf โ
โ + โ
โ invoice_AR_xxx.pdf โ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโ
โผ
CLIENT
Filename Conventions¶
Input files (from contractors):
{person}_{client}_{year}-{month}_timesheet.pdf
{person}_{client}_{year}-{month}_honorar.pdf
Examples:
wolfram_nemensis_2026-01_timesheet.pdf
ian_nemensis_2026-01_honorar.pdf
Output files (to clients):
{client}_{year}-{month}_invoice_AR_{nr}.pdf
{client}_{year}-{month}_timesheet.pdf
Examples:
nemensis_2026-01_invoice_AR_001.pdf
nemensis_2026-01_timesheet.pdf
Automation¶
| Script | Purpose | Trigger |
|---|---|---|
upload_to_drive.py |
Route files to correct folders | CI: upload_invoice |
consolidate_timesheets.py |
Merge contractor โ team | CI: build_invoice |
billing_trigger.html |
Manual pipeline trigger | Pages button |
Consequences¶
Positive¶
- Privacy: Clients never see individual rates or contractor splits
- Clarity: Clear separation of internal vs. external documents
- Scalability: Adding a new contractor = new folder, no structural changes
- Auditability: Complete paper trail for LLC accounting
- Automation-friendly: Predictable paths for CI/CD
Negative¶
- Migration: Existing files need reorganization
- Consolidation logic: New script required to merge timesheets
- Naming discipline: Team must follow filename conventions
Migration Plan¶
- Create new folder structure in GDrive
- Update
upload_to_drive.pywith routing logic - Create
consolidate_timesheets.py - Move existing files to new structure
- Update CI pipeline
- Document conventions in team wiki
Related¶
- ADR-017: GDrive Folder Structure (general structure)
- Issue #60: Restructure GDrive folder hierarchy
billing/scripts/upload_to_drive.pybilling/scripts/consolidate_timesheets.py(new)