366 lines
13 KiB
HTML
Executable File
366 lines
13 KiB
HTML
Executable File
{% extends "base.html" %}
|
|
{% block title %}View Uploaded Orders{% endblock %}
|
|
|
|
{% block head %}
|
|
<style>
|
|
/* VIEW ORDERS TABLE - Specific styling */
|
|
table.view-orders-table.scan-table {
|
|
margin: 0 !important;
|
|
border-spacing: 0 !important;
|
|
border-collapse: collapse !important;
|
|
width: 100% !important;
|
|
table-layout: fixed !important;
|
|
font-size: 11px !important;
|
|
}
|
|
|
|
/* HEADER STYLES for 2-line text */
|
|
table.view-orders-table.scan-table thead th {
|
|
height: 85px !important;
|
|
min-height: 85px !important;
|
|
max-height: 85px !important;
|
|
vertical-align: middle !important;
|
|
text-align: center !important;
|
|
white-space: normal !important;
|
|
word-wrap: break-word !important;
|
|
line-height: 1.3 !important;
|
|
padding: 6px 3px !important;
|
|
font-size: 11px !important;
|
|
background-color: #e9ecef !important;
|
|
font-weight: bold !important;
|
|
text-transform: none !important;
|
|
letter-spacing: 0 !important;
|
|
overflow: visible !important;
|
|
box-sizing: border-box !important;
|
|
border: 1px solid #ddd !important;
|
|
text-overflow: clip !important;
|
|
position: relative !important;
|
|
}
|
|
|
|
/* BODY CELL STYLES */
|
|
table.view-orders-table.scan-table tbody td {
|
|
padding: 4px 2px !important;
|
|
font-size: 10px !important;
|
|
text-align: center !important;
|
|
border: 1px solid #ddd !important;
|
|
white-space: nowrap !important;
|
|
overflow: hidden !important;
|
|
text-overflow: ellipsis !important;
|
|
vertical-align: middle !important;
|
|
}
|
|
|
|
/* REMOVE UNWANTED SPACING */
|
|
.report-table-card h3 {
|
|
margin: 0 0 15px 0 !important;
|
|
padding: 0 !important;
|
|
}
|
|
|
|
.report-table-card {
|
|
padding: 15px !important;
|
|
}
|
|
|
|
.report-table-card > * {
|
|
margin-top: 0 !important;
|
|
}
|
|
|
|
.report-table-container {
|
|
margin-top: 0 !important;
|
|
}
|
|
|
|
/* HOVER EFFECTS */
|
|
table.view-orders-table.scan-table tbody tr:hover td {
|
|
background-color: #f8f9fa !important;
|
|
}
|
|
|
|
/* COLUMN WIDTH SPECIFICATIONS */
|
|
table.view-orders-table.scan-table td:nth-child(1) { width: 50px !important; } /* ID */
|
|
table.view-orders-table.scan-table td:nth-child(2) { width: 80px !important; } /* Comanda Productie */
|
|
table.view-orders-table.scan-table td:nth-child(3) { width: 80px !important; } /* Cod Articol */
|
|
table.view-orders-table.scan-table td:nth-child(4) { width: 150px !important; } /* Descr Com Prod */
|
|
table.view-orders-table.scan-table td:nth-child(5) { width: 70px !important; } /* Cantitate */
|
|
table.view-orders-table.scan-table td:nth-child(6) { width: 80px !important; } /* Data Livrare */
|
|
table.view-orders-table.scan-table td:nth-child(7) { width: 75px !important; } /* Dimensiune */
|
|
table.view-orders-table.scan-table td:nth-child(8) { width: 90px !important; } /* Com Achiz Client */
|
|
table.view-orders-table.scan-table td:nth-child(9) { width: 70px !important; } /* Nr Linie */
|
|
table.view-orders-table.scan-table td:nth-child(10) { width: 100px !important; } /* Customer Name */
|
|
table.view-orders-table.scan-table td:nth-child(11) { width: 90px !important; } /* Customer Art Nr */
|
|
table.view-orders-table.scan-table td:nth-child(12) { width: 70px !important; } /* Open Order */
|
|
table.view-orders-table.scan-table td:nth-child(13) { width: 50px !important; } /* Line */
|
|
table.view-orders-table.scan-table td:nth-child(14) { width: 70px !important; } /* Printed */
|
|
table.view-orders-table.scan-table td:nth-child(15) { width: 100px !important; } /* Created */
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="scan-container">
|
|
<!-- Orders Actions Card (first, narrower) -->
|
|
<div class="card report-form-card">
|
|
<h3>List Uploaded Orders</h3>
|
|
|
|
<!-- Orders Actions -->
|
|
<div class="reports-grid">
|
|
<div class="form-centered">
|
|
<label class="report-description">View all uploaded orders in the current day for labels generation</label>
|
|
<button class="btn report-btn" onclick="window.location.reload()">Refresh Orders List</button>
|
|
</div>
|
|
<div class="form-centered">
|
|
<label class="report-description">View all uploaded orders for labels generation</label>
|
|
<button class="btn report-btn" onclick="window.location.reload()">Fetch Orders List</button>
|
|
</div>
|
|
<div class="form-centered">
|
|
<label class="report-description">Upload new CSV file with order data</label>
|
|
<button class="btn report-btn" onclick="location.href='/upload_orders'">Upload New Orders</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Separator -->
|
|
<div class="report-separator"></div>
|
|
|
|
<!-- Export Section -->
|
|
<div class="export-section">
|
|
<div class="form-centered last-buttons">
|
|
<label class="export-description">Export orders as:</label>
|
|
<div class="button-row">
|
|
<button class="btn export-btn" onclick="location.href='/print_module'">Print Orders</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Orders Table Card (second, wider) -->
|
|
<div class="card report-table-card">
|
|
{% if orders %}
|
|
<h3>Uploaded Orders ({{ orders|length }} total)</h3>
|
|
{% else %}
|
|
<h3>No orders uploaded yet</h3>
|
|
{% endif %}
|
|
|
|
<div class="report-table-container">
|
|
{% if orders %}
|
|
<table class="scan-table view-orders-table">
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Comanda<br>Productie</th>
|
|
<th>Cod<br>Articol</th>
|
|
<th>Descr. Com.<br>Prod</th>
|
|
<th>Cantitate</th>
|
|
<th>Data<br>Livrare</th>
|
|
<th>Dimensiune</th>
|
|
<th>Com.Achiz.<br>Client</th>
|
|
<th>Nr.<br>Linie</th>
|
|
<th>Customer<br>Name</th>
|
|
<th>Customer<br>Art. Nr.</th>
|
|
<th>Open<br>Order</th>
|
|
<th>Line</th>
|
|
<th>Printed</th>
|
|
<th>Created</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for order in orders %}
|
|
<tr>
|
|
<td>{{ order.id }}</td>
|
|
<td><strong>{{ order.comanda_productie }}</strong></td>
|
|
<td>{{ order.cod_articol or '-' }}</td>
|
|
<td>{{ order.descr_com_prod }}</td>
|
|
<td style="text-align: right; font-weight: 600;">{{ order.cantitate }}</td>
|
|
<td style="text-align: center;">
|
|
{% if order.data_livrare %}
|
|
{{ order.data_livrare.strftime('%Y-%m-%d') if order.data_livrare is not string else order.data_livrare }}
|
|
{% else %}
|
|
-
|
|
{% endif %}
|
|
</td>
|
|
<td style="text-align: center;">{{ order.dimensiune or '-' }}</td>
|
|
<td>{{ order.com_achiz_client or '-' }}</td>
|
|
<td style="text-align: right;">{{ order.nr_linie_com_client or '-' }}</td>
|
|
<td>{{ order.customer_name or '-' }}</td>
|
|
<td>{{ order.customer_article_number or '-' }}</td>
|
|
<td>{{ order.open_for_order or '-' }}</td>
|
|
<td style="text-align: right;">{{ order.line_number or '-' }}</td>
|
|
<td style="text-align: center;">
|
|
{% if order.printed_labels == 1 %}
|
|
<span style="color: #28a745; font-weight: bold;">✓ Yes</span>
|
|
{% else %}
|
|
<span style="color: #dc3545;">✗ No</span>
|
|
{% endif %}
|
|
</td>
|
|
<td style="font-size: 11px; color: #6c757d;">
|
|
{% if order.created_at %}
|
|
{{ order.created_at.strftime('%Y-%m-%d %H:%M') }}
|
|
{% else %}
|
|
-
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% else %}
|
|
<div style="text-align: center; padding: 40px; color: #6c757d;">
|
|
<div style="font-size: 48px; margin-bottom: 20px;">📦</div>
|
|
<h4>No Orders Found</h4>
|
|
<p>Upload your first CSV file to see orders here.</p>
|
|
<button class="btn report-btn" onclick="location.href='/upload_orders'" style="margin-top: 20px;">
|
|
Upload Orders
|
|
</button>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
/* View Orders Table Optimization - Higher specificity to override base styles */
|
|
.report-table-card .scan-table {
|
|
font-size: 11px !important;
|
|
line-height: 1.3 !important;
|
|
}
|
|
|
|
.report-table-card .scan-table th {
|
|
font-size: 10px !important;
|
|
padding: 8px 6px !important;
|
|
font-weight: 600 !important;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.3px;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.report-table-card .scan-table td {
|
|
padding: 6px 6px !important;
|
|
font-size: 11px !important;
|
|
line-height: 1.2 !important;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
max-width: 150px;
|
|
}
|
|
|
|
/* Specific column optimizations for better content fitting */
|
|
.report-table-card .scan-table th:nth-child(1), /* ID */
|
|
.report-table-card .scan-table td:nth-child(1) {
|
|
max-width: 50px !important;
|
|
min-width: 50px !important;
|
|
}
|
|
|
|
.report-table-card .scan-table th:nth-child(2), /* Comanda Productie */
|
|
.report-table-card .scan-table td:nth-child(2) {
|
|
max-width: 90px !important;
|
|
min-width: 90px !important;
|
|
}
|
|
|
|
.report-table-card .scan-table th:nth-child(3), /* Cod Articol */
|
|
.report-table-card .scan-table td:nth-child(3) {
|
|
max-width: 80px !important;
|
|
min-width: 80px !important;
|
|
}
|
|
|
|
.report-table-card .scan-table th:nth-child(4), /* Descr. Com. Prod */
|
|
.report-table-card .scan-table td:nth-child(4) {
|
|
max-width: 140px !important;
|
|
min-width: 140px !important;
|
|
}
|
|
|
|
.report-table-card .scan-table th:nth-child(5), /* Cantitate */
|
|
.report-table-card .scan-table td:nth-child(5) {
|
|
max-width: 70px !important;
|
|
min-width: 70px !important;
|
|
text-align: right !important;
|
|
}
|
|
|
|
.report-table-card .scan-table th:nth-child(6), /* Com.Achiz.Client */
|
|
.report-table-card .scan-table td:nth-child(6) {
|
|
max-width: 100px !important;
|
|
min-width: 100px !important;
|
|
}
|
|
|
|
.report-table-card .scan-table th:nth-child(7), /* Nr. Linie */
|
|
.report-table-card .scan-table td:nth-child(7) {
|
|
max-width: 60px !important;
|
|
min-width: 60px !important;
|
|
text-align: right !important;
|
|
}
|
|
|
|
.report-table-card .scan-table th:nth-child(8), /* Customer Name */
|
|
.report-table-card .scan-table td:nth-child(8) {
|
|
max-width: 120px !important;
|
|
min-width: 120px !important;
|
|
}
|
|
|
|
.report-table-card .scan-table th:nth-child(9), /* Customer Art. Nr. */
|
|
.report-table-card .scan-table td:nth-child(9) {
|
|
max-width: 90px !important;
|
|
min-width: 90px !important;
|
|
}
|
|
|
|
.report-table-card .scan-table th:nth-child(10), /* Open Order */
|
|
.report-table-card .scan-table td:nth-child(10) {
|
|
max-width: 70px !important;
|
|
min-width: 70px !important;
|
|
text-align: center !important;
|
|
}
|
|
|
|
.report-table-card .scan-table th:nth-child(11), /* Line */
|
|
.report-table-card .scan-table td:nth-child(11) {
|
|
max-width: 50px !important;
|
|
min-width: 50px !important;
|
|
text-align: right !important;
|
|
}
|
|
|
|
.report-table-card .scan-table th:nth-child(12), /* Printed */
|
|
.report-table-card .scan-table td:nth-child(12) {
|
|
max-width: 60px !important;
|
|
min-width: 60px !important;
|
|
text-align: center !important;
|
|
}
|
|
|
|
.report-table-card .scan-table th:nth-child(13), /* Created */
|
|
.report-table-card .scan-table td:nth-child(13) {
|
|
max-width: 110px !important;
|
|
min-width: 110px !important;
|
|
font-size: 10px !important;
|
|
}
|
|
|
|
/* Hover effects for better readability */
|
|
.report-table-card .scan-table tbody tr:hover {
|
|
background-color: #f8f9fa !important;
|
|
}
|
|
|
|
.report-table-card .scan-table tbody tr:hover td {
|
|
background-color: #f8f9fa !important;
|
|
}
|
|
|
|
/* Table container optimization */
|
|
.report-table-card .report-table-container {
|
|
overflow-x: auto !important;
|
|
}
|
|
|
|
.report-table-card .scan-table {
|
|
min-width: 1060px !important;
|
|
width: 100% !important;
|
|
table-layout: fixed !important;
|
|
}
|
|
|
|
/* Print styles */
|
|
@media print {
|
|
.report-form-card {
|
|
display: none !important;
|
|
}
|
|
|
|
.card {
|
|
box-shadow: none !important;
|
|
border: none !important;
|
|
}
|
|
|
|
.scan-table {
|
|
font-size: 9px !important;
|
|
}
|
|
|
|
.scan-table th,
|
|
.scan-table td {
|
|
padding: 3px 2px !important;
|
|
font-size: 9px !important;
|
|
}
|
|
}
|
|
</style>
|
|
{% endblock %} |