-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenewal_PGM.py
1748 lines (1635 loc) · 109 KB
/
Renewal_PGM.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
## All the functions associated with PGM_Renewal have the same logic as the functions associated with SBU_Renewal.
## The Logics have been listed in the Renewal_SBU file ##
## connection = sqlite.connect(databasename) is the line of code which needs to be replaced with the different database.
## For example: If we choose to use mysql database server then,
#connection = mysql.connector.connect(host='localhost',database='Electronics',user='pynative',password='pynative@#29')
from PyQt5 import QtCore, QtGui, QtWidgets
import sqlite3 ## Library to import sqlite3, replace this with mysql connector of python
class PGM_Renewal(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1920, 1080)
font = QtGui.QFont()
font.setPointSize(15)
MainWindow.setFont(font)
MainWindow.setStyleSheet("color: rgb(0,0,0)")
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.stackedWidget = QtWidgets.QStackedWidget(self.centralwidget)
self.stackedWidget.setGeometry(QtCore.QRect(0, 0, 1920, 1080))
self.stackedWidget.setObjectName("stackedWidget")
## Page -1: Dashboard Page ##
self.page1 = QtWidgets.QWidget()
self.page1.setObjectName("page1")
self.centralwidget.setObjectName("centralwidget")
## Biggest Frame ##
self.frame = QtWidgets.QFrame(self.page1)
self.frame.setGeometry(QtCore.QRect(20, 40, 1821, 1001))
self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame.setObjectName("frame")
## Dashboard - 1: Action Summary based on Contract Type and WO Expiry Date ##
## There are 6 Tables in this Dashboard ##
self.frame_1 = QtWidgets.QFrame(self.frame)
self.frame_1.setGeometry(QtCore.QRect(20, 170, 1781, 281))
self.frame_1.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_1.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_1.setObjectName("frame_1")
## Contract Type = FP & WO Expiry Date < 30 days
self.tableWidget1 = QtWidgets.QTableWidget(self.frame_1)
self.tableWidget1.setGeometry(QtCore.QRect(60, 110, 202, 152))
self.tableWidget1.setFocusPolicy(QtCore.Qt.NoFocus)
self.tableWidget1.setStyleSheet("gridline-color: rgb(0, 0, 0);")
self.tableWidget1.setRowCount(5)
self.tableWidget1.setColumnCount(2)
self.tableWidget1.setObjectName("tableWidget1")
item = QtWidgets.QTableWidgetItem()
self.tableWidget1.setItem(0, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget1.setItem(1, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget1.setItem(2, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget1.setItem(3, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget1.setItem(4, 0, item)
self.tableWidget1.horizontalHeader().setVisible(False)
self.tableWidget1.horizontalHeader().setHighlightSections(False)
self.tableWidget1.verticalHeader().setVisible(False)
self.FP1 = QtWidgets.QLabel(self.frame_1)
self.FP1.setGeometry(QtCore.QRect(60, 70, 202, 40))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.FP1.setFont(font)
self.FP1.setStyleSheet("background-color: rgb(255, 191, 0);")
self.FP1.setFrameShape(QtWidgets.QFrame.Box)
self.FP1.setAlignment(QtCore.Qt.AlignCenter)
self.FP1.setObjectName("FP1")
## Contract Type = T&M & WO Expiry Date < 30 days
self.tableWidget2 = QtWidgets.QTableWidget(self.frame_1)
self.tableWidget2.setGeometry(QtCore.QRect(360, 110, 202, 152))
self.tableWidget2.setFocusPolicy(QtCore.Qt.NoFocus)
self.tableWidget2.setStyleSheet("gridline-color: rgb(0, 0, 0);")
self.tableWidget2.setRowCount(5)
self.tableWidget2.setColumnCount(2)
self.tableWidget2.setObjectName("tableWidget2")
item = QtWidgets.QTableWidgetItem()
self.tableWidget2.setItem(0, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget2.setItem(1, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget2.setItem(2, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget2.setItem(3, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget2.setItem(4, 0, item)
self.tableWidget2.horizontalHeader().setVisible(False)
self.tableWidget2.horizontalHeader().setHighlightSections(False)
self.tableWidget2.verticalHeader().setVisible(False)
self.TM1 = QtWidgets.QLabel(self.frame_1)
self.TM1.setGeometry(QtCore.QRect(360, 70, 202, 40))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.TM1.setFont(font)
self.TM1.setStyleSheet("background-color: rgb(255, 191, 0);")
self.TM1.setFrameShape(QtWidgets.QFrame.Box)
self.TM1.setAlignment(QtCore.Qt.AlignCenter)
self.TM1.setObjectName("TM1")
## Contract Type = FP and T&M and WO Expiry Date < 30 days
self.tableWidget3 = QtWidgets.QTableWidget(self.frame_1)
self.tableWidget3.setGeometry(QtCore.QRect(660, 110, 202, 152))
self.tableWidget3.setFocusPolicy(QtCore.Qt.NoFocus)
self.tableWidget3.setStyleSheet("gridline-color: rgb(0, 0, 0);")
self.tableWidget3.setRowCount(5)
self.tableWidget3.setColumnCount(2)
self.tableWidget3.setObjectName("tableWidget3")
item = QtWidgets.QTableWidgetItem()
self.tableWidget3.setItem(0, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget3.setItem(1, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget3.setItem(2, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget3.setItem(3, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget3.setItem(4, 0, item)
self.tableWidget3.horizontalHeader().setVisible(False)
self.tableWidget3.horizontalHeader().setHighlightSections(False)
self.tableWidget3.verticalHeader().setVisible(False)
self.Total1 = QtWidgets.QLabel(self.frame_1)
self.Total1.setGeometry(QtCore.QRect(660, 70, 202, 40))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.Total1.setFont(font)
self.Total1.setStyleSheet("background-color: rgb(255, 191, 0);")
self.Total1.setFrameShape(QtWidgets.QFrame.Box)
self.Total1.setAlignment(QtCore.Qt.AlignCenter)
self.Total1.setObjectName("Total1")
self.summary = QtWidgets.QLabel(self.frame_1)
self.summary.setGeometry(QtCore.QRect(0, 0, 202, 40))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.summary.setFont(font)
self.summary.setStyleSheet("background-color: rgb(255, 191, 0);")
self.summary.setFrameShape(QtWidgets.QFrame.Box)
self.summary.setAlignment(QtCore.Qt.AlignCenter)
self.summary.setObjectName("summary")
self.FP2 = QtWidgets.QLabel(self.frame_1)
self.FP2.setGeometry(QtCore.QRect(980, 70, 202, 40))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.FP2.setFont(font)
self.FP2.setStyleSheet("background-color: rgb(255, 191, 0);")
self.FP2.setFrameShape(QtWidgets.QFrame.Box)
self.FP2.setAlignment(QtCore.Qt.AlignCenter)
self.FP2.setObjectName("FP2")
self.TM2 = QtWidgets.QLabel(self.frame_1)
self.TM2.setGeometry(QtCore.QRect(1270, 70, 202, 40))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.TM2.setFont(font)
self.TM2.setStyleSheet("background-color: rgb(255, 191, 0);")
self.TM2.setFrameShape(QtWidgets.QFrame.Box)
self.TM2.setAlignment(QtCore.Qt.AlignCenter)
self.TM2.setObjectName("TM2")
self.Total2 = QtWidgets.QLabel(self.frame_1)
self.Total2.setGeometry(QtCore.QRect(1550, 70, 202, 40))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.Total2.setFont(font)
self.Total2.setStyleSheet("background-color: rgb(255, 191, 0);")
self.Total2.setFrameShape(QtWidgets.QFrame.Box)
self.Total2.setAlignment(QtCore.Qt.AlignCenter)
self.Total2.setObjectName("Total2")
## Contract Type = FP & 30 days < WO Expiry Date < 60 days
self.tableWidget4 = QtWidgets.QTableWidget(self.frame_1)
self.tableWidget4.setGeometry(QtCore.QRect(980, 110, 202, 152))
self.tableWidget4.setFocusPolicy(QtCore.Qt.NoFocus)
self.tableWidget4.setStyleSheet("gridline-color: rgb(0, 0, 0);")
self.tableWidget4.setRowCount(5)
self.tableWidget4.setColumnCount(2)
self.tableWidget4.setObjectName("tableWidget4")
item = QtWidgets.QTableWidgetItem()
self.tableWidget4.setItem(0, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget4.setItem(1, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget4.setItem(2, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget4.setItem(3, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget4.setItem(4, 0, item)
self.tableWidget4.horizontalHeader().setVisible(False)
self.tableWidget4.horizontalHeader().setHighlightSections(False)
self.tableWidget4.verticalHeader().setVisible(False)
## Contract Type = T&M & 30 days < WO Expiry Date < 60 days
self.tableWidget5 = QtWidgets.QTableWidget(self.frame_1)
self.tableWidget5.setGeometry(QtCore.QRect(1270, 110, 202, 152))
self.tableWidget5.setFocusPolicy(QtCore.Qt.NoFocus)
self.tableWidget5.setStyleSheet("gridline-color: rgb(0, 0, 0);")
self.tableWidget5.setRowCount(5)
self.tableWidget5.setColumnCount(2)
self.tableWidget5.setObjectName("tableWidget5")
item = QtWidgets.QTableWidgetItem()
self.tableWidget5.setItem(0, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget5.setItem(1, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget5.setItem(2, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget5.setItem(3, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget5.setItem(4, 0, item)
self.tableWidget5.horizontalHeader().setVisible(False)
self.tableWidget5.horizontalHeader().setHighlightSections(False)
self.tableWidget5.verticalHeader().setVisible(False)
## Contract Type = FP and T&M and 30 days < WO Expiry Date < 60 days
self.tableWidget6 = QtWidgets.QTableWidget(self.frame_1)
self.tableWidget6.setGeometry(QtCore.QRect(1550, 110, 202, 152))
self.tableWidget6.setFocusPolicy(QtCore.Qt.NoFocus)
self.tableWidget6.setStyleSheet("gridline-color: rgb(0, 0, 0);")
self.tableWidget6.setRowCount(5)
self.tableWidget6.setColumnCount(2)
self.tableWidget6.setObjectName("tableWidget6")
item = QtWidgets.QTableWidgetItem()
self.tableWidget6.setItem(0, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget6.setItem(1, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget6.setItem(2, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget6.setItem(3, 0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget6.setItem(4, 0, item)
self.tableWidget6.horizontalHeader().setVisible(False)
self.tableWidget6.horizontalHeader().setHighlightSections(False)
self.tableWidget6.verticalHeader().setVisible(False)
## Customer Analysis Dashboard ##
self.frame_2 = QtWidgets.QFrame(self.frame)
self.frame_2.setGeometry(QtCore.QRect(130, 540, 1491, 261))
self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_2.setObjectName("frame_2")
self.label_2 = QtWidgets.QLabel(self.frame_2)
self.label_2.setGeometry(QtCore.QRect(0, 0, 101, 40))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_2.setFont(font)
self.label_2.setStyleSheet("background-color: rgb(255, 191, 0);")
self.label_2.setFrameShape(QtWidgets.QFrame.Box)
self.label_2.setObjectName("label_2")
self.label_2.setText("Dashboard-2")
self.tableWidget_2 = QtWidgets.QTableWidget(self.frame_2)
self.tableWidget_2.setGeometry(QtCore.QRect(20, 50, 1350, 155))
self.tableWidget_2.setRowCount(6)
self.tableWidget_2.setColumnCount(5)
self.tableWidget_2.setObjectName("tableWidget_2")
self.tableWidget_2.setFocusPolicy(QtCore.Qt.NoFocus)
self.tableWidget_2.setAlternatingRowColors(True)
for i in range(5):
item = QtWidgets.QTableWidgetItem()
self.tableWidget_2.setHorizontalHeaderItem(i,item)
self.tableWidget_2.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.tableWidget_2.verticalHeader().setVisible(False)
self.tableWidget_2.setColumnWidth(0, 300)
self.tableWidget_2.setColumnWidth(1, 300)
self.tableWidget_2.setColumnWidth(2, 250)
self.tableWidget_2.setColumnWidth(3, 250)
self.tableWidget_2.setColumnWidth(4, 248)
self.tableWidget_2.setStyleSheet("QHeaderView::section { color: rgb(0, 0,0);}")
self.tableWidget_2.setStyleSheet("gridline-color: rgb(0, 0, 0);")
self.headings = ["Customer Name","Contract Type","Subcon #", "Margin","Tenure"]
j = 0
for content in self.headings:
self.tableWidget_2.horizontalHeaderItem(j).setText(content)
j+=1
self.loaddata_2()
self.stackedWidget.addWidget(self.page1)
### Page - 2: Details ######
self.page = QtWidgets.QWidget()
self.page.setObjectName("page")
self.Heading = QtWidgets.QLabel(self.page)
self.Heading.setGeometry(QtCore.QRect(500,100, 800, 100))
font = QtGui.QFont()
font.setPointSize(36)
font.setBold(True)
font.setWeight(75)
self.Heading.setFont(font)
self.Heading.setAlignment(QtCore.Qt.AlignCenter)
self.Heading.setObjectName("Heading")
self.Heading.setText("Subcontractor Details")
## Cancel Button ##
self.goback = QtWidgets.QPushButton(self.page)
self.goback.setGeometry(QtCore.QRect(820,870, 200, 40))
font = QtGui.QFont()
font.setPointSize(15)
font.setWeight(75)
self.goback.setFont(font)
self.goback.setObjectName("goback")
self.goback.setText("Go Back")
self.goback.clicked.connect(self.GoBack)
## Table to display data ##
self.table = QtWidgets.QTableWidget(self.page)
self.table.setGeometry(QtCore.QRect(50, 300, 1750, 500))
self.table.setAutoFillBackground(True)
self.table.setStyleSheet("QHeaderView::section{background-color: rgb(255, 191, 0); color: rgb(0, 0,0);} QTableWidget {gridline-color: rgb(0, 0, 0);}")
self.table.setAlternatingRowColors(True) ## Property to show Alternating Colors for Rows of table
self.table.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.table.setFrameShadow(QtWidgets.QFrame.Sunken)
self.table.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
self.table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.table.setColumnCount(32)
self.table.setObjectName("table")
for i in range(32):
item = QtWidgets.QTableWidgetItem()
self.table.setHorizontalHeaderItem(i, item)
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
self.table.setItem(0, 0, item)
self.table.horizontalHeader().setVisible(True)
self.table.horizontalHeader().setCascadingSectionResizes(True)
self.table.horizontalHeader().setHighlightSections(True)
self.table.verticalHeader().setVisible(False)
self.table.setFocusPolicy(QtCore.Qt.NoFocus)
self.columnwidth = 150
self.Headers = ["Unit","Sub Unit","Subcon ID","Subcon Name","Date of Joining","Expected End Date","Customer Name","Customer Group Name","Project ID","Project Desc","Contract Type","Project Contribution Margin","Vendor Name","W2 Vendor","Subcon Role","Subcon Band","Subcon Experience","Country","City","Skill Family","Skill Type","Skill (Primary)","Skill (Secondary)","Location","Vendor Rate (per hour USD)","Customer Rate","Margin","Margin RAG","Tenure RAG","Project ID RAG","Subcon RAG","Cummulative RAG"]
i = 0
for names in self.Headers:
self.table.horizontalHeaderItem(i).setText(names)
i = i + 1
for i in range(32):
self.table.setColumnWidth(i,self.columnwidth)
self.stackedWidget.addWidget(self.page)
### Page - 3: Action Screen #####
## Refer to PM_Renewal File to read the comments related to UI of Page - 3. All the features are almost the same.
self.page_2 = QtWidgets.QWidget()
self.page_2.setObjectName("page_2")
## Main Frame ##
self.frame_3 = QtWidgets.QFrame(self.page_2)
self.frame_3.setGeometry(QtCore.QRect(50, 40, 1770, 970))
self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_3.setObjectName("frame_3")
## Grid containing the Header Subcon Profile ##
self.gridLayoutWidget_7 = QtWidgets.QWidget(self.frame_3)
self.gridLayoutWidget_7.setGeometry(QtCore.QRect(20, 20, 200, 50))
self.gridLayoutWidget_7.setObjectName("gridLayoutWidget")
self.gridLayout_7 = QtWidgets.QGridLayout(self.gridLayoutWidget_7)
self.gridLayout_7.setObjectName("gridLayout")
self.Subconprofile = QtWidgets.QLabel()
self.font = QtGui.QFont()
self.font.setBold(True)
self.font.setWeight(75)
self.Subconprofile.setFont(self.font)
self.Subconprofile.setText("Subcon Profile")
self.Subconprofile.setStyleSheet("background-color: rgb(255, 191, 0);")
self.Subconprofile.setFrameShape(QtWidgets.QFrame.Box)
self.Subconprofile.setFixedHeight(35)
self.Subconprofile.setAlignment(QtCore.Qt.AlignCenter)
self.Subconprofile.setObjectName("Subconprofile")
self.gridLayout_7.addWidget(self.Subconprofile,0,0,1,2)
## Grid containing all the Labels and Line Edits for showing Subcon Profile ##
## To remove any info:-
## 1) Remove all the occurences of that info
## 2) Change the locations of others to fill its space. (Coordinates)
self.gridLayoutWidget = QtWidgets.QWidget(self.frame_3)
self.gridLayoutWidget.setGeometry(QtCore.QRect(20, 70, 1171, 300))
self.gridLayoutWidget.setObjectName("gridLayoutWidget")
self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget)
self.gridLayout.setObjectName("gridLayout")
self.line_edits_1 = {}
line_edits_1 = {
"Subcon Name": (1,1),"Date of Joining": (2,1),"Customer Name": (1,3), "WO End Date": (2,3),"Tenure": (2,5),
"Vendor Name": (1,5), "Subcon Role": (3,1),"Subcon Band": (3,3),"Subcon Experience": (3,5),"Country": (4,1),
"City": (4,3),"Skill Family": (4,5),"Skill Type": (5,1),"Skill (Primary)": (5,3),"Skill (Secondary)": (5,5),
}
self.lables_1 = {}
lables_1 = {
"Subcon Name": (1,0),"Date of Joining": (2,0),"Customer Name": (1,2), "Tenure": (2,4),"WO End Date": (2,2),
"Vendor Name": (1,4), "Subcon Role": (3,0),"Subcon Band": (3,2),"Subcon Experience": (3,4),"Country": (4,0),
"City": (4,2),"Skill Family": (4,4),"Skill Type": (5,0),"Skill (Primary)": (5,2),"Skill (Secondary)": (5,4),
}
for lables_Text, pos in lables_1.items():
self.lables_1[lables_Text] = QtWidgets.QLabel()
self.lables_1[lables_Text].setText(lables_Text)
self.lables_1[lables_Text].setFont(self.font)
#self.lables[lables_Text].setStyleSheet("background-color: rgb(255, 191, 0);")
self.lables_1[lables_Text].setWordWrap(True)
self.gridLayout.addWidget(self.lables_1[lables_Text], pos[0], pos[1])
for line_Text, pos in line_edits_1.items():
self.line_edits_1[line_Text] = QtWidgets.QLineEdit()
self.line_edits_1[line_Text].setReadOnly(True)
self.gridLayout.addWidget(self.line_edits_1[line_Text], pos[0], pos[1])
## Grid to show Subcon Commercial Info ##
## Logic is similar to as explained above ##
self.gridLayoutWidget_2 = QtWidgets.QWidget(self.frame_3)
self.gridLayoutWidget_2.setGeometry(QtCore.QRect(20, 370, 1171, 120))
self.gridLayoutWidget_2.setObjectName("gridLayoutWidget_2")
self.gridLayout_2 = QtWidgets.QGridLayout(self.gridLayoutWidget_2)
self.gridLayout_2.setObjectName("gridLayout_2")
self.Subconcommercial = QtWidgets.QLabel()
self.Subconcommercial.setFont(self.font)
self.Subconcommercial.setStyleSheet("background-color: rgb(255, 191, 0);")
self.Subconcommercial.setFrameShape(QtWidgets.QFrame.Box)
self.Subconcommercial.setFixedHeight(35)
self.Subconcommercial.setObjectName("Subconcommercial")
self.Subconcommercial.setAlignment(QtCore.Qt.AlignCenter)
self.Subconcommercial.setText("Subcon Commercial")
self.gridLayout_2.addWidget(self.Subconcommercial,0,0)
self.line_edits_2 = {}
line_edits_2 = {
"Vendor Rate (per hour USD)": (1,1), "Customer Rate Margin": (1,3),"Margin": (1,5),
}
self.lables_2 = {}
lables_2 = {
"Vendor Rate (per hour USD)": (1,0), "Customer Rate Margin": (1,2),"Margin": (1,4),
}
for lables_Text, pos in lables_2.items():
self.lables_2[lables_Text] = QtWidgets.QLabel()
self.lables_2[lables_Text].setText(lables_Text)
self.lables_2[lables_Text].setFont(self.font)
#self.lables[lables_Text].setStyleSheet("background-color: rgb(255, 191, 0);")
self.lables_2[lables_Text].setWordWrap(True)
self.gridLayout_2.addWidget(self.lables_2[lables_Text], pos[0], pos[1])
for line_Text, pos in line_edits_2.items():
self.line_edits_2[line_Text] = QtWidgets.QLineEdit()
self.line_edits_2[line_Text].setReadOnly(True)
self.gridLayout_2.addWidget(self.line_edits_2[line_Text], pos[0], pos[1])
self.gridLayout_2.setHorizontalSpacing(20)
### Grid to show Subcon Health Info ##
self.gridLayoutWidget_3 = QtWidgets.QWidget(self.frame_3)
self.gridLayoutWidget_3.setGeometry(QtCore.QRect(20, 510, 1171, 120))
self.gridLayoutWidget_3.setObjectName("gridLayoutWidget_3")
self.gridLayout_3 = QtWidgets.QGridLayout(self.gridLayoutWidget_3)
self.gridLayout_3.setObjectName("gridLayout_3")
self.Subconhealth = QtWidgets.QLabel()
self.Subconhealth.setFont(self.font)
self.Subconhealth.setStyleSheet("background-color: rgb(255, 191, 0);")
self.Subconhealth.setFrameShape(QtWidgets.QFrame.Box)
self.Subconhealth.setFixedHeight(35)
self.Subconhealth.setFixedWidth(200)
self.Subconhealth.setObjectName("Subconhealth")
self.Subconhealth.setAlignment(QtCore.Qt.AlignCenter)
self.Subconhealth.setText("Subcon Health")
self.gridLayout_3.addWidget(self.Subconhealth,0,0,1,2)
self.line_edits_3 = {}
line_edits_3 = {
"Margin RAG": (1,1),"Tenure RAG": (1,3),"Project ID RAG": (1,5),"Subcon RAG": (1,7),
}
self.lables_3 = {}
lables_3 = {
"Margin RAG": (1,0),"Tenure RAG": (1,2),"Project ID RAG": (1,4),"Subcon RAG": (1,6),
}
for lables_Text, pos in lables_3.items():
self.lables_3[lables_Text] = QtWidgets.QLabel()
self.lables_3[lables_Text].setText(lables_Text)
self.lables_3[lables_Text].setFont(self.font)
#self.lables[lables_Text].setStyleSheet("background-color: rgb(255, 191, 0);")
self.lables_3[lables_Text].setWordWrap(True)
self.gridLayout_3.addWidget(self.lables_3[lables_Text], pos[0], pos[1])
for line_Text, pos in line_edits_3.items():
self.line_edits_3[line_Text] = QtWidgets.QLineEdit()
self.line_edits_3[line_Text].setReadOnly(True)
self.gridLayout_3.addWidget(self.line_edits_3[line_Text], pos[0], pos[1])
self.gridLayout_3.setHorizontalSpacing(15)
## Provides space to fill Remarks, Decision, and Actionable Date
self.gridLayoutWidget_5 = QtWidgets.QWidget(self.frame_3)
self.gridLayoutWidget_5.setGeometry(QtCore.QRect(20, 670, 1171, 120))
self.gridLayoutWidget_5.setObjectName("gridLayoutWidget_5")
self.gridLayout_5 = QtWidgets.QGridLayout(self.gridLayoutWidget_5)
self.gridLayout_5.setObjectName("gridLayout_5")
self.label4 = QtWidgets.QLabel()
self.label5 = QtWidgets.QLabel()
self.label6 = QtWidgets.QLabel()
self.label4.setFixedWidth(80)
self.label6.setFixedWidth(120)
self.label6.setWordWrap(True)
self.label5.setFixedWidth(80)
self.label4.setFont(self.font)
self.label5.setFont(self.font)
self.label6.setFont(self.font)
self.text_edit1 = QtWidgets.QTextEdit()
self.text_edit1.setFixedHeight(40)
self.combobox_1 = QtWidgets.QComboBox()
self.combobox_1.addItems(["Approve","Query", "Reject", "Conditional Approval"])
self.Date = QtWidgets.QDateEdit()
self.Date.setFixedHeight(40)
self.text_edit1.setFixedWidth(250)
self.combobox_1.setFixedWidth(150)
self.combobox_1.setFixedHeight(40)
self.Date.setFixedWidth(250)
self.label4.setWordWrap(True)
self.label5.setWordWrap(True)
self.label6.setWordWrap(True)
self.label4.setText("Remarks")
self.label5.setText("Decision")
self.label6.setText("Extension Required Till")
self.gridLayout_5.addWidget(self.label4,0,0)
self.gridLayout_5.addWidget(self.label5,0,2)
self.gridLayout_5.addWidget(self.label6,0,4)
self.gridLayout_5.addWidget(self.text_edit1,0,1)
self.gridLayout_5.addWidget(self.combobox_1,0,3)
self.gridLayout_5.addWidget(self.Date,0,5)
self.lowestdate = QtCore.QDate.currentDate() ## Person has to extend till a date greater than today's date
self.highestdate = QtCore.QDate(2075,1,1) ## This is highest date
self.Date.setDateRange(self.lowestdate,self.highestdate) ## Setting the date range
## Grid to give 2 options to the PM, Project Details and Other Details
self.gridLayoutWidget_8 = QtWidgets.QWidget(self.frame_3)
self.gridLayoutWidget_8.setGeometry(QtCore.QRect(1191, 20, 570, 50))
self.gridLayoutWidget_8.setObjectName("gridLayoutWidget_8")
self.gridLayout_8 = QtWidgets.QGridLayout(self.gridLayoutWidget_8)
self.gridLayout_8.setObjectName("gridLayout_8")
self.projectdetails = QtWidgets.QPushButton()
self.projectdetails.setFont(self.font)
self.projectdetails.setText("Project Details")
self.projectdetails.setStyleSheet("background-color: rgb(255, 191, 0);")
self.projectdetails.setFixedHeight(35)
self.projectdetails.setObjectName("Project Details")
self.gridLayout_8.addWidget(self.projectdetails, 0, 0)
self.otherdetails = QtWidgets.QPushButton()
self.otherdetails.setFont(self.font)
self.otherdetails.setText("Other Details")
self.otherdetails.setStyleSheet("background-color: rgb(255, 191, 0);")
self.otherdetails.setFixedHeight(35)
self.otherdetails.setObjectName("Other Details")
self.gridLayout_8.addWidget(self.otherdetails, 0, 1)
self.projectdetails.clicked.connect(self.showproject)
self.counter = 0 ## No. of times Project Details button has been clicked
self.otherdetails.clicked.connect(self.showother)
self.counter_1 = 0 ## No. of times Other Details button has been clicked
self.gridLayoutWidget_6 = QtWidgets.QWidget(self.frame_3)
self.gridLayoutWidget_6.setObjectName("gridLayoutWidget_6")
self.gridLayout_6 = QtWidgets.QGridLayout(self.gridLayoutWidget_6)
self.gridLayout_6.setObjectName("gridLayout_6")
## Grid to show remarks history button ##
self.gridLayoutWidget_9 = QtWidgets.QWidget(self.frame_3)
self.gridLayoutWidget_9.setGeometry(QtCore.QRect(1300, 370, 371, 51))
self.gridLayoutWidget_9.setObjectName("gridLayoutWidget_9")
self.gridLayout_9 = QtWidgets.QGridLayout(self.gridLayoutWidget_9)
self.gridLayout_9.setObjectName("gridLayout_9")
self.history = QtWidgets.QPushButton(self.gridLayoutWidget_9)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.history.setFont(font)
self.history.setObjectName("history")
self.history.setText("Show Remarks History")
self.history.setStyleSheet("background-color: rgb(255, 191, 0);")
self.history.setFixedHeight(40)
self.history.setFixedWidth(300)
self.history.clicked.connect(self.showhistory)
self.gridLayout_9.addWidget(self.history, 0, 0, 1, 1)
## Previous Comments section ##
self.tabWidget = QtWidgets.QTabWidget(self.frame_3)
self.tabWidget.setGeometry(QtCore.QRect(1200, 450, 541, 450))
self.tabWidget.setFocusPolicy(QtCore.Qt.TabFocus)
self.tabWidget.setIconSize(QtCore.QSize(16, 16))
self.tabWidget.setObjectName("tabWidget")
## Adding 4 Tabs to the Previous Comments section ##
self.tab = QtWidgets.QWidget()
self.tab.setObjectName("tab")
self.tab_2 = QtWidgets.QWidget()
self.tab_2.setObjectName("tab_2")
self.tab_3 = QtWidgets.QWidget()
self.tab_2.setObjectName("tab_3")
self.tab_4 = QtWidgets.QWidget()
self.tab_4.setObjectName("tab_4")
## Assigning Titles to tabs ##
self.tabWidget.addTab(self.tab, "Project Manager")
self.tabWidget.addTab(self.tab_2, "Program Manager")
self.tabWidget.addTab(self.tab_3, "SBU Head")
self.tabWidget.addTab(self.tab_4, "EHC Approver")
## Show the last two transactions for the same Subcon ##
## Transaction1 == Latest Transaction, Transaction2 == Second Last Transaction
## variables with _1 are associated with PGM, _2 are with SBU Head, _3 are with EHC Approver
## We have 4 data points for each Transaction, Date, Decision, Remarks, Recommended Tenure
self.transaction1 = QtWidgets.QLabel(self.tabWidget)
self.transaction1.setGeometry(QtCore.QRect(20, 60, 131, 31))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.transaction1.setFont(font)
self.transaction1.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.transaction1.setObjectName("transaction1")
self.transaction1_date_PM = QtWidgets.QLabel(self.tab)
self.transaction1_date_PM.setGeometry(QtCore.QRect(152, 35, 211, 31))
self.transaction1_date_PM.setObjectName("transaction1_date_PM")
self.transaction1_1 = QtWidgets.QLabel(self.tabWidget)
self.transaction1_1.setGeometry(QtCore.QRect(20, 100, 151, 30))
self.transaction1_1.setWordWrap(True)
self.transaction1_1.setObjectName("transaction1_1")
self.transaction1_2 = QtWidgets.QLabel(self.tabWidget)
self.transaction1_2.setGeometry(QtCore.QRect(20, 150, 151, 30))
self.transaction1_2.setWordWrap(True)
self.transaction1_2.setObjectName("transaction1_2")
self.transaction1_3 = QtWidgets.QLabel(self.tabWidget)
self.transaction1_3.setGeometry(QtCore.QRect(20, 190, 151, 30))
self.transaction1_3.setWordWrap(True)
self.transaction1_3.setObjectName("transaction1_3")
self.transaction1_decision_PM = QtWidgets.QTextEdit(self.tab)
self.transaction1_decision_PM.setGeometry(QtCore.QRect(180, 76, 321, 30))
self.transaction1_decision_PM.setReadOnly(True)
self.transaction1_decision_PM.setObjectName("transaction1_decision_PM")
self.transaction1_remarks_PM = QtWidgets.QTextEdit(self.tab)
self.transaction1_remarks_PM.setGeometry(QtCore.QRect(180, 120, 321, 30))
self.transaction1_remarks_PM.setReadOnly(True)
self.transaction1_remarks_PM.setObjectName("transaction1_remarks_PM")
self.transaction1_recomendtenure_PM = QtWidgets.QTextEdit(self.tab)
self.transaction1_recomendtenure_PM.setGeometry(QtCore.QRect(180, 160, 321, 30))
self.transaction1_recomendtenure_PM.setReadOnly(True)
self.transaction1_recomendtenure_PM.setObjectName("transaction1_recomendtenure_PM")
self.transaction1_decision_PGM = QtWidgets.QTextEdit(self.tab_2)
self.transaction1_decision_PGM.setGeometry(QtCore.QRect(180, 76, 321, 30))
self.transaction1_decision_PGM.setReadOnly(True)
self.transaction1_decision_PGM.setObjectName("transaction1_decision_PGM")
self.transaction1_remarks_PGM = QtWidgets.QTextEdit(self.tab_2)
self.transaction1_remarks_PGM.setGeometry(QtCore.QRect(180, 120, 321, 30))
self.transaction1_remarks_PGM.setReadOnly(True)
self.transaction1_remarks_PGM.setObjectName("transaction1_remarks_PGM")
self.transaction1_recomendtenure_PGM = QtWidgets.QTextEdit(self.tab_2)
self.transaction1_recomendtenure_PGM.setGeometry(QtCore.QRect(180, 160, 321, 30))
self.transaction1_recomendtenure_PGM.setReadOnly(True)
self.transaction1_recomendtenure_PGM.setObjectName("transaction1_recomendtenure_PGM")
self.transaction1_decision_SBU = QtWidgets.QTextEdit(self.tab_3)
self.transaction1_decision_SBU.setGeometry(QtCore.QRect(180, 76, 321, 30))
self.transaction1_decision_SBU.setReadOnly(True)
self.transaction1_decision_SBU.setObjectName("transaction1_decision_SBU")
self.transaction1_remarks_SBU = QtWidgets.QTextEdit(self.tab_3)
self.transaction1_remarks_SBU.setGeometry(QtCore.QRect(180, 120, 321, 30))
self.transaction1_remarks_SBU.setReadOnly(True)
self.transaction1_remarks_SBU.setObjectName("transaction1_remarks_SBU")
self.transaction1_recomendtenure_SBU = QtWidgets.QTextEdit(self.tab_3)
self.transaction1_recomendtenure_SBU.setGeometry(QtCore.QRect(180, 160, 321, 30))
self.transaction1_recomendtenure_SBU.setReadOnly(True)
self.transaction1_recomendtenure_SBU.setObjectName("transaction1_recomendtenure_SBU")
self.transaction1_decision_EHC = QtWidgets.QTextEdit(self.tab_4)
self.transaction1_decision_EHC.setGeometry(QtCore.QRect(180, 76, 321, 30))
self.transaction1_decision_EHC.setReadOnly(True)
self.transaction1_decision_EHC.setObjectName("transaction1_decision_EHC")
self.transaction1_remarks_EHC = QtWidgets.QTextEdit(self.tab_4)
self.transaction1_remarks_EHC.setGeometry(QtCore.QRect(180, 120, 321, 30))
self.transaction1_remarks_EHC.setReadOnly(True)
self.transaction1_remarks_EHC.setObjectName("transaction1_remarks_EHC")
self.transaction1_recomendtenure_EHC = QtWidgets.QTextEdit(self.tab_4)
self.transaction1_recomendtenure_EHC.setGeometry(QtCore.QRect(180, 160, 321, 30))
self.transaction1_recomendtenure_EHC.setReadOnly(True)
self.transaction1_recomendtenure_EHC.setObjectName("transaction1_recomendtenure_EHC")
self.transaction2 = QtWidgets.QLabel(self.tabWidget)
self.transaction2.setGeometry(QtCore.QRect(20, 245, 181, 31))
self.transaction2.setFont(font)
self.transaction2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.transaction2.setWordWrap(True)
self.transaction2.setObjectName("transaction2")
self.transaction2_1 = QtWidgets.QLabel(self.tabWidget)
self.transaction2_1.setGeometry(QtCore.QRect(20, 290, 151, 30))
self.transaction2_1.setWordWrap(True)
self.transaction2_1.setObjectName("transaction2_1")
self.transaction2_2 = QtWidgets.QLabel(self.tabWidget)
self.transaction2_2.setGeometry(QtCore.QRect(20, 340, 151, 30))
self.transaction2_2.setWordWrap(True)
self.transaction2_2.setObjectName("transaction2_2")
self.transaction2_3 = QtWidgets.QLabel(self.tabWidget)
self.transaction2_3.setGeometry(QtCore.QRect(20, 380, 151, 30))
self.transaction2_3.setWordWrap(True)
self.transaction2_3.setObjectName("transaction2_3")
self.transaction2_decision_PM = QtWidgets.QTextEdit(self.tab)
self.transaction2_decision_PM.setGeometry(QtCore.QRect(180, 270, 321, 30))
self.transaction2_decision_PM.setReadOnly(True)
self.transaction2_decision_PM.setObjectName("transaction2_decision_PM")
self.transaction2_remarks_PM = QtWidgets.QTextEdit(self.tab)
self.transaction2_remarks_PM.setGeometry(QtCore.QRect(180, 310, 321, 30))
self.transaction2_remarks_PM.setReadOnly(True)
self.transaction2_remarks_PM.setObjectName("transaction2_remarks_PM")
self.transaction2_recomendtenure_PM = QtWidgets.QTextEdit(self.tab)
self.transaction2_recomendtenure_PM.setGeometry(QtCore.QRect(180, 350, 321, 30))
self.transaction2_recomendtenure_PM.setReadOnly(True)
self.transaction2_recomendtenure_PM.setObjectName("transaction2_recomendtenure_PM")
self.transaction2_decision_PGM = QtWidgets.QTextEdit(self.tab_2)
self.transaction2_decision_PGM.setGeometry(QtCore.QRect(180, 270, 321, 30))
self.transaction2_decision_PGM.setReadOnly(True)
self.transaction2_decision_PGM.setObjectName("transaction1_decision_PGM")
self.transaction2_remarks_PGM = QtWidgets.QTextEdit(self.tab_2)
self.transaction2_remarks_PGM.setGeometry(QtCore.QRect(180, 310, 321, 30))
self.transaction2_remarks_PGM.setReadOnly(True)
self.transaction2_remarks_PGM.setObjectName("transaction1_remarks_PGM")
self.transaction2_recomendtenure_PGM = QtWidgets.QTextEdit(self.tab_2)
self.transaction2_recomendtenure_PGM.setGeometry(QtCore.QRect(180, 350, 321, 30))
self.transaction2_recomendtenure_PGM.setReadOnly(True)
self.transaction2_recomendtenure_PGM.setObjectName("transaction1_recomendtenure_PGM")
self.transaction2_decision_SBU = QtWidgets.QTextEdit(self.tab_3)
self.transaction2_decision_SBU.setGeometry(QtCore.QRect(180, 270, 321, 30))
self.transaction2_decision_SBU.setReadOnly(True)
self.transaction2_decision_SBU.setObjectName("transaction1_decision_SBU")
self.transaction2_remarks_SBU = QtWidgets.QTextEdit(self.tab_3)
self.transaction2_remarks_SBU.setGeometry(QtCore.QRect(180, 310, 321, 30))
self.transaction2_remarks_SBU.setReadOnly(True)
self.transaction2_remarks_SBU.setObjectName("transaction1_remarks_SBU")
self.transaction2_recomendtenure_SBU = QtWidgets.QTextEdit(self.tab_3)
self.transaction2_recomendtenure_SBU.setGeometry(QtCore.QRect(180, 350, 321, 30))
self.transaction2_recomendtenure_SBU.setReadOnly(True)
self.transaction2_recomendtenure_SBU.setObjectName("transaction1_recomendtenure_SBU")
self.transaction2_decision_EHC = QtWidgets.QTextEdit(self.tab_4)
self.transaction2_decision_EHC.setGeometry(QtCore.QRect(180, 270, 321, 30))
self.transaction2_decision_EHC.setReadOnly(True)
self.transaction2_decision_EHC.setObjectName("transaction1_decision_EHC")
self.transaction2_remarks_EHC = QtWidgets.QTextEdit(self.tab_4)
self.transaction2_remarks_EHC.setGeometry(QtCore.QRect(180, 310, 321, 30))
self.transaction2_remarks_EHC.setReadOnly(True)
self.transaction2_remarks_EHC.setObjectName("transaction1_remarks_EHC")
self.transaction2_recomendtenure_EHC = QtWidgets.QTextEdit(self.tab_4)
self.transaction2_recomendtenure_EHC.setGeometry(QtCore.QRect(180, 350, 321, 30))
self.transaction2_recomendtenure_EHC.setReadOnly(True)
self.transaction2_recomendtenure_EHC.setObjectName("transaction1_recomendtenure_EHC")
self.transaction1_date_PGM = QtWidgets.QLabel(self.tab_2)
self.transaction1_date_PGM.setGeometry(QtCore.QRect(152, 30, 211, 31))
self.transaction1_date_PGM.setObjectName("transaction1_date_PGM")
self.transaction1_date_SBU = QtWidgets.QLabel(self.tab_3)
self.transaction1_date_SBU.setGeometry(QtCore.QRect(152, 30, 211, 31))
self.transaction1_date_SBU.setObjectName("transaction1_date_SBU")
self.transaction1_date_EHC = QtWidgets.QLabel(self.tab_4)
self.transaction1_date_EHC.setGeometry(QtCore.QRect(152, 30, 211, 31))
self.transaction1_date_EHC.setObjectName("transaction1_date_EHC")
self.transaction2_date_PM = QtWidgets.QLabel(self.tab)
self.transaction2_date_PM.setGeometry(QtCore.QRect(210, 215, 211, 31))
self.transaction2_date_PM.setObjectName("transaction2_date_PM")
self.transaction2_date_PGM = QtWidgets.QLabel(self.tab_2)
self.transaction2_date_PGM.setGeometry(QtCore.QRect(210, 215, 211, 31))
self.transaction2_date_PGM.setObjectName("transaction2_date_PGM")
self.transaction2_date_SBU = QtWidgets.QLabel(self.tab_3)
self.transaction2_date_SBU.setGeometry(QtCore.QRect(210, 215, 211, 31))
self.transaction2_date_SBU.setObjectName("transaction2_date_SBU")
self.transaction2_date_EHC = QtWidgets.QLabel(self.tab_4)
self.transaction2_date_EHC.setGeometry(QtCore.QRect(210, 215, 211, 31))
self.transaction2_date_EHC.setObjectName("transaction2_date_EHC")
self.transaction1_1.setFont(font)
self.transaction1_2.setFont(font)
self.transaction1_3.setFont(font)
self.transaction2_1.setFont(font)
self.transaction2_2.setFont(font)
self.transaction2_3.setFont(font)
self.transaction1.setText("Last Transaction:")
self.transaction1_1.setText("Decision")
self.transaction1_2.setText("Remarks")
self.transaction1_3.setText("Recommended Tenure")
self.transaction2.setText("Second Last Transaction:")
self.transaction2_1.setText("Decision")
self.transaction2_2.setText("Remarks")
self.transaction2_3.setText("Recommended Tenure")
self.tabWidget.setCurrentIndex(0)
self.submit = QtWidgets.QPushButton(self.frame_3)
self.submit.setObjectName("submit")
self.submit.setText("Submit")
self.submit.setStyleSheet("background-color: rgb(255, 191, 0);")
self.submit.setFixedHeight(40)
self.submit.setFixedWidth(200)
self.submit.setGeometry(QtCore.QRect(20, 895, 150, 40))
self.goback_2 = QtWidgets.QPushButton(self.frame_3)
self.goback_2.setObjectName("goback_2")
self.goback_2.setText("Go Back")
self.goback_2.setStyleSheet("background-color: rgb(255, 191, 0);")
self.goback_2.setFixedHeight(40)
self.goback_2.setFixedWidth(200)
self.goback_2.setGeometry(QtCore.QRect(250, 895, 150, 40))
self.goback_2.clicked.connect(self.GoBack_2)
self.stackedWidget.addWidget(self.page_2)
MainWindow.setCentralWidget(self.centralwidget)
## Menubar ##
self.menubar = QtWidgets.QMenuBar(self.centralwidget)
self.menubar.setStyleSheet("QMenuBar{background-color: rgb(0,0,0); color: #e0e0e0; font-size: 20px;} QMenuBar::item:selected{background-color: #e0e0e0; color: #2e2e2e; font-size: 20px;} QMenu{background-color: rgb(0,0,0); color: rgb(255,255,255); font-size: 18px; font-weight: 150} QMenu::item:selected{background-color: #e0e0e0; color: #2e2e2e; font-size: 18px;}") ## Properties of Menubar
self.menubar.setGeometry(QtCore.QRect(0, 0, 1920, 32))
self.homescreen = QtWidgets.QAction("Home", self.menubar) ## Home Button on Menubar
self.font_1 = QtGui.QFont()
self.font_1.setBold(True)
self.font_1.setWeight(30)
self.menubar.addAction(self.homescreen)
self.modules_menu = self.menubar.addMenu("Modules") ## Modules menu
self.modules_menu.setFont(self.font_1)
self.accessdashboard = QtWidgets.QAction("Dashboard", self.menubar) ## Dashboard Menu
self.menubar.addAction(self.accessdashboard)
## Sub-menus under Modules Menu
self.hiring = QtWidgets.QAction("Subcon Hiring Request", self.menubar)
self.renewal = QtWidgets.QAction("Subcon Renewal", self.menubar)
self.allocation = QtWidgets.QAction("Subcon Allocation Update", self.menubar)
self.performance = QtWidgets.QAction("Subcon Performance Evaluation", self.menubar)
self.portfolio = QtWidgets.QAction("Subcon Portfolio", self.menubar)
self.timesheet = QtWidgets.QAction("Timesheet and Expenses", self.menubar)
self.vendor = QtWidgets.QAction("Vendor Management", self.menubar)
self.modules_menu.addAction(self.hiring)
self.modules_menu.addAction(self.renewal)
self.modules_menu.addAction(self.allocation)
self.modules_menu.addAction(self.performance)
self.modules_menu.addAction(self.portfolio)
self.modules_menu.addAction(self.timesheet)
self.modules_menu.addAction(self.vendor)
self.stackedWidget.setCurrentIndex(0)
self.tableWidget1.cellClicked.connect(self.ShowFPLess)
self.tableWidget2.cellClicked.connect(self.ShowTMLess)
self.tableWidget3.cellClicked.connect(self.ShowTotalLess)
self.tableWidget4.cellClicked.connect(self.ShowFPMore)
self.tableWidget5.cellClicked.connect(self.ShowTMMore)
self.tableWidget6.cellClicked.connect(self.ShowTotalMore)
self.table.cellClicked.connect(self.TakeAction)
self.submit.clicked.connect(self.Insert1)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def GoBack_2(self): ## Go to Page 2 without taking any action
self.transaction2_decision_PM.setText("None")
self.transaction2_remarks_PM.setText("None")
self.transaction2_recomendtenure_PM.setText("None")
self.transaction2_decision_PGM.setText("None")
self.transaction2_remarks_PGM.setText("None")
self.transaction2_recomendtenure_PGM.setText("None")
self.transaction2_decision_SBU.setText("None")
self.transaction2_remarks_SBU.setText("None")
self.transaction2_recomendtenure_SBU.setText("None")
self.transaction2_decision_EHC.setText("None")
self.transaction2_remarks_EHC.setText("None")
self.transaction2_recomendtenure_EHC.setText("None")
self.transaction1_decision_PM.setText("None")
self.transaction1_remarks_PM.setText("None")
self.transaction1_recomendtenure_PM.setText("None")
self.transaction1_decision_PGM.setText("None")
self.transaction1_remarks_PGM.setText("None")
self.transaction1_recomendtenure_PGM.setText("None")
self.transaction1_decision_SBU.setText("None")
self.transaction1_remarks_SBU.setText("None")
self.transaction1_recomendtenure_SBU.setText("None")
self.transaction1_decision_EHC.setText("None")
self.transaction1_remarks_EHC.setText("None")
self.transaction1_recomendtenure_EHC.setText("None")
self.stackedWidget.setCurrentIndex(1)
def showhistory(self):
connection = sqlite3.connect('EY')
cur = connection.cursor()
cur.execute('select count(*) from Decisions where Subcon_ID = ? order by Transaction_Date Desc LIMIT 2', (self.ID,))
transactions, = cur.fetchone() ## Calculate the number of previous transactions
if transactions == 0: ## If zero, then put all values as none
self.transaction2_decision_PM.setText("None")
self.transaction2_remarks_PM.setText("None")
self.transaction2_recomendtenure_PM.setText("None")
self.transaction2_decision_PGM.setText("None")
self.transaction2_remarks_PGM.setText("None")
self.transaction2_recomendtenure_PGM.setText("None")
self.transaction2_decision_SBU.setText("None")
self.transaction2_remarks_SBU.setText("None")
self.transaction2_recomendtenure_SBU.setText("None")
self.transaction2_decision_EHC.setText("None")
self.transaction2_remarks_EHC.setText("None")
self.transaction2_recomendtenure_EHC.setText("None")
self.transaction1_decision_PM.setText("None")
self.transaction1_remarks_PM.setText("None")
self.transaction1_recomendtenure_PM.setText("None")
self.transaction1_decision_PGM.setText("None")
self.transaction1_remarks_PGM.setText("None")
self.transaction1_recomendtenure_PGM.setText("None")
self.transaction1_decision_SBU.setText("None")
self.transaction1_remarks_SBU.setText("None")
self.transaction1_recomendtenure_SBU.setText("None")
self.transaction1_decision_EHC.setText("None")
self.transaction1_remarks_EHC.setText("None")
self.transaction1_recomendtenure_EHC.setText("None")
elif transactions == 1: ## If 1 transaction is present, then initialise the second transaction values as None
self.transaction2_decision_PM.setText("None")
self.transaction2_remarks_PM.setText("None")
self.transaction2_recomendtenure_PM.setText("None")
self.transaction2_decision_PGM.setText("None")
self.transaction2_remarks_PGM.setText("None")
self.transaction2_recomendtenure_PGM.setText("None")
self.transaction2_decision_SBU.setText("None")
self.transaction2_remarks_SBU.setText("None")
self.transaction2_recomendtenure_SBU.setText("None")
self.transaction2_decision_EHC.setText("None")
self.transaction2_remarks_EHC.setText("None")
self.transaction2_recomendtenure_EHC.setText("None")
results = cur.execute('select * from Decisions where Subcon_ID = ? order by Transaction_Date Desc LIMIT 2', (self.ID,)) ## Query the last two transactions with details
i = 0
## The query has a max of 2 transactions, and the results are in descending order of Transaction Date.
for row in results:
if i == 0: ## If it is the latest Transaction, check for PM Decision and add values to Tab-1 accordingly
if str(row[3]) == "Extend":
self.transaction1_decision_PM.setText(str(row[3]))
self.transaction1_remarks_PM.setText(str(row[4]))
self.transaction1_recomendtenure_PM.setText(str(row[5]))
elif str(row[3]) == "Release":
self.transaction1_decision_PM.setText(str(row[3]))
self.transaction1_remarks_PM.setText("None")
self.transaction1_recomendtenure_PM.setText("None")
elif str(row[3]) == "Early":
self.transaction1_decision_PM.setText(str(row[3]))
self.transaction1_remarks_PM.setText(str(row[7]))
self.transaction1_recomendtenure_PM.setText(str(row[8]))
else:
self.transaction1_decision_PM.setText(str(row[3]))
self.transaction1_remarks_PM.setText(str(row[10]))
self.transaction1_recomendtenure_PM.setText(str(row[11]))
## Add values to other tabs for the latest transaction
self.transaction1_decision_PGM.setText(str(row[13]))
self.transaction1_remarks_PGM.setText(str(row[14]))
self.transaction1_recomendtenure_PGM.setText(str(row[15]))
self.transaction1_decision_SBU.setText(str(row[16]))
self.transaction1_remarks_SBU.setText(str(row[17]))
self.transaction1_recomendtenure_SBU.setText(str(row[18]))
self.transaction1_decision_EHC.setText(str(row[19]))
self.transaction1_remarks_EHC.setText(str(row[20]))
self.transaction1_recomendtenure_EHC.setText(str(row[21]))
self.transaction1_date_PM.setText(str(row[1]))
self.transaction1_date_PGM.setText(str(row[24]))
self.transaction1_date_SBU.setText(str(row[25]))
self.transaction1_date_EHC.setText(str(row[26]))
else: ## If it is the second last transaction, check for PM Decision and add values to Tab-1 accordingly
if str(row[3]) == "Extend":
self.transaction1_decision_PM.setText(str(row[3]))
self.transaction1_remarks_PM.setText(str(row[4]))
self.transaction1_recomendtenure_PM.setText(str(row[5]))
elif str(row[3]) == "Release":
self.transaction1_decision_PM.setText(str(row[3]))
self.transaction1_remarks_PM.setText("None")
self.transaction1_recomendtenure_PM.setText("None")
elif str(row[3]) == "Early":
self.transaction1_decision_PM.setText(str(row[3]))
self.transaction1_remarks_PM.setText(str(row[7]))
self.transaction1_recomendtenure_PM.setText(str(row[8]))
else:
self.transaction1_decision_PM.setText(str(row[3]))
self.transaction1_remarks_PM.setText(str(row[10]))
self.transaction1_recomendtenure_PM.setText(str(row[11]))
## Add values to other tabs for the second latest transaction
self.transaction2_decision_PGM.setText(str(row[13]))
self.transaction2_remarks_PGM.setText(str(row[14]))
self.transaction2_recomendtenure_PGM.setText(str(row[15]))
self.transaction2_decision_SBU.setText(str(row[16]))
self.transaction2_remarks_SBU.setText(str(row[17]))
self.transaction2_recomendtenure_SBU.setText(str(row[18]))
self.transaction2_decision_EHC.setText(str(row[19]))
self.transaction2_remarks_EHC.setText(str(row[20]))
self.transaction2_recomendtenure_EHC.setText(str(row[21]))
self.transaction2_date_PM.setText(str(row[1]))
self.transaction2_date_PGM.setText(str(row[24]))
self.transaction2_date_SBU.setText(str(row[25]))