78 lines
2.4 KiB
Python
78 lines
2.4 KiB
Python
"""
|
|
Billing Business Logic Admin
|
|
|
|
NOTE: Most billing models are registered in modules/billing/admin.py
|
|
with full workflow functionality. This file contains legacy/minimal registrations.
|
|
"""
|
|
from django.contrib import admin
|
|
from django.utils.html import format_html
|
|
from igny8_core.admin.base import AccountAdminMixin
|
|
from .models import (
|
|
CreditCostConfig,
|
|
AccountPaymentMethod,
|
|
Invoice,
|
|
Payment,
|
|
CreditPackage,
|
|
PaymentMethodConfig,
|
|
)
|
|
|
|
|
|
# CreditCostConfig - DUPLICATE - Registered in modules/billing/admin.py with better features
|
|
# Commenting out to avoid conflicts
|
|
# @admin.register(CreditCostConfig)
|
|
# class CreditCostConfigAdmin(admin.ModelAdmin):
|
|
# ...existing implementation...
|
|
|
|
|
|
# Invoice - DUPLICATE - Registered in modules/billing/admin.py
|
|
# Commenting out to avoid conflicts
|
|
# @admin.register(Invoice)
|
|
# class InvoiceAdmin(AccountAdminMixin, admin.ModelAdmin):
|
|
# ...existing implementation...
|
|
|
|
|
|
# Payment - DUPLICATE - Registered in modules/billing/admin.py with full approval workflow
|
|
# Commenting out to avoid conflicts
|
|
# @admin.register(Payment)
|
|
# class PaymentAdmin(AccountAdminMixin, admin.ModelAdmin):
|
|
# ...existing implementation...
|
|
|
|
|
|
# CreditPackage - DUPLICATE - Registered in modules/billing/admin.py
|
|
# Commenting out to avoid conflicts
|
|
# @admin.register(CreditPackage)
|
|
# class CreditPackageAdmin(admin.ModelAdmin):
|
|
# ...existing implementation...
|
|
|
|
|
|
# PaymentMethodConfig and AccountPaymentMethod are kept here as they're not duplicated
|
|
# or have minimal implementations that don't conflict
|
|
|
|
@admin.register(AccountPaymentMethod)
|
|
class AccountPaymentMethodAdmin(admin.ModelAdmin):
|
|
list_display = [
|
|
'display_name',
|
|
'type',
|
|
'account',
|
|
'is_default',
|
|
'is_enabled',
|
|
'country_code',
|
|
'is_verified',
|
|
'updated_at',
|
|
]
|
|
list_filter = ['type', 'is_default', 'is_enabled', 'is_verified', 'country_code']
|
|
search_fields = ['display_name', 'account__name', 'account__id']
|
|
readonly_fields = ['created_at', 'updated_at']
|
|
fieldsets = (
|
|
('Payment Method', {
|
|
'fields': ('account', 'type', 'display_name', 'is_default', 'is_enabled', 'is_verified', 'country_code')
|
|
}),
|
|
('Instructions / Metadata', {
|
|
'fields': ('instructions', 'metadata')
|
|
}),
|
|
('Timestamps', {
|
|
'fields': ('created_at', 'updated_at'),
|
|
'classes': ('collapse',)
|
|
}),
|
|
)
|