2025-12-13 12:06:28 +01:00
|
|
|
|
{% extends "shared/frontend/base.html" %}
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
|
2025-12-13 12:06:28 +01:00
|
|
|
|
{% block title %}Timetracking Ordrer - BMC Hub{% endblock %}
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
|
2025-12-13 12:06:28 +01:00
|
|
|
|
{% block extra_css %}
|
|
|
|
|
|
<style>
|
|
|
|
|
|
/* Page specific styles */
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
|
|
|
|
|
|
.nav-link {
|
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
|
padding: 0.6rem 1.2rem !important;
|
|
|
|
|
|
border-radius: var(--border-radius);
|
|
|
|
|
|
transition: all 0.2s;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-10 18:29:13 +01:00
|
|
|
|
.nav-link:hover {
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
background-color: var(--accent-light);
|
|
|
|
|
|
color: var(--accent);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-10 18:29:13 +01:00
|
|
|
|
.nav-link.active {
|
|
|
|
|
|
background-color: var(--accent);
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
.card {
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
border-radius: var(--border-radius);
|
|
|
|
|
|
box-shadow: 0 2px 15px rgba(0,0,0,0.05);
|
|
|
|
|
|
background: var(--bg-card);
|
|
|
|
|
|
margin-bottom: 1.5rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.table {
|
|
|
|
|
|
background: var(--bg-card);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.table th {
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
|
border-bottom: 2px solid var(--accent-light);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.order-row {
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
transition: background-color 0.2s;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.order-row:hover {
|
|
|
|
|
|
background-color: var(--accent-light);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.order-details {
|
|
|
|
|
|
background: var(--accent-light);
|
|
|
|
|
|
border-radius: var(--border-radius);
|
|
|
|
|
|
padding: 1.5rem;
|
|
|
|
|
|
margin-top: 1rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.line-item {
|
|
|
|
|
|
padding: 0.75rem;
|
|
|
|
|
|
background: var(--bg-card);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
margin-bottom: 0.5rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.modal-body .info-row {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
padding: 0.75rem 0;
|
|
|
|
|
|
border-bottom: 1px solid var(--accent-light);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.modal-body .info-row:last-child {
|
|
|
|
|
|
border-bottom: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|
2025-12-13 12:06:28 +01:00
|
|
|
|
{% endblock %}
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
|
2025-12-13 12:06:28 +01:00
|
|
|
|
{% block content %}
|
|
|
|
|
|
<div class="container-fluid py-4">
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
<!-- Header -->
|
|
|
|
|
|
<div class="row mb-4">
|
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<h1 class="mb-1">
|
|
|
|
|
|
<i class="bi bi-receipt text-primary"></i> Ordrer
|
|
|
|
|
|
</h1>
|
|
|
|
|
|
<p class="text-muted mb-0">Oversigt over genererede ordrer og eksport til e-conomic</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<a href="/timetracking" class="btn btn-outline-secondary">
|
|
|
|
|
|
<i class="bi bi-arrow-left"></i> Tilbage
|
|
|
|
|
|
</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Safety Banner -->
|
|
|
|
|
|
<div class="row mb-4">
|
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
|
<div class="alert alert-warning d-flex align-items-center" role="alert">
|
|
|
|
|
|
<i class="bi bi-shield-exclamation me-2"></i>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<strong>DRY-RUN Mode Aktiv</strong> -
|
|
|
|
|
|
Eksport til e-conomic er i test-mode. Fakturaer oprettes ikke i e-conomic.
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Orders Table -->
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
|
<div class="card">
|
|
|
|
|
|
<div class="card-header bg-white d-flex justify-content-between align-items-center">
|
|
|
|
|
|
<h5 class="mb-0">Alle Ordrer</h5>
|
|
|
|
|
|
<button class="btn btn-sm btn-outline-primary" onclick="loadOrders()">
|
|
|
|
|
|
<i class="bi bi-arrow-clockwise"></i> Opdater
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
|
<div id="loading" class="text-center py-4">
|
|
|
|
|
|
<div class="spinner-border text-primary" role="status">
|
|
|
|
|
|
<span class="visually-hidden">Indlæser...</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div id="orders-table" class="d-none">
|
|
|
|
|
|
<table class="table table-hover">
|
|
|
|
|
|
<thead>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<th>Ordrenr.</th>
|
|
|
|
|
|
<th>Kunde</th>
|
|
|
|
|
|
<th>Dato</th>
|
|
|
|
|
|
<th class="text-center">Linjer</th>
|
|
|
|
|
|
<th class="text-end">Total</th>
|
|
|
|
|
|
<th class="text-center">Status</th>
|
|
|
|
|
|
<th class="text-end">Handlinger</th>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
</thead>
|
|
|
|
|
|
<tbody id="orders-tbody">
|
|
|
|
|
|
</tbody>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div id="no-orders" class="text-center py-5 d-none">
|
|
|
|
|
|
<i class="bi bi-inbox text-muted" style="font-size: 3rem;"></i>
|
|
|
|
|
|
<p class="text-muted mt-3">Ingen ordrer endnu</p>
|
|
|
|
|
|
<a href="/timetracking" class="btn btn-primary">
|
|
|
|
|
|
<i class="bi bi-arrow-left"></i> Godkend tider først
|
|
|
|
|
|
</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Order Details Modal -->
|
|
|
|
|
|
<div class="modal fade" id="orderModal" tabindex="-1">
|
|
|
|
|
|
<div class="modal-dialog modal-lg">
|
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
|
<h5 class="modal-title">
|
|
|
|
|
|
<i class="bi bi-receipt"></i> Ordre Detaljer
|
|
|
|
|
|
</h5>
|
|
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="modal-body">
|
|
|
|
|
|
<div id="order-details-content">
|
|
|
|
|
|
<!-- Will be populated dynamically -->
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Luk</button>
|
|
|
|
|
|
<button type="button" class="btn btn-success" id="export-order-btn" onclick="exportCurrentOrder()">
|
|
|
|
|
|
<i class="bi bi-cloud-upload"></i> Eksporter til e-conomic
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
let currentOrderId = null;
|
|
|
|
|
|
let orderModal = null;
|
|
|
|
|
|
|
|
|
|
|
|
// Initialize modal
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
|
|
orderModal = new bootstrap.Modal(document.getElementById('orderModal'));
|
|
|
|
|
|
loadOrders();
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Load all orders
|
|
|
|
|
|
async function loadOrders() {
|
|
|
|
|
|
document.getElementById('loading').classList.remove('d-none');
|
|
|
|
|
|
document.getElementById('orders-table').classList.add('d-none');
|
|
|
|
|
|
document.getElementById('no-orders').classList.add('d-none');
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
const response = await fetch('/api/v1/timetracking/orders');
|
|
|
|
|
|
const orders = await response.json();
|
|
|
|
|
|
|
|
|
|
|
|
if (orders.length === 0) {
|
|
|
|
|
|
document.getElementById('loading').classList.add('d-none');
|
|
|
|
|
|
document.getElementById('no-orders').classList.remove('d-none');
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const tbody = document.getElementById('orders-tbody');
|
|
|
|
|
|
tbody.innerHTML = orders.map(order => {
|
|
|
|
|
|
const statusBadge = getStatusBadge(order);
|
2025-12-15 12:28:12 +01:00
|
|
|
|
const isLocked = order.status === 'exported';
|
|
|
|
|
|
const economicInfo = order.economic_draft_id
|
|
|
|
|
|
? `<br><small class="text-muted">e-conomic draft #${order.economic_draft_id}</small>`
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
: '';
|
|
|
|
|
|
|
|
|
|
|
|
return `
|
2025-12-15 12:28:12 +01:00
|
|
|
|
<tr class="order-row ${isLocked ? 'table-warning' : ''}" onclick="viewOrder(${order.id})">
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
<td>
|
|
|
|
|
|
<strong>${order.order_number}</strong>
|
feat: Implement email processing system with scheduler, fetching, classification, and rule matching
- Added EmailProcessorService to orchestrate email workflow: fetching, saving, classifying, and matching rules.
- Introduced EmailScheduler for background processing of emails every 5 minutes.
- Developed EmailService to handle email fetching from IMAP and Microsoft Graph API.
- Created database migration for email system, including tables for email messages, rules, attachments, and analysis.
- Implemented AI classification and extraction for invoices and time confirmations.
- Added logging for better traceability and error handling throughout the email processing pipeline.
2025-12-11 02:31:29 +01:00
|
|
|
|
${economicInfo}
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
</td>
|
|
|
|
|
|
<td>${order.customer_name}</td>
|
|
|
|
|
|
<td>${new Date(order.order_date).toLocaleDateString('da-DK')}</td>
|
|
|
|
|
|
<td class="text-center">${order.line_count || 0}</td>
|
|
|
|
|
|
<td class="text-end"><strong>${parseFloat(order.total_amount).toFixed(2)} DKK</strong></td>
|
|
|
|
|
|
<td class="text-center">${statusBadge}</td>
|
|
|
|
|
|
<td class="text-end">
|
|
|
|
|
|
<button class="btn btn-sm btn-outline-primary"
|
|
|
|
|
|
onclick="event.stopPropagation(); viewOrder(${order.id})">
|
|
|
|
|
|
<i class="bi bi-eye"></i>
|
|
|
|
|
|
</button>
|
feat: Implement email processing system with scheduler, fetching, classification, and rule matching
- Added EmailProcessorService to orchestrate email workflow: fetching, saving, classifying, and matching rules.
- Introduced EmailScheduler for background processing of emails every 5 minutes.
- Developed EmailService to handle email fetching from IMAP and Microsoft Graph API.
- Created database migration for email system, including tables for email messages, rules, attachments, and analysis.
- Implemented AI classification and extraction for invoices and time confirmations.
- Added logging for better traceability and error handling throughout the email processing pipeline.
2025-12-11 02:31:29 +01:00
|
|
|
|
${order.status === 'draft' ? `
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
<button class="btn btn-sm btn-success"
|
|
|
|
|
|
onclick="event.stopPropagation(); exportOrder(${order.id})">
|
feat: Implement email processing system with scheduler, fetching, classification, and rule matching
- Added EmailProcessorService to orchestrate email workflow: fetching, saving, classifying, and matching rules.
- Introduced EmailScheduler for background processing of emails every 5 minutes.
- Developed EmailService to handle email fetching from IMAP and Microsoft Graph API.
- Created database migration for email system, including tables for email messages, rules, attachments, and analysis.
- Implemented AI classification and extraction for invoices and time confirmations.
- Added logging for better traceability and error handling throughout the email processing pipeline.
2025-12-11 02:31:29 +01:00
|
|
|
|
<i class="bi bi-cloud-upload"></i> Eksporter
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
</button>
|
2025-12-15 12:28:12 +01:00
|
|
|
|
<button class="btn btn-sm btn-outline-danger"
|
|
|
|
|
|
onclick="event.stopPropagation(); cancelOrder(${order.id})">
|
|
|
|
|
|
<i class="bi bi-x-circle"></i> Annuller
|
|
|
|
|
|
</button>
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
` : ''}
|
2025-12-15 12:28:12 +01:00
|
|
|
|
${order.status === 'exported' ? `
|
|
|
|
|
|
<span class="badge bg-warning text-dark"><i class="bi bi-lock"></i> Låst</span>
|
|
|
|
|
|
<button class="btn btn-sm btn-outline-warning"
|
|
|
|
|
|
onclick="event.stopPropagation(); unlockOrder(${order.id})">
|
|
|
|
|
|
<i class="bi bi-unlock"></i> Lås op
|
|
|
|
|
|
</button>
|
feat: Implement email processing system with scheduler, fetching, classification, and rule matching
- Added EmailProcessorService to orchestrate email workflow: fetching, saving, classifying, and matching rules.
- Introduced EmailScheduler for background processing of emails every 5 minutes.
- Developed EmailService to handle email fetching from IMAP and Microsoft Graph API.
- Created database migration for email system, including tables for email messages, rules, attachments, and analysis.
- Implemented AI classification and extraction for invoices and time confirmations.
- Added logging for better traceability and error handling throughout the email processing pipeline.
2025-12-11 02:31:29 +01:00
|
|
|
|
` : ''}
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
`;
|
|
|
|
|
|
}).join('');
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById('loading').classList.add('d-none');
|
|
|
|
|
|
document.getElementById('orders-table').classList.remove('d-none');
|
|
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
console.error('Error loading orders:', error);
|
|
|
|
|
|
document.getElementById('loading').innerHTML = `
|
|
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
|
|
Fejl ved indlæsning: ${error.message}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
`;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Get status badge
|
|
|
|
|
|
function getStatusBadge(order) {
|
feat: Implement email processing system with scheduler, fetching, classification, and rule matching
- Added EmailProcessorService to orchestrate email workflow: fetching, saving, classifying, and matching rules.
- Introduced EmailScheduler for background processing of emails every 5 minutes.
- Developed EmailService to handle email fetching from IMAP and Microsoft Graph API.
- Created database migration for email system, including tables for email messages, rules, attachments, and analysis.
- Implemented AI classification and extraction for invoices and time confirmations.
- Added logging for better traceability and error handling throughout the email processing pipeline.
2025-12-11 02:31:29 +01:00
|
|
|
|
const statusMap = {
|
|
|
|
|
|
'cancelled': '<span class="badge bg-danger">Annulleret</span>',
|
2025-12-15 12:28:12 +01:00
|
|
|
|
'exported': '<span class="badge bg-warning text-dark"><i class="bi bi-cloud-check"></i> Eksporteret</span>',
|
|
|
|
|
|
'draft': '<span class="badge bg-secondary">Kladde</span>'
|
feat: Implement email processing system with scheduler, fetching, classification, and rule matching
- Added EmailProcessorService to orchestrate email workflow: fetching, saving, classifying, and matching rules.
- Introduced EmailScheduler for background processing of emails every 5 minutes.
- Developed EmailService to handle email fetching from IMAP and Microsoft Graph API.
- Created database migration for email system, including tables for email messages, rules, attachments, and analysis.
- Implemented AI classification and extraction for invoices and time confirmations.
- Added logging for better traceability and error handling throughout the email processing pipeline.
2025-12-11 02:31:29 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return statusMap[order.status] || '<span class="badge bg-secondary">Ukendt</span>';
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// View order details
|
|
|
|
|
|
async function viewOrder(orderId) {
|
|
|
|
|
|
currentOrderId = orderId;
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
const response = await fetch(`/api/v1/timetracking/orders/${orderId}`);
|
|
|
|
|
|
const order = await response.json();
|
|
|
|
|
|
|
|
|
|
|
|
const content = document.getElementById('order-details-content');
|
|
|
|
|
|
content.innerHTML = `
|
|
|
|
|
|
<div class="info-row">
|
|
|
|
|
|
<span class="fw-bold">Ordrenummer:</span>
|
|
|
|
|
|
<span>${order.order_number}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="info-row">
|
|
|
|
|
|
<span class="fw-bold">Kunde:</span>
|
|
|
|
|
|
<span>${order.customer_name}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="info-row">
|
|
|
|
|
|
<span class="fw-bold">Dato:</span>
|
|
|
|
|
|
<span>${new Date(order.order_date).toLocaleDateString('da-DK')}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="info-row">
|
|
|
|
|
|
<span class="fw-bold">Total:</span>
|
|
|
|
|
|
<span class="fs-5 fw-bold text-primary">${parseFloat(order.total_amount).toFixed(2)} DKK</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<hr class="my-3">
|
|
|
|
|
|
|
|
|
|
|
|
<h6 class="mb-3">Ordrelinjer:</h6>
|
2025-12-10 18:29:13 +01:00
|
|
|
|
${order.lines.map(line => {
|
|
|
|
|
|
// Parse data
|
|
|
|
|
|
const caseMatch = line.description.match(/CC(\d+)/);
|
|
|
|
|
|
const caseTitle = line.description.split(' - ').slice(1).join(' - ') || line.description;
|
|
|
|
|
|
const hours = parseFloat(line.quantity);
|
|
|
|
|
|
const unitPrice = parseFloat(line.unit_price);
|
|
|
|
|
|
const total = parseFloat(line.line_total);
|
|
|
|
|
|
const date = new Date(line.time_date).toLocaleDateString('da-DK');
|
|
|
|
|
|
|
|
|
|
|
|
// Extract contact name from case_contact if available
|
|
|
|
|
|
const contactName = line.case_contact || 'Ingen kontakt';
|
|
|
|
|
|
|
|
|
|
|
|
// Check if it's an on-site visit (udkørsel)
|
|
|
|
|
|
const isOnSite = line.description.toLowerCase().includes('udkørsel') ||
|
|
|
|
|
|
line.description.toLowerCase().includes('on-site');
|
|
|
|
|
|
|
|
|
|
|
|
return `
|
|
|
|
|
|
<div class="line-item mb-3 p-3" style="border: 1px solid #dee2e6; border-radius: 8px;">
|
|
|
|
|
|
<div class="d-flex justify-content-between align-items-start mb-2">
|
|
|
|
|
|
<div class="flex-grow-1">
|
|
|
|
|
|
<div class="d-flex align-items-center gap-2 mb-1">
|
|
|
|
|
|
${caseMatch ? `<span class="badge bg-secondary">${caseMatch[0]}</span>` : ''}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="fw-bold text-uppercase mb-1" style="font-size: 0.95rem;">
|
|
|
|
|
|
${caseTitle}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="text-muted small">
|
|
|
|
|
|
${date} - ${contactName}${isOnSite ? ' <span class="badge bg-info">Udkørsel</span>' : ''}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="text-end">
|
|
|
|
|
|
<div class="fs-5 fw-bold text-primary">${total.toFixed(2)} DKK</div>
|
|
|
|
|
|
</div>
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-12-10 18:29:13 +01:00
|
|
|
|
`;
|
|
|
|
|
|
}).join('')}
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
|
feat: Implement email processing system with scheduler, fetching, classification, and rule matching
- Added EmailProcessorService to orchestrate email workflow: fetching, saving, classifying, and matching rules.
- Introduced EmailScheduler for background processing of emails every 5 minutes.
- Developed EmailService to handle email fetching from IMAP and Microsoft Graph API.
- Created database migration for email system, including tables for email messages, rules, attachments, and analysis.
- Implemented AI classification and extraction for invoices and time confirmations.
- Added logging for better traceability and error handling throughout the email processing pipeline.
2025-12-11 02:31:29 +01:00
|
|
|
|
${order.status === 'posted' ? `
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
<div class="alert alert-success mt-3 mb-0">
|
feat: Implement email processing system with scheduler, fetching, classification, and rule matching
- Added EmailProcessorService to orchestrate email workflow: fetching, saving, classifying, and matching rules.
- Introduced EmailScheduler for background processing of emails every 5 minutes.
- Developed EmailService to handle email fetching from IMAP and Microsoft Graph API.
- Created database migration for email system, including tables for email messages, rules, attachments, and analysis.
- Implemented AI classification and extraction for invoices and time confirmations.
- Added logging for better traceability and error handling throughout the email processing pipeline.
2025-12-11 02:31:29 +01:00
|
|
|
|
<i class="bi bi-lock-fill"></i>
|
|
|
|
|
|
<strong>Bogført til e-conomic</strong> den ${new Date(order.exported_at).toLocaleDateString('da-DK')}
|
|
|
|
|
|
<br>e-conomic ordre nr.: ${order.economic_order_number}
|
|
|
|
|
|
<br><small class="text-muted">Ordren er låst og kan ikke ændres.</small>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
` : order.economic_draft_id ? `
|
|
|
|
|
|
<div class="alert alert-info mt-3 mb-0">
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
<i class="bi bi-check-circle"></i>
|
|
|
|
|
|
Eksporteret til e-conomic den ${new Date(order.exported_at).toLocaleDateString('da-DK')}
|
2025-12-10 18:29:13 +01:00
|
|
|
|
<br>Draft Order nr.: ${order.economic_draft_id}
|
|
|
|
|
|
${order.economic_order_number ? `<br>e-conomic ordre nr.: ${order.economic_order_number}` : ''}
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
</div>
|
|
|
|
|
|
` : ''}
|
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
|
|
// Update export button
|
|
|
|
|
|
const exportBtn = document.getElementById('export-order-btn');
|
2025-12-15 12:28:12 +01:00
|
|
|
|
if (order.status === 'exported') {
|
feat: Implement email processing system with scheduler, fetching, classification, and rule matching
- Added EmailProcessorService to orchestrate email workflow: fetching, saving, classifying, and matching rules.
- Introduced EmailScheduler for background processing of emails every 5 minutes.
- Developed EmailService to handle email fetching from IMAP and Microsoft Graph API.
- Created database migration for email system, including tables for email messages, rules, attachments, and analysis.
- Implemented AI classification and extraction for invoices and time confirmations.
- Added logging for better traceability and error handling throughout the email processing pipeline.
2025-12-11 02:31:29 +01:00
|
|
|
|
exportBtn.disabled = true;
|
2025-12-15 12:28:12 +01:00
|
|
|
|
exportBtn.innerHTML = '<i class="bi bi-lock"></i> Eksporteret (Låst)';
|
feat: Implement email processing system with scheduler, fetching, classification, and rule matching
- Added EmailProcessorService to orchestrate email workflow: fetching, saving, classifying, and matching rules.
- Introduced EmailScheduler for background processing of emails every 5 minutes.
- Developed EmailService to handle email fetching from IMAP and Microsoft Graph API.
- Created database migration for email system, including tables for email messages, rules, attachments, and analysis.
- Implemented AI classification and extraction for invoices and time confirmations.
- Added logging for better traceability and error handling throughout the email processing pipeline.
2025-12-11 02:31:29 +01:00
|
|
|
|
exportBtn.classList.remove('btn-primary');
|
|
|
|
|
|
exportBtn.classList.add('btn-secondary');
|
2025-12-15 12:28:12 +01:00
|
|
|
|
} else if (order.status === 'draft') {
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
exportBtn.disabled = false;
|
|
|
|
|
|
exportBtn.innerHTML = '<i class="bi bi-cloud-upload"></i> Eksporter til e-conomic';
|
2025-12-10 18:29:13 +01:00
|
|
|
|
exportBtn.onclick = exportCurrentOrder;
|
2025-12-15 12:28:12 +01:00
|
|
|
|
} else {
|
|
|
|
|
|
exportBtn.disabled = true;
|
|
|
|
|
|
exportBtn.innerHTML = `<i class="bi bi-x-circle"></i> ${order.status}`;
|
|
|
|
|
|
exportBtn.classList.remove('btn-primary');
|
|
|
|
|
|
exportBtn.classList.add('btn-secondary');
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
orderModal.show();
|
|
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
alert('Fejl ved indlæsning af ordre: ' + error.message);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Export order
|
|
|
|
|
|
async function exportOrder(orderId) {
|
2025-12-10 18:29:13 +01:00
|
|
|
|
if (!confirm('Eksporter ordre til e-conomic?\n\nDette opretter en kladde-ordre i e-conomic.')) {
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
2025-12-10 18:29:13 +01:00
|
|
|
|
const response = await fetch(`/api/v1/timetracking/export`, {
|
|
|
|
|
|
method: 'POST',
|
|
|
|
|
|
headers: {
|
|
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
|
|
},
|
|
|
|
|
|
body: JSON.stringify({
|
|
|
|
|
|
order_id: orderId,
|
|
|
|
|
|
force: false
|
|
|
|
|
|
})
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
});
|
2025-12-10 18:29:13 +01:00
|
|
|
|
|
|
|
|
|
|
if (!response.ok) {
|
|
|
|
|
|
const errorData = await response.json();
|
|
|
|
|
|
throw new Error(errorData.detail || 'Export failed');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
const result = await response.json();
|
|
|
|
|
|
|
|
|
|
|
|
if (result.dry_run) {
|
2025-12-10 18:29:13 +01:00
|
|
|
|
alert(`DRY-RUN MODE:\n\n${result.message}\n\nDetails:\n- Ordre: ${result.details.order_number}\n- Kunde: ${result.details.customer_name}\n- Total: ${result.details.total_amount} DKK\n- Linjer: ${result.details.line_count}\n\n⚠️ Ingen ændringer er foretaget i e-conomic (DRY-RUN mode aktiveret).`);
|
|
|
|
|
|
} else if (result.success) {
|
|
|
|
|
|
alert(`✅ Ordre eksporteret til e-conomic!\n\n- Draft Order nr.: ${result.economic_draft_id}\n- e-conomic ordre nr.: ${result.economic_order_number}\n\n${result.message}`);
|
|
|
|
|
|
loadOrders();
|
|
|
|
|
|
if (orderModal._isShown) {
|
|
|
|
|
|
orderModal.hide();
|
|
|
|
|
|
}
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
} else {
|
2025-12-10 18:29:13 +01:00
|
|
|
|
throw new Error(result.message || 'Export failed');
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
alert('Fejl ved eksport: ' + error.message);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Export current order from modal
|
|
|
|
|
|
function exportCurrentOrder() {
|
|
|
|
|
|
if (currentOrderId) {
|
|
|
|
|
|
exportOrder(currentOrderId);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-12-10 18:29:13 +01:00
|
|
|
|
|
2025-12-15 12:28:12 +01:00
|
|
|
|
// Unlock exported order (ADMIN)
|
|
|
|
|
|
async function unlockOrder(orderId) {
|
|
|
|
|
|
const adminCode = prompt(
|
|
|
|
|
|
'🔐 ADMIN ADGANG PÅKRÆVET\n\n' +
|
|
|
|
|
|
'Før ordren kan låses op skal den være slettet fra e-conomic.\n\n' +
|
|
|
|
|
|
'Indtast admin unlock kode:'
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
if (!adminCode) return;
|
|
|
|
|
|
|
|
|
|
|
|
if (!confirm(
|
|
|
|
|
|
'⚠️ ADVARSEL\n\n' +
|
|
|
|
|
|
'Er du SIKKER på at ordren er slettet fra e-conomic?\n\n' +
|
|
|
|
|
|
'Systemet vil tjekke om ordren stadig findes i e-conomic.\n\n' +
|
|
|
|
|
|
'Fortsæt?'
|
|
|
|
|
|
)) return;
|
|
|
|
|
|
|
2025-12-10 18:29:13 +01:00
|
|
|
|
try {
|
2025-12-15 12:28:12 +01:00
|
|
|
|
const response = await fetch(`/api/v1/timetracking/orders/${orderId}/unlock?admin_code=${encodeURIComponent(adminCode)}`, {
|
2025-12-10 18:29:13 +01:00
|
|
|
|
method: 'POST',
|
|
|
|
|
|
headers: {
|
|
|
|
|
|
'Content-Type': 'application/json'
|
2025-12-15 12:28:12 +01:00
|
|
|
|
}
|
2025-12-10 18:29:13 +01:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (!response.ok) {
|
|
|
|
|
|
const errorData = await response.json();
|
2025-12-15 12:28:12 +01:00
|
|
|
|
alert(`❌ Kunne ikke låse ordre op:\n\n${errorData.detail}`);
|
|
|
|
|
|
return;
|
2025-12-10 18:29:13 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const result = await response.json();
|
2025-12-15 12:28:12 +01:00
|
|
|
|
alert(`✅ ${result.message}\n\nOrdren kan nu redigeres eller slettes.`);
|
|
|
|
|
|
loadOrders();
|
|
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
console.error('Error unlocking order:', error);
|
|
|
|
|
|
alert(`❌ Fejl ved unlock: ${error.message}`);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-12-10 18:29:13 +01:00
|
|
|
|
|
2025-12-15 12:28:12 +01:00
|
|
|
|
// Cancel order
|
|
|
|
|
|
async function cancelOrder(orderId) {
|
|
|
|
|
|
if (!confirm('Annuller denne ordre?\n\nTidsregistreringerne sættes tilbage til "godkendt" status.')) {
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
const response = await fetch(`/api/v1/timetracking/orders/${orderId}/cancel`, {
|
|
|
|
|
|
method: 'POST',
|
|
|
|
|
|
headers: {
|
|
|
|
|
|
'Content-Type': 'application/json'
|
2025-12-10 18:29:13 +01:00
|
|
|
|
}
|
2025-12-15 12:28:12 +01:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (!response.ok) {
|
|
|
|
|
|
const errorData = await response.json();
|
|
|
|
|
|
alert(`❌ Kunne ikke annullere ordre:\n\n${errorData.detail}`);
|
|
|
|
|
|
return;
|
2025-12-10 18:29:13 +01:00
|
|
|
|
}
|
2025-12-15 12:28:12 +01:00
|
|
|
|
|
|
|
|
|
|
alert('✅ Ordre annulleret\n\nTidsregistreringerne er sat tilbage til "godkendt" status.');
|
|
|
|
|
|
loadOrders();
|
|
|
|
|
|
|
2025-12-10 18:29:13 +01:00
|
|
|
|
} catch (error) {
|
2025-12-15 12:28:12 +01:00
|
|
|
|
console.error('Error cancelling order:', error);
|
|
|
|
|
|
alert(`❌ Fejl ved annullering: ${error.message}`);
|
2025-12-10 18:29:13 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-12-15 12:28:12 +01:00
|
|
|
|
|
feat(timetracking): Implement time tracking module with frontend views, HTML templates, and database migrations
- Added FastAPI router for time tracking views including dashboard, wizard, and orders.
- Created HTML templates for the time tracking wizard with responsive design and Bootstrap integration.
- Developed SQL migration script for the time tracking module, including tables for customers, cases, time entries, orders, and audit logs.
- Introduced a script to list all registered routes, focusing on time tracking routes.
- Added test script to verify route registration and specifically check for time tracking routes.
2025-12-09 22:46:30 +01:00
|
|
|
|
</script>
|
2025-12-13 12:06:28 +01:00
|
|
|
|
</div>
|
|
|
|
|
|
{% endblock %}
|