Skip to content

Commit

Permalink
cpda and ltc forms implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshay-Pahuja authored Mar 8, 2024
1 parent 1ee96a8 commit 2d97d9e
Show file tree
Hide file tree
Showing 16 changed files with 3,822 additions and 2 deletions.
48 changes: 47 additions & 1 deletion FusionIIIT/applications/hr2/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django import forms
from .models import Employee, EmpConfidentialDetails, ForeignService
from .models import Employee, EmpConfidentialDetails, ForeignService , CPDAform,LTCform
from applications.globals.models import ExtraInfo
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
Expand Down Expand Up @@ -76,3 +76,49 @@ class Meta:

def __init__(self, *args, **kwargs):
super(AddExtraInfo, self).__init__(*args, **kwargs)


class CPDAForm(forms.ModelForm):
class Meta:
model = CPDAform
fields = ['name', 'designation', 'pf_no', 'purpose', 'amount_required',
'adjusted_pda', 'achievements_uploaded_date', 'submission_date',
'recomm_hod_confirm', 'date_rspc_confirm', 'balance_available',
'advance_amount_pda', 'dealing_asstt_name', 'ar_dr_name',
'check_amount', 'dealing_asstt_ia_name', 'ar_dr_ia_name',
'sanction_status', 'copy_to', 'id', 'employee_id']

# Optionally, you can add widgets here for customizing the form fields' appearance or behavior
widgets = {
'achievements_uploaded_date': DateInput(),
'submission_date': DateInput(),
}

def _init_(self, *args, **kwargs):
super(CPDAForm, self)._init_(*args, **kwargs)



class LTCForm(forms.ModelForm):
class Meta:
model = LTCform
fields = ['name', 'block_year', 'pf_no', 'basic_pay_salary', 'designation',
'department_info', 'leave_availability', 'leave_start_date', 'leave_end_date',
'date_of_leave_for_family', 'nature_of_leave', 'purpose_of_leave', 'hometown_or_not',
'place_of_visit', 'address_during_leave', 'mode_for_vacation',
'details_of_family_members_already_done', 'family_members_about_to_avail',
'details_of_family_members', 'details_of_dependents', 'amount_of_advance_required',
'certified_family_dependents', 'certified_advance', 'adjusted_month', 'date',
'phone_number_for_contact']

# Optionally, you can add widgets here for customizing the form fields' appearance or behavior
widgets = {
'leave_start_date': DateInput(),
'leave_end_date': DateInput(),
'date_of_leave_for_family': DateInput(),
'date': DateInput(),
}


def init(self, *args, **kwargs):
super(LTCForm, self).init(*args, **kwargs)
88 changes: 88 additions & 0 deletions FusionIIIT/applications/hr2/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,91 @@ class WorkAssignemnt(models.Model):
end_date = models.DateField(max_length=6, null=True, blank=True)
job_title = models.CharField(max_length=50, default='')
orders_copy = models.FileField(blank=True, null=True)


class CPDAform(models.Model):
id = models.AutoField(primary_key=True)
employee_id = models.IntegerField(max_length=22,null=True)
name = models.CharField(max_length=40,null=True)
designation = models.CharField(max_length=40,null=True)
pf_no = models.CharField(max_length=30,null=True)
purpose = models.CharField(max_length=40,null=True)
amount_required = models.DecimalField(max_digits=10, decimal_places=2, null=True)
adjusted_pda = models.DecimalField(max_digits=10, decimal_places=2, null=True)
achievements_uploaded_date = models.DateField(blank=True, null=True)
submission_date = models.DateField(blank=True, null=True)
recomm_hod_confirm = models.BooleanField(default=False)
date_rspc_confirm = models.BooleanField(default=False)
balance_available = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
advance_amount_pda = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
dealing_asstt_name = models.CharField(max_length=40, blank=True, null=True)
ar_dr_name = models.CharField(max_length=40, blank=True, null=True)
check_amount = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
dealing_asstt_ia_name = models.CharField(max_length=40, blank=True, null=True)
ar_dr_ia_name = models.CharField(max_length=40, blank=True, null=True)
sanction_status = models.BooleanField(default=False)
copy_to = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)


class LTCform(models.Model):
id = models.AutoField(primary_key=True)
employee_id = models.IntegerField(max_length=22,null=True)
name = models.CharField(max_length=100, null=True)
block_year = models.CharField(max_length=100, null=True)
pf_no = models.IntegerField(max_length=22, null=True)
basic_pay_salary = models.IntegerField(max_length=10, null=True)
designation = models.CharField(max_length=50, null=True)
department_info = models.CharField(max_length=20, null=True)
leave_availability = models.BooleanField(default=False)
leave_start_date = models.DateField(max_length=6, null=True, blank=True)
leave_end_date = models.DateField(max_length=6, null=True, blank=True)
date_of_leave_for_family = models.DateField(max_length=6, null=True, blank=True)
nature_of_leave = models.TextField(null=True)
purpose_of_leave = models.TextField(null=True)
hometown_or_not = models.BooleanField(default=False, null=True)
place_of_visit = models.CharField(max_length=100, null=True, blank=True)
address_during_leave = models.TextField(null=True)
mode_for_vacation = models.BooleanField(null=True)
details_of_family_members_already_done = models.TextField(null=True)
family_members_about_to_avail = models.CharField(max_length=100, null=True)
details_of_family_members = models.TextField(null=True)
details_of_dependents = models.TextField(null=True)
amount_of_advance_required = models.IntegerField(null=True, blank=True)
certified_family_dependents = models.TextField(null=True)
certified_advance = models.TextField(null=True)
adjusted_month = models.TextField(null=True)
date = models.DateField(max_length=6, null=True)
phone_number_for_contact = models.IntegerField(max_length=100, null=True)



