@flowselections/dashboard-planner-installatie-techniek 1.1.1 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -4
- package/dist-lib/components/DashboardDagNotities.d.ts +2 -1
- package/dist-lib/components/DashboardDagNotities.d.ts.map +1 -1
- package/dist-lib/components/DashboardDagNotities.js +8 -4
- package/dist-lib/components/DashboardPlannerInstallatieTechniekPage.d.ts +8 -1
- package/dist-lib/components/DashboardPlannerInstallatieTechniekPage.d.ts.map +1 -1
- package/dist-lib/components/DashboardPlannerInstallatieTechniekPage.js +11 -6
- package/dist-lib/components/DashboardStatistieken.d.ts +2 -1
- package/dist-lib/components/DashboardStatistieken.d.ts.map +1 -1
- package/dist-lib/components/DashboardStatistieken.js +13 -6
- package/dist-lib/components/WerkbonnenFunnel.d.ts +3 -1
- package/dist-lib/components/WerkbonnenFunnel.d.ts.map +1 -1
- package/dist-lib/components/WerkbonnenFunnel.js +4 -4
- package/dist-lib/components/WerkurenGrafiek.d.ts +7 -4
- package/dist-lib/components/WerkurenGrafiek.d.ts.map +1 -1
- package/dist-lib/components/WerkurenGrafiek.js +21 -14
- package/dist-lib/integrations/supabase/types.d.ts +13513 -253
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.js +1 -0
- package/dist-lib/lib/dashboard-constanten.d.ts +1 -1
- package/dist-lib/lib/dashboard-constanten.d.ts.map +1 -1
- package/dist-lib/lib/dashboard-constanten.js +2 -2
- package/dist-lib/lib/dashboard-dagnotities.d.ts +1 -1
- package/dist-lib/lib/dashboard-dagnotities.d.ts.map +1 -1
- package/dist-lib/lib/dashboard-dagnotities.js +2 -2
- package/dist-lib/lib/dashboard-onvolledig.d.ts +6 -0
- package/dist-lib/lib/dashboard-onvolledig.d.ts.map +1 -0
- package/dist-lib/lib/dashboard-onvolledig.js +9 -0
- package/dist-lib/lib/dashboard-planner-installatie-techniek.server.d.ts +17 -0
- package/dist-lib/lib/dashboard-planner-installatie-techniek.server.d.ts.map +1 -1
- package/dist-lib/lib/dashboard-planner-installatie-techniek.server.js +75 -16
- package/dist-lib/lib/dashboard-planner-installatie-techniek.stats.server.d.ts +6 -1
- package/dist-lib/lib/dashboard-planner-installatie-techniek.stats.server.d.ts.map +1 -1
- package/dist-lib/lib/dashboard-planner-installatie-techniek.stats.server.js +42 -19
- package/dist-lib/lib/dashboard-planner-installatie-techniek.types.d.ts +7 -0
- package/dist-lib/lib/dashboard-planner-installatie-techniek.types.d.ts.map +1 -1
- package/dist-lib/lib/dashboard-tellingen.d.ts +23 -0
- package/dist-lib/lib/dashboard-tellingen.d.ts.map +1 -1
- package/dist-lib/lib/dashboard-tellingen.js +38 -0
- package/dist-lib/lib/dashboard-werkbon-funnel.js +1 -1
- package/dist-lib/lib/funnel-indeling.d.ts +1 -1
- package/dist-lib/lib/funnel-indeling.d.ts.map +1 -1
- package/dist-lib/lib/funnel-indeling.js +2 -2
- package/dist-lib/lib/rekenregels.d.ts +6 -3
- package/dist-lib/lib/rekenregels.d.ts.map +1 -1
- package/dist-lib/lib/rekenregels.js +42 -13
- package/package.json +56 -8
- package/supabase/dashboard-planner-installatie-techniek-installatie.sql +1046 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const DASHBOARD_TIJDZONE = "Europe/Amsterdam";
|
|
2
2
|
/** YYYY-MM-DD in de dashboardtijdzone (doorverwijzing naar rekenregels.vandaagLokaal). */
|
|
3
|
-
export declare function dashboardDatum(d?: Date): string;
|
|
3
|
+
export declare function dashboardDatum(d?: Date, tijdzone?: string): string;
|
|
4
4
|
//# sourceMappingURL=dashboard-constanten.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-constanten.d.ts","sourceRoot":"","sources":["../../src/lib/dashboard-constanten.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD,0FAA0F;AAC1F,wBAAgB,cAAc,CAAC,CAAC,GAAE,IAAiB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"dashboard-constanten.d.ts","sourceRoot":"","sources":["../../src/lib/dashboard-constanten.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD,0FAA0F;AAC1F,wBAAgB,cAAc,CAAC,CAAC,GAAE,IAAiB,EAAE,QAAQ,GAAE,MAA2B,GAAG,MAAM,CAElG"}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
import { vandaagLokaal } from "./rekenregels";
|
|
3
3
|
export const DASHBOARD_TIJDZONE = "Europe/Amsterdam";
|
|
4
4
|
/** YYYY-MM-DD in de dashboardtijdzone (doorverwijzing naar rekenregels.vandaagLokaal). */
|
|
5
|
-
export function dashboardDatum(d = new Date()) {
|
|
6
|
-
return vandaagLokaal(DASHBOARD_TIJDZONE, d);
|
|
5
|
+
export function dashboardDatum(d = new Date(), tijdzone = DASHBOARD_TIJDZONE) {
|
|
6
|
+
return vandaagLokaal(tijdzone || DASHBOARD_TIJDZONE, d);
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ export declare const MAX_NOTITIE_LENGTE = 2000;
|
|
|
2
2
|
/** YYYY-MM-DD plus `dagen` kalenderdagen (Amsterdamse datum als basis). */
|
|
3
3
|
export declare function verschuifDag(datum: string, dagen: number): string;
|
|
4
4
|
/** "vandaag", "morgen", "gisteren" of "do 5 nov". */
|
|
5
|
-
export declare function dagNaam(datum: string, nu?: Date): string;
|
|
5
|
+
export declare function dagNaam(datum: string, nu?: Date, tijdzone?: string): string;
|
|
6
6
|
export declare function knipNotitie(tekst: string): string;
|
|
7
7
|
export declare const PUNT = "\u2022 ";
|
|
8
8
|
/** Zet "• " voor elke regel; lege tekst blijft leeg, bestaande punten blijven. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-dagnotities.d.ts","sourceRoot":"","sources":["../../src/lib/dashboard-dagnotities.ts"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,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAE7G;AAED,sDAAsD;AACtD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,GAAG,IAAI,CAK7H"}
|
|
@@ -8,8 +8,8 @@ export function verschuifDag(datum, dagen) {
|
|
|
8
8
|
const DAGEN = ["zo", "ma", "di", "wo", "do", "vr", "za"];
|
|
9
9
|
const MAANDEN = ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"];
|
|
10
10
|
/** "vandaag", "morgen", "gisteren" of "do 5 nov". */
|
|
11
|
-
export function dagNaam(datum, nu = new Date()) {
|
|
12
|
-
const vandaag = dashboardDatum(nu);
|
|
11
|
+
export function dagNaam(datum, nu = new Date(), tijdzone) {
|
|
12
|
+
const vandaag = dashboardDatum(nu, tijdzone);
|
|
13
13
|
if (datum === vandaag)
|
|
14
14
|
return "vandaag";
|
|
15
15
|
if (datum === verschuifDag(vandaag, 1))
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const MAX_RIJEN_PER_OPHAAL = 1000;
|
|
2
|
+
export type OnvolledigeKpi = "omzetOpen" | "offertes" | "werkuren";
|
|
3
|
+
/** True als de oude telling (database-telling uit) de rijgrens raakte en dus mogelijk onvolledig is. */
|
|
4
|
+
export declare function mogelijkOnvolledig(aantalRijen: unknown, tellenInDatabase: boolean): boolean;
|
|
5
|
+
export declare const ONVOLLEDIG_MELDING = "Mogelijk onvolledig, zet 'Statistieken in de database tellen' aan.";
|
|
6
|
+
//# sourceMappingURL=dashboard-onvolledig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-onvolledig.d.ts","sourceRoot":"","sources":["../../src/lib/dashboard-onvolledig.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC;AAEnE,wGAAwG;AACxG,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAG3F;AAED,eAAO,MAAM,kBAAkB,uEAAuE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Waarschuwing voor de oude telling in JavaScript: PostgREST levert standaard maximaal 1000 rijen.
|
|
2
|
+
export const MAX_RIJEN_PER_OPHAAL = 1000;
|
|
3
|
+
/** True als de oude telling (database-telling uit) de rijgrens raakte en dus mogelijk onvolledig is. */
|
|
4
|
+
export function mogelijkOnvolledig(aantalRijen, tellenInDatabase) {
|
|
5
|
+
if (tellenInDatabase)
|
|
6
|
+
return false;
|
|
7
|
+
return Array.isArray(aantalRijen) ? aantalRijen.length >= MAX_RIJEN_PER_OPHAAL : typeof aantalRijen === "number" && aantalRijen >= MAX_RIJEN_PER_OPHAAL;
|
|
8
|
+
}
|
|
9
|
+
export const ONVOLLEDIG_MELDING = "Mogelijk onvolledig, zet 'Statistieken in de database tellen' aan.";
|
|
@@ -12,6 +12,23 @@ export declare function telFacturatieStatus(supabase: Supa): Promise<{
|
|
|
12
12
|
werkbonnenOpen: number | null;
|
|
13
13
|
facturenTeFactureren: number | null;
|
|
14
14
|
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Zelfde telling, met een reden in gewone taal als hij mislukt.
|
|
17
|
+
* - Gefactureerd = factuur met status ≠ gecrediteerd en (als de kolom bestaat)
|
|
18
|
+
* credit_of leeg, zoals de facturenmodule.
|
|
19
|
+
* - Klaar zonder factuur alleen als factureerbaar: gereed_door_planner = false
|
|
20
|
+
* (gelijk aan werkbon_factureerbaar); zonder die kolom het oude gedrag.
|
|
21
|
+
* - gereedDoorPlanner: klaar zonder factuur maar door de planner gereed gemeld;
|
|
22
|
+
* undefined als de kolom niet bestaat.
|
|
23
|
+
*/
|
|
24
|
+
export declare function telFacturatieStatusMetReden(supabase: Supa): Promise<{
|
|
25
|
+
werkbonnenOpen: number | null;
|
|
26
|
+
facturenTeFactureren: number | null;
|
|
27
|
+
gereedDoorPlanner?: number | null;
|
|
28
|
+
reden?: string;
|
|
29
|
+
}>;
|
|
15
30
|
export declare function fetchDashboardData(supabase: Supa, userId: string, wekenTerug?: number): Promise<DashboardData>;
|
|
31
|
+
/** Reden per KPI die niet geteld kon worden ("n.b." op de kaart). */
|
|
32
|
+
export declare function kpiRedenen(kpis: DashboardData["kpis"], facturatieReden?: string): Partial<Record<keyof DashboardData["kpis"], string>>;
|
|
16
33
|
export {};
|
|
17
34
|
//# sourceMappingURL=dashboard-planner-installatie-techniek.server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-planner-installatie-techniek.server.d.ts","sourceRoot":"","sources":["../../src/lib/dashboard-planner-installatie-techniek.server.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAMpF,KAAK,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard-planner-installatie-techniek.server.d.ts","sourceRoot":"","sources":["../../src/lib/dashboard-planner-installatie-techniek.server.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAMpF,KAAK,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AAkBhC;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,IAAI,GACb,OAAO,CAAC;IAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAGjF;AAwBD;;;;;;;;GAQG;AACH,wBAAsB,2BAA2B,CAC/C,QAAQ,EAAE,IAAI,GACb,OAAO,CAAC;IAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAsCpI;AA6JD,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,SAAI,GAAG,OAAO,CAAC,aAAa,CAAC,CAiD/G;AAED,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAOtI"}
|
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
// de ingelogde gebruiker. Een mislukte telling wordt `null` (geen crash).
|
|
6
6
|
// ============================================================================
|
|
7
7
|
import { dashboardDatum } from "./dashboard-constanten";
|
|
8
|
-
import { leesDbTellingen } from "./dashboard-tellingen";
|
|
8
|
+
import { haalAllesOp, leesDbTellingen, redenUitFout } from "./dashboard-tellingen";
|
|
9
|
+
/** Vaste volgorde op id, zodat blokken van 1000 elkaar niet overlappen. */
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
const opId = (q) => (typeof q?.order === "function" ? q.order("id") : q);
|
|
9
12
|
async function telling(q) {
|
|
10
13
|
try {
|
|
11
14
|
const { count, error } = await q;
|
|
@@ -25,24 +28,66 @@ async function telling(q) {
|
|
|
25
28
|
* Facturen-module nog van actie vraagt.
|
|
26
29
|
*/
|
|
27
30
|
export async function telFacturatieStatus(supabase) {
|
|
31
|
+
const { werkbonnenOpen, facturenTeFactureren } = await telFacturatieStatusMetReden(supabase);
|
|
32
|
+
return { werkbonnenOpen, facturenTeFactureren };
|
|
33
|
+
}
|
|
34
|
+
const KLAAR = ["completed", "invoicing"];
|
|
35
|
+
/** Kolom ontbreekt in deze database (andere versie van de eigenaar-module)? */
|
|
36
|
+
function kolomOntbreekt(error) {
|
|
37
|
+
const e = (error ?? {});
|
|
38
|
+
const code = String(e.code ?? "");
|
|
39
|
+
return code === "42703" || code === "PGRST204" || /column .* does not exist/i.test(String(e.message ?? ""));
|
|
40
|
+
}
|
|
41
|
+
/** Probeert eerst met extra kolom; ontbreekt die, dan zonder (huidig gedrag). */
|
|
42
|
+
async function haalMetOptioneleKolom(maak, basis, extra) {
|
|
43
|
+
const met = await haalAllesOp(() => maak(`${basis}, ${extra}`));
|
|
44
|
+
if (!met.error)
|
|
45
|
+
return { ...met, heeftKolom: true };
|
|
46
|
+
if (!kolomOntbreekt(met.error))
|
|
47
|
+
return { ...met, heeftKolom: false };
|
|
48
|
+
const zonder = await haalAllesOp(() => maak(basis));
|
|
49
|
+
return { ...zonder, heeftKolom: false };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Zelfde telling, met een reden in gewone taal als hij mislukt.
|
|
53
|
+
* - Gefactureerd = factuur met status ≠ gecrediteerd en (als de kolom bestaat)
|
|
54
|
+
* credit_of leeg, zoals de facturenmodule.
|
|
55
|
+
* - Klaar zonder factuur alleen als factureerbaar: gereed_door_planner = false
|
|
56
|
+
* (gelijk aan werkbon_factureerbaar); zonder die kolom het oude gedrag.
|
|
57
|
+
* - gereedDoorPlanner: klaar zonder factuur maar door de planner gereed gemeld;
|
|
58
|
+
* undefined als de kolom niet bestaat.
|
|
59
|
+
*/
|
|
60
|
+
export async function telFacturatieStatusMetReden(supabase) {
|
|
28
61
|
const leeg = { werkbonnenOpen: null, facturenTeFactureren: null };
|
|
29
62
|
try {
|
|
63
|
+
// Gepagineerd (blokken van 1000): de koppeling via source_ref vraagt de rijen zelf.
|
|
30
64
|
const [werkbonnen, facturen] = await Promise.all([
|
|
31
|
-
supabase.from("werkbonnen").select("id, status"),
|
|
32
|
-
supabase.from("invoices").select(
|
|
65
|
+
haalMetOptioneleKolom((k) => opId(supabase.from("werkbonnen").select(k)), "id, status", "gereed_door_planner"),
|
|
66
|
+
haalMetOptioneleKolom((k) => opId(supabase.from("invoices").select(k).eq("source_type", "work_order")), "source_ref, status", "credit_of"),
|
|
33
67
|
]);
|
|
34
|
-
if (werkbonnen.error || facturen.error)
|
|
35
|
-
|
|
68
|
+
if (werkbonnen.error || facturen.error) {
|
|
69
|
+
console.error("[dashboard] facturatiestatus", werkbonnen.error ?? facturen.error);
|
|
70
|
+
return { ...leeg, ...(werkbonnen.heeftKolom ? { gereedDoorPlanner: null } : {}), reden: werkbonnen.error ? redenUitFout(werkbonnen.error, "werkbonnen") : redenUitFout(facturen.error, "facturen") };
|
|
71
|
+
}
|
|
36
72
|
const wb = Array.isArray(werkbonnen.data) ? werkbonnen.data : [];
|
|
37
|
-
const ff = Array.isArray(facturen.data) ? facturen.data : [];
|
|
73
|
+
const ff = (Array.isArray(facturen.data) ? facturen.data : []).filter((f) => String(f.status) !== "gecrediteerd" && (!facturen.heeftKolom || f.credit_of == null));
|
|
38
74
|
const gefactureerd = new Set(ff.map((f) => String(f.source_ref ?? "")).filter(Boolean));
|
|
39
75
|
const open = wb.filter((w) => !gefactureerd.has(String(w.id))).length;
|
|
40
|
-
const
|
|
76
|
+
const klaarZonder = wb.filter((w) => KLAAR.includes(String(w.status)) && !gefactureerd.has(String(w.id)));
|
|
77
|
+
const doorPlanner = klaarZonder.filter((w) => w.gereed_door_planner === true).length;
|
|
78
|
+
const factureerbaar = werkbonnen.heeftKolom
|
|
79
|
+
? klaarZonder.filter((w) => w.gereed_door_planner !== true).length
|
|
80
|
+
: klaarZonder.length;
|
|
41
81
|
const nogTeVerzenden = ff.filter((f) => String(f.status) === "concept").length;
|
|
42
|
-
return {
|
|
82
|
+
return {
|
|
83
|
+
werkbonnenOpen: open,
|
|
84
|
+
facturenTeFactureren: factureerbaar + nogTeVerzenden,
|
|
85
|
+
...(werkbonnen.heeftKolom ? { gereedDoorPlanner: doorPlanner } : {}),
|
|
86
|
+
};
|
|
43
87
|
}
|
|
44
|
-
catch {
|
|
45
|
-
|
|
88
|
+
catch (e) {
|
|
89
|
+
console.error("[dashboard] facturatiestatus", e);
|
|
90
|
+
return { ...leeg, reden: "Telling mislukt" };
|
|
46
91
|
}
|
|
47
92
|
}
|
|
48
93
|
/** Zelfde logica als de E-mail-module: hoort een mailbox bij het doeleinde? */
|
|
@@ -189,11 +234,11 @@ async function mailConnecties(supabase, userId) {
|
|
|
189
234
|
return null;
|
|
190
235
|
}
|
|
191
236
|
}
|
|
192
|
-
async function dbTellingen(supabase, userId) {
|
|
237
|
+
async function dbTellingen(supabase, userId, tijdzone) {
|
|
193
238
|
try {
|
|
194
239
|
const connecties = await mailConnecties(supabase, userId);
|
|
195
240
|
const { data, error } = await supabase.rpc("dashboard_pit_tellingen", {
|
|
196
|
-
_vandaag: dashboardDatum(),
|
|
241
|
+
_vandaag: dashboardDatum(new Date(), tijdzone),
|
|
197
242
|
_mail_connecties: connecties,
|
|
198
243
|
});
|
|
199
244
|
if (error) {
|
|
@@ -209,10 +254,12 @@ async function dbTellingen(supabase, userId) {
|
|
|
209
254
|
}
|
|
210
255
|
export async function fetchDashboardData(supabase, userId, wekenTerug = 0) {
|
|
211
256
|
const head = { count: "exact", head: true };
|
|
212
|
-
const
|
|
257
|
+
const { haalInstellingen } = await import("./dashboard-instellingen");
|
|
258
|
+
const inst = await haalInstellingen(supabase);
|
|
259
|
+
const db = await dbTellingen(supabase, userId, inst.tijdzone);
|
|
213
260
|
const [planningNietIngepland, facturatie, urenTeBeoordelen, mailsTeControleren, offertesMeerwerk,] = await Promise.all([
|
|
214
261
|
db ? db.planningNietIngepland : telPlanningNietIngepland(supabase),
|
|
215
|
-
db ? { werkbonnenOpen: db.werkbonnenOpen, facturenTeFactureren: db.facturenTeFactureren } :
|
|
262
|
+
db ? { werkbonnenOpen: db.werkbonnenOpen, facturenTeFactureren: db.facturenTeFactureren, ...(db.gereedDoorPlanner !== undefined ? { gereedDoorPlanner: db.gereedDoorPlanner } : {}) } : telFacturatieStatusMetReden(supabase),
|
|
216
263
|
db ? db.urenTeBeoordelen : telUrenTeBeoordelen(supabase),
|
|
217
264
|
db ? db.mailsTeControleren : telMailsTeControleren(supabase, userId),
|
|
218
265
|
telling(supabase
|
|
@@ -224,8 +271,6 @@ export async function fetchDashboardData(supabase, userId, wekenTerug = 0) {
|
|
|
224
271
|
const werkbonnenOpen = facturatie.werkbonnenOpen;
|
|
225
272
|
const facturenTeFactureren = facturatie.facturenTeFactureren;
|
|
226
273
|
const { fetchDashboardStats } = await import("./dashboard-planner-installatie-techniek.stats.server");
|
|
227
|
-
const { haalInstellingen } = await import("./dashboard-instellingen");
|
|
228
|
-
const inst = await haalInstellingen(supabase);
|
|
229
274
|
const week = Math.min(Math.max(wekenTerug, 0), inst.max_weken_terug);
|
|
230
275
|
const stats = await fetchDashboardStats(supabase, week, db?.omzetOpen ?? null, inst);
|
|
231
276
|
return {
|
|
@@ -239,5 +284,19 @@ export async function fetchDashboardData(supabase, userId, wekenTerug = 0) {
|
|
|
239
284
|
offertesMeerwerk,
|
|
240
285
|
facturenTeFactureren,
|
|
241
286
|
},
|
|
287
|
+
...("gereedDoorPlanner" in facturatie && facturatie.gereedDoorPlanner !== undefined
|
|
288
|
+
? { gereedDoorPlanner: facturatie.gereedDoorPlanner, gereedDoorPlannerReden: facturatie.gereedDoorPlanner === null ? ("reden" in facturatie && facturatie.reden) || "Telling mislukt" : undefined }
|
|
289
|
+
: {}),
|
|
290
|
+
kpiRedenen: kpiRedenen({ planningNietIngepland, werkbonnenOpen, urenTeBeoordelen, mailsTeControleren, offertesMeerwerk, facturenTeFactureren }, "reden" in facturatie ? facturatie.reden : undefined),
|
|
242
291
|
};
|
|
243
292
|
}
|
|
293
|
+
/** Reden per KPI die niet geteld kon worden ("n.b." op de kaart). */
|
|
294
|
+
export function kpiRedenen(kpis, facturatieReden) {
|
|
295
|
+
const uit = {};
|
|
296
|
+
for (const [k, v] of Object.entries(kpis)) {
|
|
297
|
+
if (v !== null)
|
|
298
|
+
continue;
|
|
299
|
+
uit[k] = (k === "werkbonnenOpen" || k === "facturenTeFactureren") && facturatieReden ? facturatieReden : "Telling mislukt";
|
|
300
|
+
}
|
|
301
|
+
return uit;
|
|
302
|
+
}
|
|
@@ -2,6 +2,11 @@ import type { SupabaseClient } from "@supabase/supabase-js";
|
|
|
2
2
|
import type { DashboardStats, OffertePijplijnStat, OmzetOpenStat, WerkUrenStat } from "./dashboard-planner-installatie-techniek.types";
|
|
3
3
|
type Supa = SupabaseClient<any>;
|
|
4
4
|
import { type DashboardInstellingen } from "./dashboard-instellingen";
|
|
5
|
+
import { type OnvolledigeKpi } from "./dashboard-onvolledig";
|
|
6
|
+
/** First time fix uit twee tellingen: zelfde uitkomst als tellen over de rijen. */
|
|
7
|
+
export declare const ftfBasis: (ja: number | null, nee: number | null) => number;
|
|
8
|
+
export declare function ftfPct(ja: number | null, nee: number | null): number | null;
|
|
9
|
+
type Meld = Set<OnvolledigeKpi>;
|
|
5
10
|
/** RPC-uitkomst dashboard_pit_omzet_open → stat; ongeldig = null. */
|
|
6
11
|
export declare function leesOmzetRpc(data: unknown): OmzetOpenStat | null;
|
|
7
12
|
type OffertePer = Record<string, {
|
|
@@ -38,7 +43,7 @@ export declare function ftfUitRpc(data: unknown): {
|
|
|
38
43
|
basis: number;
|
|
39
44
|
pct: number | null;
|
|
40
45
|
} | null;
|
|
41
|
-
export declare function telWerkUren(supabase: Supa, nu?: Date, wekenTerug?: number, inst?: DashboardInstellingen): Promise<WerkUrenStat>;
|
|
46
|
+
export declare function telWerkUren(supabase: Supa, nu?: Date, wekenTerug?: number, inst?: DashboardInstellingen, meld?: Meld): Promise<WerkUrenStat>;
|
|
42
47
|
export declare function fetchDashboardStats(supabase: Supa, wekenTerug?: number, omzetUitDb?: OmzetOpenStat | null, inst?: DashboardInstellingen): Promise<DashboardStats>;
|
|
43
48
|
/** Vandaag en de (dagen − 1) voorgaande kalenderdagen (standaard 28). */
|
|
44
49
|
export declare function betaalPeriode(nu?: Date, dagen?: number, tz?: string): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-planner-installatie-techniek.stats.server.d.ts","sourceRoot":"","sources":["../../src/lib/dashboard-planner-installatie-techniek.stats.server.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,YAAY,EAGb,MAAM,gDAAgD,CAAC;AAGxD,KAAK,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard-planner-installatie-techniek.stats.server.d.ts","sourceRoot":"","sources":["../../src/lib/dashboard-planner-installatie-techniek.stats.server.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,YAAY,EAGb,MAAM,gDAAgD,CAAC;AAGxD,KAAK,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AAEhC,OAAO,EAA0B,KAAK,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAE9F,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGjF,mFAAmF;AACnF,eAAO,MAAM,QAAQ,GAAI,IAAI,MAAM,GAAG,IAAI,EAAE,KAAK,MAAM,GAAG,IAAI,WAA2B,CAAC;AAC1F,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,I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jL;AAiBD,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,SAAI,EAAE,UAAU,CAAC,EAAE,aAAa,GAAG,IAAI,EAAE,IAAI,GAAE,qBAA8C,GAAG,OAAO,CAAC,cAAc,CAAC,CAU1L;AAqBD,yEAAyE;AACzE,wBAAgB,aAAa,CAAC,EAAE,OAAa,EAAE,KAAK,SAA8C,EAAE,EAAE,GAAE,MAAW;;;EAElH;AAED;yFACyF;AACzF,wBAAgB,WAAW,CAAC,EAAE,OAAa,EAAE,UAAU,SAAI,EAAE,IAAI,GAAE,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,iBAAiB,GAAG,YAAY,GAAG,UAAU,CAAC,CAAM;;;EAU1J;AAED,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,OAAa,EAAE,IAAI,GAAE,qBAA8C,GAAG,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAiB1K"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import { DASHBOARD_TIJDZONE } from "./dashboard-constanten";
|
|
2
1
|
import { lokaleDatum, maandGrenzen, plusDagen } from "./rekenregels";
|
|
3
2
|
import { STANDAARD_INSTELLINGEN } from "./dashboard-instellingen";
|
|
4
|
-
const TZ =
|
|
3
|
+
const TZ = STANDAARD_INSTELLINGEN.tijdzone;
|
|
4
|
+
import { mogelijkOnvolledig } from "./dashboard-onvolledig";
|
|
5
|
+
import { haalAllesOp } from "./dashboard-tellingen";
|
|
6
|
+
/** First time fix uit twee tellingen: zelfde uitkomst als tellen over de rijen. */
|
|
7
|
+
export const ftfBasis = (ja, nee) => (ja ?? 0) + (nee ?? 0);
|
|
8
|
+
export function ftfPct(ja, nee) {
|
|
9
|
+
const basis = ftfBasis(ja, nee);
|
|
10
|
+
return basis ? Math.round(((ja ?? 0) / basis) * 100) : null;
|
|
11
|
+
}
|
|
5
12
|
/** YYYY-MM-DD in de dashboardtijdzone */
|
|
6
13
|
function nlDatum(d, tz = TZ) {
|
|
7
14
|
return lokaleDatum(d, tz);
|
|
@@ -28,7 +35,7 @@ export function leesOmzetRpc(data) {
|
|
|
28
35
|
const r = { bedragCents: getal(d.bedragCents), aantal: getal(d.aantal), vervallenCents: getal(d.vervallenCents), vervallenAantal: getal(d.vervallenAantal) };
|
|
29
36
|
return Object.values(r).some((v) => v === null) ? null : r;
|
|
30
37
|
}
|
|
31
|
-
async function telOmzetOpen(supabase, inst = STANDAARD_INSTELLINGEN) {
|
|
38
|
+
async function telOmzetOpen(supabase, inst = STANDAARD_INSTELLINGEN, meld) {
|
|
32
39
|
const leeg = { bedragCents: null, aantal: null, vervallenCents: null, vervallenAantal: null };
|
|
33
40
|
try {
|
|
34
41
|
if (inst.tellen_in_database) {
|
|
@@ -38,13 +45,19 @@ async function telOmzetOpen(supabase, inst = STANDAARD_INSTELLINGEN) {
|
|
|
38
45
|
return v;
|
|
39
46
|
log("dashboard_pit_omzet_open (terugval)", r.error ?? "ongeldige uitkomst");
|
|
40
47
|
}
|
|
41
|
-
|
|
48
|
+
// Gepagineerd: de bedragen zijn nodig, dus alle rijen in blokken van 1000.
|
|
49
|
+
const { data, error } = await haalAllesOp(() => {
|
|
50
|
+
const q = supabase.from("invoices").select("total_cents, due_date").eq("status", "verzonden");
|
|
51
|
+
return typeof q.order === "function" ? q.order("id") : q;
|
|
52
|
+
});
|
|
42
53
|
if (error) {
|
|
43
54
|
log("openstaande debiteuren", error);
|
|
44
55
|
return leeg;
|
|
45
56
|
}
|
|
46
57
|
const rows = Array.isArray(data) ? data : [];
|
|
47
|
-
|
|
58
|
+
if (mogelijkOnvolledig(rows, inst.tellen_in_database))
|
|
59
|
+
meld?.add("omzetOpen");
|
|
60
|
+
const vandaag = nlDatum(new Date(), inst.tijdzone);
|
|
48
61
|
let bedrag = 0, verv = 0, vervN = 0;
|
|
49
62
|
for (const r of rows) {
|
|
50
63
|
const c = Number(r.total_cents ?? 0);
|
|
@@ -101,7 +114,7 @@ export function offertePijplijn(per) {
|
|
|
101
114
|
],
|
|
102
115
|
};
|
|
103
116
|
}
|
|
104
|
-
async function telOffertePijplijn(supabase, inst = STANDAARD_INSTELLINGEN) {
|
|
117
|
+
async function telOffertePijplijn(supabase, inst = STANDAARD_INSTELLINGEN, meld) {
|
|
105
118
|
const leeg = { verzondenCents: null, verzondenAantal: null, conceptCents: null, acceptatiePct: null, trechter: [] };
|
|
106
119
|
try {
|
|
107
120
|
if (inst.tellen_in_database) {
|
|
@@ -116,6 +129,8 @@ async function telOffertePijplijn(supabase, inst = STANDAARD_INSTELLINGEN) {
|
|
|
116
129
|
log("offertes", error);
|
|
117
130
|
return leeg;
|
|
118
131
|
}
|
|
132
|
+
if (mogelijkOnvolledig(data, inst.tellen_in_database))
|
|
133
|
+
meld?.add("offertes");
|
|
119
134
|
return offertePijplijn(offertesPerStatus(data));
|
|
120
135
|
}
|
|
121
136
|
catch (e) {
|
|
@@ -172,7 +187,7 @@ export function ftfUitRpc(data) {
|
|
|
172
187
|
return null;
|
|
173
188
|
return { basis, pct: basis ? Math.round((ja / basis) * 100) : null };
|
|
174
189
|
}
|
|
175
|
-
export async function telWerkUren(supabase, nu = new Date(), wekenTerug = 0, inst = STANDAARD_INSTELLINGEN) {
|
|
190
|
+
export async function telWerkUren(supabase, nu = new Date(), wekenTerug = 0, inst = STANDAARD_INSTELLINGEN, meld) {
|
|
176
191
|
// Weekkeuze: 0 = huidige week, max uit de instellingen. Alleen de uren verschuiven;
|
|
177
192
|
// "afgerond deze maand" blijft op de echte maand gebaseerd.
|
|
178
193
|
const tz = inst.tijdzone;
|
|
@@ -204,12 +219,17 @@ export async function telWerkUren(supabase, nu = new Date(), wekenTerug = 0, ins
|
|
|
204
219
|
}
|
|
205
220
|
log("werkuren via database (terugval)", afgerond.error ?? ftfR.error ?? urenR.error ?? "ongeldige uitkomst");
|
|
206
221
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
222
|
+
// First time fix: tellen in de database (ja / nee), geen rijen ophalen.
|
|
223
|
+
const ftfTel = (waarde) => {
|
|
224
|
+
let q = supabase.from("werkbonnen").select("id", { count: "exact", head: true }).eq("first_time_fix", waarde);
|
|
225
|
+
if (ftfVanaf)
|
|
226
|
+
q = q.gte("afgerond_op", ftfVanaf);
|
|
227
|
+
return q;
|
|
228
|
+
};
|
|
229
|
+
const [afgerond, ftfJa, ftfNee, wtl, ot] = await Promise.all([
|
|
211
230
|
supabase.from("werkbonnen").select("id", { count: "exact", head: true }).gte("afgerond_op", maandVan),
|
|
212
|
-
|
|
231
|
+
ftfTel(true),
|
|
232
|
+
ftfTel(false),
|
|
213
233
|
// De werkbon-klok is waar de monteur zijn uren bijwerkt: activity "werken".
|
|
214
234
|
supabase
|
|
215
235
|
.from("werkbon_time_logs")
|
|
@@ -229,6 +249,7 @@ export async function telWerkUren(supabase, nu = new Date(), wekenTerug = 0, ins
|
|
|
229
249
|
res.afgerondDezeMaand = afgerond.count ?? 0;
|
|
230
250
|
else
|
|
231
251
|
log("afgerond deze maand", afgerond.error);
|
|
252
|
+
const ftf = { error: ftfJa.error ?? ftfNee.error };
|
|
232
253
|
if (ftf.error)
|
|
233
254
|
log("first-time-fix", ftf.error);
|
|
234
255
|
if (wtl.error)
|
|
@@ -236,11 +257,12 @@ export async function telWerkUren(supabase, nu = new Date(), wekenTerug = 0, ins
|
|
|
236
257
|
if (ot.error)
|
|
237
258
|
log("overuren", ot.error);
|
|
238
259
|
if (!ftf.error) {
|
|
239
|
-
|
|
240
|
-
res.
|
|
241
|
-
res.firstTimeFixPct = rows.length ? Math.round((rows.filter((r) => r.first_time_fix).length / rows.length) * 100) : null;
|
|
260
|
+
res.firstTimeFixBasis = ftfBasis(ftfJa.count, ftfNee.count);
|
|
261
|
+
res.firstTimeFixPct = ftfPct(ftfJa.count, ftfNee.count);
|
|
242
262
|
}
|
|
243
263
|
if (!wtl.error) {
|
|
264
|
+
if (mogelijkOnvolledig(wtl.data, inst.tellen_in_database))
|
|
265
|
+
meld?.add("werkuren");
|
|
244
266
|
const u = urenPerDagUitRijen(wtl.data, dagen, { tz, uitDuur: inst.uren_uit_duur_minuten });
|
|
245
267
|
res.urenPerDag = u.urenPerDag;
|
|
246
268
|
res.urenDezeWeek = u.urenDezeWeek;
|
|
@@ -275,14 +297,15 @@ async function telWerkbonJaarStats(supabase) {
|
|
|
275
297
|
}
|
|
276
298
|
}
|
|
277
299
|
export async function fetchDashboardStats(supabase, wekenTerug = 0, omzetUitDb, inst = STANDAARD_INSTELLINGEN) {
|
|
300
|
+
const meld = new Set();
|
|
278
301
|
const [omzetOpen, offertePijplijn, werkUren, werkbonJaar, facturenBetaald] = await Promise.all([
|
|
279
|
-
omzetUitDb ? Promise.resolve(omzetUitDb) : telOmzetOpen(supabase, inst),
|
|
280
|
-
telOffertePijplijn(supabase, inst),
|
|
281
|
-
telWerkUren(supabase, new Date(), wekenTerug, inst),
|
|
302
|
+
omzetUitDb ? Promise.resolve(omzetUitDb) : telOmzetOpen(supabase, inst, meld),
|
|
303
|
+
telOffertePijplijn(supabase, inst, meld),
|
|
304
|
+
telWerkUren(supabase, new Date(), wekenTerug, inst, meld),
|
|
282
305
|
telWerkbonJaarStats(supabase),
|
|
283
306
|
telFacturenBetaald(supabase, new Date(), inst),
|
|
284
307
|
]);
|
|
285
|
-
return { omzetOpen, offertePijplijn, werkUren, ...werkbonJaar, facturenBetaald };
|
|
308
|
+
return { omzetOpen, offertePijplijn, werkUren, ...werkbonJaar, facturenBetaald, mogelijkOnvolledig: [...meld] };
|
|
286
309
|
}
|
|
287
310
|
/** Zet een Nederlandse kalenderdag (UTC-middernacht) om naar het werkelijke UTC-moment. */
|
|
288
311
|
function nlMidernachtUTC(doel, tz = TZ) {
|
|
@@ -60,9 +60,16 @@ export interface DashboardStats {
|
|
|
60
60
|
werkUren: WerkUrenStat;
|
|
61
61
|
werkbonSoorten: WerkbonSoortenStat;
|
|
62
62
|
werkbonDuur: WerkbonDuurStat;
|
|
63
|
+
/** KPI's waarvan de oude telling de rijgrens van 1000 raakte (alleen bij database-telling uit). */
|
|
64
|
+
mogelijkOnvolledig?: ("omzetOpen" | "offertes" | "werkuren")[];
|
|
63
65
|
}
|
|
64
66
|
export interface DashboardData {
|
|
65
67
|
kpis: DashboardKpis;
|
|
68
|
+
/** Reden per KPI die niet geteld kon worden (alleen aanwezig bij null). */
|
|
69
|
+
kpiRedenen?: Partial<Record<keyof DashboardKpis, string>>;
|
|
70
|
+
/** Klaar zonder factuur, door de planner gereed gemeld (niet factureerbaar). Ontbreekt als de kolom niet bestaat; null = telling mislukt. */
|
|
71
|
+
gereedDoorPlanner?: number | null;
|
|
72
|
+
gereedDoorPlannerReden?: string;
|
|
66
73
|
stats?: DashboardStats;
|
|
67
74
|
/** weergave-instellingen voor de browser (standaard = huidig gedrag) */
|
|
68
75
|
instellingen?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-planner-installatie-techniek.types.d.ts","sourceRoot":"","sources":["../../src/lib/dashboard-planner-installatie-techniek.types.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,aAAa;IAC5B,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,GA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,EAAE,kBAAkB,CAAC;IACnC,WAAW,EAAE,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard-planner-installatie-techniek.types.d.ts","sourceRoot":"","sources":["../../src/lib/dashboard-planner-installatie-techniek.types.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,aAAa;IAC5B,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,mEAAmE;IACnE,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,YAAY;IAC3B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,qCAAqC;IACrC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,iBAAiB,EAAE,MAAM,GAAG,I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MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAC;QAAC,qBAAqB,EAAE,OAAO,CAAA;KAAE,CAAC;CAClH"}
|
|
@@ -6,7 +6,30 @@ export type DbTellingen = {
|
|
|
6
6
|
urenTeBeoordelen: number | null;
|
|
7
7
|
mailsTeControleren: number | null;
|
|
8
8
|
omzetOpen: OmzetOpenStat | null;
|
|
9
|
+
/** undefined = kolom gereed_door_planner bestaat niet in deze database. */
|
|
10
|
+
gereedDoorPlanner?: number | null;
|
|
9
11
|
};
|
|
10
12
|
/** Ongeldige of ontbrekende uitkomst → null (de oude telwijze neemt het over). */
|
|
11
13
|
export declare function leesDbTellingen(data: unknown): DbTellingen | null;
|
|
14
|
+
/** Maximaal aantal blokken bij gepagineerd ophalen (1000 × 1000 = 1 miljoen rijen). */
|
|
15
|
+
export declare const MAX_BLOKKEN = 1000;
|
|
16
|
+
type Blok = {
|
|
17
|
+
data: unknown;
|
|
18
|
+
error: unknown;
|
|
19
|
+
};
|
|
20
|
+
type BlokQuery = PromiseLike<Blok> & {
|
|
21
|
+
range?: (van: number, tot: number) => PromiseLike<Blok>;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Haalt alle rijen op in blokken van `blok` (standaard 1000) tot alles binnen is.
|
|
25
|
+
* Een fout komt direct terug: nooit een halve lijst. Kent de query geen
|
|
26
|
+
* `.range`, dan wordt hij in één keer uitgevoerd (zelfde uitkomst als voorheen).
|
|
27
|
+
*/
|
|
28
|
+
export declare function haalAllesOp<T = Record<string, unknown>>(maakQuery: () => BlokQuery, blok?: number): Promise<{
|
|
29
|
+
data: T[];
|
|
30
|
+
error: unknown;
|
|
31
|
+
}>;
|
|
32
|
+
/** Vertaalt een Supabase-fout naar een korte reden in gewone taal (geen ruwe databasetekst). */
|
|
33
|
+
export declare function redenUitFout(error: unknown, tabel?: string): string;
|
|
34
|
+
export {};
|
|
12
35
|
//# sourceMappingURL=dashboard-tellingen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-tellingen.d.ts","sourceRoot":"","sources":["../../src/lib/dashboard-tellingen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAEpF,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,aAAa,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard-tellingen.d.ts","sourceRoot":"","sources":["../../src/lib/dashboard-tellingen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAEpF,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,aAAa,GAAG,IAAI,CAAC;IAChC,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC,CAAC;AAOF,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAgBjE;AAED,uFAAuF;AACvF,eAAO,MAAM,WAAW,OAAO,CAAC;AAEhC,KAAK,IAAI,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAC9C,KAAK,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,WAAW,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC;AAEjG;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,SAAS,EAAE,MAAM,SAAS,EAC1B,IAAI,SAAO,GACV,OAAO,CAAC;IAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAWxC;AAED,gGAAgG;AAChG,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAUnE"}
|
|
@@ -18,5 +18,43 @@ export function leesDbTellingen(data) {
|
|
|
18
18
|
urenTeBeoordelen: getal(d.urenTeBeoordelen),
|
|
19
19
|
mailsTeControleren: getal(d.mailsTeControleren),
|
|
20
20
|
omzetOpen: omzet,
|
|
21
|
+
...("gereedDoorPlanner" in d ? { gereedDoorPlanner: getal(d.gereedDoorPlanner) } : {}),
|
|
21
22
|
};
|
|
22
23
|
}
|
|
24
|
+
/** Maximaal aantal blokken bij gepagineerd ophalen (1000 × 1000 = 1 miljoen rijen). */
|
|
25
|
+
export const MAX_BLOKKEN = 1000;
|
|
26
|
+
/**
|
|
27
|
+
* Haalt alle rijen op in blokken van `blok` (standaard 1000) tot alles binnen is.
|
|
28
|
+
* Een fout komt direct terug: nooit een halve lijst. Kent de query geen
|
|
29
|
+
* `.range`, dan wordt hij in één keer uitgevoerd (zelfde uitkomst als voorheen).
|
|
30
|
+
*/
|
|
31
|
+
export async function haalAllesOp(maakQuery, blok = 1000) {
|
|
32
|
+
const alles = [];
|
|
33
|
+
for (let i = 0; i < MAX_BLOKKEN; i++) {
|
|
34
|
+
const q = maakQuery();
|
|
35
|
+
const r = typeof q.range === "function" ? await q.range(i * blok, i * blok + blok - 1) : await q;
|
|
36
|
+
if (r.error)
|
|
37
|
+
return { data: [], error: r.error };
|
|
38
|
+
const rijen = (Array.isArray(r.data) ? r.data : []);
|
|
39
|
+
alles.push(...rijen);
|
|
40
|
+
if (typeof q.range !== "function" || rijen.length < blok)
|
|
41
|
+
return { data: alles, error: null };
|
|
42
|
+
}
|
|
43
|
+
return { data: [], error: new Error("Te veel rijen om op te halen") };
|
|
44
|
+
}
|
|
45
|
+
/** Vertaalt een Supabase-fout naar een korte reden in gewone taal (geen ruwe databasetekst). */
|
|
46
|
+
export function redenUitFout(error, tabel) {
|
|
47
|
+
const e = (error ?? {});
|
|
48
|
+
const code = String(e.code ?? "");
|
|
49
|
+
const msg = String(e.message ?? "").toLowerCase();
|
|
50
|
+
const status = Number(e.status ?? 0);
|
|
51
|
+
if (code === "42P01" || code === "PGRST205" || msg.includes("does not exist"))
|
|
52
|
+
return tabel ? `Tabel ${tabel} ontbreekt in deze database` : "Gegevens ontbreken in deze database";
|
|
53
|
+
if (code === "42501" || status === 403 || msg.includes("permission denied"))
|
|
54
|
+
return tabel ? `Geen toegang tot ${tabel}` : "Geen toegang tot deze gegevens";
|
|
55
|
+
if (status === 401 || msg.includes("jwt"))
|
|
56
|
+
return "Je sessie is verlopen";
|
|
57
|
+
if (msg.includes("te veel rijen"))
|
|
58
|
+
return "Te veel rijen om te tellen";
|
|
59
|
+
return "Telling mislukt";
|
|
60
|
+
}
|
|
@@ -45,7 +45,7 @@ export function normaliseerFunnel(raw) {
|
|
|
45
45
|
export const FUNNEL_PAARS = 'var(--funnel-extra)';
|
|
46
46
|
export const FUNNEL_NAVY = 'var(--funnel-navy)';
|
|
47
47
|
export const FUNNEL_HERKOMST = {
|
|
48
|
-
standby: { label: '
|
|
48
|
+
standby: { label: 'Stand-by (SB)', kleur: 'var(--chart-1)' },
|
|
49
49
|
mail: { label: 'Uit de mail', kleur: 'var(--chart-2)' },
|
|
50
50
|
extra_werk: { label: 'Extra werk', kleur: 'var(--chart-3)' },
|
|
51
51
|
handmatig: { label: 'Handmatig', kleur: 'var(--chart-4)' },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const FUNNEL_BALKEN: readonly ["
|
|
1
|
+
export declare const FUNNEL_BALKEN: readonly ["Stand-by (SB)", "Uit de mail", "Extra werk", "Handmatig", "Aangemaakt", "Afgerond", "Nog niet afgerond", "Betaald", "Nog niet betaald", "Extra werk meldingen", "Extra werk afgerond", "Extra werk in behandeling", "Extra werk niet geaccepteerd"];
|
|
2
2
|
export type FunnelIndeling = Partial<Record<typeof FUNNEL_BALKEN[number], number>>;
|
|
3
3
|
export declare const STANDAARD_INDELING: FunnelIndeling;
|
|
4
4
|
export interface IndelingBalk {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"funnel-indeling.d.ts","sourceRoot":"","sources":["../../src/lib/funnel-indeling.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"funnel-indeling.d.ts","sourceRoot":"","sources":["../../src/lib/funnel-indeling.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,gQAAiQ,CAAC;AAC5R,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAKnF,eAAO,MAAM,kBAAkB,EAAE,cAchC,CAAC;AACF,MAAM,WAAW,YAAY;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE;AAClG,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,CAS7D;AACD,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,EAAE,CA4B/G"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export const FUNNEL_BALKEN = ['
|
|
1
|
+
export const FUNNEL_BALKEN = ['Stand-by (SB)', 'Uit de mail', 'Extra werk', 'Handmatig', 'Aangemaakt', 'Afgerond', 'Nog niet afgerond', 'Betaald', 'Nog niet betaald', 'Extra werk meldingen', 'Extra werk afgerond', 'Extra werk in behandeling', 'Extra werk niet geaccepteerd'];
|
|
2
2
|
// De vaste standaardindeling van de funnel: de balkposities die zijn gekozen en
|
|
3
3
|
// daarmee het uiterlijk van de module bepalen. Persoonlijke indelingen worden niet
|
|
4
4
|
// meer gelezen of geschreven; deze waarden gelden voor elke gebruiker bij elke klant.
|
|
5
5
|
export const STANDAARD_INDELING = {
|
|
6
|
-
'
|
|
6
|
+
'Stand-by (SB)': 0.5977696337950241,
|
|
7
7
|
'Uit de mail': 0.4492378737706331,
|
|
8
8
|
'Extra werk': 0,
|
|
9
9
|
'Handmatig': 0.23219074328449324,
|
|
@@ -32,11 +32,11 @@ export declare function pakketBedrag(i: {
|
|
|
32
32
|
export declare function reisPakketAantal(i: {
|
|
33
33
|
minutenHeenEnTerug: number;
|
|
34
34
|
pakketMinuten: number;
|
|
35
|
-
restgrensMinuten
|
|
36
|
-
minimumBijRit
|
|
35
|
+
restgrensMinuten?: number;
|
|
36
|
+
minimumBijRit?: number;
|
|
37
37
|
}): number;
|
|
38
38
|
/** Rond het totaal af (niet elke losse registratie). */
|
|
39
|
-
export declare function rondMinutenAf(minuten: number, stapMinuten
|
|
39
|
+
export declare function rondMinutenAf(minuten: number, stapMinuten?: number, omhoogVanafMinuten?: number): number;
|
|
40
40
|
export declare function verdeelContracturen(uren: number, dagen: number[], slotMinuten: number): {
|
|
41
41
|
dag: number;
|
|
42
42
|
slots: number;
|
|
@@ -49,4 +49,7 @@ export declare function mandaatBelegdCent(i: {
|
|
|
49
49
|
extraKostenCent: number;
|
|
50
50
|
}): number;
|
|
51
51
|
export declare function mandaatStatus(belegdCent: number, budgetCent: number | null | undefined, waarschuwingPct?: number): "geen mandaat" | "over" | "waarschuwing" | "ok";
|
|
52
|
+
export declare function rondCent(waarde: number): number;
|
|
53
|
+
/** Bedrag in centen als euro (blok D2): formatEuro(125000) = "€ 1.250,00". */
|
|
54
|
+
export declare function formatEuro(cent: number): string;
|
|
52
55
|
//# sourceMappingURL=rekenregels.d.ts.map
|