lakshmikarpolam commited on
Commit
fc6f62e
1 Parent(s): 89c94c6
Files changed (1) hide show
  1. app.py +150 -0
app.py ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import datetime
3
+
4
+
5
+ def main():
6
+
7
+ # Creating the Contract Creation Workflow Screen
8
+ st.title("1 - Contract Creation Workflow")
9
+
10
+ # Contract Details Section
11
+ st.header("Contract Details")
12
+ contract_type = st.selectbox("Contract Type", ["","Type 1", "Type 2", "Type 3"])
13
+ start_date = st.date_input("Start Date", datetime.date.today())
14
+ end_date = st.date_input("End Date", datetime.date.today())
15
+ parties_involved = st.text_input("Parties Involved", help="Separate multiple parties with commas")
16
+
17
+ # Rich Text Editor for Contract Terms and Conditions
18
+ st.header("Contract Terms and Conditions")
19
+ contract_terms = st.text_area("Terms and Conditions")
20
+
21
+ # Supporting Documents Section
22
+ st.header("Supporting Documents")
23
+ uploaded_files = st.file_uploader("Attach Supporting Documents", accept_multiple_files=True)
24
+
25
+ # Displaying Contract Details
26
+ st.header("Contract Details Summary")
27
+ st.write(f"Contract Number:")
28
+ st.write(f"Contract Type: {contract_type}")
29
+ st.write(f"Start Date: {start_date}")
30
+ st.write(f"End Date: {end_date}")
31
+ st.write(f"Parties Involved: {parties_involved}")
32
+
33
+ # Displaying Contract Terms and Conditions
34
+ st.header("Contract Terms and Conditions Summary")
35
+ st.write(contract_terms)
36
+
37
+ # Displaying Attached Supporting Documents
38
+ if uploaded_files:
39
+ st.header("Attached Documents")
40
+ for file in uploaded_files:
41
+ st.write(file.name)
42
+
43
+
44
+
45
+ # Contract Approval Screen
46
+ st.title("2 - Contract Approval")
47
+ user_role = st.radio("User Role", ("Contract Approver", "Manager"))
48
+ contract_details = {
49
+ "Contract Type": contract_type,
50
+ "Start Date": start_date,
51
+ "End Date": end_date,
52
+ "Parties Involved": parties_involved,
53
+ }
54
+
55
+ st.header("Contract Details")
56
+ for key, value in contract_details.items():
57
+ st.write(f"{key}: {value}")
58
+
59
+ # Highlight pending approvals with color coding
60
+ if user_role == "Contract Approver":
61
+ st.error("Pending Approval: Contract Approver action required!")
62
+ elif user_role == "Manager":
63
+ st.warning("Pending Approval: Manager action required!")
64
+
65
+ # Comments Section
66
+ st.header("Comments Section")
67
+ comments = st.text_area("Comments")
68
+
69
+
70
+ # Screen for searching and retrieving contracts
71
+ st.title("3 - Contract Search and Retrieval")
72
+
73
+ # Search Criteria Fields
74
+ st.header("Search Criteria")
75
+ contract_number = st.text_input("Contract Number (Exact Match)")
76
+ vendor = st.text_input("Vendor", help="Enter vendor name or id")
77
+ contract_status = st.selectbox("Contract Status", ["","Approved", "Approval in process", "On hold"])
78
+ start_date_range = st.date_input("Start Date Range", help="Select the start date")
79
+ end_date_range = st.date_input("End Date Range", help="Select the end date")
80
+
81
+ # Export Options for Search Results
82
+ st.header("Export Options")
83
+ export_format = st.selectbox("Export Format", ["CSV", "PDF"])
84
+
85
+ # Simulated Search Results
86
+ st.header("Search Results")
87
+ # ... (Add simulated search results here)
88
+
89
+ # Exporting Search Results
90
+ if st.button("Export Results"):
91
+ if export_format == "CSV":
92
+ # ... (Add CSV export functionality here)
93
+ st.write("Exporting to CSV...")
94
+ elif export_format == "PDF":
95
+ # ... (Add PDF export functionality here)
96
+ st.write("Exporting to PDF...")
97
+
98
+ # Contract Amendment Workflow
99
+ st.title("4 - Contract Amendment Workflow")
100
+
101
+ # Trigger Condition - Change in Contract Scope
102
+ st.header("Trigger")
103
+ change_in_scope = st.checkbox("Change in Contract Scope")
104
+
105
+ # Display fields if change_in_scope is True
106
+ if change_in_scope:
107
+ # Fields for Describing Proposed Amendments
108
+ st.header("Proposed Amendments")
109
+ description = st.text_area("Description", "Enter the description of the proposed amendments here.")
110
+ reason = st.text_area("Reason", "Enter the reason for the proposed amendments here.")
111
+
112
+ # Approval Process for Amendments
113
+ st.header("Amendment Approval Process")
114
+ amendment_roles = ["Amendment Initiator", "Contract Approver", "Manager"]
115
+ current_role_index = amendment_roles.index(st.selectbox("Current Role", amendment_roles))
116
+ st.write(f"Current Role: {amendment_roles[current_role_index]}")
117
+
118
+ # Version Control to Track Changes
119
+ st.header("Version Control")
120
+ st.write("Implement version control to track changes during the approval process.")
121
+
122
+
123
+ # Contract renewal management
124
+ st.title("5 - Contract Renewal Management")
125
+
126
+ # Renewal Triggers - Time-based Alerts
127
+ st.header("Renewal Triggers")
128
+ days_before_expiration = st.slider("Days Before Expiration", min_value=0, max_value=365, step=1, value=30)
129
+
130
+ # Dashboard for Contracts Approaching Expiration
131
+ st.header("Contracts Approaching Expiration")
132
+ # Simulated display of contracts approaching expiration
133
+ contracts = [
134
+ {"Contract Type": "Type 1", "Parties Involved": "Party 1, Party 2", "Renewal Status": "Pending"},
135
+ {"Contract Type": "Type 2", "Parties Involved": "Party 3, Party 4", "Renewal Status": "Negotiation"},
136
+ ]
137
+ for i, contract in enumerate(contracts):
138
+ st.write(f"Contract Type: {contract['Contract Type']}")
139
+ st.write(f"Parties Involved: {contract['Parties Involved']}")
140
+ st.write(f"Renewal Status: {contract['Renewal Status']}")
141
+ st.button(f"Renew_{i}")
142
+
143
+ # Tracking Renewal History
144
+ st.header("Renewal History")
145
+ st.write("Track renewal history and view details for each contract renewal.")
146
+ st.button("View History")
147
+
148
+
149
+ if __name__ == "__main__":
150
+ main()