Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GAD-6 --> Latest Staging #1507

Merged
merged 36 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c22fd4b
Added Sdk module for Approve/Forwd and Indent file, add/view stock, g…
aniket2003 Feb 18, 2024
d65e0a1
ps1 changes
aniket2003 Feb 23, 2024
9e3b0fa
ps1 changes 1.0
aniket2003 Feb 23, 2024
89e0831
ps1 changes 20
aniket2003 Feb 23, 2024
263eadc
ps1 changes 3.0
aniket2003 Feb 23, 2024
5879abf
ps1 changes 3.0
aniket2003 Feb 23, 2024
5b920d8
made some changes
aniket2003 Mar 12, 2024
487c0f4
added sdk in inbox,outbox and some changes
aniket2003 Mar 16, 2024
1e02e5a
Merge remote-tracking branch 'upstream/main'
ThisisMS11 Mar 17, 2024
74352be
Merge remote-tracking branch 'upstream/gad-5'
ThisisMS11 Mar 17, 2024
d0760f7
Added Dashboard Changes
ThisisMS11 Mar 17, 2024
68e43d4
Removed conflicts with ps-1 and remove migrations files
ThisisMS11 Mar 20, 2024
a34ff3c
Improvised stockEntry Modals, StockView and StockEdit for updated req…
ThisisMS11 Mar 22, 2024
4ae33f1
Added StockITem and StockTransfer Table and improvised others views r…
ThisisMS11 Mar 25, 2024
871e979
added filters in stock view and added stock_transfer_view pages
ThisisMS11 Mar 29, 2024
4785c7f
Added ps-1 API for Flutter APP
ThisisMS11 Apr 10, 2024
791bf35
Changes With migrations
ThisisMS11 Apr 11, 2024
3f9e3c9
added migrations
ThisisMS11 Apr 12, 2024
38928de
completed_merge
ThisisMS11 Apr 12, 2024
333f828
Improved UI and added some buttons
ThisisMS11 Apr 12, 2024
d82ec16
Added more apis for flutter app
ThisisMS11 Apr 13, 2024
9f8fc36
Merge branch 'FusionIIIT:main' into mohit_fusion_1
ThisisMS11 Apr 14, 2024
885f59a
Added more apis for flutter app
ThisisMS11 Apr 13, 2024
4bca813
resolved some issues
ThisisMS11 Apr 14, 2024
5661abf
resolved some issues
ThisisMS11 Apr 14, 2024
c4fb508
Merge branch 'mohit_fusion_1' of https://github.com/ThisisMS11/Fusion…
ThisisMS11 Apr 15, 2024
64af913
removed conflicts with ps-1
ThisisMS11 Apr 15, 2024
eddcfe8
Removed redundant designations selection pages and prevented admins t…
ThisisMS11 Apr 17, 2024
cc938f4
removed grade ,disallowed dept_admins to create files and ui changes
ThisisMS11 Apr 18, 2024
aca3ec0
pull changes from ps-1
ThisisMS11 Apr 18, 2024
9d521cc
Merge branch 'latest_staging' of https://github.com/FusionIIIT/Fusion…
ThisisMS11 Apr 18, 2024
9cca132
Merge branch 'latest_staging' of https://github.com/FusionIIIT/Fusion…
ThisisMS11 Apr 18, 2024
fa45bde
Merge branch 'mohit_fusion_1' of https://github.com/ThisisMS11/Fusion…
ThisisMS11 Apr 18, 2024
c0c98f1
Merge branch 'mohit_fusion_1' of https://github.com/ThisisMS11/Fusion…
ThisisMS11 Apr 18, 2024
ef14147
Merge branch 'mohit_fusion_1' of https://github.com/ThisisMS11/Fusion…
ThisisMS11 Apr 19, 2024
1807e62
Merge pull request #1488 from ThisisMS11/mohit_fusion_1
prajjwalkapoor Apr 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions FusionIIIT/applications/ps1/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def createProposal(request):
designation = Designation.objects.get(id=HoldsDesignation.objects.select_related('user', 'working', 'designation').get(id=design).designation_id)
upload_file = request.FILES.get('myfile')
item_name = request.data.get('item_name')
grade = request.data.get('grade')
quantity = request.data.get('quantity')
present_stock = request.data.get('present_stock')
estimated_cost = request.data.get('estimated_cost')
Expand Down Expand Up @@ -89,7 +88,6 @@ def createProposal(request):
estimated_cost=estimated_cost,
purpose=purpose,
specification=specification,
grade=grade,
item_type=item_type,
nature=nature,
indigenous=indigenous,
Expand Down Expand Up @@ -445,12 +443,11 @@ def currentStockView(request,id):
else:
return Response({"message": "Invalid designation"}, status=status.HTTP_403_FORBIDDEN)

grouped_items = stocks.values('StockEntryId__item_id__item_type', 'StockEntryId__item_id__grade', 'department').annotate(total_quantity=Count('id'))
grouped_items = stocks.values('StockEntryId__item_id__item_type', 'department').annotate(total_quantity=Count('id'))

