feat(manager): expenses, the supplier book and tabs on v2 (platform-v2 step 6.13a)

- Finance -> Expenses: still owed, late, filters, new/edit (supplier picked or added there), pay in parts, details with payments, delete
- CRM -> Contacts: the supplier book with what each one is owed
- Finance -> Tabs: open (who owes most first) / settled, charges and payments, pay (cash/card/other), close, forgive
- backend: expenses.manage / tabs.manage (the list also reports.view, a customer's tabs also crm.manage, put-on-tab needs tabs.manage);
  payment <= due (expense.over_due), total >= paid (expense.below_paid), categories/kinds/methods checked, null clears a field;
  live events expenses.changed / tabs.changed; GET /api/expenses ?from=&to= venue dates (the report uses it); tab_status=settled
- fix: an expense with a due date failed to save (naive date refused by D-11)
- @xenia/i18n/number subpath; tests: test_finance.py (6), finance.test.mjs (5), e2e manager.mjs finance flow

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 12:54:21 +02:00
co-authored by Claude Opus 5.5
parent 6bdf0bdd79
commit 93c0dd7d9c
32 changed files with 1667 additions and 1153 deletions
+4 -1
View File
@@ -57,6 +57,7 @@ class RevertPaymentRequest(BaseModel):
item_ids: List[int]
from routers.deps import get_current_user, require_manager
from core.access.deps import require
from services.printer_service import route_and_print, route_and_print_sync, print_order_receipt, print_order_synopsis, print_cancellation_ticket
from models.settings import PosSettings
from services.ws_bus import broadcast_sync
@@ -2019,7 +2020,7 @@ def put_item_on_tab(
order_id: int,
item_id: int,
db: Session = Depends(get_db),
user: User = Depends(require_manager),
user: User = Depends(require("tabs.manage")), # also needs the tabs module on (6.13a)
):
from models.tabs import Tab, TabEntry
@@ -2061,6 +2062,8 @@ def put_item_on_tab(
db.commit()
broadcast_sync("order_updated", {"order_id": order.id, "table_id": order.table_id, "status": order.status, "action": "item_tabbed"})
from routers.tabs import changed as tabs_changed
tabs_changed()
return {"status": "tabbed", "tab_id": tab.id, "entry_amount": entry.amount}