Skip to content

Expense VAT (F4), fiscal calendar (F3), 303/130 drafts (F5), and other#39

Merged
mborchuk merged 4 commits into
mainfrom
feat/taxes-calculation
Jul 6, 2026
Merged

Expense VAT (F4), fiscal calendar (F3), 303/130 drafts (F5), and other#39
mborchuk merged 4 commits into
mainfrom
feat/taxes-calculation

Conversation

@mborchuk

@mborchuk mborchuk commented Jul 3, 2026

Copy link
Copy Markdown
Owner

…voice lifecycle (F2)

Expenses (F4): add net/vat_rate/vat_amount/deductible/deductible_pct to the expense model (core + module mirror) with guarded migration; VAT auto-calc form, category defaults + settings panel, list/report/API/tax-panel surfacing.

Fiscal calendar (F3): new module with local AEAT deadline dataset, dashboard panel, year page, form-selection settings, idempotent reminder scheduler job riding the notify capability seam.

Tax ES forms (F5): new module rendering per-quarter Modelo 303/130 box drafts from invoices + expenses (estimate only, versioned box mapping), tax-obligations panel + REST API; consumes the F2 fiscal snapshot and F4 expense VAT.

Invoice lifecycle (F2): draft->issued->paid states with issued/paid lock across routes and InvoiceService, per-series sequential numbering + frozen fiscal snapshot at issue, rectificative + annul flows, and issue-blocking on_invoice_issued/rectified/annulled module hooks.

Also fixes the empty Contractor column on the expenses list and consolidates module-loading test setup into one shared conftest fixture.

Tests: 63 passing (expense VAT, fiscal calendar, invoice lifecycle, 303/130 engine, expenses list). No live AEAT verification — box numbers/rates/dates are standard values, versioned and framed as "estimate, not tax advice".

…voice lifecycle (F2)

Expenses (F4): add net/vat_rate/vat_amount/deductible/deductible_pct to the
expense model (core + module mirror) with guarded migration; VAT auto-calc form,
category defaults + settings panel, list/report/API/tax-panel surfacing.

Fiscal calendar (F3): new module with local AEAT deadline dataset, dashboard
panel, year page, form-selection settings, idempotent reminder scheduler job
riding the notify capability seam.

Tax ES forms (F5): new module rendering per-quarter Modelo 303/130 box drafts
from invoices + expenses (estimate only, versioned box mapping), tax-obligations
panel + REST API; consumes the F2 fiscal snapshot and F4 expense VAT.

Invoice lifecycle (F2): draft->issued->paid states with issued/paid lock across
routes and InvoiceService, per-series sequential numbering + frozen fiscal
snapshot at issue, rectificative + annul flows, and issue-blocking
on_invoice_issued/rectified/annulled module hooks.

Also fixes the empty Contractor column on the expenses list and consolidates
module-loading test setup into one shared conftest fixture.

Tests: 63 passing (expense VAT, fiscal calendar, invoice lifecycle, 303/130
engine, expenses list). No live AEAT verification — box numbers/rates/dates are
standard values, versioned and framed as "estimate, not tax advice".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread app.py Fixed
Comment thread app.py Fixed
Comment thread app.py Fixed
Comment thread modules/fiscal_calendar/index.py Fixed
Comment thread modules/tax_es_forms/index.py Fixed
Comment thread tests/conftest.py Fixed
Comment thread tests/test_invoice_lifecycle.py Fixed
- Sanitize exception text in the three invoice-lifecycle error logs
  (issue/annul/rectify) to prevent log injection from user-derived data.
- Drop unused imports: datetime in fiscal_calendar, date in tax_es_forms.
- Stop importing module 'app' both ways (import + from-import) in
  tests/conftest.py and tests/test_invoice_lifecycle.py; use sys.modules['app'].

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread app.py Fixed
Comment thread app.py Fixed
Comment thread app.py Fixed
CodeQL taint tracking does not recognize the custom _log_safe helper as a
sanitizer, so the three lifecycle error logs stayed flagged. Drop the exception
text from the log line entirely and use exc_info=True instead — no
user-derived string reaches the formatter, full diagnostics stay in the
traceback. Remove the now-unused _log_safe helper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread app.py Fixed
Comment thread app.py Fixed
Comment thread app.py Fixed
CodeQL models Flask route parameters as tainted regardless of the <int:>
converter, so the lifecycle error logs stayed flagged even without the
exception text. Log the ORM object's id (DB-derived, untainted) instead,
matching how the rest of the codebase logs invoice identifiers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mborchuk mborchuk merged commit 87d3c89 into main Jul 6, 2026
8 checks passed
@mborchuk mborchuk deleted the feat/taxes-calculation branch July 6, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants