Skip to content

Commit f8e999c

Browse files
ShashankShekhar07Anitesh2004Ritik8527Himanshu8850Pheonix7113
authored
GAD-6 : Purchase V2 (#1777)
* changed urls and views according to new frontend * changed indentview api to work with new frontend * [feat]: added controllers for viewing and deleting indents * forward indent apis completed * Added Archieved indent controller (#8) * added archieve viewing functionality * added archieve-view * correct-sign-token * sign-token * added archiveview and archive_file functionality * added approval functionality in indent,bill approval * Dynamic user access for outbox indents and archieve view. (#9) * added dynamic user outboxview functionality * added dynamic user functionality for archieveview * Added Stock Entry Functionality * dynamic username access for stockentry,archieve indent and outbox * Integrated notifications (#10) * updated backend * Gad 6 (#12) * Fix multiple indent forward problem; update PS1 application - Resolved issue with forwarding multiple indents simultaneously - Added new fields to IndentFile model: indent_name, description - Updated createProposal and forwardIndent views to handle new fields * Fix multiple indent forward problem; update PS1 application - Resolved issue with forwarding multiple indents simultaneously - Added new fields to IndentFile model: indent_name, description - Updated createProposal and forwardIndent views to handle new fields --------- Co-authored-by: Arun7113 <arunhyd2003@gmail.com> * fixed stock entry * Test os 3 (#1700) * Setup Email Notifications and architected new announcement system * Added module to announcement schema and lazy loading to specific_users * Added create announcement and get announcement apis and added redis as dependency * Sorted GET Announcement result order * department info api (#1) Co-authored-by: aarav0012 <aaravjainjn@email.com> * rspc notification api added --------- Co-authored-by: Akash Kumar Sah <akashsah2003@gmail.com> Co-authored-by: aarav0012 <aaravjainjn@email.com> * Dashboard client (#1697) * Get Booking data api added (#1) * bug: fix conditional rendering of booking req * Dashboard client (#3) * Get Booking data api added * active booking api * add: forwardBooking confirmBooking * Dashboard client (#4) * Get Booking data api added * active booking api * Added cancelled, active, completed booking view functionality * cancellation_request done * reject option works * Add items backend functionality (#5) * add: rooms availibility * fix: urls * add: Account statement backend (#6) * "add: account statements" * resolved MC * Updated visitor_hostel URLs and views:added partial booking API (#7) Co-authored-by: Arun7113 <arunhyd2003@gmail.com> * fix: partial booking feature * fix: completed bookings * fix: account statement * fix: correct income display on account statement --------- Co-authored-by: Hardik Vardaan <37293677+AtOM18@users.noreply.github.com> Co-authored-by: ompandey0703 <142932201+ompandey0703@users.noreply.github.com> Co-authored-by: Vishal-Github-21 <116187488+Vishal-Github-21@users.noreply.github.com> Co-authored-by: JATOTHU ARUN <167317035+Pheonix7113@users.noreply.github.com> Co-authored-by: Arun7113 <arunhyd2003@gmail.com> * All changes of Complaint Management (#1704) * eis module version 1 (#1706) * Minor changes for integration with frontend * fix: some minor fixes * minor fixes * add: updated urls.py and file upload * fix: multiple file uploads, and ajax dropdown cbv * add: added multiple drafts upload * fix: uncommented mess migrations * Department module Version 1 (#1709) * [Dashboard] Modified Profile views to fetch relevant data only (#1711) * SA-2 [New-UI] - updated APIs for use with fusion-client (#1717) * chore: added linting * changes in feedbackAPI * feat: added update bill excel (#4) * fix: migrations * Fix: Fixed an api endpoint allowed method (#5) * Added New API for Student Records, Implement Checks in RebateAPI. (#6) * Change in feedbackAPI * New API and filter in RebateApi * Fix merge * fix: api cleanup --------- Co-authored-by: S-tej <132924903+S-tej@users.noreply.github.com> Co-authored-by: Padarthi Karthik <133255355+karthikpadarthi@users.noreply.github.com> Co-authored-by: Green Mansion <90859709+PrinceBujethia@users.noreply.github.com> * SA-2 new UI updates (#1718) * chore: added linting * changes in feedbackAPI * feat: added update bill excel (#4) * fix: migrations * Fix: Fixed an api endpoint allowed method (#5) * Added New API for Student Records, Implement Checks in RebateAPI. (#6) * Change in feedbackAPI * New API and filter in RebateApi * Fix merge * fix: api cleanup * deployment fixes --------- Co-authored-by: S-tej <132924903+S-tej@users.noreply.github.com> Co-authored-by: Padarthi Karthik <133255355+karthikpadarthi@users.noreply.github.com> Co-authored-by: Green Mansion <90859709+PrinceBujethia@users.noreply.github.com> * Old version(gad 2) (#1721) * Added API folder in iwdModuleV2 * Added endpoints in API folder in iwdModuleV2 * Added additional endpoints in API folder in iwdModuleV2 * fix[api] : fetchdesignation, requestview * fix : view file endpoint * minor updates while updating the issue-work-order table (#4) * minor changes (#5) * minor changes * minor changes * approve/reject and view file * fix: work order * Minor changes in addBudget and editBudget endpoints (#6) * fix : serializer * modified views related to audit document view (#7) * Added API folder in iwdModuleV2 * modified views related to audit document view * fixed apis * fix: serializer overriding requestCreatedBdBy value * fix: serializer overriding requestCreatedBdBy value * fix api * chore: made handlers consistent * major fixes * fix: handle dean process request file attachment upload * fix : forward file --------- Co-authored-by: Bhargavzz <vishnubhargavsitra@gmail.com> Co-authored-by: Abhijeet <pabhijeet349@gmail.com> Co-authored-by: dotniiko <115548274+dotniiko@users.noreply.github.com> Co-authored-by: Dhruv Ratmele <129955117+Somgester@users.noreply.github.com> Co-authored-by: Abhijeet Patil <133658873+abhiJeetP10@users.noreply.github.com> Co-authored-by: Bhargavzz <133690080+Bhargavzz@users.noreply.github.com> * Revert "Old version(gad 2) (#1721)" (#1723) This reverts commit e528b98. * Gad 2 (Request based system) (#1726) * Added API folder in iwdModuleV2 * Added endpoints in API folder in iwdModuleV2 * Added additional endpoints in API folder in iwdModuleV2 * fix[api] : fetchdesignation, requestview * fix : view file endpoint * minor updates while updating the issue-work-order table (#4) * minor changes (#5) * minor changes * minor changes * approve/reject and view file * fix: work order * Minor changes in addBudget and editBudget endpoints (#6) * fix : serializer * modified views related to audit document view (#7) * Added API folder in iwdModuleV2 * modified views related to audit document view * fixed apis * fix: serializer overriding requestCreatedBdBy value * fix: serializer overriding requestCreatedBdBy value * fix api * chore: made handlers consistent * major fixes * fix: handle dean process request file attachment upload * fix : forward file * fix:migrations --------- Co-authored-by: Bhargavzz <vishnubhargavsitra@gmail.com> Co-authored-by: Abhijeet <pabhijeet349@gmail.com> Co-authored-by: dotniiko <115548274+dotniiko@users.noreply.github.com> Co-authored-by: Dhruv Ratmele <129955117+Somgester@users.noreply.github.com> Co-authored-by: Abhijeet Patil <133658873+abhiJeetP10@users.noreply.github.com> Co-authored-by: Bhargavzz <133690080+Bhargavzz@users.noreply.github.com> * SPACS Module version 1 (#1722) Note : This commit deletes the migration file of iwd module as instructed. * Add new migration files * created api folder * Added files in the scholarships/api directory * previous winners api * Api Created for previous winners * api made of previous winner and catalog * API's made for MCM & all three medals * making APIs to check status * Your descriptive commit message * api for editing the catalog by convenor or assistant * Made API for showing the mcm entries to spacs convenor and assistant * created apis for showing data of director silver and gold on clicking file button by convenor or assistant * api to view all applied application for director's gold to spacs convenor or assistant is implimented * api created for invite application * some other apis * Added API for Director_gold,Director Silver,MCM listing and MCM,director gold,director silverstatus update functionality * API for Director silver status update * Changed in views of Award and Scholarship * Update scholarships URLs and add migration files * fixing some bugs * mcm submission backend complete * mcm api complete * py _1829.py 19_1830.py -> FusionIIIT/applications/online_cms/migrations/0002_auto_20241116_1949.py 107_1924.py 112_2008.py 116_0233.py 116_0248.py 118_1545.py 118_1914.py rge_20241119_1829.py 1117_2324.py 1119_1830.py 41118_1545.py 1118_1917.py 1118_1921.py y _2044.py y y * some bugs of convenor api's are solved * migration files * delete duplicate migrations * Correct Migration files * Remove unwanted changes * files api in backend (#14) * make backend changes for convocation models and mcm * Add dm-proficiency apis * modify mcmstatus update view * removed unnecessary lines * Delete migration files * Delete a migration file --------- Co-authored-by: Ms Kumkum Kadhala <22bcs165@iiitdmj.ac.in> Co-authored-by: Harsh <its.the.boy.harsh@gmail.com> Co-authored-by: Ms Kumkum Kadhala <129649903+kumkum020704@users.noreply.github.com> Co-authored-by: Priyanshu <115771027+PriyanshuXcoder@users.noreply.github.com> Co-authored-by: harshit <harshitgangwar51102@gmail.com> * Dashboard client (#1727) * Os 2 (#10) * Announcements * Creted view relief page and completed patient history * implemented medical relief system add features to reject relief which required edit in notification module * Critical migration changes * Implemented feedback and api using django-rest framework new table to keep track of feedback only two api but handelling the different types requests using post data * fix: Resolved System check errors on latest_staging * chore: migrations for previous commit changes * Required changes in forms.py * Required changes in views and template files * changed files in templates * Fixes some error in Views.py response.body to response_body (#2) * removed unwanted migrations * Modified backeng views.py and api of Health Center (#3) * Fixes some error in Views.py response.body to response_body * Modified backeng views.py and api --------- Co-authored-by: Challa Bharadwaj Reddy <129493843+ChallaBharadwajReddy@users.noreply.github.com> * Updated views.py for stock (#4) * Fixes some error in Views.py response.body to response_body * Modified backeng views.py and api * Updated Stock Backend Code * Updated views.py (#5) * Fixes some error in Views.py response.body to response_body * Modified backeng views.py and api * Updated Stock Backend Code * Updated views.py for compounder and student (#6) * Fixes some error in Views.py response.body to response_body * Modified backeng views.py and api * Updated Stock Backend Code * Updated backend for compounder history * Updated views.py for compounder prescription (#7) * Fixes some error in Views.py response.body to response_body * Modified backeng views.py and api * Updated Stock Backend Code * Updated backend for compounder history * Compounder_History minor changes * Corrected views.py for compounder prescription * Prescription for student completed (#8) * Fixes some error in Views.py response.body to response_body * Modified backeng views.py and api * Updated Stock Backend Code * Updated backend for compounder history * Compounder_History minor changes * Corrected views.py for compounder prescription * Pres for student completed * removed unwanted globals commit --------- Co-authored-by: vamshi <rajavamshinath@gmail.com> Co-authored-by: ramG-reddy <venkataramgopal16@gmail.com> Co-authored-by: grvup <upadhyaygaurav450@gmail.com> Co-authored-by: Darpan Mehta <mehtadarpans2004@gmail.com> Co-authored-by: Divij Sharma <divijs75@gmail.com> Co-authored-by: Sahil Raj Verma <sahilrv196@gmail.com> * backend support for adding file for health center completed * upload file for followup implemented and N/A stock corrected * merged dashboard_client * Os 2 (#13) * Announcements * Creted view relief page and completed patient history * implemented medical relief system add features to reject relief which required edit in notification module * Critical migration changes * Implemented feedback and api using django-rest framework new table to keep track of feedback only two api but handelling the different types requests using post data * fix: Resolved System check errors on latest_staging * chore: migrations for previous commit changes * Required changes in forms.py * Required changes in views and template files * changed files in templates * Fixes some error in Views.py response.body to response_body (#2) * removed unwanted migrations * Modified backeng views.py and api of Health Center (#3) * Fixes some error in Views.py response.body to response_body * Modified backeng views.py and api --------- Co-authored-by: Challa Bharadwaj Reddy <129493843+ChallaBharadwajReddy@users.noreply.github.com> * Updated views.py for stock (#4) * Fixes some error in Views.py response.body to response_body * Modified backeng views.py and api * Updated Stock Backend Code * Updated views.py (#5) * Fixes some error in Views.py response.body to response_body * Modified backeng views.py and api * Updated Stock Backend Code * Updated views.py for compounder and student (#6) * Fixes some error in Views.py response.body to response_body * Modified backeng views.py and api * Updated Stock Backend Code * Updated backend for compounder history * Updated views.py for compounder prescription (#7) * Fixes some error in Views.py response.body to response_body * Modified backeng views.py and api * Updated Stock Backend Code * Updated backend for compounder history * Compounder_History minor changes * Corrected views.py for compounder prescription * Prescription for student completed (#8) * Fixes some error in Views.py response.body to response_body * Modified backeng views.py and api * Updated Stock Backend Code * Updated backend for compounder history * Compounder_History minor changes * Corrected views.py for compounder prescription * Pres for student completed * removed unwanted globals commit --------- Co-authored-by: vamshi <rajavamshinath@gmail.com> Co-authored-by: ramG-reddy <venkataramgopal16@gmail.com> Co-authored-by: grvup <upadhyaygaurav450@gmail.com> Co-authored-by: Darpan Mehta <mehtadarpans2004@gmail.com> Co-authored-by: Divij Sharma <divijs75@gmail.com> Co-authored-by: Sahil Raj Verma <sahilrv196@gmail.com> --------- Co-authored-by: vamshi <rajavamshinath@gmail.com> Co-authored-by: ramG-reddy <venkataramgopal16@gmail.com> Co-authored-by: grvup <upadhyaygaurav450@gmail.com> Co-authored-by: Darpan Mehta <mehtadarpans2004@gmail.com> Co-authored-by: Divij Sharma <divijs75@gmail.com> Co-authored-by: Sahil Raj Verma <sahilrv196@gmail.com> * Dev gymkhana merge into dashboard : SA-3 GYMKHANA MODULE (#1729) * feat(feature): Added GymKhaanna APIs & DB Changes * feat(gymkhana): Added Acheivement Tables and Corresponding APIs * feat(feature&chore): API & Integration Co-authored-by: Avinash0504a ankemavinashchiru@gmail.com Co-authored-by: Blanca-Vern-2nd Lucky615b@gmail.com * feat(feature): Added functionality for Coordinator View & Budget Approvals & Migration for club_position * fests table backend * feat(KD SIR Feature: free members in current time based on events) * added newsletter backend * added backend for report * viewing report logic added * feat(deploy V1): Most required functions are done we need to work on feedback * feat(fix : removed Migration file changes) --------- Co-authored-by: Blanca-Vern-2nd <lucky615b@gmail.com> Co-authored-by: Sayali Kadam <22bcs122@iiitdmj.ac.in> * fix : remove migration * Delete Test/Fusion Automation Testing/.settings/org.eclipse.jdt.apt.core.prefs * updated stockentry * fixed model * fixed migrations --------- Co-authored-by: anitesh <anitesh6307@gmail.com> Co-authored-by: Ritik <114828877+Ritik8527@users.noreply.github.com> Co-authored-by: Himanshu Choudhary <128601673+Himanshu8850@users.noreply.github.com> Co-authored-by: Anitesh2004 <129663186+Anitesh2004@users.noreply.github.com> Co-authored-by: JATOTHU ARUN <167317035+Pheonix7113@users.noreply.github.com> Co-authored-by: Arun7113 <arunhyd2003@gmail.com> Co-authored-by: Aarav Jain <128894052+aarav0012@users.noreply.github.com> Co-authored-by: Akash Kumar Sah <akashsah2003@gmail.com> Co-authored-by: aarav0012 <aaravjainjn@email.com> Co-authored-by: SHRAMAN PAUL <pkpaulpostdn@gmail.com> Co-authored-by: Hardik Vardaan <37293677+AtOM18@users.noreply.github.com> Co-authored-by: ompandey0703 <142932201+ompandey0703@users.noreply.github.com> Co-authored-by: Vishal-Github-21 <116187488+Vishal-Github-21@users.noreply.github.com> Co-authored-by: K.Charan Teja Reddy <129493881+Charan2437@users.noreply.github.com> Co-authored-by: Ramesh Babu <srameshbabu2004@gmail.com> Co-authored-by: Zaid Alam <predcodes695@gmail.com> Co-authored-by: Vithesh Krishna <133671028+Vithesh2215@users.noreply.github.com> Co-authored-by: Pratik Solanki <128511266+Pratik2026@users.noreply.github.com> Co-authored-by: Aditya Kumar Gupta <116958420+Adi8712@users.noreply.github.com> Co-authored-by: S-tej <132924903+S-tej@users.noreply.github.com> Co-authored-by: Padarthi Karthik <133255355+karthikpadarthi@users.noreply.github.com> Co-authored-by: Green Mansion <90859709+PrinceBujethia@users.noreply.github.com> Co-authored-by: Divyansh Bisht <115489768+dcoder13@users.noreply.github.com> Co-authored-by: Bhargavzz <vishnubhargavsitra@gmail.com> Co-authored-by: Abhijeet <pabhijeet349@gmail.com> Co-authored-by: dotniiko <115548274+dotniiko@users.noreply.github.com> Co-authored-by: Dhruv Ratmele <129955117+Somgester@users.noreply.github.com> Co-authored-by: Abhijeet Patil <133658873+abhiJeetP10@users.noreply.github.com> Co-authored-by: Bhargavzz <133690080+Bhargavzz@users.noreply.github.com> Co-authored-by: Akash Paloju <119884665+AkashPaloju@users.noreply.github.com> Co-authored-by: Ms Kumkum Kadhala <22bcs165@iiitdmj.ac.in> Co-authored-by: Harsh <its.the.boy.harsh@gmail.com> Co-authored-by: Ms Kumkum Kadhala <129649903+kumkum020704@users.noreply.github.com> Co-authored-by: Priyanshu <115771027+PriyanshuXcoder@users.noreply.github.com> Co-authored-by: harshit <harshitgangwar51102@gmail.com> Co-authored-by: Challa Bharadwaj Reddy <129493843+ChallaBharadwajReddy@users.noreply.github.com> Co-authored-by: vamshi <rajavamshinath@gmail.com> Co-authored-by: ramG-reddy <venkataramgopal16@gmail.com> Co-authored-by: grvup <upadhyaygaurav450@gmail.com> Co-authored-by: Darpan Mehta <mehtadarpans2004@gmail.com> Co-authored-by: Divij Sharma <divijs75@gmail.com> Co-authored-by: Sahil Raj Verma <sahilrv196@gmail.com> Co-authored-by: RISHIKESHk07 <117551967+RISHIKESHk07@users.noreply.github.com> Co-authored-by: Blanca-Vern-2nd <lucky615b@gmail.com> Co-authored-by: Sayali Kadam <22bcs122@iiitdmj.ac.in>
1 parent 4072d40 commit f8e999c

File tree

8 files changed

+101
-49
lines changed

8 files changed

+101
-49
lines changed

FusionIIIT/applications/central_mess/migrations/0003_auto_20250209_1736.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ class Migration(migrations.Migration):
1515
name='img',
1616
field=models.ImageField(default=None, upload_to='mess/images/registration_request/%Y/%m/%d/'),
1717
),
18-
]
18+
]

