feat: add vendor invoice management UI and comprehensive tests

UI Components:
- Add vendor invoices page route in vendor_pages.py
- Create invoices.html template with stats cards, invoice table,
  settings tab, and create invoice modal
- Add invoices.js Alpine.js component for CRUD operations,
  PDF download, and settings management
- Add Invoices link to vendor sidebar in Sales section

Unit Tests (35 tests):
- VAT calculation (EU rates, regimes, labels)
- Invoice settings CRUD and number generation
- Invoice retrieval, listing, and pagination
- Status management and validation
- Statistics calculation

Integration Tests (34 tests):
- Settings API endpoints (GET/POST/PUT)
- Stats API endpoint
- Invoice list with filtering and pagination
- Invoice detail retrieval
- Invoice creation from orders
- Status update transitions
- PDF generation endpoints
- Authentication/authorization checks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-24 18:59:39 +01:00
parent 319fba5d39
commit e456ae3c73
6 changed files with 2527 additions and 0 deletions

View File

@@ -128,6 +128,17 @@ Follows same pattern as admin sidebar
<span class="ml-4">Messages</span>
</a>
</li>
<li class="relative px-6 py-3">
<span x-show="currentPage === 'invoices'"
class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg"
aria-hidden="true"></span>
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
:class="currentPage === 'invoices' ? 'text-gray-800 dark:text-gray-100' : ''"
:href="`/vendor/${vendorCode}/invoices`">
<span x-html="$icon('document-text', 'w-5 h-5')"></span>
<span class="ml-4">Invoices</span>
</a>
</li>
</ul>
<!-- Settings Section -->