Files
WYGIWYH/app/apps/splits/admin.py
T
Herculino Trotta 77bf2d7bdb feat(splits): add split expenses for shared group costs
Track expenses shared with other people (trips, flats, dinners) and settle
up with the fewest payments.

- Events with WYGIWYH users and people without an account, who join through
  a share link and pick a password on first sign-in
- Equal, exact, percentage and share-weight splits that always add up
- Balances, a minimal settle-up plan and an activity feed showing what each
  item means for you
- Link items to your own transactions; recording a payment marks planned
  ones as paid
- Share menu: printable PDF report and PNG images of the summary, settle-up
  and balances (adds modern-screenshot)
- Only the two people involved or the organizer can record a payment;
  members can leave events they don't organize
2026-11-20 19:43:23 -03:00

55 lines
1.7 KiB
Python

from django.contrib import admin
from apps.splits.models import (
SplitAttachment,
SplitEvent,
SplitExpense,
SplitExpenseShare,
SplitParticipant,
SplitPayment,
SplitTransactionLink,
)
@admin.register(SplitEvent)
class SplitEventAdmin(admin.ModelAdmin):
list_display = ("name", "currency", "creator", "allow_external_access", "is_archived", "created_at")
list_filter = ("is_archived", "allow_external_access", "currency")
search_fields = ("name", "description")
@admin.register(SplitParticipant)
class SplitParticipantAdmin(admin.ModelAdmin):
list_display = ("name", "event", "is_external", "user", "is_active", "external_claimed_at")
list_filter = ("is_external", "is_active")
search_fields = ("name", "external_username", "event__name")
@admin.register(SplitExpense)
class SplitExpenseAdmin(admin.ModelAdmin):
list_display = ("description", "event", "paid_by", "amount", "split_type", "date")
list_filter = ("split_type", "date")
search_fields = ("description", "notes", "event__name")
@admin.register(SplitExpenseShare)
class SplitExpenseShareAdmin(admin.ModelAdmin):
list_display = ("expense", "participant", "amount", "percentage", "shares")
@admin.register(SplitPayment)
class SplitPaymentAdmin(admin.ModelAdmin):
list_display = ("event", "from_participant", "to_participant", "amount", "date")
list_filter = ("date",)
@admin.register(SplitAttachment)
class SplitAttachmentAdmin(admin.ModelAdmin):
list_display = ("original_name", "event", "expense", "payment", "size", "created_at")
@admin.register(SplitTransactionLink)
class SplitTransactionLinkAdmin(admin.ModelAdmin):
list_display = ("event", "user", "kind", "transaction", "created_at")
list_filter = ("kind",)