FusionIIIT/applications/filetracking/api/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def post(self, request):
6868
class ViewFileView(APIView):
6969
authentication_classes = [TokenAuthentication]
7070
permission_classes = [permissions.IsAuthenticated]
71-
71+
7272
def get(self, request, file_id):
7373
try:
7474
file_details = view_file(int(file_id))

FusionIIIT/applications/online_cms/migrations/0001_initial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,4 +272,4 @@ class Migration(migrations.Migration):
272272
('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')),
273273
],
274274
),
275-
]
275+
]

FusionIIIT/applications/online_cms/migrations/0003_auto_20250402_1850.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ class Migration(migrations.Migration):
2929
name='verified',
3030
field=models.BooleanField(default=False),
3131
),
32-
]
32+
]

FusionIIIT/applications/ps1/api/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,5 @@
6767
path('archieveview/<str:username>/', views.archieveview, name='archievedview'),
6868
path('outboxview2/<str:username>/', views.outboxview2, name='outboxview2'),
6969
path('stockEntry/<str:username>/', views.stockEntry, name='stock-entry'),
70+
path('my-indents/<str:username>/', views.my_indents_view, name='my-indents-view'),
7071
]

FusionIIIT/applications/ps1/api/views.py

Lines changed: 85 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from notification.views import office_module_notif
1212
from django.contrib import messages
1313
from django.contrib.auth.models import User
14+
from notification.views import purchase_notif,iwd_notif
1415
from applications.filetracking.sdk.methods import *
1516
from datetime import datetime
1617
from django.http import HttpResponseForbidden,JsonResponse
@@ -52,26 +53,6 @@ def getDesignations(request):
5253

