Update pages/1_Water_Tank.py
Browse files- pages/1_Water_Tank.py +12 -8
pages/1_Water_Tank.py
CHANGED
|
@@ -15,9 +15,9 @@ if not st.session_state.get("authenticated", False):
|
|
| 15 |
st.stop()
|
| 16 |
|
| 17 |
TPL_COVER = "Cover_Template.docx"
|
| 18 |
-
TPL_INSPECTION = "
|
| 19 |
TPL_WARRANTY = "Warranty_Template.docx"
|
| 20 |
-
TPL_JOB = "Job_Completion_Template.docx"
|
| 21 |
STATIC_DM_CERT = "DM_Certificate.pdf"
|
| 22 |
STATIC_MSDS = "MSDS.pdf"
|
| 23 |
|
|
@@ -39,7 +39,7 @@ def photo_grid_to_pdf_bytes(page_photos, page_num, total_pages, client_name, dat
|
|
| 39 |
draw = ImageDraw.Draw(canvas)
|
| 40 |
font_header, font_footer, font_caption, font_wm = load_font(28), load_font(20), load_font(22), load_font(24)
|
| 41 |
|
| 42 |
-
draw.rectangle([(0, 0), (PAGE_W, HEADER_H)], fill=(0, 84, 166))
|
| 43 |
draw.text((PADDING, 18), f"Photo Documentation β {client_name} | {date_str}", font=font_header, fill=(255, 255, 255))
|
| 44 |
|
| 45 |
caption_h = 35
|
|
@@ -74,8 +74,9 @@ def photo_grid_to_pdf_bytes(page_photos, page_num, total_pages, client_name, dat
|
|
| 74 |
|
| 75 |
# ββ 3. UI: SIDEBAR ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 76 |
with st.sidebar:
|
| 77 |
-
st.image("
|
| 78 |
-
st.
|
|
|
|
| 79 |
client_name = st.text_input("π’ Client Name*", placeholder="e.g. Al Noor Properties")
|
| 80 |
authorized_person = st.text_input("π€ Authorized Person*", placeholder="e.g. Afzal Rahman")
|
| 81 |
client_email = st.text_input("π§ Client Email*", placeholder="e.g. info@client.com")
|
|
@@ -99,9 +100,10 @@ with st.sidebar:
|
|
| 99 |
handwritten_files = st.file_uploader("Upload physical reports (PDFs only)*", type=["pdf", "PDF"], accept_multiple_files=True)
|
| 100 |
|
| 101 |
# ββ 4. UI: TANK ENGINEERING DATA ββββββββββββββββββββββββββββββββββββββββββββββ
|
| 102 |
-
st.header("
|
|
|
|
| 103 |
|
| 104 |
-
# Dictionary of default states based on
|
| 105 |
default_tank = {
|
| 106 |
"name": "Roof Tank 1", "capacity": 10000, "ph": 6.7, "tds": 110, "chemical": "HygienX Water Tank Cleaner",
|
| 107 |
"type": "GRP Panel", "pipe": "UPVC", "drain": True, "lid": True, "valves": True, "pumps": True,
|
|
@@ -232,7 +234,9 @@ if st.button("π Generate Master Report", type="primary", use_container_width=
|
|
| 232 |
|
| 233 |
tank_context.update({
|
| 234 |
"tank_name": t["name"], "capacity_usg": t["capacity"], "chemical": t["chemical"],
|
| 235 |
-
"tank_type": t["type"], "pipe_type": t["pipe"],
|
|
|
|
|
|
|
| 236 |
"drain": yes_no(t["drain"]), "lid": yes_no(t["lid"]), "damage": yes_no(t["damage"]),
|
| 237 |
"leaks": yes_no(t["leaks"]), "vent_present": yes_no_title(t["vent_present"]),
|
| 238 |
"vent_installed": yes_no_title(t["vent_installed"]), "valves": yes_no(t["valves"]),
|
|
|
|
| 15 |
st.stop()
|
| 16 |
|
| 17 |
TPL_COVER = "Cover_Template.docx"
|
| 18 |
+
TPL_INSPECTION = "Inspction Report.docx" # Updated to match your new filename
|
| 19 |
TPL_WARRANTY = "Warranty_Template.docx"
|
| 20 |
+
TPL_JOB = "Job_Completion_Template.docx" # Ensure your recovered file is named exactly this
|
| 21 |
STATIC_DM_CERT = "DM_Certificate.pdf"
|
| 22 |
STATIC_MSDS = "MSDS.pdf"
|
| 23 |
|
|
|
|
| 39 |
draw = ImageDraw.Draw(canvas)
|
| 40 |
font_header, font_footer, font_caption, font_wm = load_font(28), load_font(20), load_font(22), load_font(24)
|
| 41 |
|
| 42 |
+
draw.rectangle([(0, 0), (PAGE_W, HEADER_H)], fill=(0, 84, 166)) # Wercore Navy Header
|
| 43 |
draw.text((PADDING, 18), f"Photo Documentation β {client_name} | {date_str}", font=font_header, fill=(255, 255, 255))
|
| 44 |
|
| 45 |
caption_h = 35
|
|
|
|
| 74 |
|
| 75 |
# ββ 3. UI: SIDEBAR ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 76 |
with st.sidebar:
|
| 77 |
+
st.image("WERCORE logo.png", use_container_width=True)
|
| 78 |
+
st.markdown("---")
|
| 79 |
+
st.markdown("### Project Details")
|
| 80 |
client_name = st.text_input("π’ Client Name*", placeholder="e.g. Al Noor Properties")
|
| 81 |
authorized_person = st.text_input("π€ Authorized Person*", placeholder="e.g. Afzal Rahman")
|
| 82 |
client_email = st.text_input("π§ Client Email*", placeholder="e.g. info@client.com")
|
|
|
|
| 100 |
handwritten_files = st.file_uploader("Upload physical reports (PDFs only)*", type=["pdf", "PDF"], accept_multiple_files=True)
|
| 101 |
|
| 102 |
# ββ 4. UI: TANK ENGINEERING DATA ββββββββββββββββββββββββββββββββββββββββββββββ
|
| 103 |
+
st.header("Water Tank Cleaning Engine")
|
| 104 |
+
st.caption("Compliance & Inspection Documentation System")
|
| 105 |
|
| 106 |
+
# Dictionary of default states based on Workout.txt
|
| 107 |
default_tank = {
|
| 108 |
"name": "Roof Tank 1", "capacity": 10000, "ph": 6.7, "tds": 110, "chemical": "HygienX Water Tank Cleaner",
|
| 109 |
"type": "GRP Panel", "pipe": "UPVC", "drain": True, "lid": True, "valves": True, "pumps": True,
|
|
|
|
| 234 |
|
| 235 |
tank_context.update({
|
| 236 |
"tank_name": t["name"], "capacity_usg": t["capacity"], "chemical": t["chemical"],
|
| 237 |
+
"tank_type": t["type"], "pipe_type": t["pipe"],
|
| 238 |
+
"ph": f"{float(t['ph']):.1f}", # Decimal Fix applied here
|
| 239 |
+
"tds": t["tds"],
|
| 240 |
"drain": yes_no(t["drain"]), "lid": yes_no(t["lid"]), "damage": yes_no(t["damage"]),
|
| 241 |
"leaks": yes_no(t["leaks"]), "vent_present": yes_no_title(t["vent_present"]),
|
| 242 |
"vent_installed": yes_no_title(t["vent_installed"]), "valves": yes_no(t["valves"]),
|