Update combined_summary.py
Browse files- combined_summary.py +12 -4
combined_summary.py
CHANGED
|
@@ -3,8 +3,7 @@ from salesforce import get_salesforce_connection
|
|
| 3 |
from flask import Blueprint, render_template, request, session, jsonify, redirect, url_for
|
| 4 |
import os
|
| 5 |
import re
|
| 6 |
-
from
|
| 7 |
-
|
| 8 |
|
| 9 |
combined_summary_blueprint = Blueprint('combined_summary', __name__)
|
| 10 |
|
|
@@ -128,7 +127,8 @@ def combined_summary():
|
|
| 128 |
"name": item_name,
|
| 129 |
"price": menu_item.get("Price__c", 0),
|
| 130 |
"image_url": menu_item.get("Image1__c", ''),
|
| 131 |
-
"ingredients": ingredients
|
|
|
|
| 132 |
})
|
| 133 |
|
| 134 |
# Fetch the sector details from the Sector_Detail__c object
|
|
@@ -148,6 +148,12 @@ def combined_summary():
|
|
| 148 |
"description": sector_record.get('Description__c', '')
|
| 149 |
}
|
| 150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
return render_template(
|
| 152 |
'combined_summary.html',
|
| 153 |
user_points=round(user_points),
|
|
@@ -158,7 +164,9 @@ def combined_summary():
|
|
| 158 |
progress_percentage=round(progress_percentage),
|
| 159 |
points_needed_for_next_tier=round(points_needed_for_next_tier),
|
| 160 |
order_items=order_items,
|
| 161 |
-
sector_details=sector_details
|
|
|
|
|
|
|
| 162 |
)
|
| 163 |
|
| 164 |
except Exception as e:
|
|
|
|
| 3 |
from flask import Blueprint, render_template, request, session, jsonify, redirect, url_for
|
| 4 |
import os
|
| 5 |
import re
|
| 6 |
+
from datetime import datetime
|
|
|
|
| 7 |
|
| 8 |
combined_summary_blueprint = Blueprint('combined_summary', __name__)
|
| 9 |
|
|
|
|
| 127 |
"name": item_name,
|
| 128 |
"price": menu_item.get("Price__c", 0),
|
| 129 |
"image_url": menu_item.get("Image1__c", ''),
|
| 130 |
+
"ingredients": ingredients,
|
| 131 |
+
"category": "Food" if ingredients else "Soft Drink" # Categorize based on ingredients
|
| 132 |
})
|
| 133 |
|
| 134 |
# Fetch the sector details from the Sector_Detail__c object
|
|
|
|
| 148 |
"description": sector_record.get('Description__c', '')
|
| 149 |
}
|
| 150 |
|
| 151 |
+
# Set delivery time (static for now, adjust if Salesforce field exists)
|
| 152 |
+
delivery_time = 15 # Static value in minutes; replace with dynamic logic if needed
|
| 153 |
+
|
| 154 |
+
# Set validity year for rewards (static for now)
|
| 155 |
+
validity_year = datetime.now().year
|
| 156 |
+
|
| 157 |
return render_template(
|
| 158 |
'combined_summary.html',
|
| 159 |
user_points=round(user_points),
|
|
|
|
| 164 |
progress_percentage=round(progress_percentage),
|
| 165 |
points_needed_for_next_tier=round(points_needed_for_next_tier),
|
| 166 |
order_items=order_items,
|
| 167 |
+
sector_details=sector_details,
|
| 168 |
+
delivery_time=delivery_time,
|
| 169 |
+
validity_year=validity_year
|
| 170 |
)
|
| 171 |
|
| 172 |
except Exception as e:
|