5354
@api_view(['POST'])
5455
@permission_classes([IsAuthenticated])
55-
# def getOneFiledIndent(request):
56-
# try:
57-
# file_id = request.data.get('file_id')
58-
# # console.log(file_id)
59-
# indent = IndentFile.objects.get(file_info_id=file_id)
60-
# fileinfo = File.objects.get(pk=file_id)
61-
# # console.log(indent)
62-
# serializer = IndentFileSerializer(indent)
63-
# serializer_file = FileSerializer(fileinfo)
64-
# department = request.user.extrainfo.department.name
65-
# return Response({
66-
# 'indent': serializer.data,
67-
# 'file': serializer_file.data,
68-
# 'department': department
69-
# }, status=status.HTTP_200_OK)
70-
# # return Response(serializer.data, status=status.HTTP_200_OK)
71-
# except IndentFile.DoesNotExist:
72-
# return Response({"error": "Indent not found."}, status=status.HTTP_404_NOT_FOUND)
73-
# except Exception as e:
74-
# return Response({"error": str(e)}, status=status.HTTP_400_BAD_REQUEST)
7556
def getOneFiledIndent(request):
7657
try:
7758
file_id = request.data.get('file_id')
@@ -101,6 +82,7 @@ def getOneFiledIndent(request):
10182

