B
    b7$                 @   s   d dl mZ d dlmZ d dlmZmZ G dd dejZ	G dd dejZ
G dd	 d	ejZG d
d dejZG dd dejZG dd dejZdS )    )serializers)gettext_lazy)MonthlySalarySalaryStructurec               @   s   e Zd ZG dd dZdS )#MonthlySalaryDetailReportSerializerc            A   @   s   e Zd ZeZddddddddd	d
dddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAgAZG dBdC dCZdDS )Ez(MonthlySalaryDetailReportSerializer.Metaidemp_code
first_name	last_name
department	calc_timebasic_salaryeffective_dateot1_formula_nameot1_formulaot1ot2_formula_nameot2_formulaot2ot3_formula_nameot3_formulaot3normal_ot_formula_namenormal_ot_formula	normal_otweekend_ot_formula_nameweekend_ot_formula
weekend_otholiday_ot_formula_nameholiday_ot_formula
holiday_otlate_time_formula_namelate_time_formula	late_timeearly_leave_formula_nameearly_leave_formulaearly_leaveabsent_time_formula_nameabsent_time_formulaabsent_timeincrease_formula_nameincrease_formulaincreaseloan_increaseadvance_increasededuction_formula_namededuction_formula	deductionleave_formula_nameleave_formulaleaveextra_increaseextra_deductionloan_deductionreimbursementadvance_deductiontotal_loan_amountrefund_loan_amountunrefund_loan_amounttotal_increase_formula_nametotal_increase_formulatotal_increase_expressiontotal_increasetotal_deduction_formula_nametotal_deduction_formulatotal_deduction_expressiontotal_deductionZtotal_salary_expressiontotal_salaryformat_dictc               @   s   e Zd ZeZdS )z-MonthlySalaryDetailReportSerializer.Meta.MetaN)__name__
__module____qualname__r   model rK   rK   YG:\easytimepro\master/mysite/payroll\api\serializers\monthly_salary_report_serializers.pyMeta&   s   rM   N)rG   rH   rI   r   rJ   fieldsrM   rK   rK   rK   rL   rM      s2   

rM   N)rG   rH   rI   rM   rK   rK   rK   rL   r   	   s   r   c               @   s   e Zd ZG dd dZdS )IncreaseReportSerializerc            &   @   sn   e Zd ZeZddddddddd	d
dddddddddddddddddddddd d!d"d#d$d%d&g&ZG d'd( d(Zd)S )*zIncreaseReportSerializer.Metar   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r*   r+   r,   r5   r-   r.   r8   r=   r>   r?   r@   rF   c               @   s   e Zd ZeZdS )z"IncreaseReportSerializer.Meta.MetaN)rG   rH   rI   r   rJ   rK   rK   rK   rL   rM   <   s   rM   N)rG   rH   rI   r   rJ   rN   rM   rK   rK   rK   rL   rM   ,   s   

rM   N)rG   rH   rI   rM   rK   rK   rK   rL   rO   *   s   rO   c               @   s   e Zd ZG dd dZdS )DeductionReportSerializerc               @   s^   e Zd ZeZddddddddd	d
ddddddddddddddddddddgZG dd  d Zd!S )"zDeductionReportSerializer.Metar   r   r	   r
   r   r   r   r!   r"   r#   r$   r%   r&   r'   r(   r)   r/   r0   r1   r2   r3   r4   r6   r7   r9   rA   rB   rC   rD   rF   c               @   s   e Zd ZeZdS )z#DeductionReportSerializer.Meta.MetaN)rG   rH   rI   r   rJ   rK   rK   rK   rL   rM   O   s   rM   N)rG   rH   rI   r   rJ   rN   rM   rK   rK   rK   rL   rM   B   s   

