ComptaInde/billing/admin.py

43 lines
1.1 KiB
Python
Raw Normal View History

2020-02-18 08:14:07 +01:00
from django.contrib import admin
from .models import (
Client,
Contract,
2024-06-16 11:07:59 +02:00
DiscountContract,
2020-02-18 08:14:07 +01:00
Prestation,
2024-06-16 11:07:59 +02:00
PrestationType,
2020-02-18 08:14:07 +01:00
)
2024-06-16 11:07:59 +02:00
@admin.register(Client)
2020-02-18 08:14:07 +01:00
class ClientAdmin(admin.ModelAdmin):
model = Client
list_display = ('name', 'address', 'postal_code', 'city', 'contact')
search_fields = ('name', 'adress', 'city')
2024-06-16 11:07:59 +02:00
@admin.register(Contract)
2020-02-18 08:14:07 +01:00
class ContractAdmin(admin.ModelAdmin):
model = Contract
list_display = ('name', 'client', 'advance', 'reference', 'date')
search_fields = ('name', )
2024-06-16 11:07:59 +02:00
list_filter = ('is_finished', ) # 'date__year',
2020-02-18 08:14:07 +01:00
2024-06-16 11:07:59 +02:00
@admin.register(Prestation)
2020-02-18 08:14:07 +01:00
class PrestationAdmin(admin.ModelAdmin):
model = Prestation
2024-06-16 11:07:59 +02:00
list_display = ('date', 'label', 'total_amount_htva', 'total_amount_tvac', 'contract')
2020-02-18 08:14:07 +01:00
search_fields = ('label', )
2024-06-16 11:07:59 +02:00
@admin.register(PrestationType)
class PrestationTypeAdmin(admin.ModelAdmin):
model = PrestationType
list_display = ('label',)
search_fields = ('label',)
@admin.register(DiscountContract)
class DiscountContractAdmin(admin.ModelAdmin):
model = DiscountContract
list_display = ('contract', 'label', 'quantity', 'unit')