# -*- coding: utf-8 -*-

from django.contrib import admin
from django_admin import ReadOnlyModelAdmin

from integral.models import SaleclerkIntegralIncomeExpensesInfo, SaleclerkSubmitLogInfo


class SaleclerkIntegralIncomeExpensesInfoAdmin(ReadOnlyModelAdmin, admin.ModelAdmin):
    list_display = ('franchiser_id', 'clerk_id', 'type', 'code', 'integral', 'left_integral', 'remark', 'test_user', 'status', 'created_at', 'updated_at')
    list_filter = ('franchiser_id', 'test_user', 'type', 'status')
    readonly_fields = ('franchiser_id', 'clerk_id', 'type', 'code', 'integral', 'left_integral')
    search_fields = ('code', 'remark')


class SaleclerkSubmitLogInfoAdmin(ReadOnlyModelAdmin, admin.ModelAdmin):
    list_display = ('franchiser_id', 'clerk_id', 'code', 'remark', 'dupload', 'test_user', 'status', 'created_at', 'updated_at')
    list_filter = ('franchiser_id', 'dupload', 'test_user', 'status')
    search_fields = ('code', 'remark')


admin.site.register(SaleclerkIntegralIncomeExpensesInfo, SaleclerkIntegralIncomeExpensesInfoAdmin)
admin.site.register(SaleclerkSubmitLogInfo, SaleclerkSubmitLogInfoAdmin)
