From 335ee1f8933d1cc0b5493350aa2e3740177bfcd1 Mon Sep 17 00:00:00 2001 From: Harshul Choudhary <113760758+Harshul-25@users.noreply.github.com> Date: Thu, 11 Apr 2024 00:05:06 +0530 Subject: [PATCH] Sa 2 bug fixes (#1414) * GAD-5: Fix responsiveness (#1125) Co-authored-by: A Anunaya <76819712+Anunaya07@users.noreply.github.com> Co-authored-by: Aksh Bansal <63552235+Aksh-Bansal-dev@users.noreply.github.com> * updated models * Revert "updated models" This reverts commit 83e2e73d895fc7f6a7ba2fa117624bbcb2ede278. * revert to old * some changes in frontend * some updates in frontend files * added the api for mobiles and updated urls and views of web * some updates in backend * Added frontend for new apis Created frontend for registered students and update menu features * updated admin and ui * resolved errors * Menu UI changes * Updated Menu_card * some fixes * migrations fixed * added mess registration request model * minor changes * added model and view for registeration * url fixed * fixed rebate * added new form for registration request * fixed gitignore resolved conflicts * context * Registration UI Changes * registration UI changes * restored migration file * completed registration * made some ui changes * migration fix * done things about payments * changed some views * Added Registration Remark and Dropdown * Changed id in reg * rectified error with rebate response frontend * fixed datetime in reg * worked on manage reg * deregistration request functionality added * rectified the backend issues for generate bills * added registration list * completed dereg * student bill functionality addded * rectified error of previous commit * added view reg records * added filter in view mess students * worked on bills caretaker side * changed development * Updated special food request * GAD -5 Dashboard Changes (#1325) * Updated Special food Functionality * dashboard and usercard updated (#1329) * minor ui fixes * added search * updated manage registration * added view bills and payments of students for mess caretaker * added notification functionality in right rail * Added Sem start and end date form (#26) * added start date to registration form * made some ui changes * added modal for details of a student * made some ui improvements * tested crontab * added excel upload for bill and reg * added add student to mess * fixes * update bill added and dates added (#32) Co-authored-by: Harshul Choudhary <113760758+Harshul-25@users.noreply.github.com> * Some UI changes (#35) Co-authored-by: Harshul Choudhary <113760758+Harshul-25@users.noreply.github.com> * merge fixes * added remove * some ui fixes * fixed cronjobs * semdate fixes * removed migrations * Fixing ui bugs (#1335) * added django crontab to requirements.txt * automation of bills no new msg resolved some merge conflicts * useless commit for pulling no msg * completed automation of mess bill generation and payment history feature for student * resolved a merge error * bug fixes * bug fixes --------- Co-authored-by: Harshvardhan Singh <73544247+Lawful2002@users.noreply.github.com> Co-authored-by: A Anunaya <76819712+Anunaya07@users.noreply.github.com> Co-authored-by: Aksh Bansal <63552235+Aksh-Bansal-dev@users.noreply.github.com> Co-authored-by: akshatnema <20bcs022@iiitdmj.ac.in> Co-authored-by: Harshit0009 Co-authored-by: Harshul Co-authored-by: hemantsinghhere <115834099+hemantsinghhere@users.noreply.github.com> Co-authored-by: Hritik Yadav Co-authored-by: Harshit0009 Co-authored-by: Harshit Tiwari <96289939+Harshit0009@users.noreply.github.com> Co-authored-by: hemantsinghhere Co-authored-by: BlackHAWK2001 <150950834+BlackHAWK2001@users.noreply.github.com> Co-authored-by: Arpit Tak <140220904+Ishu-ji@users.noreply.github.com> Co-authored-by: Hritik Yadav <97102768+HritikYadav7@users.noreply.github.com> Co-authored-by: Harshul Co-authored-by: SukulSarve <143542658+SukulSarve@users.noreply.github.com> --- .../applications/central_mess/handlers.py | 2 +- FusionIIIT/applications/central_mess/views.py | 108 +++++---- .../templates/messModule/de-registration.html | 5 +- .../templates/messModule/menu_card.html | 22 +- FusionIIIT/templates/messModule/mess.html | 12 +- .../templates/messModule/messactivities.html | 20 +- .../messModule/registered_student.html | 18 +- FusionIIIT/templates/messModule/viewmenu.html | 5 +- FusionIIIT/templates/messModule/views.html | 213 +----------------- 9 files changed, 123 insertions(+), 282 deletions(-) diff --git a/FusionIIIT/applications/central_mess/handlers.py b/FusionIIIT/applications/central_mess/handlers.py index 29696dafb..47e840810 100644 --- a/FusionIIIT/applications/central_mess/handlers.py +++ b/FusionIIIT/applications/central_mess/handlers.py @@ -84,7 +84,7 @@ def add_mess_feedback(request, student): data: to record success or any errors """ date_today = datetime.now().date() - mess_optn = Messinfo.objects.get(student_id=student) + mess_optn = Reg_main.objects.get(student_id=student) description = request.POST.get('description') feedback_type = request.POST.get('feedback_type') feedback_object = Feedback(student_id=student, fdate=date_today, diff --git a/FusionIIIT/applications/central_mess/views.py b/FusionIIIT/applications/central_mess/views.py index 97babf691..0914f0051 100644 --- a/FusionIIIT/applications/central_mess/views.py +++ b/FusionIIIT/applications/central_mess/views.py @@ -46,7 +46,7 @@ year_last_g = last_day_prev_month.year previous_month = last_day_prev_month.strftime('%B') - +@login_required def mess(request): """ This view get the access to the central mess dashboard. View all details and apply for any changes. @@ -87,6 +87,9 @@ def mess(request): de_reg_request = Deregistration_Request.objects.filter(student_id=student) + menu_data = Menu.objects.all() + + try: mess_optn = Reg_main.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').get(student_id=student) y = Menu.objects.filter(mess_option=mess_optn.mess_option) @@ -141,6 +144,7 @@ def mess(request): # mess_optn = Messinfo.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').get(student_id=student) # y = Menu.objects.filter(mess_option=mess_optn.mess_option) + # bill = Monthly_bill.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(Q(student_id=student) & Q(month=month_g_l) & Q(year=year_g)) # amount_c = MessBillBase.objects.latest('timestamp') @@ -191,7 +195,9 @@ def mess(request): sprequest = Special_request.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(status='1').order_by('-app_date') sprequest_past = Special_request.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(status='2').order_by('-app_date') menuchangerequest= Menu_change_request.objects.select_related('student_id').filter().order_by('-app_date') - menu_data = Menu.objects.all() + + # menu_data = Menu.objects.all() + for f in feed: if f.feedback_type == 'Maintenance' : count1 += 1 @@ -262,7 +268,9 @@ def mess(request): sprequest = Special_request.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(status='1').order_by('-app_date') sprequest_past = Special_request.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(status='2').order_by('-app_date') menuchangerequest= Menu_change_request.objects.select_related('student_id').filter().order_by('-app_date') - menu_data = Menu.objects.all().order_by() + + # menu_data = Menu.objects.all().order_by() + count5=0 count6=0 count7=0 @@ -324,6 +332,7 @@ def mess(request): return render(request, "messModule/mess.html", context) context = { + 'menu': menu_data, 'reg_menu': y, 'messinfo': mess_optn, 'monthly_bill': monthly_bill, @@ -439,49 +448,54 @@ def mess(request): return render(request, "messModule/mess.html", context) elif extrainfo.user_type == 'faculty': - meeting = Mess_meeting.objects.all() - minutes = Mess_minutes.objects.select_related().all() - feed1 = Feedback.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(mess='mess1').order_by('-fdate') - feed2 = Feedback.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(mess='mess2').order_by('-fdate') - y = Menu.objects.all() + for d in desig: + if(d.designation.name == 'mess_warden'): + + feed1 = Feedback.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(mess='mess1').order_by('-fdate') + feed2 = Feedback.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(mess='mess2').order_by('-fdate') + y = Menu.objects.all() - for f in feed1: - if f.feedback_type == 'Maintenance' : - count1 += 1 + reg_main = Reg_main.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(current_mess_status='Registered') + reg_record = Reg_records.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').all() + bills = Monthly_bill.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').all() - elif f.feedback_type == 'Food' : - count2 += 1 + for f in feed1: + if f.feedback_type == 'Maintenance' : + count1 += 1 - elif f.feedback_type == 'Cleanliness' : - count3 += 1 + elif f.feedback_type == 'Food' : + count2 += 1 - elif f.feedback_type == 'Others' : - count4 += 1 + elif f.feedback_type == 'Cleanliness' : + count3 += 1 - for f in feed2: - if f.feedback_type == 'Maintenance': - count5 += 1 + elif f.feedback_type == 'Others' : + count4 += 1 - elif f.feedback_type == 'Food': - count6 += 1 + for f in feed2: + if f.feedback_type == 'Maintenance': + count5 += 1 - elif f.feedback_type == 'Cleanliness': - count7 += 1 + elif f.feedback_type == 'Food': + count6 += 1 + + elif f.feedback_type == 'Cleanliness': + count7 += 1 + + elif f.feedback_type == 'Others': + count8 += 1 + context = { + 'info': extrainfo, + 'desig': desig, + 'menu': y, + 'count1': count1, + 'count2': count2, 'count3': count3, 'feed1': feed1,'feed2':feed2, + 'count4': count4, 'form': form, 'count5': count5, + 'count6': count6, 'count7': count7, 'count8': count8, 'desig': desig, + 'reg_record':reg_record,'reg_main':reg_main,'bill': bills, + } + return render(request, 'messModule/mess.html', context) - elif f.feedback_type == 'Others': - count8 += 1 - context = { - 'info': extrainfo, - 'menu': y, - 'meeting': meeting, - 'minutes': minutes, - 'count1': count1, - 'count2': count2, 'count3': count3, 'feed1': feed1,'feed2':feed2, - 'count4': count4, 'form': form, 'count5': count5, - 'count6': count6, 'count7': count7, 'count8': count8, 'desig': desig - - } - return render(request, 'messModule/mess.html', context) @login_required @transaction.atomic @@ -983,12 +997,18 @@ def post(self, request, *args, **kwargs): extra_info = ExtraInfo.objects.select_related().get(user=user) student = Student.objects.select_related('id','id__user','id__department').get(id=extra_info) # reg_student = Reg_records.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').get(student_id_id=student) - monthly_bill = Monthly_bill.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(student_id=student) - if monthly_bill.exists(): - context = { - 'student_bill': monthly_bill - } - return render_to_pdf('messModule/billpdfexport.html', context) + try: + monthly_bill = Monthly_bill.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(student_id=student) + if monthly_bill.exists(): + context = { + 'student_bill': monthly_bill + } + return render_to_pdf('messModule/billpdfexport.html', context) + else : + return HttpResponseRedirect('/mess') + except: + return HttpResponseRedirect('/mess') + def menu_change_request(request): diff --git a/FusionIIIT/templates/messModule/de-registration.html b/FusionIIIT/templates/messModule/de-registration.html index be18d8bf3..9ef47d5b7 100644 --- a/FusionIIIT/templates/messModule/de-registration.html +++ b/FusionIIIT/templates/messModule/de-registration.html @@ -49,8 +49,9 @@ - dereg_date_input - + + + diff --git a/FusionIIIT/templates/messModule/menu_card.html b/FusionIIIT/templates/messModule/menu_card.html index b95656018..c9a8443c3 100644 --- a/FusionIIIT/templates/messModule/menu_card.html +++ b/FusionIIIT/templates/messModule/menu_card.html @@ -6,9 +6,13 @@ View Menu - + + View Registrations + + + + View Bills + {% comment %} Feedback Statistics @@ -23,12 +27,16 @@ {% if info.user_type == 'student' %} {% if d.designation.name == 'student' %} + + View Menu + - - Menu | Bill + + View Bill and Payments - + @@ -37,7 +45,7 @@ Apply For Non-veg | Check History {% endcomment %} - + diff --git a/FusionIIIT/templates/messModule/mess.html b/FusionIIIT/templates/messModule/mess.html index 2ef337551..da109191e 100644 --- a/FusionIIIT/templates/messModule/mess.html +++ b/FusionIIIT/templates/messModule/mess.html @@ -52,7 +52,7 @@ {% endcomment %}
{% comment %}The ... start here!{% endcomment %} -
+
{% block feedback %} {% include 'messModule/feedback.html' %} {% endblock %} @@ -69,7 +69,7 @@ {% comment %}The ... starts here!{% endcomment %} -
+
{% block views %} {% include 'messModule/views.html' %} {% endblock %} @@ -143,7 +143,7 @@ {% comment %}The ... ends here!{% endcomment %} {% comment %}The ... starts here!{% endcomment %} -
+
{% block viewmenu %} {% include 'messModule/viewmenu.html' %} {% endblock %} @@ -310,8 +310,8 @@

Announcements will be displayed here...

data: { labels: ["Food", "Hygiene", "Maintenance", "Others"], datasets: [{ - label: 'Feedback', - data: [c1,c2,c3,c4], + label: 'Feedback', + data: [c2,c3,c1,c4], backgroundColor: [ 'rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', @@ -348,7 +348,7 @@

Announcements will be displayed here...

labels: ["Food", "Hygiene", "Maintenance", "Others"], datasets: [{ label: 'Feedback', - data: [c5,c6,c7,c8], + data: [c6,c7,c5,c8], backgroundColor: [ 'rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', diff --git a/FusionIIIT/templates/messModule/messactivities.html b/FusionIIIT/templates/messModule/messactivities.html index cc1eda967..4df9cff43 100644 --- a/FusionIIIT/templates/messModule/messactivities.html +++ b/FusionIIIT/templates/messModule/messactivities.html @@ -6,22 +6,27 @@ - + {% for d in desig %} + {% if d.designation.name == 'mess_manager' %} + Bill Base and Excel Upload - - View Students Bills - Update Bill + {% endif %} + {% endfor %} + + View Students Bills +
-
- + +
+ {% block reg_list_bills %} {% include 'messModule/view_payments_bills.html' %} {% endblock %} @@ -75,7 +80,8 @@
-
+ +
diff --git a/FusionIIIT/templates/messModule/registered_student.html b/FusionIIIT/templates/messModule/registered_student.html index a888d0a1e..488f57797 100644 --- a/FusionIIIT/templates/messModule/registered_student.html +++ b/FusionIIIT/templates/messModule/registered_student.html @@ -4,8 +4,12 @@ - Add/Remove from mess - View Registration List + {% for d in desig %} + {% if d.designation.name == 'mess_manager' %} + Add/Remove from mess + {% endif %} + {% endfor %} + View Registration List
-
+ + + + + +
{% block reg_list %} {% include 'messModule/reg_list.html' %} {% endblock %}

-
+ +
{% block add_remove %} {% include 'messModule/add_remove.html' %} {% endblock %} diff --git a/FusionIIIT/templates/messModule/viewmenu.html b/FusionIIIT/templates/messModule/viewmenu.html index 449b71582..0328503ce 100644 --- a/FusionIIIT/templates/messModule/viewmenu.html +++ b/FusionIIIT/templates/messModule/viewmenu.html @@ -11,7 +11,7 @@
-
+
Student IdStudent IdRemarkStatus
@@ -249,7 +249,8 @@ -
+ +
diff --git a/FusionIIIT/templates/messModule/views.html b/FusionIIIT/templates/messModule/views.html index 19a981282..9b2853f82 100644 --- a/FusionIIIT/templates/messModule/views.html +++ b/FusionIIIT/templates/messModule/views.html @@ -5,11 +5,8 @@ {% comment %}The tab menu starts here!{% endcomment %} -
- - - - - - - - - - - - - - - - {% for item in reg_menu %} - {% if item.meal_time == 'MB' %} - - {% endif %} - {% endfor %} - {% comment %}

Total Due Amount : {{total_due}}

{% endcomment %} - - {% for item in reg_menu %} - {% if item.meal_time == 'ML' %} - - {% endif %} - {% endfor %} - - {% for item in reg_menu %} - {% if item.meal_time == 'MD' %} - - {% endif %} - {% endfor %} - - - - - - - - {% for item in reg_menu %} - {% if item.meal_time == 'TB' %} - - {% endif %} - {% endfor %} - - {% for item in reg_menu %} - {% if item.meal_time == 'TL' %} - - {% endif %} - {% endfor %} - - {% for item in reg_menu %} - {% if item.meal_time == 'TD' %} - - {% endif %} - {% endfor %} - - - - - - - - - {% for item in reg_menu %} - {% if item.meal_time == 'WB' %} - - {% endif %} - {% endfor %} - - {% for item in reg_menu %} - {% if item.meal_time == 'WL' %} - - {% endif %} - {% endfor %} - - {% for item in reg_menu %} - {% if item.meal_time == 'WD' %} - - {% endif %} - {% endfor %} - - - - - - - {% for item in reg_menu %} - {% if item.meal_time == 'THB' %} - - {% endif %} - {% endfor %} - - {% for item in reg_menu %} - {% if item.meal_time == 'THL' %} - - {% endif %} - {% endfor %} - - {% for item in reg_menu %} - {% if item.meal_time == 'THD' %} - - {% endif %} - {% endfor %} - - - - - - - - {% for item in reg_menu %} - {% if item.meal_time == 'FB' %} - - {% endif %} - {% endfor %} - - {% for item in reg_menu %} - {% if item.meal_time == 'FL' %} - - {% endif %} - {% endfor %} - - {% for item in reg_menu %} - {% if item.meal_time == 'FD' %} - - {% endif %} - {% endfor %} - - - - - - - {% for item in reg_menu %} - {% if item.meal_time == 'SB' %} - - {% endif %} - {% endfor %} - - {% for item in reg_menu %} - {% if item.meal_time == 'SL' %} - - {% endif %} - {% endfor %} - - {% for item in reg_menu %} - {% if item.meal_time == 'SD' %} - - {% endif %} - {% endfor %} - - - - - - - - {% for item in reg_menu %} - {% if item.meal_time == 'SUB' %} - - {% endif %} - {% endfor %} - - {% for item in reg_menu %} - {% if item.meal_time == 'SUL' %} - - {% endif %} - {% endfor %} - - {% for item in reg_menu %} - {% if item.meal_time == 'SUD' %} - - {% endif %} - {% endfor %} - - - - - - -
Breakfast LunchDinner
Monday{{item.dish}}{{item.dish}}{{item.dish}}
Tuesday{{item.dish}}{{item.dish}}{{item.dish}}
Wednesday{{item.dish}}{{item.dish}}{{item.dish}}
Thursday{{item.dish}}{{item.dish}}{{item.dish}}
Friday{{item.dish}}{{item.dish}}{{item.dish}}
Saturday{{item.dish}}{{item.dish}}{{item.dish}}
Sunday{{item.dish}}{{item.dish}}{{item.dish}}
- -
-
-
- - - {% csrf_token %} - - -
-
- - - + -
+