# class LTCform(models.Model):
# id = models.AutoField(primary_key=True)
# employee_id = models.IntegerField(max_length=22,null=True)
# name = models.CharField(max_length=40, null=True)
# block_year = models.IntegerField(null=True)
# pf_no = models.IntegerField(null=True)
# basic_pay_salary = models.DecimalField(max_digits=10, decimal_places=2, null=True)
# designation = models.CharField(max_length=40, null=True)
# department_info = models.CharField(max_length=40, null=True)
# leave_availability = models.BooleanField(null=True)
# leave_start_date = models.DateField(null=True)
# leave_end_date = models.DateField(null=True)
# date_of_leave_for_family = models.DateField(null=True)
# nature_of_leave = models.CharField(max_length=40, null=True)
# purpose_of_leave = models.CharField(max_length=40, null=True)
# hometown_or_not = models.BooleanField(null=True)
# place_of_visit = models.CharField(max_length=40, null=True)
# address_during_leave = models.CharField(max_length=80, null=True)
# mode_for_vacation = models.BooleanField(null=True)
# family_members_about_to_avail = models.CharField(max_length=40, null=True)
# details_of_dependents = models.CharField(max_length=40, null=True)
# amount_of_advance_required = models.DecimalField(max_digits=10, decimal_places=2, null=True)
# certified_family_dependents = models.CharField(max_length=40, null=True)
# certified_advance = models.CharField(max_length=40, null=True)
# adjusted_month = models.CharField(max_length=40, null=True)
# date = models.DateField(null=True)
# phone_number_for_contact = models.CharField(max_length=40, null=True)
# serialNumber = models.IntegerField(null=True) # Field for serial number
# fullName = models.CharField(max_length=40, null=True) # Field for full name
# age = models.IntegerField(null=True) # Field for age
36 changes: 36 additions & 0 deletions FusionIIIT/applications/hr2/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,41 @@
url(r'^administrativeProfile/$', views.administrative_profile,
name='administrativeProfile'),
url(r'^addnew/$', views.add_new_user, name='addnew'),
url(r'dashboard/', views.dashboard, name='dashboard'),
url(r'^cpda_form/(?P<id>\d+)/$', views.cpda_form,
name='cpdaForm'),
url(r'^view_cpda_form/(?P<id>\d+)/$', views.view_cpda_form,
name='view_cpda_form'),


url(r'^form_mangement_cpda/',views.form_mangement_cpda, name='form_mangement_cpda'),
url(r'^form_mangement_cpda_hr/(?P<id>\d+)/$',views.form_mangement_cpda_hr, name='form_mangement_cpda_hr'),
url(r'^form_mangement_cpda_get_hod/',views.form_mangement_cpda_get_hod, name='form_mangement_cpda_get_hod'),


url(r'^form_mangement_cpda_hod/(?P<id>\d+)/$',views.form_mangement_cpda_hod, name='form_mangement_cpda_hod'),
# url(r'^form_mangement_cpda_get_ar/',views.form_mangement_cpda_get_ar, name='form_mangement_cpda_get_ar'),

# url(r'^form_mangement_cpda_director/(?P<id>\d+)/$',views.form_mangement_cpda_director, name='form_mangement_cpda_director'),
url(r'^form_mangement_cpda_get_director/',views.form_mangement_cpda_get_director, name='form_mangement_cpda_get_director'),

url(r'^ltc_form/(?P<id>\d+)/$', views.ltc_form,
name='ltcForm'),

url(r'^view_ltc_form/(?P<id>\d+)/$', views.view_ltc_form,
name='view_ltc_form'),

url(r'^form_mangement_ltc/',views.form_mangement_ltc, name='form_mangement_ltc'),
url(r'^form_mangement_ltc_hr_/(?P<id>\d+)/$',views.form_mangement_ltc_hr, name='form_mangement_ltc_hr'),
url(r'^form_mangement_ltc_get_hod/',views.form_mangement_ltc_get_hod, name='form_mangement_ltc_get_hod'),


url(r'^form_mangement_ltc_hod/(?P<id>\d+)/$',views.form_mangement_ltc_hod, name='form_mangement_ltc_hod'),
# url(r'^form_mangement_ltc_get_ar/',views.form_mangement_ltc_get_ar, name='form_mangement_ltc_get_ar'),
# url(r'^form_mangement_ltc_director/(?P<id>\d+)/$',views.form_mangement_ltc_director, name='form_mangement_ltc_director'),
url(r'^form_mangement_ltc_get_director/',views.form_mangement_ltc_get_director, name='form_mangement_ltc_get_director'),




]
Loading

0 comments on commit 2d97d9e

Please sign in to comment.