o
    IÝ,h.
  ã                   @   sð   d dl mZ d dlmZ d dlmZ ddlmZm	Z	m
Z
mZmZ G dd„ dejƒZG dd	„ d	eƒZej e¡ ej ee¡ e e¡G d
d„ dejƒƒZe e	¡G dd„ dejƒƒZe e¡G dd„ dejƒƒZe e¡G dd„ dejƒƒZdS )é    )Úadmin)Ú	UserAdmin)ÚUseré   )ÚCompanyÚ
CostCenterÚEmployeeProfileÚVacationRequestÚVacationLogc                   @   s   e Zd ZeZdZdZdS )ÚEmployeeProfileInlineFzPerfil de ColaboradorN)Ú__name__Ú
__module__Ú__qualname__r   ÚmodelÚ
can_deleteÚverbose_name_plural© r   r   ú#/var/www/html/rh/vacations/admin.pyr      s    r   c                   @   s2   e Zd ZefZdZdd„ Zdd„ Zde_de_dS )	r   )ÚusernameÚemailÚ
first_nameÚ	last_nameÚget_roleÚget_companyÚ	is_activec                 C   s   t |dƒr
|j ¡ S dS ©NÚprofileú-)Úhasattrr   Úget_role_display©ÚselfÚobjr   r   r   r      ó   

zUserAdmin.get_rolec                 C   s   t |dƒr
|jjjS dS r   )r   r   ÚcompanyÚnamer    r   r   r   r      r#   zUserAdmin.get_companyÚPapelÚEmpresaN)	r   r   r   r   ÚinlinesÚlist_displayr   r   Úshort_descriptionr   r   r   r   r      s    
r   c                   @   ó   e Zd ZdZdZdZdS )ÚCompanyAdmin)r%   Úcnpjr   )r%   r-   )r   N©r   r   r   r)   Úsearch_fieldsÚlist_filterr   r   r   r   r,   (   ó    r,   c                   @   r+   )ÚCostCenterAdmin)Úcoder%   r$   r   )r3   r%   )r$   r   Nr.   r   r   r   r   r2   .   r1   r2   c                   @   s$   e Zd ZdZdZdZdZdZdZdS )ÚVacationRequestAdmin)ÚemployeeÚ
start_dateÚend_dateÚ
total_daysÚselling_daysÚstatusÚ	is_manualÚ
created_at)r:   r;   r6   Úemployee__company)Úemployee__user__first_nameÚemployee__user__last_nameÚemployee__employee_idr6   ©r<   Ú
updated_at)r5   r6   r7   r9   r:   r;   Úapproved_byÚapproval_dateÚrejection_reasonr<   rB   N)	r   r   r   r)   r0   r/   Údate_hierarchyÚreadonly_fieldsÚfieldsr   r   r   r   r4   4   s    r4   c                   @   s   e Zd ZdZdZdZdZdS )ÚVacationLogAdmin)ÚactionÚvacation_requestÚperformed_byr<   )rJ   r<   )Ú,vacation_request__employee__user__first_nameÚperformed_by__usernamerA   N)r   r   r   r)   r0   r/   rG   r   r   r   r   rI   J   s
    rI   N)Údjango.contribr   Údjango.contrib.auth.adminr   ÚBaseUserAdminÚdjango.contrib.auth.modelsr   Úmodelsr   r   r   r	   r
   ÚStackedInliner   ÚsiteÚ
unregisterÚregisterÚ
ModelAdminr,   r2   r4   rI   r   r   r   r   Ú<module>   s     	