rM   N)rG   rH   rI   rM   rK   rK   rK   rL   rP   @   s   rP   c               @   s   e Zd ZG dd dZdS )CalcParamReportSerializerc               @   s:   e Zd ZeZddddddddd	d
ddgZG dd dZdS )zCalcParamReportSerializer.Metar   r   r	   r
   r   r   r   rF   r=   r?   rA   rC   c               @   s   e Zd ZeZdS )z#CalcParamReportSerializer.Meta.MetaN)rG   rH   rI   r   rJ   rK   rK   rK   rL   rM   \   s   rM   N)rG   rH   rI   r   rJ   rN   rM   rK   rK   rK   rL   rM   U   s   
rM   N)rG   rH   rI   rM   rK   rK   rK   rL   rQ   S   s   rQ   c               @   s
  e Zd ZejddZejddZejddZejddZejddZ	ejddZ
ejddZejd	dZejd
dZejddZejddZejddZdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zd d! Zd"d# Zd$d% ZG d&d' d'Zd(S ))SalaryStructureReportSerializerZOT1)labelZOT2ZOT3z	Normal OTz
Weekend OTz
Holiday OTzLate InzEarly LeaveZAbsenceZIncreaseZ	DeductionZLeavec             C   s   d dd |j D S )N+c             S   s    g | ]}|j d krd|j qS )   z(%s))overtime_levelformula).0irK   rK   rL   
<listcomp>o   s    z;SalaryStructureReportSerializer.get_ot1.<locals>.<listcomp>)joinovertimeformulaall)selfobjrK   rK   rL   get_ot1n   s    
z'SalaryStructureReportSerializer.get_ot1c             C   s   d dd |j D S )NrT   c             S   s    g | ]}|j d krd|j qS )   z(%s))rV   rW   )rX   rY   rK   rK   rL   rZ   s   s    z;SalaryStructureReportSerializer.get_ot2.<locals>.<listcomp>)r[   r\   r]   )r^   r_   rK   rK   rL   get_ot2r   s    
z'SalaryStructureReportSerializer.get_ot2c             C   s   d dd |j D S )NrT   c             S   s    g | ]}|j d krd|j qS )   z(%s))rV   rW   )rX   rY   rK   rK   rL   rZ   w   s    z;SalaryStructureReportSerializer.get_ot3.<locals>.<listcomp>)r[   r\   r]   )r^   r_   rK   rK   rL   get_ot3v   s    
z'SalaryStructureReportSerializer.get_ot3c             C   s   d dd |j D S )NrT   c             S   s    g | ]}|j d krd|j qS )   z(%s))rV   rW   )rX   rY   rK   rK   rL   rZ   {   s    zASalaryStructureReportSerializer.get_normal_ot.<locals>.<listcomp>)r[   r\   r]   )r^   r_   rK   rK   rL   get_normal_otz   s    
z-SalaryStructureReportSerializer.get_normal_otc             C   s   d dd |j D S )NrT   c             S   s    g | ]}|j d krd|j qS )   z(%s))rV   rW   )rX   rY   rK   rK   rL   rZ      s    zBSalaryStructureReportSerializer.get_weekend_ot.<locals>.<listcomp>)r[   r\   r]   )r^   r_   rK   rK   rL   get_weekend_ot~   s    
z.SalaryStructureReportSerializer.get_weekend_otc             C   s   d dd |j D S )NrT   c             S   s    g | ]}|j d krd|j qS )   z(%s))rV   rW   )rX   rY   rK   rK   rL   rZ      s    zBSalaryStructureReportSerializer.get_holiday_ot.<locals>.<listcomp>)r[   r\   r]   )r^   r_   rK   rK   rL   get_holiday_ot   s    
z.SalaryStructureReportSerializer.get_holiday_otc             C   s   d dd |j D S )NrT   c             S   s    g | ]}|j d krd|j qS )rU   z(%s))exception_typerW   )rX   rY   rK   rK   rL   rZ      s    zASalaryStructureReportSerializer.get_late_time.<locals>.<listcomp>)r[   exceptionformular]   )r^   r_   rK   rK   rL   get_late_time   s    
z-SalaryStructureReportSerializer.get_late_timec             C   s   d dd |j D S )NrT   c             S   s    g | ]}|j d krd|j qS )ra   z(%s))rk   rW   )rX   rY   rK   rK   rL   rZ      s    zCSalaryStructureReportSerializer.get_early_leave.<locals>.<listcomp>)r[   rl   r]   )r^   r_   rK   rK   rL   get_early_leave   s    
z/SalaryStructureReportSerializer.get_early_leavec             C   s   d dd |j D S )NrT   c             S   s    g | ]}|j d krd|j qS )rc   z(%s))rk   rW   )rX   rY   rK   rK   rL   rZ      s    zCSalaryStructureReportSerializer.get_absent_time.<locals>.<listcomp>)r[   rl   r]   )r^   r_   rK   rK   rL   get_absent_time   s    
z/SalaryStructureReportSerializer.get_absent_timec             C   s   d dd |j D S )NrT   c             S   s   g | ]}d |j  qS )z(%s))rW   )rX   rY   rK   rK   rL   rZ      s    z@SalaryStructureReportSerializer.get_increase.<locals>.<listcomp>)r[   Zincreasementformular]   )r^   r_   rK   rK   rL   get_increase   s    
z,SalaryStructureReportSerializer.get_increasec             C   s   d dd |j D S )NrT   c             S   s   g | ]}d |j  qS )z(%s))rW   )rX   rY   rK   rK   rL   rZ      s    zASalaryStructureReportSerializer.get_deduction.<locals>.<listcomp>)r[   Zdeductionformular]   )r^   r_   rK   rK   rL   get_deduction   s    
z-SalaryStructureReportSerializer.get_deductionc             C   sN   i }xD|j  D ]6}|jj|kr2|jg||jj< q||jj |j qW |S )N)Zleaveformular]   categoryZcategory_namerW   append)r^   r_   Z
leave_dictr4   rK   rK   rL   	get_leave   s    z)SalaryStructureReportSerializer.get_leavec               @   sH   e Zd ZeZddddddddd	d
dddddddddgZG dd dZdS )z$SalaryStructureReportSerializer.Metar   r   r	   r
   r   Zsalary_amountr   r   r   r   r   r   r    r#   r&   r)   r,   r1   r4   c               @   s   e Zd ZeZdS )z)SalaryStructureReportSerializer.Meta.MetaN)rG   rH   rI   r   rJ   rK   rK   rK   rL   rM      s   rM   N)rG   rH   rI   r   rJ   rN   rM   rK   rK   rK   rL   rM      s   

