exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/moneta/sort.html?_=1741701986537 108.61.209.243

set names utf8

SELECT
                `elitcar_store`.`moneta`.`MonetaId`,
                `elitcar_store`.`moneta`.`Sales`,
                `elitcar_store`.`moneta`.`Qty`,
                `elitcar_store`.`moneta`.`QtyAll`,
                `elitcar_store`.`moneta`.`FullSearchTecDocId`
            FROM
                `elitcar_store`.`moneta`
                LEFT JOIN `elitcar_store`.`availabilities` ON `elitcar_store`.`moneta`.`MonetaId` = `elitcar_store`.`availabilities`.`MonetaId` AND `elitcar_store`.`availabilities`.`BusinessGroupID` = '10'
            WHERE
                `elitcar_store`.`moneta`.`MonetaId` IN('AJUSA 12027300','AJUSA 12000700','AJUSA 12032600','CORTECO 12014584','CORTECO 49472013','DT 11.10570','FEBI 03345','SWAG 30 34 0001','TRUCKTEC 07.12.117','REINZ 70-25837-00','AUTO KELLY XS 047109675A','CORTECO 12016850','PAYEN HR569','PAYEN HR615','GOETZE 50-306670-50','STARLINE GA 6511','PAYEN HR805','AJUSA 12004500','AJUSA 57005000','REINZ 12-25837-01','DPH 45720','REINZ 70-22737-00','ELRING 294.110','ELRING 294.250','DPH 1272960','STARLINE GA 6506','PEUGEOT 1607427280')
            ORDER BY
                `elitcar_store`.`availabilities`.`Qty` DESC,
                `elitcar_store`.`moneta`.`Qty` DESC,
                `elitcar_store`.`moneta`.`QtyAll` DESC,
                `elitcar_store`.`moneta`.`Sales` DESC

Successfully disconnected from the database!

SELECT * FROM  fn_EShopItemInfo_New('ELRING 553.190', '040622F7496E4265932BDA8CD52BFEC0', '10', '');
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/history/parts.html?_=1741701986538 108.61.209.243

set names utf8

SELECT * FROM `elitcar_store`.`history_parts` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/prices/W00gUkVJTlogNzAtMjU4MzctMDBd.html?_=1741701987018 108.61.209.243
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/prices/W00gUkVJTlogNzAtMjI3MzctMDBd.html?_=1741701987019 108.61.209.243
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/prices/W00gUkVJTlogMTItMjU4MzctMDFd.html?_=1741701987019 108.61.209.243

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('ELRING 553.190', '040622F7496E4265932BDA8CD52BFEC0', '10')
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/users/bar.html?_=1741701986594 108.61.209.243

set names utf8

SELECT `TotalQty` FROM `elitcar_store`.`basket` WHERE `UserName` = 'toni25-1' AND `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' LIMIT 1

SELECT COUNT(*) FROM `elitcar_store`.`offers` WHERE `UserID` = '09894E3B1D454BE7BDD247403823C2ED' AND `Status` = 0

Successfully disconnected from the database!
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/prices/W00gRFBIIDQ1NzIwXQ.html?_=1741701987020 108.61.209.243
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/history/insert.html?_=1741701986532 108.61.209.243

set names utf8

SELECT * FROM `history_parts` LIMIT 1

SHOW COLUMNS FROM `history_parts`

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'ELRING 553.190'
            GROUP BY fComp_Id,fItem_Id

REPLACE INTO `history_parts` SET `Url` = 'https://digith.ink/elitcar/www/bg/tecdoc/10/WzEwXVs1NTMuMTkwXVtNIEVMUklORyA1NTMuMTkwXQ.html?sn=553.190', `PostDate` = '2025-03-11 16:06:26', `MonetaUser` = 'toni25-1', `Language` = 'bg', `Brand` = 'ELRING', `SearchNumber` = '553.190', `PartName` = 'гумичка на клапан, уплътн. пръстен, стъбло на кл.'

DELETE FROM history_parts WHERE `MonetaUser` = 'toni25-1' AND `ID` NOT IN
            (SELECT * FROM (SELECT `ID` FROM history_parts WHERE `MonetaUser` = 'toni25-1' ORDER BY `PostDate` DESC LIMIT 30) AS T)

SELECT * FROM `ul_parts` LIMIT 1

SHOW COLUMNS FROM `ul_parts`

INSERT INTO `ul_parts` SET `Url` = 'https://digith.ink/elitcar/www/bg/tecdoc/10/WzEwXVs1NTMuMTkwXVtNIEVMUklORyA1NTMuMTkwXQ.html?sn=553.190', `PostDate` = '2025-03-11 16:06:26', `MonetaUser` = 'toni25-1', `Brand` = 'ELRING', `SearchNumber` = '553.190', `PartName` = 'гумичка на клапан, уплътн. пръстен, стъбло на кл.', `IP` = '108.61.209.243', `MonetaName` = 'Тони 25-1 ЕООД', `MonetaObject` = '10'

SELECT * FROM (
                SELECT
                    IP,
                    COUNT(*) AS NumRows,
                    TIME_TO_SEC(TIMEDIFF(MAX(PostDate), MIN(PostDate))) / COUNT(IP) AS SecPerRow,
                    MonetaUser,
                    MonetaName,
                    MonetaObject
                FROM
                    `elitcar_store`.`ul_parts`
                WHERE
                    MonetaUser = 'toni25-1' AND
                    DATE(`PostDate`) = DATE(CURDATE())
                GROUP BY IP, MonetaUser
                ORDER BY NumRows DESC
            ) AS T
            WHERE
                NumRows > 100 AND
                SecPerRow < 180

SELECT * FROM (
                SELECT
                    IP,
                    COUNT(IP) AS NumRows,
                    COUNT(DISTINCT SearchNumber) AS NumSearchNumbers,
                    TIME_TO_SEC(TIMEDIFF(MAX(PostDate), MIN(PostDate))) / COUNT(IP) AS SecPerRow,
                    Brand,
                    MonetaUser,
                    MonetaName,
                    MonetaObject
                FROM
                    `elitcar_store`.`ul_parts`
                WHERE
                    MonetaUser = 'toni25-1' AND
                    DATE(`PostDate`) = DATE(CURDATE())
                GROUP BY IP, Brand, MonetaUser
            ) AS T
            WHERE
                NumRows > 30 AND
                SecPerRow < 600

Successfully disconnected from the database!
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/prices/W00gRUxSSU5HIDU1My4xOTBd.html?_=1741701986536 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'ELRING 553.190', 'МАШРУТ  DD', null);
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/prices/W00gRFBIIDEyNzI5NjBd.html?_=1741701987020 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gRUxSSU5HIDU1My4xOTBd%'
            LIMIT 1

Successfully disconnected from the database!

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)

# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/prices/W00gU1RBUkxJTkUgR0EgNjUwNl0.html?_=1741701987021 108.61.209.243

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM  fn_EShopItemInfo_New('REINZ 70-22737-00', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT * FROM  fn_EShopItemInfo_New('REINZ 12-25837-01', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM  fn_EShopItemInfo_New('REINZ 70-25837-00', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM  fn_EShopItemInfo_New('DPH 45720', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('REINZ 70-22737-00', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('REINZ 12-25837-01', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('REINZ 70-25837-00', '040622F7496E4265932BDA8CD52BFEC0', '10')

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('DPH 45720', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'REINZ 70-22737-00'
            GROUP BY fComp_Id,fItem_Id

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'REINZ 12-25837-01'
            GROUP BY fComp_Id,fItem_Id
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/prices/W00gUkVJTlogNzAtMjI3MzctMDBd.html?_=1741701987019 108.61.209.243

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/prices/W00gUkVJTlogMTItMjU4MzctMDFd.html?_=1741701987019 108.61.209.243

SELECT * FROM  fn_EShopItemInfo_New('DPH 1272960', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

set names utf8

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'REINZ 70-22737-00', 'МАШРУТ  DD', null);

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'REINZ 12-25837-01', 'МАШРУТ  DD', null);

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'REINZ 70-25837-00'
            GROUP BY fComp_Id,fItem_Id

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'DPH 45720'
            GROUP BY fComp_Id,fItem_Id
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/prices/W00gUkVJTlogNzAtMjU4MzctMDBd.html?_=1741701987018 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'REINZ 70-25837-00', 'МАШРУТ  DD', null);

SELECT * FROM  fn_EShopItemInfo_New('STARLINE GA 6506', '040622F7496E4265932BDA8CD52BFEC0', '10', '');
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/prices/W00gRFBIIDQ1NzIwXQ.html?_=1741701987020 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'DPH 45720', 'МАШРУТ  DD', null);

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gUkVJTlogNzAtMjI3MzctMDBd%'
            LIMIT 1

Successfully disconnected from the database!

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gUkVJTlogMTItMjU4MzctMDFd%'
            LIMIT 1

Successfully disconnected from the database!

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('DPH 1272960', '040622F7496E4265932BDA8CD52BFEC0', '10')
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/prices/W00gRkVCSSAwMzM0NV0.html?_=1741701987021 108.61.209.243
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/prices/W00gRUxSSU5HIDI5NC4xMTBd.html?_=1741701987021 108.61.209.243

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gRFBIIDQ1NzIwXQ%'
            LIMIT 1

Successfully disconnected from the database!

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('STARLINE GA 6506', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gUkVJTlogNzAtMjU4MzctMDBd%'
            LIMIT 1

Successfully disconnected from the database!

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'DPH 1272960'
            GROUP BY fComp_Id,fItem_Id
# [11-Mar-2025 16:06:27] /elitcar/www/bg/ajax/prices/W00gRFBIIDEyNzI5NjBd.html?_=1741701987020 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'STARLINE GA 6506'
            GROUP BY fComp_Id,fItem_Id

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'DPH 1272960', 'МАШРУТ  DD', null);
# [11-Mar-2025 16:06:28] /elitcar/www/bg/ajax/prices/W00gU1RBUkxJTkUgR0EgNjUwNl0.html?_=1741701987021 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'STARLINE GA 6506', 'МАШРУТ  DD', null);

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gRFBIIDEyNzI5NjBd%'
            LIMIT 1

Successfully disconnected from the database!

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gU1RBUkxJTkUgR0EgNjUwNl0%'
            LIMIT 1

Successfully disconnected from the database!

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM  fn_EShopItemInfo_New('FEBI 03345', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT * FROM  fn_EShopItemInfo_New('ELRING 294.110', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('FEBI 03345', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('ELRING 294.110', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'ELRING 294.110'
            GROUP BY fComp_Id,fItem_Id

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'FEBI 03345'
            GROUP BY fComp_Id,fItem_Id
# [11-Mar-2025 16:06:28] /elitcar/www/bg/ajax/prices/W00gRUxSSU5HIDI5NC4xMTBd.html?_=1741701987021 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'ELRING 294.110', 'МАШРУТ  DD', null);
# [11-Mar-2025 16:06:28] /elitcar/www/bg/ajax/prices/W00gRkVCSSAwMzM0NV0.html?_=1741701987021 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'FEBI 03345', 'МАШРУТ  DD', null);

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gRUxSSU5HIDI5NC4xMTBd%'
            LIMIT 1

Successfully disconnected from the database!

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gRkVCSSAwMzM0NV0%'
            LIMIT 1

Successfully disconnected from the database!
# [11-Mar-2025 16:07:32] /elitcar/www/bg/tecdoc/10/WzEwXVs1NTMuMTkwXVtNIEVMUklORyA1NTMuMTkwXQ.html?sn=553.190 108.61.209.243

set names utf8

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'ELRING 553.190'
            LIMIT 1

SELECT
                `elitcar_store`.`moneta`.`ProductId`
            FROM
                `elitcar_store`.`moneta`
                INNER JOIN `autokelly`.`recommended` ON `elitcar_store`.`moneta`.`ProductId` = `autokelly`.`recommended`.`ProductId`
            WHERE
                `elitcar_store`.`moneta`.`MonetaId` = 'ELRING 553.190'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '80133' AND `ProducerId` = 4598

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '12027300' AND `ProducerId` = 139

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'AJUSA 12027300'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '12000700' AND `ProducerId` = 139

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'AJUSA 12000700'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '12032600' AND `ProducerId` = 139

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'AJUSA 12032600'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '23467tf' AND `ProducerId` = 317

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '12014584' AND `ProducerId` = 140

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'CORTECO 12014584'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '49472013' AND `ProducerId` = 140

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'CORTECO 49472013'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '1110570' AND `ProducerId` = 355

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'DT 11.10570'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '553190' AND `ProducerId` = 10

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '1656040' AND `ProducerId` = 237

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '03345' AND `ProducerId` = 101

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'FEBI 03345'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'p7653100' AND `ProducerId` = 88

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '1405268480' AND `ProducerId` = 4257

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '1447158300' AND `ProducerId` = 4257

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '1405268000' AND `ProducerId` = 4257

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '28u8003jpn' AND `ProducerId` = 6985

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '1130010' AND `ProducerId` = 4546

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '521744' AND `ProducerId` = 6470

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '520036' AND `ProducerId` = 6470

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '30340001' AND `ProducerId` = 151

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'SWAG 30 34 0001'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '100254' AND `ProducerId` = 301

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '100207' AND `ProducerId` = 301

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '0712117' AND `ProducerId` = 209

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'TRUCKTEC 07.12.117'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '702583700' AND `ProducerId` = 9

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'REINZ 70-25837-00'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg2134437' AND `ProducerId` = 4832

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg1103708' AND `ProducerId` = 4832

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg2293069' AND `ProducerId` = 4832

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg1004625' AND `ProducerId` = 4832

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg2308257' AND `ProducerId` = 4832

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg2134503' AND `ProducerId` = 4832

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg1087866' AND `ProducerId` = 4832

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg1433591' AND `ProducerId` = 4832

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg2134436' AND `ProducerId` = 4832

SELECT `ProductId` FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'ELRING 553.190' LIMIT 1

SELECT
                    `autokelly`.`product`.`Id` AS `ProductId`,
                    `autokelly`.`brand`.`Name` AS `BrandName`,
                    `autokelly`.`codeprimary`.`CodeValue`,
                    `autokelly`.`producttextname`.`BG` AS `ProductTitle`,
                    `autokelly`.`producttextglobaldescription`.`BG` AS `ProductDescription`,
                    `elitcar_store`.`moneta`.`MonetaId`,
                    `elitcar_store`.`moneta`.`ProducerId`,
                    `elitcar_store`.`moneta`.`FullSearchTecDocId`,
                    `elitcar_store`.`moneta`.`Sales`,
                    `elitcar_store`.`moneta`.`Qty`,
                    `elitcar_store`.`moneta`.`QtyAll`
                FROM
                    `autokelly`.`product`
                    INNER JOIN `autokelly`.`brand` ON `autokelly`.`brand`.`Id` =  `autokelly`.`product`.`BrandId`
                    INNER JOIN `autokelly`.`codeprimary` ON `autokelly`.`codeprimary`.`ProductId` =  `autokelly`.`product`.`Id`
                    INNER JOIN `autokelly`.`producttextnameconversion` ON `autokelly`.`producttextnameconversion`.`ProductId` = `autokelly`.`product`.`Id`
                    INNER JOIN `autokelly`.`producttextname` ON `autokelly`.`producttextname`.`ProductTextNameConversionId` = `autokelly`.`producttextnameconversion`.`Id`
                    INNER JOIN `elitcar_store`.`moneta` ON `elitcar_store`.`moneta`.`ProductId` = `autokelly`.`product`.`Id` AND `elitcar_store`.`moneta`.`MonetaId` NOT IN ('ELRING 553.190','AJUSA 12027300','AJUSA 12000700','AJUSA 12032600','CORTECO 12014584','CORTECO 49472013','DT 11.10570','FEBI 03345','SWAG 30 34 0001','TRUCKTEC 07.12.117','REINZ 70-25837-00')
                    LEFT JOIN `autokelly`.`producttextglobaldescriptionconversion` ON `autokelly`.`producttextglobaldescriptionconversion`.`ProductId` = `autokelly`.`product`.`Id`
                    LEFT JOIN `autokelly`.`producttextglobaldescription` ON `autokelly`.`producttextglobaldescription`.`ProductTextGlobalDescriptionConversionId` = `autokelly`.`producttextglobaldescriptionconversion`.`Id`
                WHERE
                    `autokelly`.`product`.`Id` IN (
                        SELECT
                            cp1.`ProductId`
                        FROM
                            `autokelly`.`substitute`
                            INNER JOIN `autokelly`.`codeprimary` cp ON cp.`ProductId` = `autokelly`.`substitute`.`ProductId`
                            INNER JOIN `autokelly`.`codeprimary` cp1 ON cp1.`ProductId` = `autokelly`.`substitute`.`SubstituteId`
                        where
                            `autokelly`.`substitute`.`ProductId` = 11513339
                    )

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `ProductId` = 1948172
            LIMIT 1

SELECT
                `FolderName`,
                `Name`,
                `Suffix`
            FROM
                `autokelly`.`productfile`
                INNER JOIN `autokelly`.`file` ON `autokelly`.`file`.`Id` = `autokelly`.`productfile`.`FileId`
            WHERE
                `autokelly`.`productfile`.`ProductId` = 1948172 AND
                `autokelly`.`file`.`Image` = 1 AND
                 `autokelly`.`file`.`Suffix` = 'JPG'
            ORDER BY
                `autokelly`.`productfile`.`Order`
            LIMIT 1

SELECT
                `autokelly`.`product`.`Id` AS ProductId,
                `autokelly`.`productcriterium`.*,
                `autokelly`.`codeprimary`.`CodeValue` AS Code,
                `autokelly`.`criteriumtext`.`Name` AS CriteriumName,
                `autokelly`.`criteriumunittext`.`Code` AS CriteriumUnitText,
                CASE `autokelly`.`productcriterium`.`CriteriumType`
                    WHEN 1
                    THEN (SELECT
                            `autokelly`.`criteriumvaluetext`.Value
                        FROM
                            `autokelly`.`criteriumvalue`
                            INNER JOIN `autokelly`.`criteriumvaluetext` ON
                                `autokelly`.`criteriumvaluetext`.`CriteriumValueId` = `autokelly`.`criteriumvalue`.`Id` AND
                                `autokelly`.`criteriumvaluetext`.`CountryType` = 'BG'
                        WHERE
                            `autokelly`.`criteriumvalue`.`CriteriumId` = `autokelly`.`criterium`.`Id` AND
                            `autokelly`.`criteriumvalue`.`ValueId` = `autokelly`.`productcriterium`.`Value`
                        LIMIT 1)
                    ELSE `autokelly`.`productcriterium`.Value
                END AS `Value`,
                `autokelly`.`criterium`.`Order`
            FROM
                `autokelly`.`codeprimary`
                INNER JOIN `autokelly`.`product` ON `autokelly`.`codeprimary`.`ProductId` =  `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`productcriterium` ON  `autokelly`.`productcriterium`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`criterium` ON `autokelly`.`criterium`.`Id` = `autokelly`.`productcriterium`.CriteriumId
                INNER JOIN `autokelly`.`criteriumtext` ON `autokelly`.`criteriumtext`.`CriteriumId` = `autokelly`.`productcriterium`.`CriteriumId` AND `autokelly`.`criteriumtext`.`CountryType` = 'BG'
                LEFT JOIN `autokelly`.`criteriumunit` ON `autokelly`.`criteriumunit`.`Id` = `autokelly`.`criterium`.`CriteriumUnitId`
                LEFT JOIN `autokelly`.`criteriumunittext` ON `autokelly`.`criteriumunittext`.`CriteriumUnitId` = `autokelly`.`criterium`.`CriteriumUnitId` AND `autokelly`.`criteriumunittext`.`CountryType` = 'BG'
            WHERE
                `autokelly`.`codeprimary`.`ProductId` = 1948172 AND
                `autokelly`.`criterium`.`Order` = 100
            ORDER BY
                /* `autokelly`.`product`.`Id`, ??? */
                `autokelly`.`productcriterium`.`Group`,
                `autokelly`.`productcriterium`.`Order`
         LIMIT 5

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'CORTECO 12016850'
            LIMIT 1

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'PAYEN HR569'
            LIMIT 1

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'PAYEN HR615'
            LIMIT 1

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `ProductId` = 11898471
            LIMIT 1