grouped_items_list = [
{
'item_type': item['StockEntryId__item_id__item_type'],
'grade': item['StockEntryId__item_id__grade'],
'department': DepartmentInfo.objects.get(id=item['department']).name,
'total_quantity': item['total_quantity']
}
Expand All @@ -462,25 +459,22 @@ def currentStockView(request,id):
elif request.method == 'POST':
# Handle POST request
department = request.data.get('department')
grade = request.data.get('grade')
item_type = request.data.get('item_type')

if not department or not grade or not item_type:
if not department or not item_type:
return Response({"message": "Missing required parameters"}, status=status.HTTP_400_BAD_REQUEST)

# Filter StockItem based on provided filters
StockItems = StockItem.objects.filter(
department=department,
StockEntryId__item_id__grade=grade,
StockEntryId__item_id__item_type=item_type
)

grouped_items = StockItems.values('StockEntryId__item_id__item_type', 'StockEntryId__item_id__grade', 'department').annotate(total_quantity=Count('id'))
grouped_items = StockItems.values('StockEntryId__item_id__item_type', 'department').annotate(total_quantity=Count('id'))

grouped_items_list = [
{
'item_type': item['StockEntryId__item_id__item_type'],
'grade': item['StockEntryId__item_id__grade'],
'department': DepartmentInfo.objects.get(id=department).name,
'total_quantity': item['total_quantity']
}
Expand Down Expand Up @@ -544,11 +538,9 @@ def stockTransfer(request,id):
temp1=IndentFile.objects.get(file_info=temp)

item_type_required =temp1.item_type
item_grade_required = temp1.grade

available_items=StockItem.objects.filter(
StockEntryId__item_id__item_type=item_type_required,
StockEntryId__item_id__grade=item_grade_required,
inUse=False
)

Expand Down
14 changes: 5 additions & 9 deletions FusionIIIT/applications/ps1/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class IndentFile(models.Model):
estimated_cost=models.IntegerField(null=True, blank=False)
purpose=models.CharField(max_length=250,blank=False )
specification=models.CharField(max_length=250)
grade = models.CharField(max_length=1, choices=[('A', 'A'), ('B', 'B'), ('C', 'C')],default='A')
item_type=models.CharField(max_length=250)
nature=models.BooleanField(default = False)
indigenous= models.BooleanField(default = False)
Expand All @@ -34,14 +33,11 @@ class Meta:

class Constants:
Locations = (
('H1', 'Vashistha Hostel'),
('H4', 'Vivekananda Hostel'),
('H3', 'AryaBhatta Hostel'),
('SR1', 'Storage Room 1'),
('SR2', 'Storage Room 2'),
('SR3', 'Storage Room 3'),
('SR4', 'Storage Room 4'),
('SR5', 'Storage Room 5'),
('SR1', 'LHTC'),
('SR2', 'Computer Center'),
('SR3', 'Panini Hostel'),
('SR4', 'Lab complex'),
('SR5', 'Admin Block'),
)

class StockEntry(models.Model):
Expand Down
16 changes: 9 additions & 7 deletions FusionIIIT/applications/ps1/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,22 @@
url(r'^composed_indents/$', views.composed_indents, name='composed_indents'),

# here id is the Holdsdesignation id.
url(r'^indentview/(?P<id>\d+)$', views.indentview, name='indentview'),
url(r'^indentview/(?P<id>\d+)/$', views.indentview, name='indentview'),
url(r'^archieveview/(?P<id>\d+)/$', views.archieveview, name='archieveview'),

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

# indentview2 is to get all the indentFiles inwarded towards the request.user.

url(r'^indentview2/(?P<id>\d+)$', views.indentview2, name='indentview2'),
url(r'^confirmdelete/(?P<id>\d+)$', views.confirmdelete, name='confirm_delete'),
url(r'^delete/(?P<id>\d+)$',views.delete, name='delete'),
url(r'^indentview2/(?P<id>\d+)/$', views.indentview2, name='indentview2'),
url(r'^confirmdelete/(?P<id>\d+)/$', views.confirmdelete, name='confirm_delete'),
url(r'^delete/(?P<id>\d+)/$',views.delete, name='delete'),
# forward Indent is to see a specific forwarded indent to ourselves
url(r'^forwardindent/(?P<id>\d+)/$', views.forwardindent, name='forwardindent'),
url(r'^createdindent/(?P<id>\d+)/$', views.createdindent, name='createdindent'),

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

url(r'^entry/$', views.entry, name='entry'),
url(r'^StockEntry/$', views.Stock_Entry, name='Stock_Entry'),
Expand All @@ -43,6 +44,7 @@
# to display stock items which are having similar item_type ,grade and department.(used in current_stock_view)
url(r'^stock_item_view/$', views.stock_item_view, name='stock_item_view'),

url(r'^archieved_indents/$', views.archieved_files, name='archieved_indents_view'),



Expand All @@ -62,7 +64,7 @@
url(r'^stock_transfer/$', views.stock_transfer, name='stock_transfer'),
url(r'^view_transfer/$', views.view_transfer, name='view_transfer'),

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


Expand Down
Loading
Loading