{% extends 'layout/base.html' %} {% block content %}
{% if current_user.role in ['operator'] %}
(Max File Size 5 MB)
{% endif %}
📁 Uploaded Sales Documents
{% if documents %}
{% for doc in documents %} {% if current_user.role == 'admin' %} {% set show_doc = True %} {% elif current_user.role == 'accounts' %} {% set show_doc = doc.status in ['pending', 'reupload'] %} {% elif current_user.role == 'operator' %} {% set show_doc = doc.status in ['pending'] %} {% elif current_user.role == 'ca' %} {% set show_doc = doc.status == 'approved' %} {% else %} {% set show_doc = False %} {% endif %} {% if show_doc %} {% set icon_path = url_for('static', filename='images/document.png') %}
{% if current_user.role == 'admin' and doc.status in ['pending', 'reupload'] %} {{ doc.title }} {% set fname = doc.bill_path.split('/')[-1] %} {{ fname }} ({{ fname.split('.')[-1]|lower }}) {% else %} {{ doc.title }} {% set fname = doc.bill_path.split('/')[-1] %} {{ fname }} ({{ fname.split('.')[-1]|lower }}) {% endif %} {% if current_user.role == 'accounts' and doc.status in ['pending', 'reupload'] %}
{% else %}
Status: {{ doc.status|capitalize }}
{% endif %} {% if current_user.role in ['admin', 'accounts'] %} {% endif %}
{% endif %} {% endfor %}
{% else %}

No documents uploaded yet.

{% endif %}
{% endblock %}