|
import streamlit as st |
|
import datetime |
|
|
|
|
|
def main(): |
|
|
|
|
|
st.title("1 - Contract Creation Workflow") |
|
|
|
|
|
st.header("Contract Details") |
|
contract_type = st.selectbox("Contract Type", ["","Type 1", "Type 2", "Type 3"]) |
|
start_date = st.date_input("Start Date", datetime.date.today()) |
|
end_date = st.date_input("End Date", datetime.date.today()) |
|
parties_involved = st.text_input("Parties Involved", help="Separate multiple parties with commas") |
|
|
|
|
|
st.header("Contract Terms and Conditions") |
|
contract_terms = st.text_area("Terms and Conditions") |
|
|
|
|
|
st.header("Supporting Documents") |
|
uploaded_files = st.file_uploader("Attach Supporting Documents", accept_multiple_files=True) |
|
|
|
|
|
st.header("Contract Details Summary") |
|
st.write(f"Contract Number:") |
|
st.write(f"Contract Type: {contract_type}") |
|
st.write(f"Start Date: {start_date}") |
|
st.write(f"End Date: {end_date}") |
|
st.write(f"Parties Involved: {parties_involved}") |
|
|
|
|
|
st.header("Contract Terms and Conditions Summary") |
|
st.write(contract_terms) |
|
|
|
|
|
if uploaded_files: |
|
st.header("Attached Documents") |
|
for file in uploaded_files: |
|
st.write(file.name) |
|
|
|
|
|
|
|
|
|
st.title("2 - Contract Approval") |
|
user_role = st.radio("User Role", ("Contract Approver", "Manager")) |
|
contract_details = { |
|
"Contract Type": contract_type, |
|
"Start Date": start_date, |
|
"End Date": end_date, |
|
"Parties Involved": parties_involved, |
|
} |
|
|
|
st.header("Contract Details") |
|
for key, value in contract_details.items(): |
|
st.write(f"{key}: {value}") |
|
|
|
|
|
if user_role == "Contract Approver": |
|
st.error("Pending Approval: Contract Approver action required!") |
|
elif user_role == "Manager": |
|
st.warning("Pending Approval: Manager action required!") |
|
|
|
|
|
st.header("Comments Section") |
|
comments = st.text_area("Comments") |
|
|
|
|
|
|
|
st.title("3 - Contract Search and Retrieval") |
|
|
|
|
|
st.header("Search Criteria") |
|
contract_number = st.text_input("Contract Number (Exact Match)") |
|
vendor = st.text_input("Vendor", help="Enter vendor name or id") |
|
contract_status = st.selectbox("Contract Status", ["","Approved", "Approval in process", "On hold"]) |
|
start_date_range = st.date_input("Start Date Range", help="Select the start date") |
|
end_date_range = st.date_input("End Date Range", help="Select the end date") |
|
|
|
|
|
st.header("Export Options") |
|
export_format = st.selectbox("Export Format", ["CSV", "PDF"]) |
|
|
|
|
|
st.header("Search Results") |
|
|
|
|
|
|
|
if st.button("Export Results"): |
|
if export_format == "CSV": |
|
|
|
st.write("Exporting to CSV...") |
|
elif export_format == "PDF": |
|
|
|
st.write("Exporting to PDF...") |
|
|
|
|
|
st.title("4 - Contract Amendment Workflow") |
|
|
|
|
|
st.header("Trigger") |
|
change_in_scope = st.checkbox("Change in Contract Scope") |
|
|
|
|
|
if change_in_scope: |
|
|
|
st.header("Proposed Amendments") |
|
description = st.text_area("Description", "Enter the description of the proposed amendments here.") |
|
reason = st.text_area("Reason", "Enter the reason for the proposed amendments here.") |
|
|
|
|
|
st.header("Amendment Approval Process") |
|
amendment_roles = ["Amendment Initiator", "Contract Approver", "Manager"] |
|
current_role_index = amendment_roles.index(st.selectbox("Current Role", amendment_roles)) |
|
st.write(f"Current Role: {amendment_roles[current_role_index]}") |
|
|
|
|
|
st.header("Version Control") |
|
st.write("Implement version control to track changes during the approval process.") |
|
|
|
|
|
|
|
st.title("5 - Contract Renewal Management") |
|
|
|
|
|
st.header("Renewal Triggers") |
|
days_before_expiration = st.slider("Days Before Expiration", min_value=0, max_value=365, step=1, value=30) |
|
|
|
|
|
st.header("Contracts Approaching Expiration") |
|
|
|
contracts = [ |
|
{"Contract Type": "Type 1", "Parties Involved": "Party 1, Party 2", "Renewal Status": "Pending"}, |
|
{"Contract Type": "Type 2", "Parties Involved": "Party 3, Party 4", "Renewal Status": "Negotiation"}, |
|
] |
|
for i, contract in enumerate(contracts): |
|
st.write(f"Contract Type: {contract['Contract Type']}") |
|
st.write(f"Parties Involved: {contract['Parties Involved']}") |
|
st.write(f"Renewal Status: {contract['Renewal Status']}") |
|
st.button(f"Renew_{i}") |
|
|
|
|
|
st.header("Renewal History") |
|
st.write("Track renewal history and view details for each contract renewal.") |
|
st.button("View History") |
|
|
|
|
|
if __name__ == "__main__": |
|
main() |
|
|