|
|
|
@ -500,10 +500,10 @@ class SparepartManager:
|
|
|
|
recommendations.append({
|
|
|
|
recommendations.append({
|
|
|
|
'type': 'BUDGET_SUMMARY',
|
|
|
|
'type': 'BUDGET_SUMMARY',
|
|
|
|
'priority': 'INFO',
|
|
|
|
'priority': 'INFO',
|
|
|
|
'message': f'Total sparepart investment: ${total_investment:,.2f}',
|
|
|
|
'message': f'Total sparepart investment: Rp. {total_investment:,.2f}',
|
|
|
|
'details': [
|
|
|
|
'details': [
|
|
|
|
f"Existing orders: ${pr_po_summary['total_existing_value']:,.2f}",
|
|
|
|
f"Existing orders: Rp. {pr_po_summary['total_existing_value']:,.2f}",
|
|
|
|
f"Additional orders needed: ${pr_po_summary['total_new_orders_value']:,.2f}"
|
|
|
|
f"Additional orders needed: Rp. {pr_po_summary['total_new_orders_value']:,.2f}"
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'action': 'Ensure budget allocation for sparepart procurement'
|
|
|
|
'action': 'Ensure budget allocation for sparepart procurement'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
@ -559,23 +559,23 @@ class SparepartManager:
|
|
|
|
if not missing_parts:
|
|
|
|
if not missing_parts:
|
|
|
|
if pr_po_summary['existing_orders']:
|
|
|
|
if pr_po_summary['existing_orders']:
|
|
|
|
message = f"All spareparts available through {len(pr_po_summary['existing_orders'])} existing orders"
|
|
|
|
message = f"All spareparts available through {len(pr_po_summary['existing_orders'])} existing orders"
|
|
|
|
detailed_message = f"Total existing order value: ${pr_po_summary['total_existing_value']:,.2f}"
|
|
|
|
detailed_message = f"Total existing order value: Rp. {pr_po_summary['total_existing_value']:,.2f}"
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
message = "All spareparts available from current stock"
|
|
|
|
message = "All spareparts available from current stock"
|
|
|
|
detailed_message = "No additional procurement required"
|
|
|
|
detailed_message = "No additional procurement required"
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
if critical_missing:
|
|
|
|
if critical_missing:
|
|
|
|
message = f"CRITICAL: {len(critical_missing)} critical spareparts missing. Overhaul cannot proceed."
|
|
|
|
message = f"CRITICAL: {len(critical_missing)} critical spareparts missing. Overhaul cannot proceed."
|
|
|
|
detailed_message = f"Additional procurement required: ${pr_po_summary['total_new_orders_value']:,.2f}"
|
|
|
|
detailed_message = f"Additional procurement required: Rp. {pr_po_summary['total_new_orders_value']:,.2f}"
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
message = f"WARNING: {len(missing_parts)} spareparts missing, but no critical parts."
|
|
|
|
message = f"WARNING: {len(missing_parts)} spareparts missing, but no critical parts."
|
|
|
|
if pr_po_summary['total_new_orders_value'] > 0:
|
|
|
|
if pr_po_summary['total_new_orders_value'] > 0:
|
|
|
|
detailed_message = f"Additional procurement required: ${pr_po_summary['total_new_orders_value']:,.2f}. "
|
|
|
|
detailed_message = f"Additional procurement required: Rp. {pr_po_summary['total_new_orders_value']:,.2f}. "
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
detailed_message = ""
|
|
|
|
detailed_message = ""
|
|
|
|
|
|
|
|
|
|
|
|
if pr_po_summary['existing_orders']:
|
|
|
|
if pr_po_summary['existing_orders']:
|
|
|
|
detailed_message += f"Existing orders cover some requirements (${pr_po_summary['total_existing_value']:,.2f})."
|
|
|
|
detailed_message += f"Existing orders cover some requirements (Rp. {pr_po_summary['total_existing_value']:,.2f})."
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
'message': message,
|
|
|
|
'message': message,
|
|
|
|
|