SELECT
                `FolderName`,
                `Name`,
                `Suffix`
            FROM
                `autokelly`.`productfile`
                INNER JOIN `autokelly`.`file` ON `autokelly`.`file`.`Id` = `autokelly`.`productfile`.`FileId`
            WHERE
                `autokelly`.`productfile`.`ProductId` = 11898471 AND
                `autokelly`.`file`.`Image` = 1 AND
                 `autokelly`.`file`.`Suffix` = 'JPG'
            ORDER BY
                `autokelly`.`productfile`.`Order`
            LIMIT 1

SELECT
                `autokelly`.`product`.`Id` AS ProductId,
                `autokelly`.`productcriterium`.*,
                `autokelly`.`codeprimary`.`CodeValue` AS Code,
                `autokelly`.`criteriumtext`.`Name` AS CriteriumName,
                `autokelly`.`criteriumunittext`.`Code` AS CriteriumUnitText,
                CASE `autokelly`.`productcriterium`.`CriteriumType`
                    WHEN 1
                    THEN (SELECT
                            `autokelly`.`criteriumvaluetext`.Value
                        FROM
                            `autokelly`.`criteriumvalue`
                            INNER JOIN `autokelly`.`criteriumvaluetext` ON
                                `autokelly`.`criteriumvaluetext`.`CriteriumValueId` = `autokelly`.`criteriumvalue`.`Id` AND
                                `autokelly`.`criteriumvaluetext`.`CountryType` = 'BG'
                        WHERE
                            `autokelly`.`criteriumvalue`.`CriteriumId` = `autokelly`.`criterium`.`Id` AND
                            `autokelly`.`criteriumvalue`.`ValueId` = `autokelly`.`productcriterium`.`Value`
                        LIMIT 1)
                    ELSE `autokelly`.`productcriterium`.Value
                END AS `Value`,
                `autokelly`.`criterium`.`Order`
            FROM
                `autokelly`.`codeprimary`
                INNER JOIN `autokelly`.`product` ON `autokelly`.`codeprimary`.`ProductId` =  `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`productcriterium` ON  `autokelly`.`productcriterium`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`criterium` ON `autokelly`.`criterium`.`Id` = `autokelly`.`productcriterium`.CriteriumId
                INNER JOIN `autokelly`.`criteriumtext` ON `autokelly`.`criteriumtext`.`CriteriumId` = `autokelly`.`productcriterium`.`CriteriumId` AND `autokelly`.`criteriumtext`.`CountryType` = 'BG'
                LEFT JOIN `autokelly`.`criteriumunit` ON `autokelly`.`criteriumunit`.`Id` = `autokelly`.`criterium`.`CriteriumUnitId`
                LEFT JOIN `autokelly`.`criteriumunittext` ON `autokelly`.`criteriumunittext`.`CriteriumUnitId` = `autokelly`.`criterium`.`CriteriumUnitId` AND `autokelly`.`criteriumunittext`.`CountryType` = 'BG'
            WHERE
                `autokelly`.`codeprimary`.`ProductId` = 11898471 AND
                `autokelly`.`criterium`.`Order` = 100
            ORDER BY
                /* `autokelly`.`product`.`Id`, ??? */
                `autokelly`.`productcriterium`.`Group`,
                `autokelly`.`productcriterium`.`Order`
         LIMIT 5

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `ProductId` = 12122729
            LIMIT 1

SELECT
                `FolderName`,
                `Name`,
                `Suffix`
            FROM
                `autokelly`.`productfile`
                INNER JOIN `autokelly`.`file` ON `autokelly`.`file`.`Id` = `autokelly`.`productfile`.`FileId`
            WHERE
                `autokelly`.`productfile`.`ProductId` = 12122729 AND
                `autokelly`.`file`.`Image` = 1 AND
                 `autokelly`.`file`.`Suffix` = 'JPG'
            ORDER BY
                `autokelly`.`productfile`.`Order`
            LIMIT 1

SELECT
                `autokelly`.`product`.`Id` AS ProductId,
                `autokelly`.`productcriterium`.*,
                `autokelly`.`codeprimary`.`CodeValue` AS Code,
                `autokelly`.`criteriumtext`.`Name` AS CriteriumName,
                `autokelly`.`criteriumunittext`.`Code` AS CriteriumUnitText,
                CASE `autokelly`.`productcriterium`.`CriteriumType`
                    WHEN 1
                    THEN (SELECT
                            `autokelly`.`criteriumvaluetext`.Value
                        FROM
                            `autokelly`.`criteriumvalue`
                            INNER JOIN `autokelly`.`criteriumvaluetext` ON
                                `autokelly`.`criteriumvaluetext`.`CriteriumValueId` = `autokelly`.`criteriumvalue`.`Id` AND
                                `autokelly`.`criteriumvaluetext`.`CountryType` = 'BG'
                        WHERE
                            `autokelly`.`criteriumvalue`.`CriteriumId` = `autokelly`.`criterium`.`Id` AND
                            `autokelly`.`criteriumvalue`.`ValueId` = `autokelly`.`productcriterium`.`Value`
                        LIMIT 1)
                    ELSE `autokelly`.`productcriterium`.Value
                END AS `Value`,
                `autokelly`.`criterium`.`Order`
            FROM
                `autokelly`.`codeprimary`
                INNER JOIN `autokelly`.`product` ON `autokelly`.`codeprimary`.`ProductId` =  `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`productcriterium` ON  `autokelly`.`productcriterium`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`criterium` ON `autokelly`.`criterium`.`Id` = `autokelly`.`productcriterium`.CriteriumId
                INNER JOIN `autokelly`.`criteriumtext` ON `autokelly`.`criteriumtext`.`CriteriumId` = `autokelly`.`productcriterium`.`CriteriumId` AND `autokelly`.`criteriumtext`.`CountryType` = 'BG'
                LEFT JOIN `autokelly`.`criteriumunit` ON `autokelly`.`criteriumunit`.`Id` = `autokelly`.`criterium`.`CriteriumUnitId`
                LEFT JOIN `autokelly`.`criteriumunittext` ON `autokelly`.`criteriumunittext`.`CriteriumUnitId` = `autokelly`.`criterium`.`CriteriumUnitId` AND `autokelly`.`criteriumunittext`.`CountryType` = 'BG'
            WHERE
                `autokelly`.`codeprimary`.`ProductId` = 12122729 AND
                `autokelly`.`criterium`.`Order` = 100
            ORDER BY
                /* `autokelly`.`product`.`Id`, ??? */
                `autokelly`.`productcriterium`.`Group`,
                `autokelly`.`productcriterium`.`Order`
         LIMIT 5

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'PAYEN HR805'
            LIMIT 1

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'AJUSA 12004500'
            LIMIT 1

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'AJUSA 57005000'
            LIMIT 1

