Divers avec code moteur DAFA

Filtres


Année de construction

Commandez maintenant

Médias

Prix

Garantie

Code moteur

Code boîte de vitesses

Article numéro

Modèles
Aucun fournisseur trouvé

Fournisseurs

Démontage quality management (KZD) est un système de gestion de la qualité certifiée pour l'industrie du démantèlement des véhicules.

Les entreprises de démontage certifiées selon la norme KZD ont été évaluées sur un certain nombre de réglementations et d'exigences légales pertinentes applicables aux entreprises du secteur du démontage de véhicules, ainsi que sur des exigences spécifiques concernant les déchets destinés au recyclage. Ces entreprises disposent également d’un processus opérationnel clair et bien organisé.

La norme KZDPlus comporte un certain nombre de compléments. Les entreprises de démontage qui vendent des pièces peuvent, grâce au niveau supérieur KZDPlus, démontrer qu'elles sont un lieu fiable pour acheter des pièces d'occasion contrôlées et traçables avec garantie.

Les entreprises disposant de la certification complémentaire KZD-E ont été évaluées sur un certain nombre de points supplémentaires nécessaires pour le démontage sécurisé des véhicules électriques et hybrides. KZD-E est un complément aux normes KZD et KZDPlus et n'est pas disponible séparément.

Aucun fournisseur trouvé
1

PreLoad

