
    vg                         d Z ddlmZ d Zy)zK
deductions.py

This module is used to compute the deductions of employees
    )	Deductionc           	         t         j                  j                  ||       j                  |      j                  |      }g }|}|D ]  }|j                  r|j                  nd}	|j
                  }
|
r||
z  dz  }	|t        |	      z
  }d}t        d|j                        r|	|j                  z  dz  }|j                  |j                  |j                  |	|j                  |d        ||z
  }|||dS )z
    This method is used to update the basic or gross pay

    Args:
        compensation_amount (_type_): Gross pay or Basic pay or employee
    )update_compensationspecific_employees)one_time_date__lt)one_time_date__gtr   d   )deduction_idtitleamountemployer_contribution_rateemployer_contribution_amount)compensation_amount
deductionsdifference_amount)r   objectsfilterexcluder   ratefloatmaxemployer_rateappendidr   )employeer   compensation_type
start_dateend_datededuction_headsr   temp	deductionr   employee_rater   r   s                ./var/www/horilla/payroll/methods/deductions.pyupdate_compensation_deductionr$   
   s    	   1h 	! 	
 
:	.	8	,  JD$ 
	%.%5%5!!1!(=83>F1E&MA'($q)))*,2Y5L5L,LPS+S( )" .7.E.E0L	

& 222 .     N)__doc__payroll.models.modelsr   r$    r%   r#   <module>r)      s    ,+r%   