Add sales types, party adjustments, FunZone party fields, and treasury fee support

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Shayan Azadi
2026-07-03 03:15:52 +03:30
parent 5dd29c41d6
commit 5fb79fb7f0
8 changed files with 366 additions and 3 deletions

View File

@@ -10,8 +10,10 @@ from .models import (
Employee,
Invoice,
Party,
PartyAdjustment,
Payslip,
Product,
SalesType,
TreasuryTxn,
Voucher,
)
@@ -22,9 +24,11 @@ from .serializers import (
CompanySettingsSerializer,
EmployeeSerializer,
InvoiceSerializer,
PartyAdjustmentSerializer,
PartySerializer,
PayslipSerializer,
ProductSerializer,
SalesTypeSerializer,
TreasuryTxnSerializer,
VoucherSerializer,
)
@@ -66,6 +70,18 @@ class InvoiceViewSet(_AdminModelViewSet):
pagination_class = None
class SalesTypeViewSet(_AdminModelViewSet):
queryset = SalesType.objects.all()
serializer_class = SalesTypeSerializer
pagination_class = None
class PartyAdjustmentViewSet(_AdminModelViewSet):
queryset = PartyAdjustment.objects.all()
serializer_class = PartyAdjustmentSerializer
pagination_class = None
class TreasuryTxnViewSet(_AdminModelViewSet):
queryset = TreasuryTxn.objects.all()
serializer_class = TreasuryTxnSerializer
@@ -117,6 +133,8 @@ def reset_accounting_data(request):
"""Wipes all accounting data and recreates a clean, zeroed starting point."""
Voucher.objects.all().delete()
Invoice.objects.all().delete()
PartyAdjustment.objects.all().delete()
SalesType.objects.all().delete()
TreasuryTxn.objects.all().delete()
Payslip.objects.all().delete()
Employee.objects.all().delete()