
    vg                         d Z ddlZddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ dd	lmZ dd
lmZ  G d dej&                        Z G d de      Z G d de      Zy)a{  
Forms for handling payroll-related operations.

This module provides Django ModelForms for creating and managing payroll-related data,
including filing status, tax brackets, and federal tax records.

The forms in this module inherit from the Django `forms.ModelForm` class and customize
the widget attributes to enhance the user interface and provide a better user experience.

    N)date)forms)gettext_lazy)reload_queryset)horilla_middlewares)federal_tax)FilingStatus)
TaxBracketc                   "     e Zd ZdZ fdZ xZS )	ModelFormz1Custom ModelForm with enhanced widget attributes.c                    t        |   |i | t        t        j                  dd       }t        | j                         | j                  j                         D ]d  \  }}|j                  }t        |t        j                        rt        j                         |_        t        |t        j                  t        j                   t        j"                  f      r5t%        |j&                        }|j(                  j+                  d|d       nUt        |t        j,                  f      rd}|j&                  t%        |j&                        }t/        t%        d            j1                  |      |_        | j                  |   j                  j(                  j+                  dt5        j6                         dd	       nt        |t        j8                        rDt%        |j&                  j;                               }|j(                  j+                  d|d
dd       nGt        |t        j<                  t        j>                  f      r|j(                  j+                  ddi       	 |j@                  jB                  | j                  d   _        	 |j@                  jB                  jD                  | j                  d   _        g y #  Y ;xY w#  Y uxY w)Nrequestzoh-input w-100)classplaceholder z---Choose {label}---)labelzoh-select oh-select-2 w-100zheight:50px;border-radius:0;)r   idstyle   (   )r   r   rowscolsr   zoh-switch__checkboxemployee_id
company_id)#super__init__getattrr   _thread_localsr   fieldsitemswidget
isinstancer   	DateInputr   todayinitialNumberInput
EmailInput	TextInput_r   attrsupdateSelectstrformatempty_labeluuiduuid4TextareatitleCheckboxInputCheckboxSelectMultipleuseremployee_getget_company)	selfargskwargsr   
field_namefieldinput_widgetr   	__class__s	           +/var/www/horilla/payroll/forms/tax_forms.pyr   zModelForm.__init__   s;   $)&)-<<iN$!%!2!2!4 6	J <<L,: $

u00%2B2BEOOT %++"")).uE L5<</:;;*ekkNE$'*@(A$B$I$IPU$I$V!J'..44;;!>"jjl!? L5>>;%++++-.""))!1', ! "	 ''00 ""))74I*JK5<\\5N5NM*2LL--99 L)1e6	\s   %(K2KKK)__name__
__module____qualname____doc__r   __classcell__r?   s   @r@   r   r      s    ;: :    r   c                   6     e Zd ZdZ G d d      Z fdZ xZS )FilingStatusFormz-Form for creating and updating filing status.c                       e Zd ZdZeZdZdgZy)FilingStatusForm.MetaMeta options for the form.__all__	is_activeN)rA   rB   rC   rD   r	   modelr   exclude rG   r@   MetarK   \   s    (-rG   rR   c                    t        |   |i | | j                  d   j                  j                  }d|d<   | j
                  j                   t        j                  | j
                  _	        y | j                  d= | j                  d= y )Nuse_pya<  
        if($(this).is(':checked')){
            $('#oc-editor').show();
            //$("#objectCreateModal #objectCreateModalTarget").css("max-width","90%")
        }else{
            //$("#objectCreateModal #objectCreateModalTarget").css("max-width","650px")
            $('#oc-editor').hide();
        }
        onchangepython_code)
r   r   r   r!   r*   instancepkr   CODErV   )r9   r:   r;   r*   r?   s       r@   r   zFilingStatusForm.__init__c   s}    $)&)kk(+2288 		
 ==#(3(8(8DMM%H%M*rG   )rA   rB   rC   rD   rR   r   rE   rF   s   @r@   rI   rI   Y   s    7   + +rG   rI   c                   $    e Zd ZdZ G d d      Zy)TaxBracketFormz+Form for creating and updating tax bracket.c                   D    e Zd ZdZeZdZdgZd ej                         iZ
y)TaxBracketForm.MetarL   rM   rN   filing_status_idN)rA   rB   rC   rD   r
   rO   r   rP   r   HiddenInputwidgetsrQ   rG   r@   rR   r]   |   s.    (- 1 1 1 3
rG   rR   N)rA   rB   rC   rD   rR   rQ   rG   r@   r[   r[   y   s    5
 
rG   r[   )rD   r0   datetimer   djangor   django.utils.translationr   r)   base.methodsr   horillar   payroll.methodsr   payroll.models.modelsr	   payroll.models.tax_modelsr
   r   rI   r[   rQ   rG   r@   <module>ri      sQ   	    6 ( ' ' . 0= =@+y +@
Y 
rG   