SELECT `ReusableGroupId` FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'ELRING 553.190' LIMIT 1

SELECT
                    *
                FROM
                    `elitcar_store`.`moneta`
                WHERE
                    `ReusableGroupId` = 'B975FCE6DA3249339C216FDFA6DB75F7' AND
                    `MonetaId` NOT IN ('ELRING 553.190','AJUSA 12027300','AJUSA 12000700','AJUSA 12032600','CORTECO 12014584','CORTECO 49472013','DT 11.10570','FEBI 03345','SWAG 30 34 0001','TRUCKTEC 07.12.117','REINZ 70-25837-00','AUTO KELLY XS 047109675A','CORTECO 12016850','PAYEN HR569','PAYEN HR615','GOETZE 50-306670-50','STARLINE GA 6511','PAYEN HR805','AJUSA 12004500','AJUSA 57005000') AND
                    `QtyAll` > 0
                ORDER BY
                    `Sales`  DESC,
                    `Qty`  DESC,
                    `QtyAll`  DESC

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'REINZ 12-25837-01'
            LIMIT 1

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'DPH 45720'
            LIMIT 1

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'REINZ 70-22737-00'
            LIMIT 1

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'ELRING 294.110'
            LIMIT 1

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'ELRING 294.250'
            LIMIT 1

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'DPH 1272960'
            LIMIT 1

SELECT
                `autokelly`.`product`.`Id` AS `ProductId`,
                `autokelly`.`codeprimary`.`CodeValue`,
                `autokelly`.`brand`.`Name` AS `BrandName`,
                `autokelly`.`producttextname`.`BG` AS `ProductTitle`,
                `elitcar_store`.`moneta`.`MonetaId`,
                `elitcar_store`.`moneta`.`ProducerId`,
                `elitcar_store`.`moneta`.`ProducerCode`
            FROM
                `autokelly`.`product`
                INNER JOIN `autokelly`.`brand` ON `autokelly`.`brand`.`Id` =  `autokelly`.`product`.`BrandId`
                INNER JOIN `autokelly`.`codeprimary` ON `autokelly`.`codeprimary`.`ProductId` =  `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`producttextnameconversion` ON `autokelly`.`producttextnameconversion`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`producttextname` ON `autokelly`.`producttextname`.`ProductTextNameConversionId` = `autokelly`.`producttextnameconversion`.`Id`
                LEFT JOIN `elitcar_store`.`moneta` ON `elitcar_store`.`moneta`.`ProductId` = `autokelly`.`product`.`Id`
            WHERE
                `autokelly`.`product`.`Id` = 12121902
            LIMIT 1

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `ProductId` = 12121902
            LIMIT 1

SELECT
                `FolderName`,
                `Name`,
                `Suffix`
            FROM
                `autokelly`.`productfile`
                INNER JOIN `autokelly`.`file` ON `autokelly`.`file`.`Id` = `autokelly`.`productfile`.`FileId`
            WHERE
                `autokelly`.`productfile`.`ProductId` = 12121902 AND
                `autokelly`.`file`.`Image` = 1 AND
                 `autokelly`.`file`.`Suffix` = 'JPG'
            ORDER BY
                `autokelly`.`productfile`.`Order`
            LIMIT 1

SELECT
                `autokelly`.`product`.`Id` AS ProductId,
                `autokelly`.`productcriterium`.*,
                `autokelly`.`codeprimary`.`CodeValue` AS Code,
                `autokelly`.`criteriumtext`.`Name` AS CriteriumName,
                `autokelly`.`criteriumunittext`.`Code` AS CriteriumUnitText,
                CASE `autokelly`.`productcriterium`.`CriteriumType`
                    WHEN 1
                    THEN (SELECT
                            `autokelly`.`criteriumvaluetext`.Value
                        FROM
                            `autokelly`.`criteriumvalue`
                            INNER JOIN `autokelly`.`criteriumvaluetext` ON
                                `autokelly`.`criteriumvaluetext`.`CriteriumValueId` = `autokelly`.`criteriumvalue`.`Id` AND
                                `autokelly`.`criteriumvaluetext`.`CountryType` = 'BG'
                        WHERE
                            `autokelly`.`criteriumvalue`.`CriteriumId` = `autokelly`.`criterium`.`Id` AND
                            `autokelly`.`criteriumvalue`.`ValueId` = `autokelly`.`productcriterium`.`Value`
                        LIMIT 1)
                    ELSE `autokelly`.`productcriterium`.Value
                END AS `Value`,
                `autokelly`.`criterium`.`Order`
            FROM
                `autokelly`.`codeprimary`
                INNER JOIN `autokelly`.`product` ON `autokelly`.`codeprimary`.`ProductId` =  `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`productcriterium` ON  `autokelly`.`productcriterium`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`criterium` ON `autokelly`.`criterium`.`Id` = `autokelly`.`productcriterium`.CriteriumId
                INNER JOIN `autokelly`.`criteriumtext` ON `autokelly`.`criteriumtext`.`CriteriumId` = `autokelly`.`productcriterium`.`CriteriumId` AND `autokelly`.`criteriumtext`.`CountryType` = 'BG'
                LEFT JOIN `autokelly`.`criteriumunit` ON `autokelly`.`criteriumunit`.`Id` = `autokelly`.`criterium`.`CriteriumUnitId`
                LEFT JOIN `autokelly`.`criteriumunittext` ON `autokelly`.`criteriumunittext`.`CriteriumUnitId` = `autokelly`.`criterium`.`CriteriumUnitId` AND `autokelly`.`criteriumunittext`.`CountryType` = 'BG'
            WHERE
                `autokelly`.`codeprimary`.`ProductId` = 12121902 AND
                `autokelly`.`criterium`.`Order` = 100
            ORDER BY
                /* `autokelly`.`product`.`Id`, ??? */
                `autokelly`.`productcriterium`.`Group`,
                `autokelly`.`productcriterium`.`Order`
         LIMIT 5

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'PEUGEOT 1607427280'
            LIMIT 1

SELECT * FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'ELRING 553.190' LIMIT 1

SELECT
                `autokelly`.`product`.`Id` AS `ProductId`,
                `autokelly`.`brand`.`Name` AS `BrandName`,
                `autokelly`.`codeprimary`.`CodeValue`,
                `autokelly`.`producttextname`.`BG` AS `ProductTitle`,
                `elitcar_store`.`moneta`.`MonetaId`,
                `elitcar_store`.`moneta`.`ProducerId`,
                `elitcar_store`.`moneta`.`Sales`,
                `elitcar_store`.`moneta`.`Qty`,
                `elitcar_store`.`moneta`.`QtyAll`
            FROM
                `autokelly`.`recommended`
                INNER JOIN `autokelly`.`product` ON `autokelly`.`recommended`.`RecommendedId` =  `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`brand` ON `autokelly`.`brand`.`Id` =  `autokelly`.`product`.`BrandId`
                INNER JOIN `autokelly`.`codeprimary` ON `autokelly`.`codeprimary`.`ProductId` =  `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`producttextnameconversion` ON `autokelly`.`producttextnameconversion`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`producttextname` ON `autokelly`.`producttextname`.`ProductTextNameConversionId` = `autokelly`.`producttextnameconversion`.`Id`
                INNER JOIN `elitcar_store`.`moneta` ON `elitcar_store`.`moneta`.`ProductId` = `autokelly`.`product`.`Id`
            WHERE
                `autokelly`.`recommended`.`ProductId` = 11513339
            ORDER BY
                `Sales` DESC,
                `Qty` DESC,
                `QtyAll` DESC
            LIMIT 3

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `ProductId` = 240305
            LIMIT 1

SELECT
                `FolderName`,
                `Name`,
                `Suffix`
            FROM
                `autokelly`.`productfile`
                INNER JOIN `autokelly`.`file` ON `autokelly`.`file`.`Id` = `autokelly`.`productfile`.`FileId`
            WHERE
                `autokelly`.`productfile`.`ProductId` = 240305 AND
                `autokelly`.`file`.`Image` = 1 AND
                 `autokelly`.`file`.`Suffix` = 'JPG'
            ORDER BY
                `autokelly`.`productfile`.`Order`
            LIMIT 1

SELECT
                `autokelly`.`product`.`Id` AS ProductId,
                `autokelly`.`productcriterium`.*,
                `autokelly`.`codeprimary`.`CodeValue` AS Code,
                `autokelly`.`criteriumtext`.`Name` AS CriteriumName,
                `autokelly`.`criteriumunittext`.`Code` AS CriteriumUnitText,
                CASE `autokelly`.`productcriterium`.`CriteriumType`
                    WHEN 1
                    THEN (SELECT
                            `autokelly`.`criteriumvaluetext`.Value
                        FROM
                            `autokelly`.`criteriumvalue`
                            INNER JOIN `autokelly`.`criteriumvaluetext` ON
                                `autokelly`.`criteriumvaluetext`.`CriteriumValueId` = `autokelly`.`criteriumvalue`.`Id` AND
                                `autokelly`.`criteriumvaluetext`.`CountryType` = 'BG'
                        WHERE
                            `autokelly`.`criteriumvalue`.`CriteriumId` = `autokelly`.`criterium`.`Id` AND
                            `autokelly`.`criteriumvalue`.`ValueId` = `autokelly`.`productcriterium`.`Value`
                        LIMIT 1)
                    ELSE `autokelly`.`productcriterium`.Value
                END AS `Value`,
                `autokelly`.`criterium`.`Order`
            FROM
                `autokelly`.`codeprimary`
                INNER JOIN `autokelly`.`product` ON `autokelly`.`codeprimary`.`ProductId` =  `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`productcriterium` ON  `autokelly`.`productcriterium`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`criterium` ON `autokelly`.`criterium`.`Id` = `autokelly`.`productcriterium`.CriteriumId
                INNER JOIN `autokelly`.`criteriumtext` ON `autokelly`.`criteriumtext`.`CriteriumId` = `autokelly`.`productcriterium`.`CriteriumId` AND `autokelly`.`criteriumtext`.`CountryType` = 'BG'
                LEFT JOIN `autokelly`.`criteriumunit` ON `autokelly`.`criteriumunit`.`Id` = `autokelly`.`criterium`.`CriteriumUnitId`
                LEFT JOIN `autokelly`.`criteriumunittext` ON `autokelly`.`criteriumunittext`.`CriteriumUnitId` = `autokelly`.`criterium`.`CriteriumUnitId` AND `autokelly`.`criteriumunittext`.`CountryType` = 'BG'
            WHERE
                `autokelly`.`codeprimary`.`ProductId` = 240305 AND
                `autokelly`.`criterium`.`Order` = 100
            ORDER BY
                /* `autokelly`.`product`.`Id`, ??? */
                `autokelly`.`productcriterium`.`Group`,
                `autokelly`.`productcriterium`.`Order`
         LIMIT 5

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `ProductId` = 240306
            LIMIT 1

SELECT
                `FolderName`,
                `Name`,
                `Suffix`
            FROM
                `autokelly`.`productfile`
                INNER JOIN `autokelly`.`file` ON `autokelly`.`file`.`Id` = `autokelly`.`productfile`.`FileId`
            WHERE
                `autokelly`.`productfile`.`ProductId` = 240306 AND
                `autokelly`.`file`.`Image` = 1 AND
                 `autokelly`.`file`.`Suffix` = 'JPG'
            ORDER BY
                `autokelly`.`productfile`.`Order`
            LIMIT 1

SELECT
                `autokelly`.`product`.`Id` AS ProductId,
                `autokelly`.`productcriterium`.*,
                `autokelly`.`codeprimary`.`CodeValue` AS Code,
                `autokelly`.`criteriumtext`.`Name` AS CriteriumName,
                `autokelly`.`criteriumunittext`.`Code` AS CriteriumUnitText,
                CASE `autokelly`.`productcriterium`.`CriteriumType`
                    WHEN 1
                    THEN (SELECT
                            `autokelly`.`criteriumvaluetext`.Value
                        FROM
                            `autokelly`.`criteriumvalue`
                            INNER JOIN `autokelly`.`criteriumvaluetext` ON
                                `autokelly`.`criteriumvaluetext`.`CriteriumValueId` = `autokelly`.`criteriumvalue`.`Id` AND
                                `autokelly`.`criteriumvaluetext`.`CountryType` = 'BG'
                        WHERE
                            `autokelly`.`criteriumvalue`.`CriteriumId` = `autokelly`.`criterium`.`Id` AND
                            `autokelly`.`criteriumvalue`.`ValueId` = `autokelly`.`productcriterium`.`Value`
                        LIMIT 1)
                    ELSE `autokelly`.`productcriterium`.Value
                END AS `Value`,
                `autokelly`.`criterium`.`Order`
            FROM
                `autokelly`.`codeprimary`
                INNER JOIN `autokelly`.`product` ON `autokelly`.`codeprimary`.`ProductId` =  `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`productcriterium` ON  `autokelly`.`productcriterium`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`criterium` ON `autokelly`.`criterium`.`Id` = `autokelly`.`productcriterium`.CriteriumId
                INNER JOIN `autokelly`.`criteriumtext` ON `autokelly`.`criteriumtext`.`CriteriumId` = `autokelly`.`productcriterium`.`CriteriumId` AND `autokelly`.`criteriumtext`.`CountryType` = 'BG'
                LEFT JOIN `autokelly`.`criteriumunit` ON `autokelly`.`criteriumunit`.`Id` = `autokelly`.`criterium`.`CriteriumUnitId`
                LEFT JOIN `autokelly`.`criteriumunittext` ON `autokelly`.`criteriumunittext`.`CriteriumUnitId` = `autokelly`.`criterium`.`CriteriumUnitId` AND `autokelly`.`criteriumunittext`.`CountryType` = 'BG'
            WHERE
                `autokelly`.`codeprimary`.`ProductId` = 240306 AND
                `autokelly`.`criterium`.`Order` = 100
            ORDER BY
                /* `autokelly`.`product`.`Id`, ??? */
                `autokelly`.`productcriterium`.`Group`,
                `autokelly`.`productcriterium`.`Order`
         LIMIT 5

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `ProductId` = 8363184
            LIMIT 1

