|
|
|
@ -1045,10 +1045,12 @@ async def get_calculation_result(db_session: DbSession, calculation_id: str):
|
|
|
|
urgent_items = [r for r in recommendations if r.get("priority") == "CRITICAL"]
|
|
|
|
urgent_items = [r for r in recommendations if r.get("priority") == "CRITICAL"]
|
|
|
|
if urgent_items:
|
|
|
|
if urgent_items:
|
|
|
|
urgent_procurements += 1
|
|
|
|
urgent_procurements += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
is_included_eq = False if eq.is_initial else eq.is_included
|
|
|
|
|
|
|
|
|
|
|
|
# Add detailed procurement info for this equipment
|
|
|
|
# Add detailed procurement info for this equipment
|
|
|
|
month_result["procurement_details"][eq.location_tag] = {
|
|
|
|
month_result["procurement_details"][eq.location_tag] = {
|
|
|
|
"is_included": eq.is_included,
|
|
|
|
"is_included": is_included_eq,
|
|
|
|
"location_tag": eq.location_tag,
|
|
|
|
"location_tag": eq.location_tag,
|
|
|
|
"details": procurement_detail.get("procurement_needed", []),
|
|
|
|
"details": procurement_detail.get("procurement_needed", []),
|
|
|
|
"detailed_message": procurement_detail.get("detailed_message", ""),
|
|
|
|
"detailed_message": procurement_detail.get("detailed_message", ""),
|
|
|
|
@ -1583,7 +1585,8 @@ async def bulk_update_equipment(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"is_included": case(
|
|
|
|
"is_included": case(
|
|
|
|
*when_clauses
|
|
|
|
*when_clauses
|
|
|
|
) # Unpack the when clauses as separate arguments
|
|
|
|
) ,
|
|
|
|
|
|
|
|
"is_initial" : False
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|