rawshal commited on
Commit
42ca7eb
Β·
verified Β·
1 Parent(s): f2dd980

Update pages/1_Water_Tank.py

Browse files
Files changed (1) hide show
  1. 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 = "Inspection_Template.docx"
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("https://img.icons8.com/fluency/96/water-tank.png", width=72)
78
- st.title("Project Details")
 
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("πŸ’§ Wercore Master Compliance Engine")
 
103
 
104
- # Dictionary of default states based on your Workout.txt
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"], "ph": f"{t['ph']:.1f}", "tds": t["tds"],
 
 
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"]),