SELECT
                `FolderName`,
                `Name`,
                `Suffix`
            FROM
                `autokelly`.`productfile`
                INNER JOIN `autokelly`.`file` ON `autokelly`.`file`.`Id` = `autokelly`.`productfile`.`FileId`
            WHERE
                `autokelly`.`productfile`.`ProductId` = 8363184 AND
                `autokelly`.`file`.`Image` = 1 AND
                 `autokelly`.`file`.`Suffix` = 'JPG'
            ORDER BY
                `autokelly`.`productfile`.`Order`
            LIMIT 1

SELECT
                `autokelly`.`product`.`Id` AS ProductId,
                `autokelly`.`productcriterium`.*,
                `autokelly`.`codeprimary`.`CodeValue` AS Code,
                `autokelly`.`criteriumtext`.`Name` AS CriteriumName,
                `autokelly`.`criteriumunittext`.`Code` AS CriteriumUnitText,
                CASE `autokelly`.`productcriterium`.`CriteriumType`
                    WHEN 1
                    THEN (SELECT
                            `autokelly`.`criteriumvaluetext`.Value
                        FROM
                            `autokelly`.`criteriumvalue`
                            INNER JOIN `autokelly`.`criteriumvaluetext` ON
                                `autokelly`.`criteriumvaluetext`.`CriteriumValueId` = `autokelly`.`criteriumvalue`.`Id` AND
                                `autokelly`.`criteriumvaluetext`.`CountryType` = 'BG'
                        WHERE
                            `autokelly`.`criteriumvalue`.`CriteriumId` = `autokelly`.`criterium`.`Id` AND
                            `autokelly`.`criteriumvalue`.`ValueId` = `autokelly`.`productcriterium`.`Value`
                        LIMIT 1)
                    ELSE `autokelly`.`productcriterium`.Value
                END AS `Value`,
                `autokelly`.`criterium`.`Order`
            FROM
                `autokelly`.`codeprimary`
                INNER JOIN `autokelly`.`product` ON `autokelly`.`codeprimary`.`ProductId` =  `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`productcriterium` ON  `autokelly`.`productcriterium`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`criterium` ON `autokelly`.`criterium`.`Id` = `autokelly`.`productcriterium`.CriteriumId
                INNER JOIN `autokelly`.`criteriumtext` ON `autokelly`.`criteriumtext`.`CriteriumId` = `autokelly`.`productcriterium`.`CriteriumId` AND `autokelly`.`criteriumtext`.`CountryType` = 'BG'
                LEFT JOIN `autokelly`.`criteriumunit` ON `autokelly`.`criteriumunit`.`Id` = `autokelly`.`criterium`.`CriteriumUnitId`
                LEFT JOIN `autokelly`.`criteriumunittext` ON `autokelly`.`criteriumunittext`.`CriteriumUnitId` = `autokelly`.`criterium`.`CriteriumUnitId` AND `autokelly`.`criteriumunittext`.`CountryType` = 'BG'
            WHERE
                `autokelly`.`codeprimary`.`ProductId` = 8363184 AND
                `autokelly`.`criterium`.`Order` = 100
            ORDER BY
                /* `autokelly`.`product`.`Id`, ??? */
                `autokelly`.`productcriterium`.`Group`,
                `autokelly`.`productcriterium`.`Order`
         LIMIT 5
# [11-Mar-2025 16:07:34] /elitcar/www/bg/tecdoc/10/WzEwXVs1NTMuMTkwXVtNIEVMUklORyA1NTMuMTkwXQ.html?sn=553.190 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM `elitcar_store`.`history_autos` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

SELECT * FROM `elitcar_store`.`history_vin` WHERE `MonetaUser` = 'toni25-1' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!
# [11-Mar-2025 16:07:35] /elitcar/www/bg/ajax/history/insert.html?_=1741702055599 108.61.209.243
# [11-Mar-2025 16:07:35] /elitcar/www/bg/ajax/prices/W00gRUxSSU5HIDU1My4xOTBd.html?_=1741702055605 108.61.209.243
# [11-Mar-2025 16:07:35] /elitcar/www/bg/ajax/moneta/sort.html?_=1741702055607 108.61.209.243
# [11-Mar-2025 16:07:35] /elitcar/www/bg/ajax/history/parts.html?_=1741702055610 108.61.209.243
# [11-Mar-2025 16:07:35] /elitcar/www/bg/ajax/users/bar.html?_=1741702055810 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'
# [11-Mar-2025 16:07:36] /elitcar/www/bg/ajax/moneta/sort.html?_=1741702055607 108.61.209.243

set names utf8

SELECT
                `elitcar_store`.`moneta`.`MonetaId`,
                `elitcar_store`.`moneta`.`Sales`,
                `elitcar_store`.`moneta`.`Qty`,
                `elitcar_store`.`moneta`.`QtyAll`,
                `elitcar_store`.`moneta`.`FullSearchTecDocId`
            FROM
                `elitcar_store`.`moneta`
                LEFT JOIN `elitcar_store`.`availabilities` ON `elitcar_store`.`moneta`.`MonetaId` = `elitcar_store`.`availabilities`.`MonetaId` AND `elitcar_store`.`availabilities`.`BusinessGroupID` = '10'
            WHERE
                `elitcar_store`.`moneta`.`MonetaId` IN('AJUSA 12027300','AJUSA 12000700','AJUSA 12032600','CORTECO 12014584','CORTECO 49472013','DT 11.10570','FEBI 03345','SWAG 30 34 0001','TRUCKTEC 07.12.117','REINZ 70-25837-00','AUTO KELLY XS 047109675A','CORTECO 12016850','PAYEN HR569','PAYEN HR615','GOETZE 50-306670-50','STARLINE GA 6511','PAYEN HR805','AJUSA 12004500','AJUSA 57005000','REINZ 12-25837-01','DPH 45720','REINZ 70-22737-00','ELRING 294.110','ELRING 294.250','DPH 1272960','STARLINE GA 6506','PEUGEOT 1607427280')
            ORDER BY
                `elitcar_store`.`availabilities`.`Qty` DESC,
                `elitcar_store`.`moneta`.`Qty` DESC,
                `elitcar_store`.`moneta`.`QtyAll` DESC,
                `elitcar_store`.`moneta`.`Sales` DESC

SELECT * FROM  fn_EShopItemInfo_New('ELRING 553.190', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

Successfully disconnected from the database!

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)
# [11-Mar-2025 16:07:36] /elitcar/www/bg/ajax/prices/W00gUkVJTlogNzAtMjU4MzctMDBd.html?_=1741702056201 108.61.209.243
# [11-Mar-2025 16:07:36] /elitcar/www/bg/ajax/prices/W00gUkVJTlogNzAtMjI3MzctMDBd.html?_=1741702056202 108.61.209.243
# [11-Mar-2025 16:07:36] /elitcar/www/bg/ajax/history/parts.html?_=1741702055610 108.61.209.243

set names utf8

SELECT * FROM `elitcar_store`.`history_parts` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('ELRING 553.190', '040622F7496E4265932BDA8CD52BFEC0', '10')
# [11-Mar-2025 16:07:36] /elitcar/www/bg/ajax/prices/W00gUkVJTlogMTItMjU4MzctMDFd.html?_=1741702056202 108.61.209.243
# [11-Mar-2025 16:07:36] /elitcar/www/bg/ajax/users/bar.html?_=1741702055810 108.61.209.243

set names utf8

SELECT `TotalQty` FROM `elitcar_store`.`basket` WHERE `UserName` = 'toni25-1' AND `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' LIMIT 1

SELECT COUNT(*) FROM `elitcar_store`.`offers` WHERE `UserID` = '09894E3B1D454BE7BDD247403823C2ED' AND `Status` = 0

Successfully disconnected from the database!

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'ELRING 553.190'
            GROUP BY fComp_Id,fItem_Id
# [11-Mar-2025 16:07:36] /elitcar/www/bg/ajax/prices/W00gRFBIIDQ1NzIwXQ.html?_=1741702056202 108.61.209.243
# [11-Mar-2025 16:07:36] /elitcar/www/bg/ajax/prices/W00gRUxSSU5HIDU1My4xOTBd.html?_=1741702055605 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'ELRING 553.190', 'МАШРУТ  DD', null);

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'
# [11-Mar-2025 16:07:36] /elitcar/www/bg/ajax/history/insert.html?_=1741702055599 108.61.209.243

set names utf8

SELECT * FROM `history_parts` LIMIT 1

SHOW COLUMNS FROM `history_parts`

REPLACE INTO `history_parts` SET `Url` = 'https://digith.ink/elitcar/www/bg/tecdoc/10/WzEwXVs1NTMuMTkwXVtNIEVMUklORyA1NTMuMTkwXQ.html?sn=553.190', `PostDate` = '2025-03-11 16:07:35', `MonetaUser` = 'toni25-1', `Language` = 'bg', `Brand` = 'ELRING', `SearchNumber` = '553.190', `PartName` = 'гумичка на клапан, уплътн. пръстен, стъбло на кл.'

DELETE FROM history_parts WHERE `MonetaUser` = 'toni25-1' AND `ID` NOT IN
            (SELECT * FROM (SELECT `ID` FROM history_parts WHERE `MonetaUser` = 'toni25-1' ORDER BY `PostDate` DESC LIMIT 30) AS T)

SELECT * FROM `ul_parts` LIMIT 1

SHOW COLUMNS FROM `ul_parts`

INSERT INTO `ul_parts` SET `Url` = 'https://digith.ink/elitcar/www/bg/tecdoc/10/WzEwXVs1NTMuMTkwXVtNIEVMUklORyA1NTMuMTkwXQ.html?sn=553.190', `PostDate` = '2025-03-11 16:07:35', `MonetaUser` = 'toni25-1', `Brand` = 'ELRING', `SearchNumber` = '553.190', `PartName` = 'гумичка на клапан, уплътн. пръстен, стъбло на кл.', `IP` = '108.61.209.243', `MonetaName` = 'Тони 25-1 ЕООД', `MonetaObject` = '10'

SELECT * FROM (
                SELECT
                    IP,
                    COUNT(*) AS NumRows,
                    TIME_TO_SEC(TIMEDIFF(MAX(PostDate), MIN(PostDate))) / COUNT(IP) AS SecPerRow,
                    MonetaUser,
                    MonetaName,
                    MonetaObject
                FROM
                    `elitcar_store`.`ul_parts`
                WHERE
                    MonetaUser = 'toni25-1' AND
                    DATE(`PostDate`) = DATE(CURDATE())
                GROUP BY IP, MonetaUser
                ORDER BY NumRows DESC
            ) AS T
            WHERE
                NumRows > 100 AND
                SecPerRow < 180

SELECT * FROM (
                SELECT
                    IP,
                    COUNT(IP) AS NumRows,
                    COUNT(DISTINCT SearchNumber) AS NumSearchNumbers,
                    TIME_TO_SEC(TIMEDIFF(MAX(PostDate), MIN(PostDate))) / COUNT(IP) AS SecPerRow,
                    Brand,
                    MonetaUser,
                    MonetaName,
                    MonetaObject
                FROM
                    `elitcar_store`.`ul_parts`
                WHERE
                    MonetaUser = 'toni25-1' AND
                    DATE(`PostDate`) = DATE(CURDATE())
                GROUP BY IP, Brand, MonetaUser
            ) AS T
            WHERE
                NumRows > 30 AND
                SecPerRow < 600

Successfully disconnected from the database!

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'
# [11-Mar-2025 16:07:36] /elitcar/www/bg/ajax/prices/W00gRFBIIDEyNzI5NjBd.html?_=1741702056203 108.61.209.243

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gRUxSSU5HIDU1My4xOTBd%'
            LIMIT 1

Successfully disconnected from the database!

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)

