Fix print_lost_labels compact styling and production data import

- Added compact table styling to print_lost_labels page (smaller fonts, reduced padding)
- Fixed production data import missing fields (production_order_line, line_number)
- Added better error handling and logging for Excel file imports
- Skip empty rows in production data import
- Log all columns and columns with data for debugging
This commit is contained in:
ske087
2025-11-26 21:59:03 +02:00
parent d3a0123acc
commit d070db0052
13 changed files with 649 additions and 1042 deletions

View File

@@ -94,21 +94,25 @@ table.view-orders-table.scan-table tbody tr:hover td {
{% else %}
<!-- Show file upload -->
<input type="hidden" name="action" value="preview">
<label for="file">Choose CSV file:</label>
<input type="file" name="file" accept=".csv" required><br>
<label for="file">Choose CSV or Excel file:</label>
<input type="file" name="file" accept=".csv,.xlsx,.xls" required><br>
<button type="submit" class="btn">Upload & Preview</button>
<!-- CSV Format Information -->
<!-- File Format Information -->
<div style="margin-top: 20px; padding: 15px; background-color: var(--app-card-bg, #2a3441); border-radius: 5px; border-left: 4px solid var(--app-accent-color, #007bff); color: var(--app-text-color, #ffffff);">
<h5 style="margin-top: 0; color: var(--app-accent-color, #007bff);">Expected CSV Format</h5>
<p style="margin-bottom: 10px; color: var(--app-text-color, #ffffff);">Your CSV file should contain columns such as:</p>
<h5 style="margin-top: 0; color: var(--app-accent-color, #007bff);">Expected File Format</h5>
<p style="margin-bottom: 10px; color: var(--app-text-color, #ffffff);">Supported file types: <strong>CSV (.csv)</strong> and <strong>Excel (.xlsx, .xls)</strong></p>
<p style="margin-bottom: 10px; color: var(--app-text-color, #ffffff);">Your file should contain columns such as:</p>
<ul style="margin-bottom: 10px; color: var(--app-text-color, #ffffff);">
<li><strong>order_number</strong> - The order/production number</li>
<li><strong>quantity</strong> - Number of items</li>
<li><strong>warehouse_location</strong> - Storage location</li>
<li><strong>Comanda Productie</strong> - Production order number</li>
<li><strong>Cod Articol</strong> - Article code</li>
<li><strong>Descr. Com. Prod</strong> - Description</li>
<li><strong>Cantitate</strong> - Quantity</li>
<li><strong>Data Livrare</strong> - Delivery date</li>
<li><strong>Customer Name</strong> - Customer name</li>
</ul>
<p style="color: var(--app-secondary-text, #b8c5d1); font-size: 14px; margin-bottom: 0;">
Column names are case-insensitive and can have variations like "Order Number", "Quantity", "Location", etc.
Column names are case-insensitive and can have variations. For Excel files, the first sheet with data will be used.
</p>
</div>
{% endif %}