Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -132,7 +132,7 @@ def process_equipment_utilization(equip, proj, use_h, idle_h, move_f, cost_h, la
|
|
| 132 |
"Title": "UtilReport",
|
| 133 |
"PathOnClient": os.path.basename(str(pdf_path)),
|
| 134 |
"VersionData": encoded,
|
| 135 |
-
"FirstPublishLocationId":
|
| 136 |
})
|
| 137 |
pdf_url = f"https://{sf.sf_instance}/sfc/servlet.shepherd/version/download/{cv['id']}"
|
| 138 |
sf.Equipment_Utilization_Record__c.update(rec_id, {"Report_Link__c": pdf_url})
|
|
@@ -155,17 +155,17 @@ def format_output(result):
|
|
| 155 |
util_score *= 100
|
| 156 |
|
| 157 |
lines = [
|
| 158 |
-
f"• AI Suggestion: {summary.get('Suggestion', 'N/A')}",
|
| 159 |
-
f"• Suggestion Confidence: {conf_pct:.2f}%",
|
| 160 |
-
f"• Utilization Score: {util_score:.2f}%",
|
| 161 |
-
f"• Report Link: {result.get('Report_Link', 'N/A')}",
|
| 162 |
-
f"• CSV Report Link: {result.get('CSV_Report_Link', 'N/A')}",
|
| 163 |
-
f"• Equipment Name: {summary.get('Equipment Name', 'N/A')}",
|
| 164 |
-
f"• Project: {summary.get('Project', 'N/A')}",
|
| 165 |
-
f"• Usage Hours: {summary.get('Usage Hours', 0):.2f}",
|
| 166 |
-
f"• Idle Hours: {summary.get('Idle Hours', 0):.2f}",
|
| 167 |
-
f"• Cost per Hour: {cost_str}",
|
| 168 |
-
f"• Last Maintenance: {summary.get('Last Maintenance', 'N/A')}",
|
| 169 |
]
|
| 170 |
|
| 171 |
return "\n".join(lines)
|
|
|
|
| 132 |
"Title": "UtilReport",
|
| 133 |
"PathOnClient": os.path.basename(str(pdf_path)),
|
| 134 |
"VersionData": encoded,
|
| 135 |
+
"FirstPublishLocationId": Report_File_Path
|
| 136 |
})
|
| 137 |
pdf_url = f"https://{sf.sf_instance}/sfc/servlet.shepherd/version/download/{cv['id']}"
|
| 138 |
sf.Equipment_Utilization_Record__c.update(rec_id, {"Report_Link__c": pdf_url})
|
|
|
|
| 155 |
util_score *= 100
|
| 156 |
|
| 157 |
lines = [
|
| 158 |
+
f" • AI Suggestion: {summary.get('Suggestion', 'N/A')}",
|
| 159 |
+
f" • Suggestion Confidence: {conf_pct:.2f}%",
|
| 160 |
+
f" • Utilization Score: {util_score:.2f}%",
|
| 161 |
+
f" • Report Link: {result.get('Report_Link', 'N/A')}",
|
| 162 |
+
f" • CSV Report Link: {result.get('CSV_Report_Link', 'N/A')}",
|
| 163 |
+
f" • Equipment Name: {summary.get('Equipment Name', 'N/A')}",
|
| 164 |
+
f" • Project: {summary.get('Project', 'N/A')}",
|
| 165 |
+
f" • Usage Hours: {summary.get('Usage Hours', 0):.2f}",
|
| 166 |
+
f" • Idle Hours: {summary.get('Idle Hours', 0):.2f}",
|
| 167 |
+
f" • Cost per Hour: {cost_str}",
|
| 168 |
+
f" • Last Maintenance: {summary.get('Last Maintenance', 'N/A')}",
|
| 169 |
]
|
| 170 |
|
| 171 |
return "\n".join(lines)
|