{% extends "base.html" %} {% block title %}إدارة طلب - {{ proto.title }}{% endblock %} {% block content %}
← العودة لقائمة الطلبات

{{ proto.title }}

{% set status_colors = {'draft': 'bg-gray-100 text-gray-700', 'sent': 'bg-blue-100 text-blue-700', 'quoted': 'bg-yellow-100 text-yellow-700', 'accepted': 'bg-green-100 text-green-700', 'in_production': 'bg-purple-100 text-purple-700', 'delivered': 'bg-emerald-100 text-emerald-700'} %} {% set status_labels = {'draft': 'مسودة', 'sent': 'مُرسل', 'quoted': 'تم التسعير', 'accepted': 'مقبول', 'in_production': 'قيد التصنيع', 'delivered': 'تم التسليم'} %} {{ status_labels.get(proto.status, proto.status) }}
المستخدم
{{ proto.user.name if proto.user else '-' }}
المصنع
{{ proto.factory.name_ar if proto.factory else 'الكل' }}
الكمية
{{ proto.quantity }}
التاريخ
{{ proto.created_at.strftime('%Y-%m-%d') }}
{% if proto.description %}

{{ proto.description }}

{% endif %}
{% if proto.nda_html %}

🔒 اتفاقية عدم الإفشاء (NDA)

{% set nda_colors = {'draft': 'bg-gray-100 text-gray-700', 'pending_admin': 'bg-blue-100 text-blue-700', 'pending_factory': 'bg-yellow-100 text-yellow-700', 'approved': 'bg-green-100 text-green-700', 'rejected': 'bg-red-100 text-red-700'} %} {% set nda_labels = {'draft': 'مسودة', 'pending_admin': 'بانتظار موافقتك', 'pending_factory': 'بانتظار موافقة المصنع', 'approved': 'معتمدة ✅', 'rejected': 'مرفوضة'} %} {{ nda_labels.get(proto.nda_status, proto.nda_status or '-') }}
{{ proto.nda_html|safe }}
{% if proto.nda_status == 'pending_admin' %}
{% endif %}
{% endif %} {% if proto.cost_estimate_json %}

💰 تقدير التكلفة

{% set e = proto.cost_estimate_json %}
تكلفة المواد
{{ e.get('bom_cost', '-') }}
تكلفة الوحدة
{{ e.get('unit_cost', '-') }}
التكلفة الإجمالية
{{ e.get('total_cost', '-') }}
المدة المتوقعة
{{ e.get('lead_time', '-') }}
{% endif %}

📢 إرسال تنبيه

📋 معلومات سريعة

الميزانية:{{ proto.budget_range or '-' }}
الموعد:{{ proto.deadline.strftime('%Y-%m-%d') if proto.deadline else '-' }}
NDA:{{ proto.nda_status or 'لا يوجد' }}
{% if proto.nda_generated_at %}
تاريخ NDA:{{ proto.nda_generated_at.strftime('%Y-%m-%d') }}
{% endif %} {% if proto.nda_approved_at %}
اعتماد NDA:{{ proto.nda_approved_at.strftime('%Y-%m-%d') }}
{% endif %}
{% endblock %}