10283

10384

85+
10486
@api_view(['POST'])
10587
@permission_classes([IsAuthenticated])
10688
def delete_indent(request):
@@ -165,7 +147,6 @@ def createDraft(request):
165147
file_extra_JSON={"value": 2},
166148
attached_file=upload_file
167149
)
168-
169150
# Create IndentFile object
170151
indent_file = IndentFile.objects.create(
171152
file_info=get_object_or_404(File, pk=file_id),
@@ -199,10 +180,6 @@ def createDraft(request):
199180
'message': 'Indent Filed Successfully!',
200181
}, status=status.HTTP_201_CREATED)
201182

202-
# except HoldsDesignation.DoesNotExist:
203-
# return Response({
204-
# 'error': 'The specified designation does not exist.'
205-
# }, status=status.HTTP_404_NOT_FOUND)
206183

207184
except Exception as e:
208185
return Response({
@@ -337,7 +314,7 @@ def draftView(request, username):
337314
indents = IndentFile.objects.filter(file_info__in=request.user.extrainfo.uploaded_files.all()).select_related('file_info')
338315
department = request.user.extrainfo.department.name
339316
# print("gaurva")
340-
print(department)
317+
print(department)
341318
indent_ids = [indent.file_info for indent in indents]
342319
filed_indents = Tracking.objects.filter(file_id__in=indent_ids)
343320
filed_indent_ids = [indent.file_id for indent in filed_indents]
@@ -427,7 +404,7 @@ def ForwardIndentFile(request, id):
427404
print('hdfjaldfalk' , request.data)
428405
try:
429406
indent = IndentFile.objects.select_related('file_info').get(file_info=id)
430-
file = indent.file_info
407+
file = indent.file_info_id
431408
track = Tracking.objects.select_related('file_id__uploader__user','file_id__uploader__department','file_id__designation','current_id__user','current_id__department','current_design__user','current_design__working','current_design__designation','receiver_id','receive_design').filter(file_id=file)
432409
except IndentFile.DoesNotExist:
433410
return Response({"message": "Indent file does not exist"}, status=status.HTTP_404_NOT_FOUND)
@@ -496,6 +473,7 @@ def ForwardIndentFile(request, id):
496473
return Response({"message": "Method not allowed"}, status=status.HTTP_405_METHOD_NOT_ALLOWED)
497474

498475

476+
499477
@api_view(['GET'])
500478
@permission_classes([IsAuthenticated])
501479
def archieve_file(request,id):
@@ -557,6 +535,7 @@ def entry(request,id):
557535
except IndentFile.DoesNotExist:
558536
return Response({"message": "Corresponding indent file does not exist"}, status=status.HTTP_404_NOT_FOUND)
559537

538+
560539
@api_view(['GET'])
561540
@permission_classes([IsAuthenticated])
562541
def stockEntryView(request,id):
@@ -954,7 +933,7 @@ def stockEntry(request,username):
954933
print("location-",location)
955934
try:
956935
# temp1 = File.objects.get(id=id)
957-
temp = IndentItem.objects.get(indent_file_id=id)
936+
temp = IndentItem.objects.get(id=id)
958937
except (File.DoesNotExist, IndentFile.DoesNotExist):
959938
return Response({"message": "File with given ID does not exist"}, status=status.HTTP_404_NOT_FOUND)
960939

@@ -987,12 +966,13 @@ def forwardIndent(request, id):
987966
try:
988967
indent=IndentFile.objects.select_related('file_info').get(file_info=id)
989968
file=indent.file_info
990-
969+
print("file details",file);
991970
upload_file = request.FILES.get('file')
992971
receiverName = request.data.get('forwardTo')
993972
receiver_id = User.objects.get(username=receiverName)
994973
receive_design = request.data.get('receiverDesignation')
995974
remarks = request.data.get('remarks')
975+
print("remarks",remarks);
996976
sender_designation_name = request.data.get('role')
997977
# vkjain -> director
998978
print(receiver_id) #bhartenduks
@@ -1012,20 +992,25 @@ def forwardIndent(request, id):
1012992
remarks=remarks,
1013993
file_attachment=upload_file
1014994
)
1015-
1016-
office_module_notif(request.user, receiver_id)
995+
print("noti",request.user);
996+
print("noti2",receiver_id);
997+
# iwd_notif(request.user, receiver_id, "Request_added")
998+
purchase_notif(request.user,receiver_id)
999+
# office_module_notif(request.user, receiver_id)
10171000
if((sender_designation_name in ["HOD (CSE)", "HOD (ECE)", "HOD (ME)", "HOD (SM)", "HOD (Design)", "HOD (Liberal Arts)", "HOD (Natural Science)"]) and (str(receive_design) in ["Director","Registrar"])):
10181001
indent.head_approval=True
1019-
elif ((sender_designation_name in ["Director","Registrar"]) and (str(receive_design) in ["Professor","Accounts Admin"]) and indent.purchased==True):
1002+
elif ((sender_designation_name in ["Director","Registrar"]) and (str(receive_design) in ["ps_admin"]) ):
10201003
indent.director_approval=True
1021-
indent.financial_approval=True
1022-
elif ((sender_designation_name in ["Director","Registrar"]) and (str(receive_design) in ["Professor"]) ):
1023-
indent.director_approval=True
1024-
elif ((sender_designation_name in ["Professor"]) and (str(receive_design) in ["ps_admin"] )):
1004+
elif ((sender_designation_name in ["Professor","Assistant Professor"]) and (str(receive_design) in ["ps_admin"] )):
10251005
indent.purchased=True
1026-
elif ((sender_designation_name in ["ps_admin"]) and str(receive_design) in ["Director","Registrar"]):
1027-
indent.head_approval=True
1006+
elif ((sender_designation_name in ["Director","Registrar"]) and (str(receive_design) in ["Professor","Accounts Admin","Assistant Professor"]) and indent.purchased==True):
1007+
print("financial approval");
10281008
indent.director_approval=True
1009+
indent.financial_approval=True
1010+
1011+
# elif ((sender_designation_name in ["ps_admin"]) and str(receive_design) in ["Director","Registrar"]):
1012+
# indent.head_approval=True
1013+
# indent.director_approval=True
10291014
elif ((sender_designation_name == "Accounts Admin") and ((str(receive_design) in dept_admin_design) or str(receive_design) == "ps_admin")):
10301015
indent.financial_approval=True
10311016

@@ -1111,8 +1096,7 @@ def createProposal(request):
11111096
sources_of_supply=item.get('sources_of_supply', ''),
11121097
)
11131098

