@flowselections/floriday-klanten-module 1.0.50 → 1.0.51
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/dist-lib/components/CustomerAvatar.js +1 -1
- package/dist-lib/components/klanten/BewerkKlant.js +1 -1
- package/dist-lib/components/klanten/BewerkKlantRoute.js +1 -1
- package/dist-lib/components/klanten/BulkStickerUploadDialog.js +1 -1
- package/dist-lib/components/klanten/CustomerAnalyticsTab.js +2 -2
- package/dist-lib/components/klanten/CustomerAssortmentTab.js +4 -4
- package/dist-lib/components/klanten/DeliveryLocationsTab.js +5 -5
- package/dist-lib/components/klanten/DiscountsTab.js +2 -2
- package/dist-lib/components/klanten/ExternalCacheBanner.d.ts +1 -1
- package/dist-lib/components/klanten/FloridayNetworkStatus.js +3 -3
- package/dist-lib/components/klanten/GroupedKlantDetailRoute.js +1 -1
- package/dist-lib/components/klanten/ImportKlanten.js +1 -1
- package/dist-lib/components/klanten/KlantBewerkenDialog.js +2 -2
- package/dist-lib/components/klanten/KlantDetailLayout.d.ts +1 -1
- package/dist-lib/components/klanten/KlantDetailLayout.js +5 -5
- package/dist-lib/components/klanten/KlantDetailRoute.js +1 -1
- package/dist-lib/components/klanten/KlantenOverzicht.js +16 -16
- package/dist-lib/components/klanten/LocalDiscountFormDialog.js +1 -1
- package/dist-lib/components/klanten/LocalDiscountsTab.js +2 -2
- package/dist-lib/components/klanten/NetwerkPagina.js +3 -3
- package/dist-lib/components/klanten/NieuweKlant.js +1 -1
- package/dist-lib/components/klanten/OvernemenTwinfieldKlant.js +1 -1
- package/dist-lib/components/klanten/OvernemenTwinfieldKlantRoute.js +1 -1
- package/dist-lib/components/klanten/RouteError.js +1 -1
- package/dist-lib/components/klanten/pricegroups/CustomerPickerDialog.js +6 -6
- package/dist-lib/components/klanten/pricegroups/CustomerPriceGroupSelect.js +3 -3
- package/dist-lib/components/klanten/pricegroups/PriceGroupEditRoute.js +1 -1
- package/dist-lib/components/klanten/pricegroups/PriceGroupFormPage.js +11 -11
- package/dist-lib/components/klanten/pricegroups/PriceGroupNewRoute.js +1 -1
- package/dist-lib/components/klanten/pricegroups/PriceGroupsPage.js +4 -4
- package/dist-lib/components/klanten/pricegroups/PriceGroupsRoute.js +1 -1
- package/dist-lib/components/klanten/pricegroups/ProductPickerDialog.d.ts +1 -1
- package/dist-lib/components/klanten/pricegroups/UnknownFloridayMembers.d.ts +1 -1
- package/dist-lib/components/klanten/pricegroups/UnknownFloridayMembers.js +2 -2
- package/dist-lib/components/klanten/useCustomerDefaults.d.ts +1 -1
- package/dist-lib/index.d.ts +34 -34
- package/dist-lib/index.js +35 -35
- package/dist-lib/integrations/supabase/auth-attacher.js +1 -1
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +1 -1
- package/dist-lib/integrations/supabase/client.d.ts +1 -1
- package/dist-lib/integrations/supabase/client.server.d.ts +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +346 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/accounting/exact/client.server.d.ts +1 -1
- package/dist-lib/lib/accounting/exact/client.server.js +2 -2
- package/dist-lib/lib/accounting/exact/sync.server.d.ts +1 -1
- package/dist-lib/lib/accounting/exact/sync.server.js +3 -3
- package/dist-lib/lib/accounting/floriday/sync.server.d.ts +1 -1
- package/dist-lib/lib/accounting/floriday/sync.server.js +1 -1
- package/dist-lib/lib/accounting/registry.server.d.ts +1 -1
- package/dist-lib/lib/accounting/registry.server.js +2 -2
- package/dist-lib/lib/accounting/twinfield/client.server.js +2 -2
- package/dist-lib/lib/accounting/twinfield/field-coverage.test.js +6 -6
- package/dist-lib/lib/accounting/twinfield/mapping.js +3 -3
- package/dist-lib/lib/accounting/twinfield/rmw-push.server.d.ts +2 -2
- package/dist-lib/lib/accounting/twinfield/rmw-push.server.js +4 -4
- package/dist-lib/lib/accounting/twinfield/rmw.server.d.ts +1 -1
- package/dist-lib/lib/accounting/twinfield/rmw.server.js +2 -2
- package/dist-lib/lib/accounting/twinfield/sandbox-rmw.server.d.ts +6 -6
- package/dist-lib/lib/accounting/twinfield/sandbox-rmw.server.js +12 -12
- package/dist-lib/lib/accounting/twinfield/sandbox.server.js +3 -3
- package/dist-lib/lib/accounting/twinfield/sync.server.js +4 -4
- package/dist-lib/lib/accounting/twinfield/worker.functions.d.ts +7 -7
- package/dist-lib/lib/accounting/twinfield/worker.functions.js +6 -6
- package/dist-lib/lib/accounting/twinfield/worker.server.js +8 -8
- package/dist-lib/lib/accounting.functions.d.ts +4 -4
- package/dist-lib/lib/accounting.functions.js +2 -2
- package/dist-lib/lib/countries.test.js +3 -3
- package/dist-lib/lib/customer-analytics.functions.d.ts +1 -1
- package/dist-lib/lib/customer-analytics.functions.js +1 -1
- package/dist-lib/lib/customer-assortment.functions.d.ts +1 -1
- package/dist-lib/lib/customer-assortment.functions.js +3 -3
- package/dist-lib/lib/customer-defaults.test.js +3 -3
- package/dist-lib/lib/customer-insert.d.ts +1 -1
- package/dist-lib/lib/customer-insert.js +2 -2
- package/dist-lib/lib/customer-notes.functions.d.ts +2 -2
- package/dist-lib/lib/customer-notes.functions.js +1 -1
- package/dist-lib/lib/customer-orders.functions.d.ts +1 -1
- package/dist-lib/lib/customer-orders.functions.js +1 -1
- package/dist-lib/lib/customer-revenue.functions.d.ts +1 -1
- package/dist-lib/lib/customer-revenue.functions.js +2 -2
- package/dist-lib/lib/customer-schemas.js +1 -1
- package/dist-lib/lib/customer-schemas.test.js +1 -1
- package/dist-lib/lib/customer-stickers.functions.d.ts +9 -9
- package/dist-lib/lib/customer-stickers.functions.js +2 -2
- package/dist-lib/lib/customers.functions.d.ts +29 -29
- package/dist-lib/lib/customers.functions.js +11 -11
- package/dist-lib/lib/delivery-locations.functions.d.ts +7 -7
- package/dist-lib/lib/delivery-locations.functions.js +2 -2
- package/dist-lib/lib/external-customers.functions.d.ts +4 -4
- package/dist-lib/lib/external-customers.functions.js +2 -2
- package/dist-lib/lib/floriday-app-url.functions.d.ts +1 -1
- package/dist-lib/lib/floriday-app-url.functions.js +2 -2
- package/dist-lib/lib/floriday-assortment.functions.d.ts +1 -1
- package/dist-lib/lib/floriday-assortment.functions.js +2 -2
- package/dist-lib/lib/floriday-discounts.functions.d.ts +2 -2
- package/dist-lib/lib/floriday-discounts.functions.js +2 -2
- package/dist-lib/lib/floriday-network-status.functions.d.ts +1 -1
- package/dist-lib/lib/floriday-network-status.functions.js +1 -1
- package/dist-lib/lib/floriday-price-import.functions.d.ts +2 -2
- package/dist-lib/lib/floriday-price-import.functions.js +2 -2
- package/dist-lib/lib/floriday-sticker-import.functions.d.ts +1 -1
- package/dist-lib/lib/floriday-sticker-import.functions.js +1 -1
- package/dist-lib/lib/floriday-trade-items.functions.d.ts +1 -1
- package/dist-lib/lib/floriday-trade-items.functions.js +1 -1
- package/dist-lib/lib/floriday-trade-settings.functions.d.ts +1 -1
- package/dist-lib/lib/floriday-trade-settings.functions.js +1 -1
- package/dist-lib/lib/local-discounts.functions.d.ts +7 -7
- package/dist-lib/lib/local-discounts.functions.js +1 -1
- package/dist-lib/lib/logistics-events.functions.d.ts +1 -1
- package/dist-lib/lib/logistics-events.functions.js +1 -1
- package/dist-lib/lib/logistics-strategy.functions.d.ts +4 -4
- package/dist-lib/lib/logistics-strategy.functions.js +1 -1
- package/dist-lib/lib/overdue-invoices.functions.d.ts +1 -1
- package/dist-lib/lib/overdue-invoices.functions.js +2 -2
- package/dist-lib/lib/price-groups-local.functions.d.ts +15 -15
- package/dist-lib/lib/price-groups-local.functions.js +1 -1
- package/dist-lib/lib/price-groups.functions.d.ts +1 -1
- package/dist-lib/lib/price-groups.functions.js +1 -1
- package/dist-lib/lib/twinfield-adopt.functions.d.ts +5 -5
- package/dist-lib/lib/twinfield-adopt.functions.js +7 -7
- package/dist-lib/lib/twinfield-customer-defaults.functions.d.ts +2 -2
- package/dist-lib/lib/twinfield-customer-defaults.functions.js +2 -2
- package/dist-lib/lib/twinfield-customer-defaults.server.js +1 -1
- package/dist-lib/lib/twinfield-ledger.functions.d.ts +2 -2
- package/dist-lib/lib/twinfield-ledger.functions.js +2 -2
- package/dist-lib/lib/twinfield-ledger.server.js +2 -2
- package/dist-lib/lib/twinfield-required-fields.js +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Database } from "../../../integrations/supabase/types";
|
|
1
|
+
import type { Database } from "../../../integrations/supabase/types.js";
|
|
2
2
|
type ExactConnection = Database["public"]["Tables"]["exact_connections"]["Row"];
|
|
3
3
|
type ExactEnv = Database["public"]["Enums"]["exact_env"];
|
|
4
4
|
export declare function hostFor(_environment: ExactEnv): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Server-only Exact Online REST/OAuth helpers. NEVER import from client code.
|
|
2
|
-
import { supabaseAdmin } from "../../../integrations/supabase/client.server";
|
|
3
|
-
import { decryptToken, encryptToken } from "../../crypto.server";
|
|
2
|
+
import { supabaseAdmin } from "../../../integrations/supabase/client.server.js";
|
|
3
|
+
import { decryptToken, encryptToken } from "../../crypto.server.js";
|
|
4
4
|
// Exact Online's "staging" en "live" omgevingen draaien beide op
|
|
5
5
|
// start.exactonline.nl — er is geen aparte sandbox-host. Een test-/dev-app
|
|
6
6
|
// gebruikt eigen client credentials maar dezelfde endpoints.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccountingProvider, AccountingSyncResult } from "../types";
|
|
1
|
+
import type { AccountingProvider, AccountingSyncResult } from "../types.js";
|
|
2
2
|
export declare function syncAllExactCustomers(): Promise<AccountingSyncResult>;
|
|
3
3
|
export declare const exactProvider: AccountingProvider;
|
|
4
4
|
//# sourceMappingURL=sync.server.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { supabaseAdmin } from "../../../integrations/supabase/client.server";
|
|
2
|
-
import { ensureValidAccessToken, exactFetch } from "./client.server";
|
|
3
|
-
import { mapExactAccount } from "./mapping";
|
|
1
|
+
import { supabaseAdmin } from "../../../integrations/supabase/client.server.js";
|
|
2
|
+
import { ensureValidAccessToken, exactFetch } from "./client.server.js";
|
|
3
|
+
import { mapExactAccount } from "./mapping.js";
|
|
4
4
|
const SELECT_FIELDS = [
|
|
5
5
|
"ID",
|
|
6
6
|
"Code",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { supabaseAdmin } from "../../../integrations/supabase/client.server";
|
|
1
|
+
import { supabaseAdmin } from "../../../integrations/supabase/client.server.js";
|
|
2
2
|
// De Floriday-sync wordt volledig door de Floriday-authenticatiemodule
|
|
3
3
|
// uitgevoerd (cron jobs in Supabase). Deze module is read-only en doet
|
|
4
4
|
// dus zelf geen sync — we geven hier een no-op terug zodat de provider in
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccountingProvider } from "./types";
|
|
1
|
+
import type { AccountingProvider } from "./types.js";
|
|
2
2
|
export declare function listProviders(): AccountingProvider[];
|
|
3
3
|
export declare function getProvider(id: string): AccountingProvider | undefined;
|
|
4
4
|
//# sourceMappingURL=registry.server.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { exactProvider } from "./exact/sync.server";
|
|
2
|
-
import { floridayProvider } from "./floriday/sync.server";
|
|
1
|
+
import { exactProvider } from "./exact/sync.server.js";
|
|
2
|
+
import { floridayProvider } from "./floriday/sync.server.js";
|
|
3
3
|
const PROVIDERS = [floridayProvider, exactProvider];
|
|
4
4
|
export function listProviders() {
|
|
5
5
|
return PROVIDERS;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { supabaseAdmin } from "../../../integrations/supabase/client.server";
|
|
2
|
-
import { buildProcessXmlEnvelope } from "./mapping";
|
|
1
|
+
import { supabaseAdmin } from "../../../integrations/supabase/client.server.js";
|
|
2
|
+
import { buildProcessXmlEnvelope } from "./mapping.js";
|
|
3
3
|
export class TwinfieldError extends Error {
|
|
4
4
|
constructor(kind, message) {
|
|
5
5
|
super(message);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { describe, expect, it, vi } from "vitest";
|
|
2
2
|
vi.mock("../../../integrations/supabase/client.server", () => ({ supabaseAdmin: {} }));
|
|
3
3
|
vi.mock("@/integrations/supabase/client.server", () => ({ supabaseAdmin: {} }));
|
|
4
|
-
import { SYNC_FIELDS, erpSnapshot } from "./sync.server";
|
|
5
|
-
import { SYNC_FIELDS as _SF, keepConditional } from "./sync.server";
|
|
6
|
-
import { applyErpChanges, checkExpectations, parseDimension, BIC_WITHOUT_IBAN } from "./rmw.server";
|
|
7
|
-
import { truncateTwinfieldName, TWINFIELD_TAG_MAX, TWINFIELD_READONLY_FIELDS, TWINFIELD_CONDITIONAL_FIELDS, ERP_ONLY_FIELDS } from "../../twinfield-limits";
|
|
4
|
+
import { SYNC_FIELDS, erpSnapshot } from "./sync.server.js";
|
|
5
|
+
import { SYNC_FIELDS as _SF, keepConditional } from "./sync.server.js";
|
|
6
|
+
import { applyErpChanges, checkExpectations, parseDimension, BIC_WITHOUT_IBAN } from "./rmw.server.js";
|
|
7
|
+
import { truncateTwinfieldName, TWINFIELD_TAG_MAX, TWINFIELD_READONLY_FIELDS, TWINFIELD_CONDITIONAL_FIELDS, ERP_ONLY_FIELDS } from "../../twinfield-limits.js";
|
|
8
8
|
import { readFileSync } from "node:fs";
|
|
9
9
|
import { resolve } from "node:path";
|
|
10
|
-
import { creditManagerDisplay } from "../../credit-management";
|
|
11
|
-
import { toPrefill } from "../../twinfield-adopt.functions";
|
|
10
|
+
import { creditManagerDisplay } from "../../credit-management.js";
|
|
11
|
+
import { toPrefill } from "../../twinfield-adopt.functions.js";
|
|
12
12
|
/** Alle velden van het klantformulier, rechtstreeks uit de standaardwaarden van het formulier. */
|
|
13
13
|
const FORM_ALL_FIELDS = (() => {
|
|
14
14
|
const src = readFileSync(resolve(__dirname, "../../../components/klanten/KlantFormulier.tsx"), "utf8");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { toTwinfieldReminder } from "../../twinfield-defaults";
|
|
2
|
-
import { TWINFIELD_TAG_MAX, truncateTwinfieldName } from "../../twinfield-limits";
|
|
3
|
-
import { toIsoCountry } from "../../countries";
|
|
1
|
+
import { toTwinfieldReminder } from "../../twinfield-defaults.js";
|
|
2
|
+
import { TWINFIELD_TAG_MAX, truncateTwinfieldName } from "../../twinfield-limits.js";
|
|
3
|
+
import { toIsoCountry } from "../../countries.js";
|
|
4
4
|
// Simple, dependency-free, synchronous 64-bit FNV-1a hash used only for
|
|
5
5
|
// change-detection (not for cryptographic purposes). Avoids Node's "crypto"
|
|
6
6
|
// module so this file bundles cleanly in browser/edge runtimes.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type TwinfieldConnection } from "./client.server";
|
|
2
|
-
import type { DebLayout } from "./mapping";
|
|
1
|
+
import { type TwinfieldConnection } from "./client.server.js";
|
|
2
|
+
import type { DebLayout } from "./mapping.js";
|
|
3
3
|
export interface RmwResult {
|
|
4
4
|
status: "geen_basis" | "niets_gewijzigd" | "gelukt" | "verificatie_mislukt";
|
|
5
5
|
calls: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { readDimensionXml, sendProcessXml } from "./client.server";
|
|
2
|
-
import { erpSnapshot } from "./sync.server";
|
|
3
|
-
import { TWINFIELD_FIELD_MAX } from "../../twinfield-limits";
|
|
4
|
-
import { applyErpChanges, checkExpectations, countBlocks, dimensionVersion, parseDimension, serializeForWrite, stripReadonly, } from "./rmw.server";
|
|
1
|
+
import { readDimensionXml, sendProcessXml } from "./client.server.js";
|
|
2
|
+
import { erpSnapshot } from "./sync.server.js";
|
|
3
|
+
import { TWINFIELD_FIELD_MAX } from "../../twinfield-limits.js";
|
|
4
|
+
import { applyErpChanges, checkExpectations, countBlocks, dimensionVersion, parseDimension, serializeForWrite, stripReadonly, } from "./rmw.server.js";
|
|
5
5
|
/** Push naar een bestaande debiteur via lezen-wijzigen-schrijven. */
|
|
6
6
|
export async function pushExistingDebtor(conn, code, customer, layout) {
|
|
7
7
|
const r = { status: "niets_gewijzigd", calls: 0, changed: [], concurrent: false, readVersion: null, afterVersion: null, problems: [], warnings: [], nietAangekomen: [], xml: "", raw: "", xmlnsOnRoot: false };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
|
|
2
|
-
import { TWINFIELD_TAG_MAX } from "../../twinfield-limits";
|
|
3
|
-
import { isValidCocNumber, isValidVatNumber, toCountryCode } from "./mapping";
|
|
2
|
+
import { TWINFIELD_TAG_MAX } from "../../twinfield-limits.js";
|
|
3
|
+
import { isValidCocNumber, isValidVatNumber, toCountryCode } from "./mapping.js";
|
|
4
4
|
/** Elementen die Twinfield wel teruggeeft maar bij schrijven weigert. */
|
|
5
5
|
const READONLY = new Set(["inuse", "touched", "behaviour", "uid", "beginperiod", "beginyear", "endperiod", "endyear"]);
|
|
6
6
|
export function parseDimension(xml) {
|
|
@@ -144,7 +144,7 @@ export declare function runCcStep(step: string): Promise<{
|
|
|
144
144
|
};
|
|
145
145
|
nieuwePlaats: string;
|
|
146
146
|
updateFout: string | null;
|
|
147
|
-
run: import("./worker.server").WorkerRunResult;
|
|
147
|
+
run: import("./worker.server.js").WorkerRunResult;
|
|
148
148
|
naB: {
|
|
149
149
|
versie: number | null;
|
|
150
150
|
status: string | null;
|
|
@@ -169,7 +169,7 @@ export declare function runCcStep(step: string): Promise<{
|
|
|
169
169
|
created_at: string;
|
|
170
170
|
}[] | null;
|
|
171
171
|
activiteit: {
|
|
172
|
-
changes: import("../../../integrations/supabase/types").Json;
|
|
172
|
+
changes: import("../../../integrations/supabase/types.js").Json;
|
|
173
173
|
created_at: string;
|
|
174
174
|
}[] | null;
|
|
175
175
|
klant?: undefined;
|
|
@@ -209,7 +209,7 @@ export declare function runCcStep(step: string): Promise<{
|
|
|
209
209
|
groups: number;
|
|
210
210
|
};
|
|
211
211
|
activiteit: {
|
|
212
|
-
changes: import("../../../integrations/supabase/types").Json;
|
|
212
|
+
changes: import("../../../integrations/supabase/types.js").Json;
|
|
213
213
|
created_at: string;
|
|
214
214
|
}[] | null;
|
|
215
215
|
wachtrij: {
|
|
@@ -261,7 +261,7 @@ export declare function runCcStep(step: string): Promise<{
|
|
|
261
261
|
last_error: string | null;
|
|
262
262
|
created_at: string;
|
|
263
263
|
}[] | null;
|
|
264
|
-
run: import("./worker.server").WorkerRunResult;
|
|
264
|
+
run: import("./worker.server.js").WorkerRunResult;
|
|
265
265
|
na: {
|
|
266
266
|
versie: number | null;
|
|
267
267
|
status: string | null;
|
|
@@ -279,7 +279,7 @@ export declare function runCcStep(step: string): Promise<{
|
|
|
279
279
|
created_at: string;
|
|
280
280
|
}[] | null;
|
|
281
281
|
activiteit: {
|
|
282
|
-
changes: import("../../../integrations/supabase/types").Json;
|
|
282
|
+
changes: import("../../../integrations/supabase/types.js").Json;
|
|
283
283
|
created_at: string;
|
|
284
284
|
}[] | null;
|
|
285
285
|
klant?: undefined;
|
|
@@ -318,7 +318,7 @@ export declare function runCcStep(step: string): Promise<{
|
|
|
318
318
|
banks: number;
|
|
319
319
|
groups: number;
|
|
320
320
|
};
|
|
321
|
-
run: import("./worker.server").WorkerRunResult;
|
|
321
|
+
run: import("./worker.server.js").WorkerRunResult;
|
|
322
322
|
na: {
|
|
323
323
|
versie: number | null;
|
|
324
324
|
status: string | null;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { supabaseAdmin } from "../../../integrations/supabase/client.server";
|
|
1
|
+
import { supabaseAdmin } from "../../../integrations/supabase/client.server.js";
|
|
2
2
|
import { DOMParser } from "@xmldom/xmldom";
|
|
3
|
-
import { loadActiveConnection, readDimensionXml, sendProcessXml, sendRawProcessXml } from "./client.server";
|
|
4
|
-
import { countBlocks, diffDimensions, dimensionVersion, parseDimension, serializeForWrite, stripReadonly } from "./rmw.server";
|
|
5
|
-
import { pushExistingDebtor } from "./rmw-push.server";
|
|
6
|
-
import { erpSnapshot } from "./sync.server";
|
|
7
|
-
import { resolveDebLayout } from "./mapping";
|
|
3
|
+
import { loadActiveConnection, readDimensionXml, sendProcessXml, sendRawProcessXml } from "./client.server.js";
|
|
4
|
+
import { countBlocks, diffDimensions, dimensionVersion, parseDimension, serializeForWrite, stripReadonly } from "./rmw.server.js";
|
|
5
|
+
import { pushExistingDebtor } from "./rmw-push.server.js";
|
|
6
|
+
import { erpSnapshot } from "./sync.server.js";
|
|
7
|
+
import { resolveDebLayout } from "./mapping.js";
|
|
8
8
|
async function sandboxConn() {
|
|
9
9
|
const conn = await loadActiveConnection();
|
|
10
10
|
const office = (conn?.office_code || conn?.company_code || "").trim();
|
|
@@ -173,8 +173,8 @@ async function auditRows(customerId) {
|
|
|
173
173
|
}
|
|
174
174
|
export async function runCcStep(step) {
|
|
175
175
|
const { conn } = await sandboxConn();
|
|
176
|
-
const { runTwinfieldPushQueueInternal } = await import("./worker.server");
|
|
177
|
-
const { twinfieldSnapshot, splitStreetHouseNumber } = await import("./sync.server");
|
|
176
|
+
const { runTwinfieldPushQueueInternal } = await import("./worker.server.js");
|
|
177
|
+
const { twinfieldSnapshot, splitStreetHouseNumber } = await import("./sync.server.js");
|
|
178
178
|
if (step === "setup") {
|
|
179
179
|
const existing = await testCustomer();
|
|
180
180
|
const row = await cache1019(conn.id);
|
|
@@ -255,9 +255,9 @@ export async function runCcStep(step) {
|
|
|
255
255
|
return { error: "onbekende stap" };
|
|
256
256
|
}
|
|
257
257
|
// ---------- Veldendekkingstest (alleen 1019 in NLA003250) ----------
|
|
258
|
-
import { applyErpChanges as _apply, checkExpectations as _check } from "./rmw.server";
|
|
259
|
-
import { buildCustomerDimensionXml } from "./mapping";
|
|
260
|
-
import { truncateTwinfieldName } from "../../twinfield-limits";
|
|
258
|
+
import { applyErpChanges as _apply, checkExpectations as _check } from "./rmw.server.js";
|
|
259
|
+
import { buildCustomerDimensionXml } from "./mapping.js";
|
|
260
|
+
import { truncateTwinfieldName } from "../../twinfield-limits.js";
|
|
261
261
|
function q(root, path) {
|
|
262
262
|
let el = root;
|
|
263
263
|
for (const part of path.split("/")) {
|
|
@@ -460,7 +460,7 @@ export async function runConditionalCheck() {
|
|
|
460
460
|
const { data: cacheRow } = await supabaseAdmin.from("twinfield_dimension_types_cache").select("mask,label1,label2,label3,label4,label5,label6").eq("office_code", office).eq("dim_type", "DEB").maybeSingle();
|
|
461
461
|
const { data: v } = await supabaseAdmin.from("app_settings").select("value").eq("key", "twinfield_deb_label_variants").maybeSingle();
|
|
462
462
|
const layout = resolveDebLayout(cacheRow, JSON.parse(v?.value ?? "{}"));
|
|
463
|
-
const { keepConditional } = await import("./sync.server");
|
|
463
|
+
const { keepConditional } = await import("./sync.server.js");
|
|
464
464
|
const start = parseDimension(await readDimensionXml(conn, "DEB", code));
|
|
465
465
|
const orig = erpFromXml(start);
|
|
466
466
|
const steps = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { supabaseAdmin } from "../../../integrations/supabase/client.server";
|
|
2
|
-
import { loadActiveConnection, readTwinfieldDimension, sendProcessXml, } from "./client.server";
|
|
3
|
-
import { buildCustomerDimensionXml, isTwinfieldAssignedCode, resolveDebLayout, DEFAULT_BLOCK_ORDER, DOC_BLOCK_ORDER, } from "./mapping";
|
|
1
|
+
import { supabaseAdmin } from "../../../integrations/supabase/client.server.js";
|
|
2
|
+
import { loadActiveConnection, readTwinfieldDimension, sendProcessXml, } from "./client.server.js";
|
|
3
|
+
import { buildCustomerDimensionXml, isTwinfieldAssignedCode, resolveDebLayout, DEFAULT_BLOCK_ORDER, DOC_BLOCK_ORDER, } from "./mapping.js";
|
|
4
4
|
function pick(raw, tag) {
|
|
5
5
|
const m = new RegExp(`<${tag}[^>]*>([\\s\\S]*?)</${tag}>`, "i").exec(raw);
|
|
6
6
|
return (m?.[1] ?? "").trim();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { supabaseAdmin } from "../../../integrations/supabase/client.server";
|
|
2
|
-
import { truncateTwinfieldName, conditionalFor, TWINFIELD_READONLY_FIELDS } from "../../twinfield-limits";
|
|
1
|
+
import { supabaseAdmin } from "../../../integrations/supabase/client.server.js";
|
|
2
|
+
import { truncateTwinfieldName, conditionalFor, TWINFIELD_READONLY_FIELDS } from "../../twinfield-limits.js";
|
|
3
3
|
/**
|
|
4
4
|
* Voorwaardelijk Twinfield-veld terwijl de voorwaarde in Twinfield niet geldt
|
|
5
5
|
* → de Twinfield-waarde telt niet: leeg is "onbekend" (niet "gewist"), en een
|
|
@@ -11,8 +11,8 @@ export function keepConditional(k, _t, tw) {
|
|
|
11
11
|
const c = conditionalFor(k);
|
|
12
12
|
return !!c && !c.geldt(tw);
|
|
13
13
|
}
|
|
14
|
-
import { loadActiveConnection } from "./client.server";
|
|
15
|
-
import { toPrefill } from "../../twinfield-adopt.functions";
|
|
14
|
+
import { loadActiveConnection } from "./client.server.js";
|
|
15
|
+
import { toPrefill } from "../../twinfield-adopt.functions.js";
|
|
16
16
|
export const SYNC_FIELDS = {
|
|
17
17
|
company_name: "text", email: "text", street: "text", house_number: "text",
|
|
18
18
|
postal_code: "text", city: "text", country: "text", vat_number: "text", coc_number: "text",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare const processTwinfieldPushQueue: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
2
|
-
supabase: import("../../../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
2
|
+
supabase: import("../../../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
3
3
|
userId: string;
|
|
4
4
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
5
5
|
}, undefined, undefined, undefined>], (input: {
|
|
6
6
|
limit?: number;
|
|
7
7
|
} | undefined) => {
|
|
8
8
|
limit: number;
|
|
9
|
-
}, Promise<import("./worker.server").WorkerRunResult>>;
|
|
9
|
+
}, Promise<import("./worker.server.js").WorkerRunResult>>;
|
|
10
10
|
export declare const retryTwinfieldPush: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
11
|
-
supabase: import("../../../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
11
|
+
supabase: import("../../../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
12
12
|
userId: string;
|
|
13
13
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
14
14
|
}, undefined, undefined, undefined>], (input: {
|
|
@@ -19,7 +19,7 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
|
|
|
19
19
|
reset: number;
|
|
20
20
|
}>>;
|
|
21
21
|
export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
22
|
-
supabase: import("../../../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
22
|
+
supabase: import("../../../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
23
23
|
userId: string;
|
|
24
24
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
25
25
|
}, undefined, undefined, undefined>], (input: {
|
|
@@ -49,7 +49,7 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
|
|
|
49
49
|
* masker uit de cache van de administratie. Alleen voor beheerders.
|
|
50
50
|
*/
|
|
51
51
|
export declare const previewTwinfieldXml: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
52
|
-
supabase: import("../../../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
52
|
+
supabase: import("../../../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
53
53
|
userId: string;
|
|
54
54
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
55
55
|
}, undefined, undefined, undefined>], (input: {
|
|
@@ -68,12 +68,12 @@ export declare const previewTwinfieldXml: import("@tanstack/start-client-core").
|
|
|
68
68
|
* serverinstelling `twinfield_sandbox_offices` staan; anders wordt geweigerd.
|
|
69
69
|
*/
|
|
70
70
|
export declare const runTwinfieldSandboxTest: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
71
|
-
supabase: import("../../../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
71
|
+
supabase: import("../../../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
72
72
|
userId: string;
|
|
73
73
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
74
74
|
}, undefined, undefined, undefined>], (input: {
|
|
75
75
|
customerId: string;
|
|
76
76
|
}) => {
|
|
77
77
|
customerId: string;
|
|
78
|
-
}, Promise<import("./sandbox.server").SandboxTestResult>>;
|
|
78
|
+
}, Promise<import("./sandbox.server.js").SandboxTestResult>>;
|
|
79
79
|
//# sourceMappingURL=worker.functions.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
|
-
import { requireSupabaseAuth } from "../../../integrations/supabase/auth-middleware";
|
|
2
|
+
import { requireSupabaseAuth } from "../../../integrations/supabase/auth-middleware.js";
|
|
3
3
|
export const processTwinfieldPushQueue = createServerFn({ method: "POST" })
|
|
4
4
|
.middleware([requireSupabaseAuth])
|
|
5
5
|
.inputValidator((input) => ({
|
|
@@ -12,7 +12,7 @@ export const processTwinfieldPushQueue = createServerFn({ method: "POST" })
|
|
|
12
12
|
});
|
|
13
13
|
if (!isAdmin)
|
|
14
14
|
throw new Error("Alleen beheerders mogen de sync-queue handmatig draaien.");
|
|
15
|
-
const { runTwinfieldPushQueueInternal } = await import("./worker.server");
|
|
15
|
+
const { runTwinfieldPushQueueInternal } = await import("./worker.server.js");
|
|
16
16
|
return runTwinfieldPushQueueInternal(data.limit);
|
|
17
17
|
});
|
|
18
18
|
export const retryTwinfieldPush = createServerFn({ method: "POST" })
|
|
@@ -26,7 +26,7 @@ export const retryTwinfieldPush = createServerFn({ method: "POST" })
|
|
|
26
26
|
throw new Error(error.message);
|
|
27
27
|
// Meteen opnieuw proberen in plaats van wachten op de cron-ronde.
|
|
28
28
|
try {
|
|
29
|
-
const { runTwinfieldPushQueueInternal } = await import("./worker.server");
|
|
29
|
+
const { runTwinfieldPushQueueInternal } = await import("./worker.server.js");
|
|
30
30
|
await runTwinfieldPushQueueInternal(5, data.customerId);
|
|
31
31
|
}
|
|
32
32
|
catch (e) {
|
|
@@ -118,14 +118,14 @@ export const previewTwinfieldXml = createServerFn({ method: "POST" })
|
|
|
118
118
|
variants = JSON.parse(setting?.value ?? "{}");
|
|
119
119
|
}
|
|
120
120
|
catch { /* lege varianten */ }
|
|
121
|
-
const { resolveDebLayout } = await import("./mapping");
|
|
121
|
+
const { resolveDebLayout } = await import("./mapping.js");
|
|
122
122
|
layout = resolveDebLayout(cacheRow, variants);
|
|
123
123
|
}
|
|
124
124
|
else {
|
|
125
125
|
layoutWarning = "Twinfield-veldindeling onbekend, wacht op de Twinfield-module.";
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
const { buildCustomerDimensionXml } = await import("./mapping");
|
|
128
|
+
const { buildCustomerDimensionXml } = await import("./mapping.js");
|
|
129
129
|
const result = buildCustomerDimensionXml(customer, office || "OFFICE", layout);
|
|
130
130
|
return { ...result, layoutWarning };
|
|
131
131
|
});
|
|
@@ -144,6 +144,6 @@ export const runTwinfieldSandboxTest = createServerFn({ method: "POST" })
|
|
|
144
144
|
});
|
|
145
145
|
if (!isAdmin)
|
|
146
146
|
throw new Error("Alleen beheerders mogen de sandbox-test uitvoeren.");
|
|
147
|
-
const { runTwinfieldSandboxTestInternal } = await import("./sandbox.server");
|
|
147
|
+
const { runTwinfieldSandboxTestInternal } = await import("./sandbox.server.js");
|
|
148
148
|
return runTwinfieldSandboxTestInternal(data.customerId);
|
|
149
149
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { erpSnapshot } from "./sync.server";
|
|
2
|
-
import { toIsoCountry } from "../../countries";
|
|
3
|
-
import { TWINFIELD_FIELD_MAX } from "../../twinfield-limits";
|
|
4
|
-
import { supabaseAdmin } from "../../../integrations/supabase/client.server";
|
|
5
|
-
import { loadActiveConnection, sendProcessXml, TwinfieldError } from "./client.server";
|
|
6
|
-
import { buildCustomerDimensionXml, isTwinfieldAssignedCode, resolveDebLayout, } from "./mapping";
|
|
7
|
-
import { getMissingTwinfieldFields } from "../../twinfield-required-fields";
|
|
1
|
+
import { erpSnapshot } from "./sync.server.js";
|
|
2
|
+
import { toIsoCountry } from "../../countries.js";
|
|
3
|
+
import { TWINFIELD_FIELD_MAX } from "../../twinfield-limits.js";
|
|
4
|
+
import { supabaseAdmin } from "../../../integrations/supabase/client.server.js";
|
|
5
|
+
import { loadActiveConnection, sendProcessXml, TwinfieldError } from "./client.server.js";
|
|
6
|
+
import { buildCustomerDimensionXml, isTwinfieldAssignedCode, resolveDebLayout, } from "./mapping.js";
|
|
7
|
+
import { getMissingTwinfieldFields } from "../../twinfield-required-fields.js";
|
|
8
8
|
const BACKOFF_MINUTES = [1, 5, 30, 120, 360];
|
|
9
9
|
const MAX_ATTEMPTS = 6;
|
|
10
10
|
/** Wachttijd voordat een blokkerende voorwaarde bij de klant zichtbaar wordt. */
|
|
@@ -179,7 +179,7 @@ export async function runTwinfieldPushQueueInternal(limit = 25, customerId) {
|
|
|
179
179
|
code = null;
|
|
180
180
|
// Bestaande debiteur: altijd lezen-wijzigen-schrijven.
|
|
181
181
|
if (code) {
|
|
182
|
-
const { pushExistingDebtor } = await import("./rmw-push.server");
|
|
182
|
+
const { pushExistingDebtor } = await import("./rmw-push.server.js");
|
|
183
183
|
const rmw = await pushExistingDebtor(conn, code, customer, layout);
|
|
184
184
|
if (rmw.status === "geen_basis") {
|
|
185
185
|
await deferRow(row.id, "Wacht op de basis uit Twinfield (gelijktrekking of opnameronde) voordat er gepusht mag worden.", row.customer_id, 10, isConditionVisible(row.created_at));
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type { AccountingProviderInfo, AccountingSyncResult } from "./accounting/types";
|
|
1
|
+
import type { AccountingProviderInfo, AccountingSyncResult } from "./accounting/types.js";
|
|
2
2
|
export declare const listAccountingProviders: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
3
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
3
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
4
4
|
userId: string;
|
|
5
5
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
6
6
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
7
7
|
providers: AccountingProviderInfo[];
|
|
8
8
|
}>>;
|
|
9
9
|
export declare const syncAccountingProvider: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
10
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
10
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
11
11
|
userId: string;
|
|
12
12
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
13
13
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
14
14
|
providerId: string;
|
|
15
15
|
}, Promise<AccountingSyncResult>>;
|
|
16
16
|
export declare const syncAllAccountingProviders: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
17
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
17
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
18
18
|
userId: string;
|
|
19
19
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
20
20
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware";
|
|
4
|
-
import { getProvider, listProviders, } from "./accounting/registry.server";
|
|
3
|
+
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware.js";
|
|
4
|
+
import { getProvider, listProviders, } from "./accounting/registry.server.js";
|
|
5
5
|
export const listAccountingProviders = createServerFn({ method: "POST" })
|
|
6
6
|
.middleware([requireSupabaseAuth])
|
|
7
7
|
.handler(async () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { toIsoCountry } from "./countries";
|
|
3
|
-
import { toCountryCode, buildCustomerDimensionXml } from "./accounting/twinfield/mapping";
|
|
4
|
-
import { isDutch, requiresVatNumber } from "./twinfield-required-fields";
|
|
2
|
+
import { toIsoCountry } from "./countries.js";
|
|
3
|
+
import { toCountryCode, buildCustomerDimensionXml } from "./accounting/twinfield/mapping.js";
|
|
4
|
+
import { isDutch, requiresVatNumber } from "./twinfield-required-fields.js";
|
|
5
5
|
describe("landen", () => {
|
|
6
6
|
it("synoniemen", () => {
|
|
7
7
|
for (const [v, c] of [["Nederland", "NL"], ["NL", "NL"], ["nl", "NL"], ["Holland", "NL"], ["The Netherlands", "NL"], ["België", "BE"], ["Belgie", "BE"], ["Duitsland.", "DE"], ["Germany", "DE"], ["UK", "GB"], ["FR", "FR"], ["KE", "KE"], ["SA", "SA"], ["ES", "ES"]])
|
|
@@ -52,7 +52,7 @@ export type CustomerAnalytics = {
|
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
54
|
export declare const getCustomerAnalytics: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
55
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
55
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
56
56
|
userId: string;
|
|
57
57
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
58
58
|
}, undefined, undefined, undefined>], (input: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
|
-
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware";
|
|
2
|
+
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware.js";
|
|
3
3
|
function parseDate(s) {
|
|
4
4
|
if (!s)
|
|
5
5
|
return null;
|
|
@@ -45,7 +45,7 @@ export type CustomerAssortmentResult = {
|
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
export declare const listCustomerAssortment: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
48
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
48
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
49
49
|
userId: string;
|
|
50
50
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
51
51
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware";
|
|
4
|
-
import { computePrice } from "./pricing";
|
|
5
|
-
import { loadFloridayCatalogPrices } from "./floriday-catalog-prices";
|
|
3
|
+
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware.js";
|
|
4
|
+
import { computePrice } from "./pricing.js";
|
|
5
|
+
import { loadFloridayCatalogPrices } from "./floriday-catalog-prices.js";
|
|
6
6
|
function str(...vals) {
|
|
7
7
|
for (const v of vals) {
|
|
8
8
|
if (typeof v === "string" && v.trim())
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { toCustomerDefaults } from "./twinfield-customer-defaults.server";
|
|
3
|
-
import { buildCustomerInsertRow } from "./customer-insert";
|
|
4
|
-
import { buildCustomerDimensionXml } from "./accounting/twinfield/mapping";
|
|
2
|
+
import { toCustomerDefaults } from "./twinfield-customer-defaults.server.js";
|
|
3
|
+
import { buildCustomerInsertRow } from "./customer-insert.js";
|
|
4
|
+
import { buildCustomerDimensionXml } from "./accounting/twinfield/mapping.js";
|
|
5
5
|
describe("standaardwaarden uit de administratie", () => {
|
|
6
6
|
const d = toCustomerDefaults({ customer_gl_account: "1300", default_country: "NL", default_language: null, sales_payment_term_days: 10 });
|
|
7
7
|
it("leest de instellingen, taal ontbreekt", () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CustomerDefaults } from "./twinfield-customer-defaults.server";
|
|
1
|
+
import type { CustomerDefaults } from "./twinfield-customer-defaults.server.js";
|
|
2
2
|
/**
|
|
3
3
|
* Gedeelde opbouw van een insert-rij voor `customers`. Wordt gebruikt bij het
|
|
4
4
|
* aanmaken van een nieuwe klant én bij het overnemen van een Twinfield-debiteur.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TWINFIELD_DEFAULTS } from "./twinfield-defaults";
|
|
2
|
-
import { toIsoCountry } from "./countries";
|
|
1
|
+
import { TWINFIELD_DEFAULTS } from "./twinfield-defaults.js";
|
|
2
|
+
import { toIsoCountry } from "./countries.js";
|
|
3
3
|
/**
|
|
4
4
|
* Gedeelde opbouw van een insert-rij voor `customers`. Wordt gebruikt bij het
|
|
5
5
|
* aanmaken van een nieuwe klant én bij het overnemen van een Twinfield-debiteur.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const getCustomerNote: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
2
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
2
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
3
3
|
userId: string;
|
|
4
4
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
5
5
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -10,7 +10,7 @@ export declare const getCustomerNote: import("@tanstack/start-client-core").Opti
|
|
|
10
10
|
updated_at: string | null;
|
|
11
11
|
}>>;
|
|
12
12
|
export declare const upsertCustomerNote: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
13
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
13
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
14
14
|
userId: string;
|
|
15
15
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
16
16
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware";
|
|
3
|
+
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware.js";
|
|
4
4
|
const getInput = z.object({
|
|
5
5
|
customer_id: z.string().uuid().optional(),
|
|
6
6
|
group_key: z.string().trim().min(1).optional(),
|
|
@@ -12,7 +12,7 @@ export type CustomerOrder = {
|
|
|
12
12
|
};
|
|
13
13
|
/** Leest uit de gedeelde, al ontdubbelde orders-tabel (Verkoop/Logistieke Engine). Koppeling alleen via customer_id. */
|
|
14
14
|
export declare const listCustomerOrders: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
15
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
15
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
16
16
|
userId: string;
|
|
17
17
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
18
18
|
}, undefined, undefined, undefined>], (d: unknown) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware";
|
|
3
|
+
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware.js";
|
|
4
4
|
/** Leest uit de gedeelde, al ontdubbelde orders-tabel (Verkoop/Logistieke Engine). Koppeling alleen via customer_id. */
|
|
5
5
|
export const listCustomerOrders = createServerFn({ method: "POST" })
|
|
6
6
|
.middleware([requireSupabaseAuth])
|
|
@@ -23,7 +23,7 @@ export type RevenueActivityResult = {
|
|
|
23
23
|
as_of: string;
|
|
24
24
|
};
|
|
25
25
|
export declare const listRevenueActivity: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
26
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
26
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
27
27
|
userId: string;
|
|
28
28
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
29
29
|
}, undefined, undefined, undefined>], undefined, Promise<RevenueActivityResult>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
|
-
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware";
|
|
2
|
+
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware.js";
|
|
3
3
|
async function admin() {
|
|
4
|
-
const { supabaseAdmin } = await import("../integrations/supabase/client.server");
|
|
4
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
5
5
|
return supabaseAdmin;
|
|
6
6
|
}
|
|
7
7
|
/** Leest alle rijen in blokken van 1000 door, zodat er geen limiet ontstaat. */
|