Marwan Alwali a788c086ae update
2025-11-02 18:05:50 +03:00

126 lines
5.9 KiB
HTML

{% extends "base.html" %}
{% load i18n static %}
{% block title %}{% trans "E-Invoices (ZATCA)" %} - {{ block.super }}{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="d-flex justify-content-between align-items-center mb-4">
<h1 class="h3 mb-0">
<i class="fa fa-file-invoice me-2"></i>{% trans "E-Invoices (ZATCA)" %}
</h1>
</div>
<!-- Filters -->
<div class="card mb-3">
<div class="card-body">
<form method="get" class="row g-3">
<div class="col-md-4">
<label class="form-label">{% trans "Clearance Status" %}</label>
<select name="clearance_status" class="form-select">
<option value="">{% trans "All Statuses" %}</option>
{% for value, label in clearance_statuses %}
<option value="{{ value }}" {% if request.GET.clearance_status == value %}selected{% endif %}>{{ label }}</option>
{% endfor %}
</select>
</div>
<div class="col-md-4">
<label class="form-label">{% trans "Submission Mode" %}</label>
<select name="submission_mode" class="form-select">
<option value="">{% trans "All Modes" %}</option>
{% for value, label in submission_modes %}
<option value="{{ value }}" {% if request.GET.submission_mode == value %}selected{% endif %}>{{ label }}</option>
{% endfor %}
</select>
</div>
<div class="col-md-4 d-flex align-items-end">
<button type="submit" class="btn btn-primary me-2">
<i class="fa fa-filter me-1"></i>{% trans "Filter" %}
</button>
<a href="{% url 'integrations:einvoice-list' %}" class="btn btn-secondary">
<i class="fa fa-times me-1"></i>{% trans "Clear" %}
</a>
</div>
</form>
</div>
</div>
<div class="card">
<div class="card-body">
{% if einvoices %}
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>{% trans "Invoice" %}</th>
<th>{% trans "UUID" %}</th>
<th>{% trans "Submission Mode" %}</th>
<th>{% trans "Clearance Status" %}</th>
<th>{% trans "Created At" %}</th>
<th>{% trans "Submitted At" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
</thead>
<tbody>
{% for einvoice in einvoices %}
<tr>
<td>
<a href="{% url 'integrations:einvoice-detail' einvoice.pk %}">
{{ einvoice.invoice.invoice_number }}
</a>
<br>
<small class="text-muted">
{{ einvoice.invoice.patient.full_name_en }}
</small>
</td>
<td>
<small class="font-monospace">{{ einvoice.uuid }}</small>
</td>
<td>
{% if einvoice.submission_mode == 'CLEARANCE' %}
<span class="badge bg-primary">{{ einvoice.get_submission_mode_display }}</span>
{% else %}
<span class="badge bg-info">{{ einvoice.get_submission_mode_display }}</span>
{% endif %}
</td>
<td>
{% if einvoice.clearance_status == 'PENDING' %}
<span class="badge bg-warning">{{ einvoice.get_clearance_status_display }}</span>
{% elif einvoice.clearance_status == 'CLEARED' %}
<span class="badge bg-success">{{ einvoice.get_clearance_status_display }}</span>
{% elif einvoice.clearance_status == 'REPORTED' %}
<span class="badge bg-info">{{ einvoice.get_clearance_status_display }}</span>
{% else %}
<span class="badge bg-danger">{{ einvoice.get_clearance_status_display }}</span>
{% endif %}
</td>
<td>{{ einvoice.created_at|date:"Y-m-d H:i" }}</td>
<td>{{ einvoice.submitted_at|date:"Y-m-d H:i"|default:"—" }}</td>
<td>
<a href="{% url 'integrations:einvoice-detail' einvoice.pk %}" class="btn btn-sm btn-outline-primary">
<i class="fa fa-eye"></i>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if is_paginated %}
{% include "includes/pagination_unified.html" %}
{% endif %}
</div>
{% else %}
<div class="text-center py-5">
<i class="fa fa-file-invoice fa-3x text-muted mb-3"></i>
<p class="text-muted">{% trans "No e-invoices found." %}</p>
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}