1114-
# Notify the receiver
1115-
office_module_notif(request.user, receiver)
1099+
purchase_notif(request.user,receiver)
11161100

11171101
# Auto-approve if receiver is 'ps_admin'
11181102
if receiver_designation == "ps_admin":
@@ -1148,4 +1132,64 @@ def user_suggestions(request):
11481132
# user = Faculty.objects.all().values('id')
11491133
# print(users)
11501134
# print(user)
1151-
return JsonResponse({'users': list(users)})
1135+
return JsonResponse({'users': list(users)})
1136+
1137+
@api_view(['GET'])
1138+
@permission_classes([IsAuthenticated])
1139+
def my_indents_view(request, username):
1140+
try:
1141+
# Validate user
1142+
user = User.objects.get(username=username)
1143+
if user != request.user:
1144+
return Response({'error': 'Unauthorized access'}, status=status.HTTP_403_FORBIDDEN)
1145+
1146+
# Get all files created by this user
1147+
created_files = File.objects.filter(uploader=user.extrainfo).order_by('-upload_date')
1148+
1149+
# Get associated indent files
1150+
indent_files = IndentFile.objects.filter(
1151+
file_info__in=created_files
1152+
).select_related(
1153+
'file_info'
1154+
).prefetch_related(
1155+
'items'
1156+
).order_by('-file_info__upload_date')
1157+
1158+
# Serialize the data
1159+
data = []
1160+
for indent in indent_files:
1161+
# Get last tracking info if exists
1162+
tracking = Tracking.objects.filter(file_id=indent.file_info_id).select_related(
1163+
'receiver_id'
1164+
).last()
1165+
1166+
indent_data = {
1167+
'id': indent.file_info_id,
1168+
'indent_name': indent.indent_name,
1169+
'description': indent.description,
1170+
'upload_date': indent.file_info.upload_date,
1171+
'status': {
1172+
'head_approval': indent.head_approval,
1173+
'director_approval': indent.director_approval,
1174+
'financial_approval': indent.financial_approval,
1175+
'purchased': indent.purchased
1176+
},
1177+
'current_receiver': tracking.receiver_id.username if tracking else None,
1178+
'items': [{
1179+
'name': item.item_name,
1180+
'quantity': item.quantity,
1181+
'estimated_cost': item.estimated_cost
1182+
} for item in indent.items.all()]
1183+
}
1184+
data.append(indent_data)
1185+
1186+
return Response({
1187+
'count': len(data),
1188+
'results': data,
1189+
'department': user.extrainfo.department.name
1190+
})
1191+
1192+
except User.DoesNotExist:
1193+
return Response({'error': 'User not found'}, status=status.HTTP_404_NOT_FOUND)
1194+
except Exception as e:
1195+
return Response({'error': str(e)}, status=status.HTTP_400_BAD_REQUEST)