{ "Data": { "SessionId": 70, "Match": null, "Timestamp": "0001-01-01T00:00:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/dafa/piece/divers/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/dafa/piece/divers/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/dafa/piece/divers/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 0, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 0, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }

All sessions

{ "Data": { "SessionId": 1, "Match": null, "Timestamp": "2026-08-15T06:26:46.4484624+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/m11/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/m11/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/m11/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 2, "Match": null, "Timestamp": "2026-08-15T06:26:47.4172154+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/40/piece/dynamo/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/40/piece/dynamo/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/40/piece/dynamo/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('8411A') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE '40%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '8411A' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE '40%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 242, 280, 244)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE '40%'), '40') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([18] AS INT) AS [18],  CASE WHEN [117] = 'M' THEN 'Ceinture multi' WHEN [117] = 'K' THEN 'Chaîne' WHEN [117] = 'V' THEN 'Courroie trapézoïdale' WHEN [117] = 'T' THEN 'Pignon/roue dentée' WHEN [117] = 'VP' THEN 'Roue libre' WHEN ISNULL([117], '') = '' THEN NULL ELSE [117] END AS [117],  TRY_CAST([118] AS INT) AS [118],  [25],  (SELECT TOP 1 [XOV].[Waarde] FROM dbo.[OOLVelden] [XOV] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 241 ORDER BY [XOV].[OrderId]) AS [241],  TRY_CAST([26] AS INT) AS [26],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 18, 117, 118, 25, 241, 26)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [18], [117], [118], [25], [241], [26])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,17,117,25,241)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,118,26)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 76, "SizeMax": 150, "SetMax": false, "GetIndexMax": 8, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "24488649": 1, "18701046": 1, "21365818": 1, "20503611": 1, "6082521": 1, "22904165": 1, "20553863": 1, "21909722": 2, "25008202": 2, "22460058": 2 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 3, "Match": null, "Timestamp": "2026-08-15T06:26:47.9172055+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/176a5000/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/176a5000/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/176a5000/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 4, "Match": null, "Timestamp": "2026-08-15T06:26:48.432832+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/dkrf/piece/divers/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/dkrf/piece/divers/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/dkrf/piece/divers/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('0005X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'DKRF%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '0005X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'DKRF%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 125)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'DKRF%'), 'DKRF') ELSE [R].[Motorcodes] END AS [108],  [R].[Versnellingsbakcodes] AS [114],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Versnellingsbakcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 5, "SizeMax": 150, "SetMax": false, "GetIndexMax": 1, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "12710630": 1, "19178516": 1, "20905212": 1, "12709657": 2, "22610555": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 5, "Match": null, "Timestamp": "2026-08-15T06:26:49.1203218+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/913/piece/divers/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/913/piece/divers/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/913/piece/divers/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('0005X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE '913%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '0005X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE '913%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 125)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE '913%'), '913') ELSE [R].[Motorcodes] END AS [108],  [R].[Versnellingsbakcodes] AS [114],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Versnellingsbakcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 1, "SizeMax": 150, "SetMax": false, "GetIndexMax": 1, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "11105330": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 6, "Match": null, "Timestamp": "2026-08-15T06:26:49.5109368+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/k7mf7/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/k7mf7/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/k7mf7/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 7, "Match": null, "Timestamp": "2026-08-15T06:26:50.2765929+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/nagx/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/nagx/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/nagx/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 8, "Match": null, "Timestamp": "2026-08-15T06:26:51.6203521+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/l5/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/l5/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/l5/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 9, "Match": null, "Timestamp": "2026-08-15T06:26:52.3718603+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/245211/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/245211/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/245211/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 10, "Match": null, "Timestamp": "2026-08-15T06:26:52.6374726+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/bbbb8b222220/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/bbbb8b222220/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/bbbb8b222220/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 11, "Match": null, "Timestamp": "2026-08-15T06:26:53.4499733+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/n22b3/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/n22b3/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/n22b3/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 12, "Match": null, "Timestamp": "2026-08-15T06:26:54.1062117+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/406629a/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/406629a/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/406629a/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 13, "Match": null, "Timestamp": "2026-08-15T06:26:54.5281015+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/mr9782/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/mr9782/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/mr9782/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 14, "Match": null, "Timestamp": "2026-08-15T06:26:54.8562751+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/crbccrb/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/crbccrb/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/crbccrb/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 15, "Match": null, "Timestamp": "2026-08-15T06:26:56.7156027+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/om601/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/om601/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/om601/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 16, "Match": null, "Timestamp": "2026-08-15T06:26:57.3562396+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/vm52cens/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/vm52cens/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/vm52cens/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 17, "Match": null, "Timestamp": "2026-08-15T06:26:57.9187142+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/atb/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/atb/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/atb/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 18, "Match": null, "Timestamp": "2026-08-15T06:26:58.4812153+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/030/piece/intercooler/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/030/piece/intercooler/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/030/piece/intercooler/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('7740X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE '030%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '7740X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE '030%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 230, 231, 232)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE '030%'), '030') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([18] AS INT) AS [18],  [V19].[NaamLang] AS [19],  CASE WHEN [36] = '4' THEN '4x4' WHEN [36] = 'A' THEN 'Roue arrière' WHEN [36] = 'V' THEN 'Roue avant' WHEN ISNULL([36], '') = '' THEN NULL ELSE [36] END AS [36],  [V23].[NaamLang] AS [23],  (SELECT TOP 1 [XOV].[Waarde] FROM dbo.[OOLVelden] [XOV] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 241 ORDER BY [XOV].[OrderId]) AS [241],  TRY_CAST([26] AS INT) AS [26],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 18, 19, 36, 23, 241, 26, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [18], [19], [36], [23], [241], [26], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [V19] ON [V19].[VeldId] = 19 AND [V19].[Waarde] = [19] AND [V19].[LanguageId] = 5   LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [V23] ON [V23].[VeldId] = 23 AND [V23].[Waarde] = [23] AND [V23].[LanguageId] = 5   LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,17,19,36,23,241,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,26)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 2, "SizeMax": 150, "SetMax": false, "GetIndexMax": 1, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "20567724": 1, "2230492": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 19, "Match": null, "Timestamp": "2026-08-15T06:26:59.6530856+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/n6/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/n6/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/n6/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 20, "Match": null, "Timestamp": "2026-08-15T06:27:00.0905841+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/cc/piece/module-electronique-central/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/cc/piece/module-electronique-central/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/cc/piece/module-electronique-central/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('7845A') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'CC%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '7845A' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'CC%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 232)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  CASE WHEN [22] = '2' THEN '2 portes' WHEN [22] = '4' THEN '4 portes' WHEN ISNULL([22], '') = '' THEN NULL ELSE [22] END AS [22],  [V23].[NaamLang] AS [23],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  TRY_CAST([18] AS INT) AS [18],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'CC%'), 'CC') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([167] AS INT) AS [167],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 22, 23, 18, 167, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [22], [23], [18], [167], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [V23] ON [V23].[VeldId] = 23 AND [V23].[Waarde] = [23] AND [V23].[LanguageId] = 5   LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,22,23,17,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,167)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 2, "SizeMax": 150, "SetMax": false, "GetIndexMax": 1, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "18881547": 1, "22843827": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 21, "Match": null, "Timestamp": "2026-08-15T06:27:00.5437225+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/217570/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/217570/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/217570/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 22, "Match": null, "Timestamp": "2026-08-15T06:27:00.8249746+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/111921/piece/module-electronique-central/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/111921/piece/module-electronique-central/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/111921/piece/module-electronique-central/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('7845A') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE '111921%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '7845A' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE '111921%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 232)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  CASE WHEN [22] = '2' THEN '2 portes' WHEN [22] = '4' THEN '4 portes' WHEN ISNULL([22], '') = '' THEN NULL ELSE [22] END AS [22],  [V23].[NaamLang] AS [23],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  TRY_CAST([18] AS INT) AS [18],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE '111921%'), '111921') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([167] AS INT) AS [167],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 22, 23, 18, 167, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [22], [23], [18], [167], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [V23] ON [V23].[VeldId] = 23 AND [V23].[Waarde] = [23] AND [V23].[LanguageId] = 5   LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,22,23,17,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,167)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 1, "SizeMax": 150, "SetMax": false, "GetIndexMax": 1, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "15857136": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 23, "Match": null, "Timestamp": "2026-08-15T06:27:01.2156164+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/b33l/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/b33l/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/b33l/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 24, "Match": null, "Timestamp": "2026-08-15T06:27:01.5125065+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/199b00/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/199b00/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/199b00/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 25, "Match": null, "Timestamp": "2026-08-15T06:27:01.8562434+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/5fu/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/5fu/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/5fu/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 26, "Match": null, "Timestamp": "2026-08-15T06:27:02.5905916+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/c5mb/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/c5mb/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/c5mb/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 27, "Match": null, "Timestamp": "2026-08-15T06:27:03.1062139+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/dbc/piece/divers/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/dbc/piece/divers/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/dbc/piece/divers/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('0005X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'DBC%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '0005X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'DBC%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 125)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'DBC%'), 'DBC') ELSE [R].[Motorcodes] END AS [108],  [R].[Versnellingsbakcodes] AS [114],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Versnellingsbakcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 13, "SizeMax": 150, "SetMax": false, "GetIndexMax": 2, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "12800191": 1, "12800182": 2, "12817720": 1, "12830872": 2, "12830873": 3, "13120071": 4, "13119765": 5, "13120394": 6, "13120368": 7, "13120481": 8 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 28, "Match": null, "Timestamp": "2026-08-15T06:27:04.8093446+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/204/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/204/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/204/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 29, "Match": null, "Timestamp": "2026-08-15T06:27:05.4655987+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/dnf/piece/piston/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/dnf/piece/piston/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/dnf/piece/piston/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('7902X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'DNF%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '7902X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'DNF%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  CASE WHEN [101] = 'I' THEN 'Intercooler' WHEN [101] = 'N' THEN 'Non' WHEN ISNULL([101], '') = '' THEN NULL ELSE [101] END AS [101],  TRY_CAST([18] AS INT) AS [18],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'DNF%'), 'DNF') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([122] AS INT) AS [122],  (SELECT TOP 1 [XOV].[Waarde] FROM dbo.[OOLVelden] [XOV] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 241 ORDER BY [XOV].[OrderId]) AS [241],  TRY_CAST([26] AS INT) AS [26],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 101, 18, 122, 241, 26, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [101], [18], [122], [241], [26], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,17,101,241,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,122,26)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 3, "SizeMax": 150, "SetMax": false, "GetIndexMax": 1, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "23005120": 1, "23005118": 2, "23005119": 3 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 30, "Match": null, "Timestamp": "2026-08-15T06:27:06.2624615+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/a2/piece/divers/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/a2/piece/divers/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/a2/piece/divers/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('0005X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'A2%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '0005X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'A2%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 125)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'A2%'), 'A2') ELSE [R].[Motorcodes] END AS [108],  [R].[Versnellingsbakcodes] AS [114],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Versnellingsbakcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 58, "SizeMax": 150, "SetMax": false, "GetIndexMax": 6, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "19374965": 1, "24445538": 1, "13371877": 1, "5525731": 1, "25124671": 1, "19383602": 2, "19078678": 2, "24327670": 2, "17081356": 3, "19081299": 3 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 31, "Match": null, "Timestamp": "2026-08-15T06:27:06.8360926+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/601913/piece/dynamo/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/601913/piece/dynamo/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/601913/piece/dynamo/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('8411A') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE '601913%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '8411A' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE '601913%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 242, 280, 244)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE '601913%'), '601913') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([18] AS INT) AS [18],  CASE WHEN [117] = 'M' THEN 'Ceinture multi' WHEN [117] = 'K' THEN 'Chaîne' WHEN [117] = 'V' THEN 'Courroie trapézoïdale' WHEN [117] = 'T' THEN 'Pignon/roue dentée' WHEN [117] = 'VP' THEN 'Roue libre' WHEN ISNULL([117], '') = '' THEN NULL ELSE [117] END AS [117],  TRY_CAST([118] AS INT) AS [118],  [25],  (SELECT TOP 1 [XOV].[Waarde] FROM dbo.[OOLVelden] [XOV] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 241 ORDER BY [XOV].[OrderId]) AS [241],  TRY_CAST([26] AS INT) AS [26],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 18, 117, 118, 25, 241, 26)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [18], [117], [118], [25], [241], [26])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,17,117,25,241)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,118,26)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 3, "SizeMax": 150, "SetMax": false, "GetIndexMax": 1, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "18052110": 1, "4125267": 1, "25089286": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 32, "Match": null, "Timestamp": "2026-08-15T06:27:07.2735858+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/l8de/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/l8de/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/l8de/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 33, "Match": null, "Timestamp": "2026-08-15T06:27:08.6017455+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/188a/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/188a/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/188a/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 34, "Match": null, "Timestamp": "2026-08-15T06:27:09.3985869+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/f9qa7/piece/dynamo/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/f9qa7/piece/dynamo/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/f9qa7/piece/dynamo/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('8411A') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'F9QA7%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '8411A' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'F9QA7%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 242, 280, 244)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'F9QA7%'), 'F9QA7') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([18] AS INT) AS [18],  CASE WHEN [117] = 'M' THEN 'Ceinture multi' WHEN [117] = 'K' THEN 'Chaîne' WHEN [117] = 'V' THEN 'Courroie trapézoïdale' WHEN [117] = 'T' THEN 'Pignon/roue dentée' WHEN [117] = 'VP' THEN 'Roue libre' WHEN ISNULL([117], '') = '' THEN NULL ELSE [117] END AS [117],  TRY_CAST([118] AS INT) AS [118],  [25],  (SELECT TOP 1 [XOV].[Waarde] FROM dbo.[OOLVelden] [XOV] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 241 ORDER BY [XOV].[OrderId]) AS [241],  TRY_CAST([26] AS INT) AS [26],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 18, 117, 118, 25, 241, 26)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [18], [117], [118], [25], [241], [26])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,17,117,25,241)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,118,26)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 13, "SizeMax": 150, "SetMax": false, "GetIndexMax": 2, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "11850762": 1, "24043612": 1, "11061999": 1, "6570323": 1, "14229481": 1, "8799086": 1, "4147421": 1, "6638615": 1, "17732172": 1, "583827": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 35, "Match": null, "Timestamp": "2026-08-15T06:27:09.773568+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/11005a3dfa7/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/11005a3dfa7/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/11005a3dfa7/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 36, "Match": null, "Timestamp": "2026-08-15T06:27:10.8517209+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/b16dth/piece/intercooler/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/b16dth/piece/intercooler/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/b16dth/piece/intercooler/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('7740X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'B16DTH%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '7740X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'B16DTH%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 230, 231, 232)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'B16DTH%'), 'B16DTH') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([18] AS INT) AS [18],  [V19].[NaamLang] AS [19],  CASE WHEN [36] = '4' THEN '4x4' WHEN [36] = 'A' THEN 'Roue arrière' WHEN [36] = 'V' THEN 'Roue avant' WHEN ISNULL([36], '') = '' THEN NULL ELSE [36] END AS [36],  [V23].[NaamLang] AS [23],  (SELECT TOP 1 [XOV].[Waarde] FROM dbo.[OOLVelden] [XOV] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 241 ORDER BY [XOV].[OrderId]) AS [241],  TRY_CAST([26] AS INT) AS [26],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 18, 19, 36, 23, 241, 26, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [18], [19], [36], [23], [241], [26], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [V19] ON [V19].[VeldId] = 19 AND [V19].[Waarde] = [19] AND [V19].[LanguageId] = 5   LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [V23] ON [V23].[VeldId] = 23 AND [V23].[Waarde] = [23] AND [V23].[LanguageId] = 5   LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,17,19,36,23,241,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,26)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 12, "SizeMax": 150, "SetMax": false, "GetIndexMax": 2, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "24502237": 1, "17777997": 1, "22143279": 1, "17189593": 1, "13684080": 1, "15730501": 1, "21551578": 1, "13649279": 2, "10301309": 1, "21317785": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 37, "Match": null, "Timestamp": "2026-08-15T06:27:11.8829383+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/fb/piece/divers/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/fb/piece/divers/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/fb/piece/divers/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('0005X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'FB%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '0005X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'FB%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 125)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'FB%'), 'FB') ELSE [R].[Motorcodes] END AS [108],  [R].[Versnellingsbakcodes] AS [114],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Versnellingsbakcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 9, "SizeMax": 150, "SetMax": false, "GetIndexMax": 1, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "17859069": 1, "6213353": 1, "6213359": 2, "13126492": 1, "9617972": 1, "9617977": 2, "9617969": 3, "13266168": 1, "11944204": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 38, "Match": null, "Timestamp": "2026-08-15T06:27:12.4051197+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/caycayd/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/caycayd/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/caycayd/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 39, "Match": null, "Timestamp": "2026-08-15T06:27:13.2488542+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/a2/piece/piston/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/a2/piece/piston/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/a2/piece/piston/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('7902X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'A2%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '7902X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'A2%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  CASE WHEN [101] = 'I' THEN 'Intercooler' WHEN [101] = 'N' THEN 'Non' WHEN ISNULL([101], '') = '' THEN NULL ELSE [101] END AS [101],  TRY_CAST([18] AS INT) AS [18],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'A2%'), 'A2') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([122] AS INT) AS [122],  (SELECT TOP 1 [XOV].[Waarde] FROM dbo.[OOLVelden] [XOV] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 241 ORDER BY [XOV].[OrderId]) AS [241],  TRY_CAST([26] AS INT) AS [26],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 101, 18, 122, 241, 26, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [101], [18], [122], [241], [26], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,17,101,241,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,122,26)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 36, "SizeMax": 150, "SetMax": false, "GetIndexMax": 4, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "13530350": 1, "15974743": 1, "15974744": 2, "21530340": 1, "21530341": 2, "21530338": 3, "21530339": 4, "18240156": 1, "18239957": 2, "17213970": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 40, "Match": null, "Timestamp": "2026-08-15T06:27:13.6394738+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/cmxa/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/cmxa/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/cmxa/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 41, "Match": null, "Timestamp": "2026-08-15T06:27:14.9988546+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/g4c/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/g4c/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/g4c/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 42, "Match": null, "Timestamp": "2026-08-15T06:27:16.1707239+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/jug/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/jug/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/jug/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 43, "Match": null, "Timestamp": "2026-08-15T06:27:16.5925991+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/12v/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/12v/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/12v/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 44, "Match": null, "Timestamp": "2026-08-15T06:27:17.1707333+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/k4mc8/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/k4mc8/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/k4mc8/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 45, "Match": null, "Timestamp": "2026-08-15T06:27:17.7644725+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/bbm/piece/piston/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/bbm/piece/piston/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/bbm/piece/piston/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('7902X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'BBM%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '7902X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'BBM%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  CASE WHEN [101] = 'I' THEN 'Intercooler' WHEN [101] = 'N' THEN 'Non' WHEN ISNULL([101], '') = '' THEN NULL ELSE [101] END AS [101],  TRY_CAST([18] AS INT) AS [18],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'BBM%'), 'BBM') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([122] AS INT) AS [122],  (SELECT TOP 1 [XOV].[Waarde] FROM dbo.[OOLVelden] [XOV] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 241 ORDER BY [XOV].[OrderId]) AS [241],  TRY_CAST([26] AS INT) AS [26],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 101, 18, 122, 241, 26, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [101], [18], [122], [241], [26], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,17,101,241,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,122,26)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 3, "SizeMax": 150, "SetMax": false, "GetIndexMax": 1, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "14606990": 1, "14606931": 2, "14607003": 3 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 46, "Match": null, "Timestamp": "2026-08-15T06:27:18.5300996+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/a7/piece/intercooler/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/a7/piece/intercooler/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/a7/piece/intercooler/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('7740X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'A7%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '7740X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'A7%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 230, 231, 232)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'A7%'), 'A7') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([18] AS INT) AS [18],  [V19].[NaamLang] AS [19],  CASE WHEN [36] = '4' THEN '4x4' WHEN [36] = 'A' THEN 'Roue arrière' WHEN [36] = 'V' THEN 'Roue avant' WHEN ISNULL([36], '') = '' THEN NULL ELSE [36] END AS [36],  [V23].[NaamLang] AS [23],  (SELECT TOP 1 [XOV].[Waarde] FROM dbo.[OOLVelden] [XOV] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 241 ORDER BY [XOV].[OrderId]) AS [241],  TRY_CAST([26] AS INT) AS [26],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 18, 19, 36, 23, 241, 26, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [18], [19], [36], [23], [241], [26], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [V19] ON [V19].[VeldId] = 19 AND [V19].[Waarde] = [19] AND [V19].[LanguageId] = 5   LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [V23] ON [V23].[VeldId] = 23 AND [V23].[Waarde] = [23] AND [V23].[LanguageId] = 5   LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,17,19,36,23,241,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,26)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 11, "SizeMax": 150, "SetMax": false, "GetIndexMax": 2, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "5413689": 1, "8504998": 1, "3634175": 1, "15346102": 1, "9659711": 1, "9790468": 1, "3093401": 1, "788743": 1, "184149": 2, "4332278": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 47, "Match": null, "Timestamp": "2026-08-15T06:27:19.3269689+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/tsn/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/tsn/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/tsn/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 48, "Match": null, "Timestamp": "2026-08-15T06:27:20.0457193+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/fbk02j/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/fbk02j/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/fbk02j/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 49, "Match": null, "Timestamp": "2026-08-15T06:27:21.3113531+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/ib5/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/ib5/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/ib5/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 50, "Match": null, "Timestamp": "2026-08-15T06:27:22.4695903+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/cfa/piece/divers/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/cfa/piece/divers/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/cfa/piece/divers/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('0005X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'CFA%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '0005X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'CFA%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 125)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'CFA%'), 'CFA') ELSE [R].[Motorcodes] END AS [108],  [R].[Versnellingsbakcodes] AS [114],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Versnellingsbakcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 2, "SizeMax": 150, "SetMax": false, "GetIndexMax": 1, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "3281892": 1, "16987529": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 51, "Match": null, "Timestamp": "2026-08-15T06:27:23.8758438+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/t9/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/t9/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/t9/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 52, "Match": null, "Timestamp": "2026-08-15T06:27:24.5320844+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/b16dtu/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/b16dtu/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/b16dtu/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 53, "Match": null, "Timestamp": "2026-08-15T06:27:25.3758345+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/dnw/piece/intercooler/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/dnw/piece/intercooler/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/dnw/piece/intercooler/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('7740X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'DNW%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '7740X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'DNW%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 230, 231, 232)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'DNW%'), 'DNW') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([18] AS INT) AS [18],  [V19].[NaamLang] AS [19],  CASE WHEN [36] = '4' THEN '4x4' WHEN [36] = 'A' THEN 'Roue arrière' WHEN [36] = 'V' THEN 'Roue avant' WHEN ISNULL([36], '') = '' THEN NULL ELSE [36] END AS [36],  [V23].[NaamLang] AS [23],  (SELECT TOP 1 [XOV].[Waarde] FROM dbo.[OOLVelden] [XOV] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 241 ORDER BY [XOV].[OrderId]) AS [241],  TRY_CAST([26] AS INT) AS [26],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 18, 19, 36, 23, 241, 26, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [18], [19], [36], [23], [241], [26], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [V19] ON [V19].[VeldId] = 19 AND [V19].[Waarde] = [19] AND [V19].[LanguageId] = 5   LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [V23] ON [V23].[VeldId] = 23 AND [V23].[Waarde] = [23] AND [V23].[LanguageId] = 5   LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,17,19,36,23,241,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,26)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 2, "SizeMax": 150, "SetMax": false, "GetIndexMax": 1, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "23531563": 1, "25301911": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 54, "Match": null, "Timestamp": "2026-08-15T06:27:39.9934353+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/h9fd/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/h9fd/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/h9fd/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 55, "Match": null, "Timestamp": "2026-08-15T06:27:42.0246849+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/dv4/piece/dynamo/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/dv4/piece/dynamo/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/dv4/piece/dynamo/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('8411A') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'DV4%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '8411A' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'DV4%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 242, 280, 244)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'DV4%'), 'DV4') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([18] AS INT) AS [18],  CASE WHEN [117] = 'M' THEN 'Ceinture multi' WHEN [117] = 'K' THEN 'Chaîne' WHEN [117] = 'V' THEN 'Courroie trapézoïdale' WHEN [117] = 'T' THEN 'Pignon/roue dentée' WHEN [117] = 'VP' THEN 'Roue libre' WHEN ISNULL([117], '') = '' THEN NULL ELSE [117] END AS [117],  TRY_CAST([118] AS INT) AS [118],  [25],  (SELECT TOP 1 [XOV].[Waarde] FROM dbo.[OOLVelden] [XOV] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 241 ORDER BY [XOV].[OrderId]) AS [241],  TRY_CAST([26] AS INT) AS [26],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 18, 117, 118, 25, 241, 26)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [18], [117], [118], [25], [241], [26])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,17,117,25,241)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,118,26)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 14, "SizeMax": 150, "SetMax": false, "GetIndexMax": 2, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "7173321": 1, "22086331": 1, "22267116": 1, "25102233": 1, "24514283": 2, "15928805": 1, "11935812": 2, "21798571": 1, "23169575": 1, "15363932": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 56, "Match": null, "Timestamp": "2026-08-15T06:27:43.8825896+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/axrdb/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/axrdb/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/axrdb/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 57, "Match": null, "Timestamp": "2026-08-15T06:27:44.6326069+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/edz/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/edz/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/edz/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 58, "Match": null, "Timestamp": "2026-08-15T06:27:45.9607211+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/nfx/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/nfx/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/nfx/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 59, "Match": null, "Timestamp": "2026-08-15T06:27:48.0857223+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/aeh/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/aeh/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/aeh/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 60, "Match": null, "Timestamp": "2026-08-15T06:27:49.4294678+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/dcx/piece/piston/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/dcx/piece/piston/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/dcx/piece/piston/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('7902X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'DCX%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '7902X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'DCX%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  CASE WHEN [101] = 'I' THEN 'Intercooler' WHEN [101] = 'N' THEN 'Non' WHEN ISNULL([101], '') = '' THEN NULL ELSE [101] END AS [101],  TRY_CAST([18] AS INT) AS [18],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'DCX%'), 'DCX') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([122] AS INT) AS [122],  (SELECT TOP 1 [XOV].[Waarde] FROM dbo.[OOLVelden] [XOV] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 241 ORDER BY [XOV].[OrderId]) AS [241],  TRY_CAST([26] AS INT) AS [26],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 101, 18, 122, 241, 26, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [101], [18], [122], [241], [26], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,17,101,241,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,122,26)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 5, "SizeMax": 150, "SetMax": false, "GetIndexMax": 1, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "22870030": 1, "22870031": 2, "22869944": 3, "22870029": 4, "18451719": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 61, "Match": null, "Timestamp": "2026-08-15T06:27:50.5232144+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/176a7/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/176a7/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/176a7/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 62, "Match": null, "Timestamp": "2026-08-15T06:27:53.1649615+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/f1/piece/dynamo/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/f1/piece/dynamo/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/f1/piece/dynamo/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('8411A') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'F1%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '8411A' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'F1%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 242, 280, 244)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  STUFF((SELECT '|' + [XVT].[NaamLang] FROM dbo.[OOLVelden] [XOV] LEFT JOIN [Basis].dbo.[AutomateVeldWaardenTranslated] [XVT] ON [XVT].[VeldId] = [XOV].[VeldId] AND [XVT].[LanguageId] = 5 AND [XVT].[Waarde] = [XOV].[Waarde] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 17 ORDER BY [XOV].[OrderId] FOR XML PATH('')), 1, 1, '') AS [17],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'F1%'), 'F1') ELSE [R].[Motorcodes] END AS [108],  TRY_CAST([18] AS INT) AS [18],  CASE WHEN [117] = 'M' THEN 'Ceinture multi' WHEN [117] = 'K' THEN 'Chaîne' WHEN [117] = 'V' THEN 'Courroie trapézoïdale' WHEN [117] = 'T' THEN 'Pignon/roue dentée' WHEN [117] = 'VP' THEN 'Roue libre' WHEN ISNULL([117], '') = '' THEN NULL ELSE [117] END AS [117],  TRY_CAST([118] AS INT) AS [118],  [25],  (SELECT TOP 1 [XOV].[Waarde] FROM dbo.[OOLVelden] [XOV] WHERE [XOV].[RecordId] = [R].[RecordId] AND [XOV].[VeldId] = 241 ORDER BY [XOV].[OrderId]) AS [241],  TRY_CAST([26] AS INT) AS [26],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 18, 117, 118, 25, 241, 26)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [18], [117], [118], [25], [241], [26])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,17,117,25,241)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135,18,118,26)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 669, "SizeMax": 150, "SetMax": false, "GetIndexMax": 67, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "24155468": 1, "20448873": 1, "24527260": 1, "21345634": 1, "22304890": 1, "19490555": 1, "21824387": 1, "14287905": 1, "22631227": 1, "20694102": 1 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 63, "Match": null, "Timestamp": "2026-08-15T06:27:54.9149508+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/d4bh/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/d4bh/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/d4bh/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 64, "Match": null, "Timestamp": "2026-08-15T06:27:55.5243414+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/nvt/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/nvt/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/nvt/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 65, "Match": null, "Timestamp": "2026-08-15T06:27:56.2274576+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/rlz/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/rlz/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/rlz/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 66, "Match": null, "Timestamp": "2026-08-15T06:27:57.2274539+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/akl235621/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/akl235621/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/akl235621/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 67, "Match": null, "Timestamp": "2026-08-15T06:27:57.5868256+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/1j/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/1j/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/1j/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 68, "Match": null, "Timestamp": "2026-08-15T06:27:57.9930793+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/v44b/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/v44b/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/v44b/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }
{ "Data": { "SessionId": 69, "Match": null, "Timestamp": "2026-08-15T06:27:59.1180677+02:00", "UrlRawCurrent": "/stock-de-pieces-auto/recherche/code-moteur/02merf/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/recherche/code-moteur/02merf/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/recherche/code-moteur/02merf/" ], "UrlSet": false, "Query": null }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 0, "SizeMax": 150, "SetMax": false, "GetIndexMax": 0, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": {}, "Sort": "", "SortDirection": "Ascending", "CountryName": null, "CountryId": 0, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }


LoadComplete

{ "Data": { "SessionId": 70, "Match": null, "Timestamp": "0001-01-01T00:00:00", "UrlRawCurrent": "/stock-de-pieces-auto/entrepot/code-moteur/dafa/piece/divers/", "UrlAbsoluteCurrent": "/url_voorraad/stock-de-pieces-auto/entrepot/code-moteur/dafa/piece/divers/", "UrlAbsoluteReferer": "", "UrlReferers": [ "/stock-de-pieces-auto/entrepot/code-moteur/dafa/piece/divers/" ], "UrlSet": false, "Query": "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; DECLARE @RM TABLE ([RecordId] BIGINT NOT NULL, [xPR] DECIMAL(9, 2), [xPS] BIT NOT NULL, [xPD] INT, [xTP] DECIMAL(5, 2) NOT NULL, [xTT] INT NOT NULL, [xShopState] INT, [xShippingState] TINYINT, [Match] INT, [XChange] BIT, [xPF] DECIMAL(9, 2), [xPE] DECIMAL(9, 2), [xPI] DECIMAL(9, 2) PRIMARY KEY CLUSTERED (RecordId ASC)) INSERT INTO @RM ([RecordId], [xPR], [xPS], [xPD], [xTP], [xTT], [xShopState], [xShippingState], [Match], [XChange], [xPF], [xPE], [xPI]) SELECT  *,  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 1 THEN CAST([xPF] / ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPE],  CASE WHEN [xPF] IS NOT NULL THEN CASE WHEN [xTT] = 0 THEN CAST([xPF] * ((100 + [xTP]) / 100) AS DECIMAL(9, 2)) ELSE [xPF] END END AS [xPI]     FROM (SELECT  *,  CASE WHEN [xPS] = 1 AND [xPR] IS NOT NULL THEN CAST(CASE WHEN [xPD] IS NOT NULL THEN (CAST((100 - ISNULL([xPD], 0)) AS DECIMAL) / 100) * [xPR] ELSE [xPR] END AS DECIMAL(10, 2)) END AS [xPF]     FROM (SELECT  [R].[RecordId],  (ISNULL(CASE WHEN [R].[Shop] = 1 THEN ISNULL([R].[PriceShop],ROUND ( [R].[Prijs] * ((100 + ISNULL([D].[ShopPricePercentage], 0)) / 100), 2)) END, [R].[Prijs])) AS [xPR],  CASE WHEN [R].[PrijsTonen] IS NOT NULL THEN [R].[PrijsTonen] WHEN [R].[SoortId] = 0 THEN [D].[OOLPrijzenG] WHEN [R].[SoortId] = 1 THEN [D].[OOLPrijzenR] WHEN [R].[SoortId] = 2 THEN [D].[OOLPrijzenN] ELSE 1 END AS [xPS],  (SELECT [T].[Discount] FROM dbo.[AutomatePartDiscount] [T] WHERE [T].[SupplierId] = [R].[DebiteurId] AND [T].[StateId] = [R].[SoortId] AND [T].[PartAutomateId] = [R].[DeelId]) AS [xPD],  ISNULL([VT].[General], 21) AS [xTP],  CASE WHEN [R].[SoortId] = 0 AND NOT ISNULL([R].[PrijsSoort], 0) = 1 THEN 2 WHEN [D].[OOLPrijzenExcl] = 0 THEN 1 ELSE 0 END AS [xTT],  CASE WHEN NOT [D].[ShopActive] = 1 THEN 11 ELSE dbo.fnGetOOLShopStateQuick([R].[RecordId], 1, 5, xShippingState) END AS [xShopState],  xShippingState AS [xShippingState],  NULL AS [Match],  CASE WHEN [RM].[xPM] = 4 THEN 1 END AS [XChange]     FROM (SELECT  [RM].[RecordId],  MAX([RM].[xPM]) AS [xPM]     FROM (SELECT  [R].[RecordId],  10 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DeelId] IN ('0005X') AND [R].[RecordId] IN (SELECT  [OT].[RecordId]     FROM dbo.[OOLEnginecodes] [OT] WITH (NOLOCK)     WHERE [OT].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'DAFA%')) AND [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) UNION SELECT  [R].[RecordId],  4 AS [xPM]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[DebiteurId] IN (100001, 100003, 100007, 100008, 100012, 100019, 100022, 100029, 100034, 100044, 100045, 100056, 100062, 100081, 100085, 100086, 100107, 100109, 100110, 100116, 100119, 100120, 100121, 100124, 100129, 100131, 100139, 100141, 100145, 100152, 100153, 100155, 100159, 100160, 100161, 100177, 100178, 100180, 100181, 100184, 100187, 100189, 100191, 100194, 100197, 100208, 100209, 100216, 100219, 100232, 100238, 100248, 100249, 100251, 100255, 100261, 100278, 100282, 100283, 100284, 100291, 100294, 100305, 100307, 100315, 100324, 100327, 100328, 100336, 100345, 100353, 100358, 100359, 100378, 100385, 100386, 100414, 100417, 100426, 100433, 100457, 100471, 100473, 100480, 100493, 100509, 100512, 100515, 100617, 100727, 100771, 100803, 100805, 100883, 100886, 100997, 101112, 101113, 101114, 101115, 101117, 101118, 101119, 101120, 101121, 101122, 101175, 101185, 101186, 101205, 101209, 101221, 101222, 101232, 101234, 101237, 101238, 101239, 101240, 101249, 101255, 101257, 101262, 101268, 101269, 101271, 101273, 101275, 101276, 101277, 101279, 101280, 101285, 101293, 101300, 101301, 101302, 101304, 101305, 101309, 101311, 101313, 101314, 101315, 101317, 101319, 101321, 101328, 101331, 101332, 101334, 101335, 101337, 101340, 101342, 101343, 101344, 101345, 101348, 101349, 101352, 101353, 101355, 101356, 101361, 101362, 101363, 101365, 101366, 101368, 101369, 101370, 101371, 101374, 101385, 101387, 101390, 101391, 101394, 101395, 101396, 101397, 101398, 101400, 101401, 101403, 101405, 101406, 101407, 101408, 101412, 101413, 101414, 101415, 101417, 101418, 101420, 101422, 101423, 101424, 101425, 101429, 101432, 101433, 101434, 101436, 101438, 101441, 101442, 111111, 123456, 123457, 123462) AND [R].[DeelId] = '0005X' AND ([R].[RecordId] IN (SELECT  [OX].[RecordId]     FROM dbo.[OOLXchg] [OX] WITH (NOLOCK)     WHERE [OX].[CollectionId] IN (SELECT  [DX].[CollectionId]     FROM dbo.[DebtorXchgEnginecode] [DX]     WHERE [DX].[CodeId] IN (SELECT  [CT].[Id]     FROM dbo.[CodeEngine] [CT]     WHERE [CT].[Code] LIKE 'DAFA%'))))) [RM]  GROUP BY [RM].[RecordId]) [RM]  LEFT JOIN dbo.[OOLInternet] [R] ON [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)   LEFT JOIN [Basis].dbo.[CountryVatRate] [VT] ON [VT].[CountryId] = [D].[LandId] AND [VT].[Active] = 1  OUTER APPLY (SELECT dbo.fnGetOOLShippingStateExtended([R].[DebiteurId], [R].[DebiteurLocatieId], [R].[DeelNr], 250, NULL) [xShippingState]) [SHS]) [R]) [R]; SELECT  [R].[DeelId],  [R].[SoortId],  COUNT(*) AS [Aantal]     FROM (SELECT  [R].[DeelId],  [R].[SoortId],  [R].[RecordId],  [R].[DebiteurId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) [R]  GROUP BY [R].[DeelId], [R].[SoortId]; SELECT  [R].*,  [xTP] AS [PrijsTaxPerc],  [xPD] AS [PrijsKorting],  (SELECT [VIBM].[Bouwmaand] FROM dbo.[VOLInternet] [VIBM] WHERE [VIBM].[RecordId] = [R].[AutoRecordId]) AS [ConstructionMonth],  [xPE] AS [PrijsAlt],  STUFF((SELECT '|' + CAST([V].[VeldId] AS VARCHAR(10)) + '^' + [V].[Waarde] FROM (SELECT [V].[VeldId], [V].[Waarde], [V].[OrderId] FROM dbo.[OOLVelden] [V] WHERE [V].[RecordId] = [R].[RecordId] AND [V].[VeldId] IN (26, 125)) [V] ORDER BY [V].[VeldId], [V].[OrderId] FOR XML PATH('')), 1, 1, '') AS [Automate2Velden],  CASE WHEN [R].[GarantieToelichting] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 2) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [GarantieTranslated],  CASE WHEN [R].[BijzonderheidInet] IS NOT NULL THEN (SELECT TOP 1 [TV].[Translation] FROM [Storage].dbo.[TranslateTextResult] [TV] WHERE [TV].[TextId] = (SELECT [TR].[TextId] FROM [Storage].dbo.[TranslateTextRecord] [TR] WHERE [TR].[RecordId] = [R].[RecordId] AND [TR].[TextTypeId] = 1) AND [TV].[LanguageId] IN (5, 2, 1) ORDER BY [TV].[LanguageId] DESC) END AS [BijzonderheidInetTranslated],  [xShopState] AS [ShopState],  CASE WHEN [R].[AldocModelCode] IS NOT NULL THEN (SELECT ISNULL((STUFF((SELECT '^' + [T3].[NaamInternet] + '~' + [T2].[NaamInternet] FROM [Basis].dbo.[AutomateModellenTranslated] [T2] LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [T3] ON [T3].[MerkId] = [T2].[MerkId] AND [T3].[LanguageId] = 5 WHERE [T2].[ModelId] IN (SELECT [T].[ModelId] FROM [Basis].dbo.[AldocModelKoppelingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode]) AND [T2].[LanguageId] = 5 AND [T2].[Synoniem] = 0 FOR XML PATH('')), 1, 1,'')), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocModelOmschrijvingen] [T] WHERE [T].[ModelCode] = [R].[AldocModelCode] AND [T].[LanguageId] = 5), '') + '|' + ISNULL((SELECT [T].[Omschrijving] FROM [Basis].dbo.[AldocTypeOmschrijvingen] [T] WHERE [T].[TypeId] = [R].[AldocTypeId] AND [T].[LanguageId] = 5), '')) END AS [AldocDescription]     FROM (SELECT  [R].*,  ROW_NUMBER() OVER (PARTITION BY R.SortId, R.DebiteurId ORDER BY SortId + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, CASE WHEN [12] IS NULL THEN 1 END ASC, [12] DESC, CASE WHEN [14] IS NULL THEN 1 END ASC, [14] ASC, RIGHT([RecordId], 2)%(DATEPART(WEEKDAY, GETDATE()) + 3) ASC, [RecordId] ASC) AS [RowId]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube] AS [181],  [184],  [190],  ISNULL([R].[Fotos], (SELECT 'G^' + CAST([G].[GroupId] AS VARCHAR(20)) + '^' + [G].[Images] FROM dbo.[OOLFotoGroups] [G] WHERE [G].[DebiteurId] = [R].[DebiteurId] AND [G].[SModelId] = [R].[SModelId] AND [G].[DeelId] = [R].[DeelId])) AS [58],  [R].[SoortId] AS [StateId],  CASE WHEN SUBSTRING([R].[ModelId], 1, 3) IN ('00X', '0XX') THEN NULL ELSE [MET].[NaamInternet] + '^' + [MOT].[NaamInternet] END AS [MakeModel],  [xPS] AS [PrijsTonen],  CASE WHEN [xTT] IN (0, 1) THEN 1 ELSE [xTT] END AS [PrijsTaxType],  [xPI] AS [14],  [R].[Bouwjaar] AS [12],  [R].[AutoRecordId],  CASE WHEN [135] IS NULL THEN CASE WHEN [R].[SoortId] = 0 THEN [D].[OOLGarantieG] WHEN [R].[SoortId] = 1 THEN [D].[OOLGarantieR] WHEN [R].[SoortId] = 2 THEN [D].[OOLGarantieN] ELSE NULL END ELSE [135] END AS [135],  [37],  CASE WHEN [XChange] = 1 THEN ISNULL([R].[Motorcodes] + '|', '') + ISNULL((SELECT TOP 1 [CT].[Code] FROM dbo.[OOLXchg] [X] LEFT JOIN dbo.[DebtorXchgEnginecode] [XP] ON [XP].[CollectionId] = [X].[CollectionId] LEFT JOIN dbo.[CodeEngine] [CT] ON [CT].[Id] = [XP].[CodeId] WHERE [X].[RecordId] = [R].[RecordId] AND [CT].[Code] LIKE 'DAFA%'), 'DAFA') ELSE [R].[Motorcodes] END AS [108],  [R].[Versnellingsbakcodes] AS [114],  [25],  [R].[Artikelnummers] AS [21],  ISNULL([D].[Bedrijfsnaam], '') + '|' + ISNULL([D].[BedrijfKort], '') AS [Leverancier],  [R].[BijzonderheidInet],  [R].[WarrantyText] AS [GarantieToelichting],  [R].[Shop],  [R].[Created],  [xShippingState] AS [ShippingState],  [R].[WarrantyConstruction] AS [WarrantyInstallation],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop]     FROM (SELECT  *     FROM (SELECT  [R].*,  [OV].[VeldId],  [OV].[Waarde]     FROM (SELECT  [R].[SortId],  [R].[RecordId],  [R].[DebiteurId],  [R].[ExternalId],  [R].[ReferenceId],  [R].[Youtube],  [R].[Fotos],  [R].[SoortId],  [R].[PrijsTonen],  [R].[Prijs],  [R].[Bouwjaar],  [R].[AutoRecordId],  [R].[Motorcodes],  [R].[Versnellingsbakcodes],  [R].[Artikelnummers],  [R].[BijzonderheidInet],  [R].[WarrantyText],  [R].[Shop],  [R].[Created],  [R].[WarrantyConstruction],  [R].[DeelId],  [R].[DebiteurRecordId],  [R].[AldocModelCode],  [R].[AldocTypeId],  [R].[DebiteurLocatieId],  [R].[SModelId],  [R].[ModelId],  [R].[PrijsSoort],  [R].[PriceShop],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]) AS [R]  LEFT JOIN dbo.[OOLVelden] [OV] WITH (INDEX(PK_OOLVelden)) ON [OV].[RecordId] = [R].[RecordId] AND [OV].[VeldId] IN (184, 190, 135, 37, 25)) [R]  PIVOT (MAX([Waarde]) FOR [VeldId] IN ([184], [190], [135], [37], [25])) AS [R]) [R]  LEFT JOIN [Basis].dbo.[AutomateModellenTranslated] [MOT] ON [MOT].[ModelId] = [R].[ModelID] AND [MOT].[LanguageId] = 5 AND [MOT].[Synoniem] = 0   LEFT JOIN [Basis].dbo.[AutomateMerkenTranslated] [MET] ON [MET].[MerkId] = [MOT].[MerkId] AND [MET].[LanguageId] = 5   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) [R]  ORDER BY [SortId] DESC,  + CASE WHEN [R].[xShopState] = 1 THEN 1 ELSE 0 END DESC, [RowId] ASC     OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY) [R]; WITH [R] AS (SELECT  [R].[RecordId],  [xPR],  [xPF],  [xPD],  [xPS],  [xPE],  [xPI],  [xTP],  [xTT],  [xShopState],  [xShippingState],  [XChange],  [Bouwjaar],  [xPI] AS [Prijs],  [ModelId]     FROM @RM [RM]  LEFT JOIN dbo.[OOLInternet] [R] With (NOLOCK FORCESEEK) On [R].[RecordId] = [RM].[RecordId]   LEFT JOIN dbo.[DebiteurLocatieData] [D] ON [D].[DebiteurId] = [R].[DebiteurId] AND [D].[LocatieId] = ISNULL([R].[DebiteurLocatieId], 1)) SELECT  [VeldId],  [Waarde] AS [Value],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (184,190,37,25)  GROUP BY [VeldId], [Waarde] UNION SELECT  [VeldId],  NULL AS [Value],  MIN([Waarde]) AS [ValueMIN],  MAX([Waarde]) AS [ValueMAX]     FROM (SELECT  [VeldId],  TRY_CAST([Waarde] AS INT) AS [Waarde]     FROM dbo.[OOLVelden] [OV]     WHERE [RecordId] IN (SELECT [R].[RecordId] FROM [R]) AND [VeldId] IN (135)) [OV]  GROUP BY [VeldId] UNION SELECT  12,  NULL AS [Value],  MIN([R].[Bouwjaar]) AS [ValueMIN],  MAX([R].[Bouwjaar]) AS [ValueMAX]     FROM [R] UNION SELECT  14,  NULL AS [Value],  MIN(CAST([Prijs] AS INT)) AS [ValueMIN],  MAX(CAST([Prijs] AS INT)) AS [ValueMAX]     FROM [R] UNION SELECT  1,  [ModelId],  NULL AS [ValueMIN],  NULL AS [ValueMAX]     FROM [R] ORDER BY 1, 2; SELECT  DISTINCT  [R].[DebiteurId]     FROM (SELECT  DISTINCT  [DebiteurId]     FROM dbo.[OOLInternet] [R] WITH (NOLOCK)     WHERE [R].[RecordId] In (Select [RM].[RecordId] FROM @RM [RM])) [R]" }, "Gridview": { "Type": "Detailed", "Properties": { "Index": 1, "Size": 10, "Rows": 15, "SizeMax": 150, "SetMax": false, "GetIndexMax": 2, "GetSizeValid": true, "GetIndex": 1, "GetQuery": { "Min": 1, "Max": 10, "Rows": 10, "Offset": 0 } }, "Rows": { "14641590": 1, "14641612": 2, "14641563": 3, "14641613": 4, "14641554": 5, "14641564": 6, "14641584": 7, "14641546": 8, "14641586": 9, "14641577": 10 }, "Sort": "", "SortDirection": "Ascending", "CountryName": "France", "CountryId": 250, "Remarks": true, "Images": true, "Distance": false, "Zipcode": "", "UseSortPartitioning": true }  }

Expériences de clients

D'autres ont rapidement trouvé la bonne pièce et partagent leur expérience.