fix(export): Stundennachweis nur fuer laufende Projekte auswaehlbar
Die Auswahl im Exportdialog kam aus allen zugewiesenen Projekten - also auch aus archivierten und von stillgelegten Kunden. In der Liste stand damit etwa "Top IT Services", wo seit 2025 nichts mehr laeuft. Waehlbar sind jetzt nur laufende Projekte aktiver Kunden. Dafuer liefert loadProjects den Status des Kunden mit; ohne ihn liesse sich "nur aktive Kunden" in der Oberflaeche nicht entscheiden. Die Zeiten aus archivierten Projekten bleiben erreichbar: ohne Filter exportiert der Nachweis alles, was die Person im Monat gebucht hat, und der Projektreport hat seinen eigenen Export. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0cd426777d
commit
4e46df813c
@@ -175,6 +175,7 @@ export function isBillable(project, task) {
|
||||
export async function loadProjects(settings, { where = '1=1', params = [] } = {}) {
|
||||
const [projects] = await pool.query(
|
||||
`SELECT p.*, c.name AS customer_name, c.short_name AS customer_short, c.color AS customer_color,
|
||||
c.is_active AS customer_active,
|
||||
u.name AS owner_name
|
||||
FROM pulse_projects p
|
||||
JOIN pulse_customers c ON c.id = p.customer_id
|
||||
@@ -270,7 +271,7 @@ export async function loadProjects(settings, { where = '1=1', params = [] } = {}
|
||||
return {
|
||||
...project,
|
||||
display_name: displayName(settings, project, customer),
|
||||
customer: { id: p.customer_id, name: p.customer_name, short_name: p.customer_short, color: p.customer_color },
|
||||
customer: { id: p.customer_id, name: p.customer_name, short_name: p.customer_short, color: p.customer_color, is_active: Boolean(p.customer_active) },
|
||||
pots: projectPots,
|
||||
tasks: tasks
|
||||
.filter((t) => t.project_id === p.id)
|
||||
|
||||
Reference in New Issue
Block a user