FusionIIIT/applications/ps1/models.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class IndentFile(models.Model):
1414
director_approval = models.BooleanField(default=False)
1515
financial_approval = models.BooleanField(default=False)
1616
purchased = models.BooleanField(default=False)
17-
1817
class Meta:
1918
db_table = 'IndentFile'
2019

@@ -37,7 +36,6 @@ class IndentItem(models.Model):
3736

3837
class Meta:
3938
db_table = 'IndentItem'
40-
4139
class Constants:
4240
Locations = (
4341
('SR1', 'LHTC'),
@@ -112,6 +110,9 @@ def create_stock_items(sender, instance, created, **kwargs):
112110
if created:
113111
# Automatically create 'n' number of StockItem instances based on current_stock of StockEntry
114112
# instance is stockEntry
113+
department = instance.item_id.indent_file.file_info.uploader.department
115114
current_stock = int(instance.current_stock)
116-
for _ in range(current_stock):
117-
StockItem.objects.create(StockEntryId=instance,location=instance.location,department=instance.item_id.file_info.uploader.department)
115+
for _ in range(current_stock):
116+
StockItem.objects.create(StockEntryId=instance,location=instance.location,department=department)
117+
# for _ in range(current_stock):
118+
# StockItem.objects.create(StockEntryId=instance,location=instance.location,department=instance.item_id.file_info.uploader.department)

FusionIIIT/notification/views.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,4 +714,10 @@ def iwd_notif(sender,recipient,type):
714714
verb = "Request approved by " + sender.username + "."
715715
if type == "Request_rejected":
716716
verb = "Request rejected by " + sender.username + "."
717+
notify.send(sender=sender,recipient=recipient,url=url,module=module,verb=verb)
718+
719+
def purchase_notif(sender,recipient):
720+
module= 'purchase-and-store'
721+
url= 'purchase'
722+
verb="A new Indent Received"
717723
notify.send(sender=sender,recipient=recipient,url=url,module=module,verb=verb)

0 commit comments

Comments
 (0)