rM   N)rG   rH   rI   r   ZSerializerMethodFieldr   r   r   r   r   r    r#   r&   r)   r,   r1   r4   r`   rb   rd   rf   rh   rj   rm   rn   ro   rp   rq   rt   rM   rK   rK   rK   rL   rR   `   s2   	rR   c               @   sV   e Zd ZejeddddZejeddddZejeddddZ	G d	d
 d
Z
dS )'DepartmentSummarySalaryReportSerializerZreport_column_departmentCodeZemployee__department__dept_codeT)rS   sourceZ
allow_nullZreport_column_departmentNameZemployee__department__dept_nameZreport_column_employeeCountZ	emp_countc               @   sX   e Zd ZeZddddddddd	d
dddddddddddddddddgZG dd dZdS )z,DepartmentSummarySalaryReportSerializer.Meta	dept_code	dept_name	total_empr   r@   rD   r   r   r   r   r   r    r#   r&   r)   r,   r5   r-   r.   r8   r6   r9   r7   r:   r;   r<   rE   c               @   s   e Zd ZeZdS )z1DepartmentSummarySalaryReportSerializer.Meta.MetaN)rG   rH   rI   r   rJ   rK   rK   rK   rL   rM      s   rM   N)rG   rH   rI   r   rJ   rN   rM   rK   rK   rK   rL   rM      s   rM   N)rG   rH   rI   r   Z	CharField_rw   rx   ZIntegerFieldry   rM   rK   rK   rK   rL   ru      s   ru   N)Zrest_frameworkr   Zdjango.utils.translationr   rz   Zmysite.payroll.modelsr   r   ZModelSerializerr   rO   rP   rQ   rR   ru   rK   rK   rK   rL   <module>   s   !O