feat: Deposit & Final Invoices (Abschlagsrechnung / Schlussrechnung)#349
Draft
clstaudt wants to merge 1 commit into
Draft
feat: Deposit & Final Invoices (Abschlagsrechnung / Schlussrechnung)#349clstaudt wants to merge 1 commit into
clstaudt wants to merge 1 commit into
Conversation
…srechnung) Implements #326 — linked partial invoice chains with milestone-based payment schedules. Schema: - Add PaymentMilestone table for contract payment schedules - Extend Invoice.document_type with "deposit" and "final" - Add deposit chain FK (deposit_for_id) and milestone FK - Alembic migration for all new columns/tables Invoicing logic: - generate_deposit_invoice() for milestone-based deposits - generate_final_invoice() showing full amount with deposit deductions - Last-milestone shortcut auto-creates final invoice - toggle_paid propagates across deposit chains Rendering: - Legally compliant PDF layout for deposit and final invoices - Deposit deduction lines with VAT breakdown on final invoices - i18n labels (EN/DE/ES) for all new document types UI: - Milestone editor on contract detail view - Document type picker (Invoice / Milestone) in create dialog - Deposit chain visualization in invoice list - MilestoneScheduleBadge showing progress - Deposit/final invoice detail views Known issues: - Milestone paid count badge may show stale data - PDF rendering for final invoices needs session hydration fix Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #326
Summary
PaymentMilestonetable,Invoice.document_typeextended with"deposit"/"final", deposit chain FK (deposit_for_id), milestone FK, Alembic migrationgenerate_deposit_invoice(),generate_final_invoice()with deduction lines + VAT settlement, last-milestone auto-creates final, paid-status propagation across chainsMilestoneScheduleBadge, deposit/final detail viewsKnown Issues
Test plan
Made with Cursor