# [11-Mar-2025 16:07:36] /elitcar/www/bg/ajax/prices/W00gU1RBUkxJTkUgR0EgNjUwNl0.html?_=1741702056203 108.61.209.243

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM  fn_EShopItemInfo_New('REINZ 70-22737-00', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT * FROM  fn_EShopItemInfo_New('REINZ 70-25837-00', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM  fn_EShopItemInfo_New('REINZ 12-25837-01', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('REINZ 70-22737-00', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('REINZ 70-25837-00', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('REINZ 12-25837-01', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'REINZ 70-22737-00'
            GROUP BY fComp_Id,fItem_Id

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM  fn_EShopItemInfo_New('DPH 45720', '040622F7496E4265932BDA8CD52BFEC0', '10', '');
# [11-Mar-2025 16:07:36] /elitcar/www/bg/ajax/prices/W00gUkVJTlogNzAtMjI3MzctMDBd.html?_=1741702056202 108.61.209.243

set names utf8

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'REINZ 70-25837-00'
            GROUP BY fComp_Id,fItem_Id

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'REINZ 70-22737-00', 'МАШРУТ  DD', null);

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'REINZ 12-25837-01'
            GROUP BY fComp_Id,fItem_Id

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'
# [11-Mar-2025 16:07:36] /elitcar/www/bg/ajax/prices/W00gUkVJTlogNzAtMjU4MzctMDBd.html?_=1741702056201 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'REINZ 70-25837-00', 'МАШРУТ  DD', null);
# [11-Mar-2025 16:07:37] /elitcar/www/bg/ajax/prices/W00gUkVJTlogMTItMjU4MzctMDFd.html?_=1741702056202 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'REINZ 12-25837-01', 'МАШРУТ  DD', null);

SELECT * FROM  fn_EShopItemInfo_New('DPH 1272960', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gUkVJTlogNzAtMjI3MzctMDBd%'
            LIMIT 1

Successfully disconnected from the database!

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('DPH 45720', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT * FROM  fn_EShopItemInfo_New('STARLINE GA 6506', '040622F7496E4265932BDA8CD52BFEC0', '10', '');
# [11-Mar-2025 16:07:37] /elitcar/www/bg/ajax/prices/W00gRkVCSSAwMzM0NV0.html?_=1741702056204 108.61.209.243

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gUkVJTlogNzAtMjU4MzctMDBd%'
            LIMIT 1

Successfully disconnected from the database!

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('DPH 1272960', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gUkVJTlogMTItMjU4MzctMDFd%'
            LIMIT 1

Successfully disconnected from the database!
# [11-Mar-2025 16:07:37] /elitcar/www/bg/ajax/prices/W00gRUxSSU5HIDI5NC4xMTBd.html?_=1741702056204 108.61.209.243

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'DPH 45720'
            GROUP BY fComp_Id,fItem_Id

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('STARLINE GA 6506', '040622F7496E4265932BDA8CD52BFEC0', '10')
# [11-Mar-2025 16:07:37] /elitcar/www/bg/ajax/prices/W00gRFBIIDQ1NzIwXQ.html?_=1741702056202 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'DPH 45720', 'МАШРУТ  DD', null);

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'DPH 1272960'
            GROUP BY fComp_Id,fItem_Id

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'STARLINE GA 6506'
            GROUP BY fComp_Id,fItem_Id
# [11-Mar-2025 16:07:37] /elitcar/www/bg/ajax/prices/W00gRFBIIDEyNzI5NjBd.html?_=1741702056203 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'DPH 1272960', 'МАШРУТ  DD', null);

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gRFBIIDQ1NzIwXQ%'
            LIMIT 1

Successfully disconnected from the database!
# [11-Mar-2025 16:07:37] /elitcar/www/bg/ajax/prices/W00gU1RBUkxJTkUgR0EgNjUwNl0.html?_=1741702056203 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'STARLINE GA 6506', 'МАШРУТ  DD', null);

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gRFBIIDEyNzI5NjBd%'
            LIMIT 1

Successfully disconnected from the database!

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gU1RBUkxJTkUgR0EgNjUwNl0%'
            LIMIT 1

Successfully disconnected from the database!

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM  fn_EShopItemInfo_New('FEBI 03345', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('FEBI 03345', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT * FROM  fn_EShopItemInfo_New('ELRING 294.110', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'FEBI 03345'
            GROUP BY fComp_Id,fItem_Id

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('ELRING 294.110', '040622F7496E4265932BDA8CD52BFEC0', '10')
# [11-Mar-2025 16:07:37] /elitcar/www/bg/ajax/prices/W00gRkVCSSAwMzM0NV0.html?_=1741702056204 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'FEBI 03345', 'МАШРУТ  DD', null);

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'ELRING 294.110'
            GROUP BY fComp_Id,fItem_Id

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gRkVCSSAwMzM0NV0%'
            LIMIT 1

Successfully disconnected from the database!
# [11-Mar-2025 16:07:37] /elitcar/www/bg/ajax/prices/W00gRUxSSU5HIDI5NC4xMTBd.html?_=1741702056204 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'ELRING 294.110', 'МАШРУТ  DD', null);

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gRUxSSU5HIDI5NC4xMTBd%'
            LIMIT 1

Successfully disconnected from the database!
# [11-Mar-2025 16:08:07] /elitcar/www/bg/search/sn_970/W0ROIDk3MDU3MzkyMjAxXQ.html 108.61.209.243

set names utf8

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '178001n' AND `ProducerId` = 80

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'at13058' AND `ProducerId` = 5362

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'dy8766' AND `ProducerId` = 6742

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'bw0331' AND `ProducerId` = 4585

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '68skv071' AND `ProducerId` = 4969

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 441

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'k92258' AND `ProducerId` = 341

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 4399

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'k92258' AND `ProducerId` = 244

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '87760' AND `ProducerId` = 123

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'NISSENS 87760'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '61582' AND `ProducerId` = 4683

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '11612294' AND `ProducerId` = 4020

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 27

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'v45030001' AND `ProducerId` = 183

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg2118038' AND `ProducerId` = 4832

SELECT
                `autokelly`.`code`.`CodeValue`,
                `autokelly`.`product`.`Id` AS `ProductId`,
                `autokelly`.`codeprimary`.`CodeValue`,
                `autokelly`.`brand`.`Name` AS `BrandName`,
                `autokelly`.`producttextname`.`BG` AS `ProductTitle`,
                `elitcar_store`.`moneta`.`MonetaId`,
                `elitcar_store`.`moneta`.`ProducerId`,
                `elitcar_store`.`moneta`.`ProducerCode`,
                `elitcar_store`.`moneta`.`FullSearchTecDocId`,
                `elitcar_store`.`moneta`.`ReusableGroupId`,
                `elitcar_store`.`moneta`.`OE`
            FROM
                `autokelly`.`code`
                INNER JOIN `autokelly`.`product` ON `autokelly`.`code`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`brand` ON `autokelly`.`brand`.`Id` =  `autokelly`.`product`.`BrandId`
                INNER JOIN `autokelly`.`codeprimary` ON `autokelly`.`codeprimary`.`ProductId` =  `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`producttextnameconversion` ON `autokelly`.`producttextnameconversion`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`producttextname` ON `autokelly`.`producttextname`.`ProductTextNameConversionId` = `autokelly`.`producttextnameconversion`.`Id`
                INNER JOIN `elitcar_store`.`moneta` ON `elitcar_store`.`moneta`.`ProductId` = `autokelly`.`product`.`Id`
            WHERE
                MATCH(`autokelly`.`code`.`CodeValue`) AGAINST('97057392201' IN BOOLEAN MODE)
            LIMIT 500

SELECT
                `autokelly`.`codeoem`.`CodeValue`,
                `autokelly`.`product`.`Id` AS `ProductId`,
                `autokelly`.`codeprimary`.`CodeValue`,
                `autokelly`.`brand`.`Name` AS `BrandName`,
                `autokelly`.`producttextname`.`BG` AS `ProductTitle`,
                `elitcar_store`.`moneta`.`MonetaId`,
                `elitcar_store`.`moneta`.`FullSearchTecDocId`,
                `elitcar_store`.`moneta`.`ReusableGroupId`,
                -- `elitcar_store`.`moneta`.`OE`
                1 AS `OE`
            FROM
                `autokelly`.`codeoem`
                INNER JOIN `autokelly`.`product` ON `autokelly`.`codeoem`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`brand` ON `autokelly`.`brand`.`Id` =  `autokelly`.`product`.`BrandId`
                INNER JOIN `autokelly`.`codeprimary` ON `autokelly`.`codeprimary`.`ProductId` =  `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`producttextnameconversion` ON `autokelly`.`producttextnameconversion`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`producttextname` ON `autokelly`.`producttextname`.`ProductTextNameConversionId` = `autokelly`.`producttextnameconversion`.`Id`
                INNER JOIN `elitcar_store`.`moneta` ON `elitcar_store`.`moneta`.`ProductId` = `autokelly`.`product`.`Id`
            WHERE
                MATCH(`autokelly`.`codeoem`.`CodeValue`) AGAINST('97057392201' IN BOOLEAN MODE);

(SELECT * FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '97057392201')
            UNION
            (SELECT
                M2.*
            FROM
                `elitcar_store`.`moneta` AS M1
                LEFT JOIN `elitcar_store`.`moneta` AS M2 ON M1.`ReusableGroupId` = M2.`ReusableGroupId`
            WHERE
                M1.`FullSearchTecDocId` = '97057392201' AND
                M2.`ReusableGroupId` != '' AND
                M2.`QtyAll` > 0
            ORDER BY
                `M2`.`Sales` DESC,
                `M2`.`Qty` DESC,
                `M2`.`QtyAll` DESC)

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'PORSCHE 97057392201'
            LIMIT 1
# [11-Mar-2025 16:08:07] /elitcar/www/bg/search/sn_970/W0ROIDk3MDU3MzkyMjAxXQ.html 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM `elitcar_store`.`history_autos` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

SELECT * FROM `elitcar_store`.`history_vin` WHERE `MonetaUser` = 'toni25-1' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!
# [11-Mar-2025 16:08:08] /elitcar/www/bg/ajax/moneta/sort.html?sn=97057392201&_=1741702088772 108.61.209.243
# [11-Mar-2025 16:08:08] /elitcar/www/bg/ajax/history/parts.html?_=1741702088773 108.61.209.243
# [11-Mar-2025 16:08:09] /elitcar/www/bg/ajax/users/bar.html?_=1741702088862 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)
# [11-Mar-2025 16:08:09] /elitcar/www/bg/ajax/moneta/sort.html?sn=97057392201&_=1741702088772 108.61.209.243

set names utf8

SELECT
                `elitcar_store`.`moneta`.`MonetaId`,
                `elitcar_store`.`moneta`.`Sales`,
                `elitcar_store`.`moneta`.`Qty`,
                `elitcar_store`.`moneta`.`QtyAll`,
                `elitcar_store`.`moneta`.`FullSearchTecDocId`
            FROM
                `elitcar_store`.`moneta`
                LEFT JOIN `elitcar_store`.`availabilities` ON `elitcar_store`.`moneta`.`MonetaId` = `elitcar_store`.`availabilities`.`MonetaId` AND `elitcar_store`.`availabilities`.`BusinessGroupID` = '10'
            WHERE
                `elitcar_store`.`moneta`.`MonetaId` IN('NISSENS 87760','PORSCHE 97057392201')
            ORDER BY
                `elitcar_store`.`availabilities`.`Qty` DESC,
                `elitcar_store`.`moneta`.`Qty` DESC,
                `elitcar_store`.`moneta`.`QtyAll` DESC,
                `elitcar_store`.`moneta`.`Sales` DESC

Successfully disconnected from the database!

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'
# [11-Mar-2025 16:08:09] /elitcar/www/bg/ajax/users/bar.html?_=1741702088862 108.61.209.243

set names utf8

SELECT `TotalQty` FROM `elitcar_store`.`basket` WHERE `UserName` = 'toni25-1' AND `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' LIMIT 1

SELECT COUNT(*) FROM `elitcar_store`.`offers` WHERE `UserID` = '09894E3B1D454BE7BDD247403823C2ED' AND `Status` = 0

Successfully disconnected from the database!
# [11-Mar-2025 16:08:09] /elitcar/www/bg/ajax/history/parts.html?_=1741702088773 108.61.209.243

set names utf8

SELECT * FROM `elitcar_store`.`history_parts` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!
# [11-Mar-2025 16:11:15] /elitcar/www/bg/search/sn_970/W0ROIDk3MDU3MzkyMjAxXQ.html 108.61.209.243

set names utf8

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '178001n' AND `ProducerId` = 80

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'at13058' AND `ProducerId` = 5362

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'dy8766' AND `ProducerId` = 6742

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'bw0331' AND `ProducerId` = 4585

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '68skv071' AND `ProducerId` = 4969

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 441

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'k92258' AND `ProducerId` = 341

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 4399

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'k92258' AND `ProducerId` = 244

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '87760' AND `ProducerId` = 123

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'NISSENS 87760'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '61582' AND `ProducerId` = 4683

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '11612294' AND `ProducerId` = 4020

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 27

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'v45030001' AND `ProducerId` = 183

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg2118038' AND `ProducerId` = 4832

SELECT
                `autokelly`.`code`.`CodeValue`,
                `autokelly`.`product`.`Id` AS `ProductId`,
                `autokelly`.`codeprimary`.`CodeValue`,
                `autokelly`.`brand`.`Name` AS `BrandName`,
                `autokelly`.`producttextname`.`BG` AS `ProductTitle`,
                `elitcar_store`.`moneta`.`MonetaId`,
                `elitcar_store`.`moneta`.`ProducerId`,
                `elitcar_store`.`moneta`.`ProducerCode`,
                `elitcar_store`.`moneta`.`FullSearchTecDocId`,
                `elitcar_store`.`moneta`.`ReusableGroupId`,
                `elitcar_store`.`moneta`.`OE`
            FROM
                `autokelly`.`code`
                INNER JOIN `autokelly`.`product` ON `autokelly`.`code`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`brand` ON `autokelly`.`brand`.`Id` =  `autokelly`.`product`.`BrandId`
                INNER JOIN `autokelly`.`codeprimary` ON `autokelly`.`codeprimary`.`ProductId` =  `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`producttextnameconversion` ON `autokelly`.`producttextnameconversion`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`producttextname` ON `autokelly`.`producttextname`.`ProductTextNameConversionId` = `autokelly`.`producttextnameconversion`.`Id`
                INNER JOIN `elitcar_store`.`moneta` ON `elitcar_store`.`moneta`.`ProductId` = `autokelly`.`product`.`Id`
            WHERE
                MATCH(`autokelly`.`code`.`CodeValue`) AGAINST('97057392201' IN BOOLEAN MODE)
            LIMIT 500

SELECT
                `autokelly`.`codeoem`.`CodeValue`,
                `autokelly`.`product`.`Id` AS `ProductId`,
                `autokelly`.`codeprimary`.`CodeValue`,
                `autokelly`.`brand`.`Name` AS `BrandName`,
                `autokelly`.`producttextname`.`BG` AS `ProductTitle`,
                `elitcar_store`.`moneta`.`MonetaId`,
                `elitcar_store`.`moneta`.`FullSearchTecDocId`,
                `elitcar_store`.`moneta`.`ReusableGroupId`,
                -- `elitcar_store`.`moneta`.`OE`
                1 AS `OE`
            FROM
                `autokelly`.`codeoem`
                INNER JOIN `autokelly`.`product` ON `autokelly`.`codeoem`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`brand` ON `autokelly`.`brand`.`Id` =  `autokelly`.`product`.`BrandId`
                INNER JOIN `autokelly`.`codeprimary` ON `autokelly`.`codeprimary`.`ProductId` =  `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`producttextnameconversion` ON `autokelly`.`producttextnameconversion`.`ProductId` = `autokelly`.`product`.`Id`
                INNER JOIN `autokelly`.`producttextname` ON `autokelly`.`producttextname`.`ProductTextNameConversionId` = `autokelly`.`producttextnameconversion`.`Id`
                INNER JOIN `elitcar_store`.`moneta` ON `elitcar_store`.`moneta`.`ProductId` = `autokelly`.`product`.`Id`
            WHERE
                MATCH(`autokelly`.`codeoem`.`CodeValue`) AGAINST('97057392201' IN BOOLEAN MODE);

(SELECT * FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '97057392201')
            UNION
            (SELECT
                M2.*
            FROM
                `elitcar_store`.`moneta` AS M1
                LEFT JOIN `elitcar_store`.`moneta` AS M2 ON M1.`ReusableGroupId` = M2.`ReusableGroupId`
            WHERE
                M1.`FullSearchTecDocId` = '97057392201' AND
                M2.`ReusableGroupId` != '' AND
                M2.`QtyAll` > 0
            ORDER BY
                `M2`.`Sales` DESC,
                `M2`.`Qty` DESC,
                `M2`.`QtyAll` DESC)

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'PORSCHE 97057392201'
            LIMIT 1
# [11-Mar-2025 16:11:15] /elitcar/www/bg/search/sn_970/W0ROIDk3MDU3MzkyMjAxXQ.html 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM `elitcar_store`.`history_autos` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

SELECT * FROM `elitcar_store`.`history_vin` WHERE `MonetaUser` = 'toni25-1' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!
# [11-Mar-2025 16:11:16] /elitcar/www/bg/ajax/moneta/sort.html?sn=97057392201&_=1741702276560 108.61.209.243
# [11-Mar-2025 16:11:16] /elitcar/www/bg/ajax/history/parts.html?_=1741702276563 108.61.209.243
# [11-Mar-2025 16:11:16] /elitcar/www/bg/ajax/users/bar.html?_=1741702276616 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'
# [11-Mar-2025 16:11:17] /elitcar/www/bg/ajax/history/parts.html?_=1741702276563 108.61.209.243

set names utf8

SELECT * FROM `elitcar_store`.`history_parts` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!
# [11-Mar-2025 16:11:17] /elitcar/www/bg/ajax/users/bar.html?_=1741702276616 108.61.209.243

set names utf8

SELECT `TotalQty` FROM `elitcar_store`.`basket` WHERE `UserName` = 'toni25-1' AND `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' LIMIT 1

SELECT COUNT(*) FROM `elitcar_store`.`offers` WHERE `UserID` = '09894E3B1D454BE7BDD247403823C2ED' AND `Status` = 0

Successfully disconnected from the database!
# [11-Mar-2025 16:11:17] /elitcar/www/bg/ajax/moneta/sort.html?sn=97057392201&_=1741702276560 108.61.209.243

set names utf8

SELECT
                `elitcar_store`.`moneta`.`MonetaId`,
                `elitcar_store`.`moneta`.`Sales`,
                `elitcar_store`.`moneta`.`Qty`,
                `elitcar_store`.`moneta`.`QtyAll`,
                `elitcar_store`.`moneta`.`FullSearchTecDocId`
            FROM
                `elitcar_store`.`moneta`
                LEFT JOIN `elitcar_store`.`availabilities` ON `elitcar_store`.`moneta`.`MonetaId` = `elitcar_store`.`availabilities`.`MonetaId` AND `elitcar_store`.`availabilities`.`BusinessGroupID` = '10'
            WHERE
                `elitcar_store`.`moneta`.`MonetaId` IN('NISSENS 87760','PORSCHE 97057392201')
            ORDER BY
                `elitcar_store`.`availabilities`.`Qty` DESC,
                `elitcar_store`.`moneta`.`Qty` DESC,
                `elitcar_store`.`moneta`.`QtyAll` DESC,
                `elitcar_store`.`moneta`.`Sales` DESC

Successfully disconnected from the database!
# [11-Mar-2025 16:11:28] /elitcar/www/bg/moneta/9092/W00gUE9SU0NIRSA5NzA1NzM5MjIwMV0.html?sn=97057392201 108.61.209.243

set names utf8

SELECT * FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'PORSCHE 97057392201' LIMIT 1

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'PORSCHE 97057392201'
            LIMIT 1

SELECT `ProductId` FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'PORSCHE 97057392201' LIMIT 1

SELECT `ReusableGroupId` FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'PORSCHE 97057392201' LIMIT 1
# [11-Mar-2025 16:11:28] /elitcar/www/bg/moneta/9092/W00gUE9SU0NIRSA5NzA1NzM5MjIwMV0.html?sn=97057392201 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM `elitcar_store`.`history_autos` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

SELECT * FROM `elitcar_store`.`history_vin` WHERE `MonetaUser` = 'toni25-1' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!
# [11-Mar-2025 16:11:29] /elitcar/www/bg/ajax/history/insert.html?_=1741702289687 108.61.209.243
# [11-Mar-2025 16:11:29] /elitcar/www/bg/ajax/prices/W00gUE9SU0NIRSA5NzA1NzM5MjIwMV0.html?_=1741702289689 108.61.209.243
# [11-Mar-2025 16:11:29] /elitcar/www/bg/ajax/history/parts.html?_=1741702289690 108.61.209.243
# [11-Mar-2025 16:11:29] /elitcar/www/bg/ajax/users/bar.html?_=1741702289791 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM  fn_EShopItemInfo_New('PORSCHE 97057392201', '040622F7496E4265932BDA8CD52BFEC0', '10', '');
# [11-Mar-2025 16:11:30] /elitcar/www/bg/ajax/history/parts.html?_=1741702289690 108.61.209.243

set names utf8

SELECT * FROM `elitcar_store`.`history_parts` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!

Successfully disconnected from the database!
# [11-Mar-2025 16:11:30] /elitcar/www/bg/ajax/users/bar.html?_=1741702289791 108.61.209.243

set names utf8

SELECT `TotalQty` FROM `elitcar_store`.`basket` WHERE `UserName` = 'toni25-1' AND `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' LIMIT 1

SELECT COUNT(*) FROM `elitcar_store`.`offers` WHERE `UserID` = '09894E3B1D454BE7BDD247403823C2ED' AND `Status` = 0

Successfully disconnected from the database!

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('PORSCHE 97057392201', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'PORSCHE 97057392201'
            GROUP BY fComp_Id,fItem_Id
# [11-Mar-2025 16:11:30] /elitcar/www/bg/ajax/prices/W00gUE9SU0NIRSA5NzA1NzM5MjIwMV0.html?_=1741702289689 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gUE9SU0NIRSA5NzA1NzM5MjIwMV0%'
            LIMIT 1

Successfully disconnected from the database!
# [11-Mar-2025 16:11:33] /elitcar/www/bg/tecdoc/123/WzEyM11bODc3NjBdW00gTklTU0VOUyA4Nzc2MF0.html?sn=87760 108.61.209.243

set names utf8

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'NISSENS 87760'
            LIMIT 1

SELECT
                `elitcar_store`.`moneta`.`ProductId`
            FROM
                `elitcar_store`.`moneta`
                INNER JOIN `autokelly`.`recommended` ON `elitcar_store`.`moneta`.`ProductId` = `autokelly`.`recommended`.`ProductId`
            WHERE
                `elitcar_store`.`moneta`.`MonetaId` = 'NISSENS 87760'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '178001n' AND `ProducerId` = 80

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'bw0331' AND `ProducerId` = 4585

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '68skv071' AND `ProducerId` = 4969

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 441

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'k92258' AND `ProducerId` = 341

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 4399

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'k92258' AND `ProducerId` = 244

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '87760' AND `ProducerId` = 123

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '34295' AND `ProducerId` = 205

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'NRF 34295'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'ewnvw019' AND `ProducerId` = 6355

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'NTY EWN-VW-019'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '11612294' AND `ProducerId` = 4020

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 27

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg2160429' AND `ProducerId` = 4832

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg2118038' AND `ProducerId` = 4832

SELECT `ProductId` FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'NISSENS 87760' LIMIT 1

SELECT `ReusableGroupId` FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'NISSENS 87760' LIMIT 1

SELECT
                    *
                FROM
                    `elitcar_store`.`moneta`
                WHERE
                    `ReusableGroupId` = 'D55538D3FCAE4F23AE4423758EA1CFB5' AND
                    `MonetaId` NOT IN ('NISSENS 87760','NRF 34295','NTY EWN-VW-019') AND
                    `QtyAll` > 0
                ORDER BY
                    `Sales`  DESC,
                    `Qty`  DESC,
                    `QtyAll`  DESC

SELECT * FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'NISSENS 87760' LIMIT 1
# [11-Mar-2025 16:11:34] /elitcar/www/bg/tecdoc/123/WzEyM11bODc3NjBdW00gTklTU0VOUyA4Nzc2MF0.html?sn=87760 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM `elitcar_store`.`history_autos` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

SELECT * FROM `elitcar_store`.`history_vin` WHERE `MonetaUser` = 'toni25-1' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!
# [11-Mar-2025 16:11:35] /elitcar/www/bg/ajax/history/insert.html?_=1741702295247 108.61.209.243
# [11-Mar-2025 16:11:35] /elitcar/www/bg/ajax/prices/W00gTklTU0VOUyA4Nzc2MF0.html?_=1741702295251 108.61.209.243
# [11-Mar-2025 16:11:35] /elitcar/www/bg/ajax/moneta/sort.html?_=1741702295252 108.61.209.243
# [11-Mar-2025 16:11:35] /elitcar/www/bg/ajax/history/parts.html?_=1741702295252 108.61.209.243
# [11-Mar-2025 16:11:35] /elitcar/www/bg/ajax/users/bar.html?_=1741702295351 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'
# [11-Mar-2025 16:11:35] /elitcar/www/bg/ajax/history/parts.html?_=1741702295252 108.61.209.243

set names utf8

SELECT * FROM `elitcar_store`.`history_parts` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30
# [11-Mar-2025 16:11:35] /elitcar/www/bg/ajax/moneta/sort.html?_=1741702295252 108.61.209.243

set names utf8

Successfully disconnected from the database!

SELECT
                `elitcar_store`.`moneta`.`MonetaId`,
                `elitcar_store`.`moneta`.`Sales`,
                `elitcar_store`.`moneta`.`Qty`,
                `elitcar_store`.`moneta`.`QtyAll`,
                `elitcar_store`.`moneta`.`FullSearchTecDocId`
            FROM
                `elitcar_store`.`moneta`
                LEFT JOIN `elitcar_store`.`availabilities` ON `elitcar_store`.`moneta`.`MonetaId` = `elitcar_store`.`availabilities`.`MonetaId` AND `elitcar_store`.`availabilities`.`BusinessGroupID` = '10'
            WHERE
                `elitcar_store`.`moneta`.`MonetaId` IN('NRF 34295','NTY EWN-VW-019')
            ORDER BY
                `elitcar_store`.`availabilities`.`Qty` DESC,
                `elitcar_store`.`moneta`.`Qty` DESC,
                `elitcar_store`.`moneta`.`QtyAll` DESC,
                `elitcar_store`.`moneta`.`Sales` DESC

Successfully disconnected from the database!

SELECT * FROM  fn_EShopItemInfo_New('NISSENS 87760', '040622F7496E4265932BDA8CD52BFEC0', '10', '');
# [11-Mar-2025 16:11:35] /elitcar/www/bg/ajax/prices/W00gTlJGIDM0Mjk1XQ.html?_=1741702295768 108.61.209.243
# [11-Mar-2025 16:11:35] /elitcar/www/bg/ajax/prices/W00gTlRZIEVXTi1WVy0wMTld.html?_=1741702295768 108.61.209.243
# [11-Mar-2025 16:11:35] /elitcar/www/bg/ajax/users/bar.html?_=1741702295351 108.61.209.243

set names utf8

SELECT `TotalQty` FROM `elitcar_store`.`basket` WHERE `UserName` = 'toni25-1' AND `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' LIMIT 1

SELECT COUNT(*) FROM `elitcar_store`.`offers` WHERE `UserID` = '09894E3B1D454BE7BDD247403823C2ED' AND `Status` = 0

Successfully disconnected from the database!

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('NISSENS 87760', '040622F7496E4265932BDA8CD52BFEC0', '10')
# [11-Mar-2025 16:11:36] /elitcar/www/bg/ajax/history/insert.html?_=1741702295247 108.61.209.243

set names utf8

SELECT * FROM `history_parts` LIMIT 1

SHOW COLUMNS FROM `history_parts`

REPLACE INTO `history_parts` SET `Url` = 'https://digith.ink/elitcar/www/bg/tecdoc/123/WzEyM11bODc3NjBdW00gTklTU0VOUyA4Nzc2MF0.html?sn=87760', `PostDate` = '2025-03-11 16:11:35', `MonetaUser` = 'toni25-1', `Language` = 'bg', `Brand` = 'NISSENS', `SearchNumber` = '87760', `PartName` = 'вентилатор вътрешно пространство'

DELETE FROM history_parts WHERE `MonetaUser` = 'toni25-1' AND `ID` NOT IN
            (SELECT * FROM (SELECT `ID` FROM history_parts WHERE `MonetaUser` = 'toni25-1' ORDER BY `PostDate` DESC LIMIT 30) AS T)

SELECT * FROM `ul_parts` LIMIT 1

SHOW COLUMNS FROM `ul_parts`

INSERT INTO `ul_parts` SET `Url` = 'https://digith.ink/elitcar/www/bg/tecdoc/123/WzEyM11bODc3NjBdW00gTklTU0VOUyA4Nzc2MF0.html?sn=87760', `PostDate` = '2025-03-11 16:11:35', `MonetaUser` = 'toni25-1', `Brand` = 'NISSENS', `SearchNumber` = '87760', `PartName` = 'вентилатор вътрешно пространство', `IP` = '108.61.209.243', `MonetaName` = 'Тони 25-1 ЕООД', `MonetaObject` = '10'

SELECT * FROM (
                SELECT
                    IP,
                    COUNT(*) AS NumRows,
                    TIME_TO_SEC(TIMEDIFF(MAX(PostDate), MIN(PostDate))) / COUNT(IP) AS SecPerRow,
                    MonetaUser,
                    MonetaName,
                    MonetaObject
                FROM
                    `elitcar_store`.`ul_parts`
                WHERE
                    MonetaUser = 'toni25-1' AND
                    DATE(`PostDate`) = DATE(CURDATE())
                GROUP BY IP, MonetaUser
                ORDER BY NumRows DESC
            ) AS T
            WHERE
                NumRows > 100 AND
                SecPerRow < 180

SELECT * FROM (
                SELECT
                    IP,
                    COUNT(IP) AS NumRows,
                    COUNT(DISTINCT SearchNumber) AS NumSearchNumbers,
                    TIME_TO_SEC(TIMEDIFF(MAX(PostDate), MIN(PostDate))) / COUNT(IP) AS SecPerRow,
                    Brand,
                    MonetaUser,
                    MonetaName,
                    MonetaObject
                FROM
                    `elitcar_store`.`ul_parts`
                WHERE
                    MonetaUser = 'toni25-1' AND
                    DATE(`PostDate`) = DATE(CURDATE())
                GROUP BY IP, Brand, MonetaUser
            ) AS T
            WHERE
                NumRows > 30 AND
                SecPerRow < 600

Successfully disconnected from the database!

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'NISSENS 87760'
            GROUP BY fComp_Id,fItem_Id

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'
# [11-Mar-2025 16:11:36] /elitcar/www/bg/ajax/prices/W00gTklTU0VOUyA4Nzc2MF0.html?_=1741702295251 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gTklTU0VOUyA4Nzc2MF0%'
            LIMIT 1

Successfully disconnected from the database!

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM  fn_EShopItemInfo_New('NRF 34295', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT * FROM  fn_EShopItemInfo_New('NTY EWN-VW-019', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('NRF 34295', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('NTY EWN-VW-019', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'NRF 34295'
            GROUP BY fComp_Id,fItem_Id

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'NTY EWN-VW-019'
            GROUP BY fComp_Id,fItem_Id
# [11-Mar-2025 16:11:36] /elitcar/www/bg/ajax/prices/W00gTlJGIDM0Mjk1XQ.html?_=1741702295768 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'NRF 34295', 'МАШРУТ  DD', null);
# [11-Mar-2025 16:11:36] /elitcar/www/bg/ajax/prices/W00gTlRZIEVXTi1WVy0wMTld.html?_=1741702295768 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gTlRZIEVXTi1WVy0wMTld%'
            LIMIT 1

Successfully disconnected from the database!

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gTlJGIDM0Mjk1XQ%'
            LIMIT 1

Successfully disconnected from the database!
# [11-Mar-2025 16:11:40] /elitcar/www/bg/moneta/9092/W00gUE9SU0NIRSA5NzA1NzM5MjIwMV0.html?sn=97057392201 108.61.209.243

set names utf8

SELECT * FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'PORSCHE 97057392201' LIMIT 1

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'PORSCHE 97057392201'
            LIMIT 1

SELECT `ProductId` FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'PORSCHE 97057392201' LIMIT 1

SELECT `ReusableGroupId` FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'PORSCHE 97057392201' LIMIT 1
# [11-Mar-2025 16:11:40] /elitcar/www/bg/moneta/9092/W00gUE9SU0NIRSA5NzA1NzM5MjIwMV0.html?sn=97057392201 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM `elitcar_store`.`history_autos` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

SELECT * FROM `elitcar_store`.`history_vin` WHERE `MonetaUser` = 'toni25-1' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!
# [11-Mar-2025 16:11:41] /elitcar/www/bg/ajax/history/insert.html?_=1741702301615 108.61.209.243
# [11-Mar-2025 16:11:41] /elitcar/www/bg/ajax/prices/W00gUE9SU0NIRSA5NzA1NzM5MjIwMV0.html?_=1741702301616 108.61.209.243
# [11-Mar-2025 16:11:41] /elitcar/www/bg/ajax/history/parts.html?_=1741702301617 108.61.209.243
# [11-Mar-2025 16:11:41] /elitcar/www/bg/ajax/users/bar.html?_=1741702301734 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)
# [11-Mar-2025 16:11:42] /elitcar/www/bg/ajax/history/parts.html?_=1741702301617 108.61.209.243

set names utf8

SELECT * FROM `elitcar_store`.`history_parts` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!

SELECT * FROM  fn_EShopItemInfo_New('PORSCHE 97057392201', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

Successfully disconnected from the database!

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('PORSCHE 97057392201', '040622F7496E4265932BDA8CD52BFEC0', '10')
# [11-Mar-2025 16:11:42] /elitcar/www/bg/ajax/users/bar.html?_=1741702301734 108.61.209.243

set names utf8

SELECT `TotalQty` FROM `elitcar_store`.`basket` WHERE `UserName` = 'toni25-1' AND `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' LIMIT 1

SELECT COUNT(*) FROM `elitcar_store`.`offers` WHERE `UserID` = '09894E3B1D454BE7BDD247403823C2ED' AND `Status` = 0

Successfully disconnected from the database!

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'PORSCHE 97057392201'
            GROUP BY fComp_Id,fItem_Id
# [11-Mar-2025 16:11:42] /elitcar/www/bg/ajax/prices/W00gUE9SU0NIRSA5NzA1NzM5MjIwMV0.html?_=1741702301616 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gUE9SU0NIRSA5NzA1NzM5MjIwMV0%'
            LIMIT 1

Successfully disconnected from the database!
# [11-Mar-2025 16:11:45] /elitcar/www/bg/tecdoc/123/WzEyM11bODc3NjBdW00gTklTU0VOUyA4Nzc2MF0.html?sn=87760 108.61.209.243

set names utf8

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'NISSENS 87760'
            LIMIT 1

SELECT
                `elitcar_store`.`moneta`.`ProductId`
            FROM
                `elitcar_store`.`moneta`
                INNER JOIN `autokelly`.`recommended` ON `elitcar_store`.`moneta`.`ProductId` = `autokelly`.`recommended`.`ProductId`
            WHERE
                `elitcar_store`.`moneta`.`MonetaId` = 'NISSENS 87760'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '178001n' AND `ProducerId` = 80

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'bw0331' AND `ProducerId` = 4585

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '68skv071' AND `ProducerId` = 4969

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 441

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'k92258' AND `ProducerId` = 341

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 4399

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'k92258' AND `ProducerId` = 244

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '87760' AND `ProducerId` = 123

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '34295' AND `ProducerId` = 205

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'NRF 34295'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'ewnvw019' AND `ProducerId` = 6355

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'NTY EWN-VW-019'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '11612294' AND `ProducerId` = 4020

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 27

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg2160429' AND `ProducerId` = 4832

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg2118038' AND `ProducerId` = 4832

SELECT `ProductId` FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'NISSENS 87760' LIMIT 1

SELECT `ReusableGroupId` FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'NISSENS 87760' LIMIT 1

SELECT
                    *
                FROM
                    `elitcar_store`.`moneta`
                WHERE
                    `ReusableGroupId` = 'D55538D3FCAE4F23AE4423758EA1CFB5' AND
                    `MonetaId` NOT IN ('NISSENS 87760','NRF 34295','NTY EWN-VW-019') AND
                    `QtyAll` > 0
                ORDER BY
                    `Sales`  DESC,
                    `Qty`  DESC,
                    `QtyAll`  DESC

SELECT * FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'NISSENS 87760' LIMIT 1
# [11-Mar-2025 16:11:45] /elitcar/www/bg/tecdoc/123/WzEyM11bODc3NjBdW00gTklTU0VOUyA4Nzc2MF0.html?sn=87760 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM `elitcar_store`.`history_autos` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

SELECT * FROM `elitcar_store`.`history_vin` WHERE `MonetaUser` = 'toni25-1' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!
# [11-Mar-2025 16:11:46] /elitcar/www/bg/ajax/history/insert.html?_=1741702306129 108.61.209.243
# [11-Mar-2025 16:11:46] /elitcar/www/bg/ajax/prices/W00gTklTU0VOUyA4Nzc2MF0.html?_=1741702306131 108.61.209.243
# [11-Mar-2025 16:11:46] /elitcar/www/bg/ajax/moneta/sort.html?_=1741702306132 108.61.209.243
# [11-Mar-2025 16:11:46] /elitcar/www/bg/ajax/history/parts.html?_=1741702306132 108.61.209.243
# [11-Mar-2025 16:11:46] /elitcar/www/bg/ajax/users/bar.html?_=1741702306228 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM  fn_EShopItemInfo_New('NISSENS 87760', '040622F7496E4265932BDA8CD52BFEC0', '10', '');
# [11-Mar-2025 16:11:46] /elitcar/www/bg/ajax/history/parts.html?_=1741702306132 108.61.209.243

set names utf8

SELECT * FROM `elitcar_store`.`history_parts` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!
# [11-Mar-2025 16:11:46] /elitcar/www/bg/ajax/moneta/sort.html?_=1741702306132 108.61.209.243

set names utf8

SELECT
                `elitcar_store`.`moneta`.`MonetaId`,
                `elitcar_store`.`moneta`.`Sales`,
                `elitcar_store`.`moneta`.`Qty`,
                `elitcar_store`.`moneta`.`QtyAll`,
                `elitcar_store`.`moneta`.`FullSearchTecDocId`
            FROM
                `elitcar_store`.`moneta`
                LEFT JOIN `elitcar_store`.`availabilities` ON `elitcar_store`.`moneta`.`MonetaId` = `elitcar_store`.`availabilities`.`MonetaId` AND `elitcar_store`.`availabilities`.`BusinessGroupID` = '10'
            WHERE
                `elitcar_store`.`moneta`.`MonetaId` IN('NRF 34295','NTY EWN-VW-019')
            ORDER BY
                `elitcar_store`.`availabilities`.`Qty` DESC,
                `elitcar_store`.`moneta`.`Qty` DESC,
                `elitcar_store`.`moneta`.`QtyAll` DESC,
                `elitcar_store`.`moneta`.`Sales` DESC

Successfully disconnected from the database!

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('NISSENS 87760', '040622F7496E4265932BDA8CD52BFEC0', '10')
# [11-Mar-2025 16:11:46] /elitcar/www/bg/ajax/prices/W00gTlJGIDM0Mjk1XQ.html?_=1741702306687 108.61.209.243
# [11-Mar-2025 16:11:46] /elitcar/www/bg/ajax/prices/W00gTlRZIEVXTi1WVy0wMTld.html?_=1741702306687 108.61.209.243
# [11-Mar-2025 16:11:46] /elitcar/www/bg/ajax/users/bar.html?_=1741702306228 108.61.209.243

set names utf8

SELECT `TotalQty` FROM `elitcar_store`.`basket` WHERE `UserName` = 'toni25-1' AND `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' LIMIT 1

SELECT COUNT(*) FROM `elitcar_store`.`offers` WHERE `UserID` = '09894E3B1D454BE7BDD247403823C2ED' AND `Status` = 0

Successfully disconnected from the database!

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'NISSENS 87760'
            GROUP BY fComp_Id,fItem_Id
# [11-Mar-2025 16:11:46] /elitcar/www/bg/ajax/prices/W00gTklTU0VOUyA4Nzc2MF0.html?_=1741702306131 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gTklTU0VOUyA4Nzc2MF0%'
            LIMIT 1

Successfully disconnected from the database!

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'
# [11-Mar-2025 16:11:47] /elitcar/www/bg/ajax/history/insert.html?_=1741702306129 108.61.209.243

set names utf8

SELECT * FROM `history_parts` LIMIT 1

SHOW COLUMNS FROM `history_parts`

REPLACE INTO `history_parts` SET `Url` = 'https://digith.ink/elitcar/www/bg/tecdoc/123/WzEyM11bODc3NjBdW00gTklTU0VOUyA4Nzc2MF0.html?sn=87760', `PostDate` = '2025-03-11 16:11:46', `MonetaUser` = 'toni25-1', `Language` = 'bg', `Brand` = 'NISSENS', `SearchNumber` = '87760', `PartName` = 'вентилатор вътрешно пространство'

DELETE FROM history_parts WHERE `MonetaUser` = 'toni25-1' AND `ID` NOT IN
            (SELECT * FROM (SELECT `ID` FROM history_parts WHERE `MonetaUser` = 'toni25-1' ORDER BY `PostDate` DESC LIMIT 30) AS T)

SELECT * FROM `ul_parts` LIMIT 1

SHOW COLUMNS FROM `ul_parts`

INSERT INTO `ul_parts` SET `Url` = 'https://digith.ink/elitcar/www/bg/tecdoc/123/WzEyM11bODc3NjBdW00gTklTU0VOUyA4Nzc2MF0.html?sn=87760', `PostDate` = '2025-03-11 16:11:46', `MonetaUser` = 'toni25-1', `Brand` = 'NISSENS', `SearchNumber` = '87760', `PartName` = 'вентилатор вътрешно пространство', `IP` = '108.61.209.243', `MonetaName` = 'Тони 25-1 ЕООД', `MonetaObject` = '10'

SELECT * FROM (
                SELECT
                    IP,
                    COUNT(*) AS NumRows,
                    TIME_TO_SEC(TIMEDIFF(MAX(PostDate), MIN(PostDate))) / COUNT(IP) AS SecPerRow,
                    MonetaUser,
                    MonetaName,
                    MonetaObject
                FROM
                    `elitcar_store`.`ul_parts`
                WHERE
                    MonetaUser = 'toni25-1' AND
                    DATE(`PostDate`) = DATE(CURDATE())
                GROUP BY IP, MonetaUser
                ORDER BY NumRows DESC
            ) AS T
            WHERE
                NumRows > 100 AND
                SecPerRow < 180

SELECT * FROM (
                SELECT
                    IP,
                    COUNT(IP) AS NumRows,
                    COUNT(DISTINCT SearchNumber) AS NumSearchNumbers,
                    TIME_TO_SEC(TIMEDIFF(MAX(PostDate), MIN(PostDate))) / COUNT(IP) AS SecPerRow,
                    Brand,
                    MonetaUser,
                    MonetaName,
                    MonetaObject
                FROM
                    `elitcar_store`.`ul_parts`
                WHERE
                    MonetaUser = 'toni25-1' AND
                    DATE(`PostDate`) = DATE(CURDATE())
                GROUP BY IP, Brand, MonetaUser
            ) AS T
            WHERE
                NumRows > 30 AND
                SecPerRow < 600

Successfully disconnected from the database!

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM  fn_EShopItemInfo_New('NRF 34295', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT * FROM  fn_EShopItemInfo_New('NTY EWN-VW-019', '040622F7496E4265932BDA8CD52BFEC0', '10', '');

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('NRF 34295', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT AuctionDescription FROM fn_EShopItemInfoGiftsAuctionDesc_ElitCar('NTY EWN-VW-019', '040622F7496E4265932BDA8CD52BFEC0', '10')

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'NRF 34295'
            GROUP BY fComp_Id,fItem_Id
# [11-Mar-2025 16:11:47] /elitcar/www/bg/ajax/prices/W00gTlJGIDM0Mjk1XQ.html?_=1741702306687 108.61.209.243

set names utf8

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LToday','LTomorrow','LMonday','LTuesday','LWednesday','LThursday','LFriday','LSaturday','LSunday','LFor','LQty','LUntil','LOClock','LInStock','LDeliveryTime','LAvailability','LOrderDeadline','LForToday','LForTomorrow') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

SELECT * FROM fn_GetDeliveryTS_ElitCar('001', '10', 'NRF 34295', 'МАШРУТ  DD', null);

SELECT
                SUM(sQuantity) AS sQuantity
            FROM
                G_LItemEntry_0 E WITH(NOLOCK)
                INNER JOIN N_Businessgroup B WITH(NOLOCK) ON (B.Id=E.fBusinessGroup_Id) AND (B.Comp_Id=E.fComp_Id)
            WHERE
                E.SLevel=3 AND
                E.fComp_Id = '001' AND
                B.IsOuterBG = 1 AND
                E.fBusinessGroup_Id > 74 AND
                e.fItem_Id = 'NTY EWN-VW-019'
            GROUP BY fComp_Id,fItem_Id
# [11-Mar-2025 16:11:47] /elitcar/www/bg/ajax/prices/W00gTlRZIEVXTi1WVy0wMTld.html?_=1741702306687 108.61.209.243

set names utf8

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gTlJGIDM0Mjk1XQ%'
            LIMIT 1

SELECT
                `Label`,
                `Value`
            FROM
                `elitcar_store`.`labels`
            WHERE
                `Label` IN ('LPriceForYou','InfoDeposit','LDeposit','InfoDeliveryTaxes','LSevenDays','LAction','LAdd','LReplace','LDeliveryNoReturn','LOutOfStock') AND
                `Language` = 'bg'
             ORDER BY
                `elitcar_store`.`labels`.`Label` ASC

Successfully disconnected from the database!

SELECT
                `Items`
            FROM
                `elitcar_store`.`basket`
            WHERE
                `UserName` = 'toni25-1' AND
                `ContragentID` = '040622F7496E4265932BDA8CD52BFEC0' AND
                `Items` LIKE '%W00gTlRZIEVXTi1WVy0wMTld%'
            LIMIT 1

Successfully disconnected from the database!
# [11-Mar-2025 16:12:10] /elitcar/www/bg/ajax/products/gallery/WzEyM11bODc3NjBdW00gTklTU0VOUyA4Nzc2MF0.html?_=1741702330204 108.61.209.243

set names utf8

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'NISSENS 87760'
            LIMIT 1
# [11-Mar-2025 16:12:15] /elitcar/www/bg/ajax/products/gallery/WzEyM11bODc3NjBdW00gTklTU0VOUyA4Nzc2MF0.html?_=1741702335477 108.61.209.243

set names utf8

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'NISSENS 87760'
            LIMIT 1
# [11-Mar-2025 16:17:12] /elitcar/www/bg/tecdoc/123/WzEyM11bODc3NjBdW00gTklTU0VOUyA4Nzc2MF0.html?sn=87760 108.61.209.243

set names utf8

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'NISSENS 87760'
            LIMIT 1

SELECT
                `elitcar_store`.`moneta`.`ProductId`
            FROM
                `elitcar_store`.`moneta`
                INNER JOIN `autokelly`.`recommended` ON `elitcar_store`.`moneta`.`ProductId` = `autokelly`.`recommended`.`ProductId`
            WHERE
                `elitcar_store`.`moneta`.`MonetaId` = 'NISSENS 87760'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '178001n' AND `ProducerId` = 80

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'bw0331' AND `ProducerId` = 4585

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '68skv071' AND `ProducerId` = 4969

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 441

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'k92258' AND `ProducerId` = 341

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 4399

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'k92258' AND `ProducerId` = 244

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '87760' AND `ProducerId` = 123

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '34295' AND `ProducerId` = 205

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'NRF 34295'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'ewnvw019' AND `ProducerId` = 6355

SELECT
                `BrandID`,
                `Gallery`,
                `Title`,
                `Content`
            FROM
                `elitcar_store`.`products`
            WHERE
                `MonetaID` = 'NTY EWN-VW-019'
            LIMIT 1

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '11612294' AND `ProducerId` = 4020

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = '92258' AND `ProducerId` = 27

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg2160429' AND `ProducerId` = 4832

SELECT `MonetaId` FROM `elitcar_store`.`moneta` WHERE `FullSearchTecDocId` = 'wg2118038' AND `ProducerId` = 4832

SELECT `ProductId` FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'NISSENS 87760' LIMIT 1

SELECT `ReusableGroupId` FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'NISSENS 87760' LIMIT 1

SELECT
                    *
                FROM
                    `elitcar_store`.`moneta`
                WHERE
                    `ReusableGroupId` = 'D55538D3FCAE4F23AE4423758EA1CFB5' AND
                    `MonetaId` NOT IN ('NISSENS 87760','NRF 34295','NTY EWN-VW-019') AND
                    `QtyAll` > 0
                ORDER BY
                    `Sales`  DESC,
                    `Qty`  DESC,
                    `QtyAll`  DESC

SELECT * FROM `elitcar_store`.`moneta` WHERE `MonetaId` = 'NISSENS 87760' LIMIT 1
# [11-Mar-2025 16:17:12] /elitcar/www/bg/tecdoc/123/WzEyM11bODc3NjBdW00gTklTU0VOUyA4Nzc2MF0.html?sn=87760 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                    _User_Id,
                                    _ChangeBlockedCntr
                                FROM
                                    N_ContragentEShopSettings
                                    INNER JOIN N_Users ON N_Users.Id = N_ContragentEShopSettings._User_Id
                                WHERE
                                    N_ContragentEShopSettings._User_Id = :sUser_Id /*това ти е променливата, която прочиташ при логване*/
                                    AND  N_Users.Is_Active = 1
Array
(
    [:sUser_Id] => 
)


SELECT * FROM fn_GetNextRouteForClient('001', '040622F7496E4265932BDA8CD52BFEC0', '10', 0)

exec usp_CheckContragentDue_ElitCar_web '040622F7496E4265932BDA8CD52BFEC0', '001',0, '2025-03-11', '10'

SELECT * FROM `elitcar_store`.`history_autos` WHERE `MonetaUser` = 'toni25-1' AND `Language` = 'bg' ORDER BY PostDate DESC LIMIT 30

SELECT * FROM `elitcar_store`.`history_vin` WHERE `MonetaUser` = 'toni25-1' ORDER BY PostDate DESC LIMIT 30

Successfully disconnected from the database!
# [11-Mar-2025 16:17:13] /elitcar/www/bg/ajax/history/insert.html?_=1741702633785 108.61.209.243
# [11-Mar-2025 16:17:13] /elitcar/www/bg/ajax/prices/W00gTklTU0VOUyA4Nzc2MF0.html?_=1741702633790 108.61.209.243
# [11-Mar-2025 16:17:13] /elitcar/www/bg/ajax/moneta/sort.html?_=1741702633791 108.61.209.243
# [11-Mar-2025 16:17:13] /elitcar/www/bg/ajax/history/parts.html?_=1741702633792 108.61.209.243
# [11-Mar-2025 16:17:14] /elitcar/www/bg/ajax/users/bar.html?_=1741702633886 108.61.209.243

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

SELECT
                                [N_ContragentEShopSettings].[ID],
                                [N_ContragentEShopSettings].[UserName],
                                [N_ContragentEShopSettings].[Password],
                                [N_ContragentEShopSettings].[Name],
                                [N_ContragentEShopSettings].[OELogin],
                                [N_ContragentEShopSettings].[_User_Id],
                                [N_ContragentEShopSettings].[Contragent_Id],
                                [N_ContragentEShopSettings].[ServiceBG_Id],
                                [N_ContragentEShopSettings].[Blocked],
                                [N_ContragentEShopSettings].[BlockOrders],
                                [N_ContragentEShopSettings].[_Comp_type],
                                [N_Contragent].[Comp_Id],
                                [N_DeliveryAddress].[Route_Id] AS _Route,
                                [N_Contragent].[Name2] AS ContragentName,
                                [N_Contragent].[Address] AS ContragentAddress,
                                [N_Contragent].[BULSTAT] AS ContragentBulstat,
                                [N_Contragent].[VATRegistrationNo] AS ContragentVAT,
                                [N_Contragent].[Contact] AS ContragentContact,
                                [N_Businessgroup].[IpAddressBG],
                                [N_Contragent].[VATBus_PostingGroup] AS VAT,
                                [N_Contragent].[Currency_Id],
                                [N_Contragent].CreditLimit_LCY AS Creditlimit,
                                [N_Contragent].PaymentTermsCode  AS PaymentTerms,
                                [N_Contragent].PaymentMethodCode  AS PaymentMethodCode,
                                COALESCE([N_DeliveryAddress]._TransportType, [N_Contragent].TransportType) AS TransportType,
                                -- [N_DeliveryAddress].Route_Id AS TransportType,
                                COALESCE([N_DeliveryAddress]._SubDocument_Code, [N_Contragent]._SaleDocSubType_EK) AS SaleDocSubType,
                                COALESCE([N_DeliveryAddress]._DefaultPrintForm, [N_Contragent]._DefaultPrintForm) AS DefaultPrintForm
                            FROM
                                [N_ContragentEShopSettings] WITH(NOLOCK)
                            INNER JOIN [N_Contragent] WITH(NOLOCK) ON
                                [N_Contragent].[Id] = [N_ContragentEShopSettings].[Contragent_Id]
                            LEFT JOIN [N_DeliveryAddress] WITH(NOLOCK) ON
                                [N_Contragent].[Comp_Id] = [N_DeliveryAddress].[Comp_Id] AND
                                [N_Contragent].[Id] = [N_DeliveryAddress].[Contragent_Id] AND
                                [N_ContragentEShopSettings].[ServiceBG_Id] = [N_DeliveryAddress].[ServiceBG_Id]
                            LEFT JOIN [N_Businessgroup] WITH(NOLOCK) ON
                                [N_Businessgroup].[Id] = [N_ContragentEShopSettings].[ServiceBG_Id] AND
                                [N_Businessgroup].[Comp_Id] = [N_ContragentEShopSettings].[Comp_Id]
                            WHERE
                                [N_ContragentEShopSettings].[ID] = '09894E3B1D454BE7BDD247403823C2ED'

