from django.contrib import admin
from .models import Account, JournalEntry, Ledger, Invoice, InvoiceItem, Bill, BillItem

class InvoiceItemInline(admin.TabularInline):
    model = InvoiceItem
    extra = 1

class InvoiceAdmin(admin.ModelAdmin):
    inlines = [InvoiceItemInline]

class BillItemInline(admin.TabularInline):
    model = BillItem
    extra = 1

class BillAdmin(admin.ModelAdmin):
    inlines = [BillItemInline]

admin.site.register(Account)
admin.site.register(JournalEntry)
admin.site.register(Ledger)
admin.site.register(Invoice, InvoiceAdmin)
admin.site.register(Bill, BillAdmin)