
set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT
                `URLLabel`
            FROM
                `pages`
            WHERE
                `Rules` = 'cookies' AND
                `Language` = 'bg'
         AND `Visible` = 1 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 109 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 109

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 109 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 109

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 142250 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT `ID` FROM `orders` WHERE `UserID` = 109 AND `Status` = 0 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 109 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 109

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 142250 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 89 AND `UserID` = 109 LIMIT 1

SELECT
                `URLLabel`
            FROM
                `pages`
            WHERE
                `Rules` = 'gdpr' AND
                `Language` = 'bg'
         AND `Visible` = 1 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 109 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 109

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT `UserKey`, `Data` FROM `users` WHERE `ID` = 109 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT `UserKey`, `Data` FROM `users` WHERE `ID` = 109 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 142250 AND
                    `users`.`ID` = 109
                LIMIT 3
            ) AS `Result`;

SELECT `Basket` FROM `basket` WHERE `UserID` = 109 LIMIT 1

SELECT `MinQuantity` FROM `parts` WHERE `ID` = 142250

UPDATE
                            `basket`
                        SET
                            `UpdateDate` = NOW(),
                            `Basket` = '{"142250":{"qty":1,"price":"36.01","note":"","number":"0001110003, 0001110026, 0001110089"}}',
                            `Num` = 1
                        WHERE
                            `UserID` = 109 LIMIT 1

SELECT * FROM `orders` LIMIT 1

SHOW COLUMNS FROM `orders`

UPDATE `orders` SET `ClientOrderNumber` = '', `UserID` = 109, `TotalPrice` = 0, `TotalWeight` = 0, `DeliveryPrice` = 0, `Currency` = 'EUR', `DeliveryData` = 'Nn8tw3uakvxubKnijmUjhLGMzVL__ayY_JOzwa_Cej85gJYVXo5nyn2Bv6kco4i6F9mlmWxO3XjyBL97Ffu8NRO3Xf16Eyd1D9jQkLRnZoU5nj8MX-S6gSCOrgeuGkhU7pMgo8d5DWS7LjcUIDuanySZSmhNw8vIK3v89eWYJGUy31rZPKCNCPZ0ivXXoMjl_rovQC2iGamu0bUbR-RAD5qnZtla4SZQ10MbuvAF7DgmAv0H2AuriE3vmjWKhd_HBzlV28m6HEUHC1N6wYllwnNX9LtaZoypDvXKg-el6MN_98_fXgnl6il-54s4rsbWCg8i64z4j31fXjV2M9CdB3DUJ8HZoDIxhYGSPG4WvOf5jhxK3JYGjnZ5KUK43XfjrxVMuE9fjW7MzhCax5RRDBlAoPBGQhwX7O96mypcRNI', `InvoiceData` = '_J8Eu8GomKKW3NQ_xMv72OYlkXCzqMybzbGQ1EHWdQZMn9-aZ9xeElBvWvNYqOUajvkXT3FE7ehh1_GUYrfRP8xJg26KCX5J-rr0cNI7NhlDAyAgzAWBoGiTD1LBbFmiTX8N4xR4ez8MhnmJ_eR5HpkMiFpHm8H-BnX265Y9RzEuzlw6MQoMYyN-Tt530iBBUJtXnTmJh8iC6dnwaio5zoeQfR5LNK7Dn7qsxH99NGMCMlvDe1tdBrqli5iw3_dkPqCaPMGQ-3amCmSYg8TN584zorNtfjwExa22auykats', `SearchKey` = 'wqfCjsKiwobDnsKCwplowqfDicKLwrzDmsODwqjCwqfCgcKewoXDqsKCwpnCrcKnwrzCh8K8w5rCncKswrlmwpDCtsK4w4LCw5h9wpTCpMOaZ8KowqrDiMK3dMOSw5jClsOJw7DCj8KcwobDlsKuwqbClsOsw4vCpMw4R5wrFow4XCiMKXZsOGwrTCkMKaw4HC', `LastUpdate` = '2024-10-25 06:53:35' WHERE `ID` = '89'

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 89 AND `UserID` = 109 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 109 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 109

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 142250 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                `URLLabel`
            FROM
                `pages`
            WHERE
                `Rules` = 'terms' AND
                `Language` = 'bg'
         AND `Visible` = 1 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 109 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 109

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 89 AND `UserID` = 109 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 109 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 109

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 142250 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `TotalPrice` = 36.01,
                    `TotalWeight` = 3.869,
                    `DeliveryPrice` = 7.17,
                    `CurrencyPrice` = '€ 43.18',
                    `CurrencyExchange` = 1.95583,
                    `AccessKey` = '1nBSI5EAEvCp90qTcW2HE61GUIzDpHUTkbBTHRWZBWBGEhqN7KGNf3VSTcFMi2Ne'
                WHERE
                    `ID` = 89 AND
                    `UserID` = 109 AND
                    `Status` = 0
                LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 109 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 109

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 142250 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 89 AND `AccessKey` = '1nBSI5EAEvCp90qTcW2HE61GUIzDpHUTkbBTHRWZBWBGEhqN7KGNf3VSTcFMi2Ne' LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Status` = `Status` | 1
                WHERE
                    `ID` = 89
                LIMIT 1

SELECT `Data` FROM `users` WHERE `ID` = 109 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 109

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Basket` = '{"142250":{"qty":1,"price":"36.01","note":"","number":"0001110003, 0001110026, 0001110089"}}'
                WHERE
                    `ID` = 89 AND
                    `UserID` = 109
                LIMIT 1

DELETE FROM `basket` WHERE `UserID` = 109

SELECT * FROM `orders` WHERE `ID` = 89 LIMIT 1

SELECT * FROM `users` WHERE `ID` = 109 LIMIT 1

SELECT
                `parts`.*,
                `part-texts`.*,
                `ParentGroup`.`Title` AS `ParentGroupName`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`Title` AS `SubGroupName`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `availabilities`.`Quantity`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'bg'
                LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
            WHERE
                `parts`.`ID` = 142250 AND
                `part-texts`.`Language` = 'bg'
            LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT SUM(`Quantity`) AS Quantity FROM `recepta`.`quantities` WHERE `RefNumber` = 'IR8038R'

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT `Data` FROM `users` WHERE `ID` = 109 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 109 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 109

SELECT
                `ClientOrderNumber`,
                `DeliveryData`
            FROM
                `orders`
            WHERE
                `ID` = 89 AND
                `Status` & 6 = 0
            LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Status` = `Status` | 2
                WHERE
                    `ID` = 89
                LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Status` = `Status` | 4
                WHERE
                    `ID` = 89
                LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

UPDATE `users` SET `LastUpdate` = NOW(), `AccessKey` = '' WHERE `ID` = 109

set names utf8

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT `ID`, `UserKey` FROM `users` WHERE `UserKey` LIKE 'w5vClsOAwpXDqcKnw4HCncK3w5fCsMOLw5zCu8KTw5rCpcKx%' LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 3
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 33

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 33
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `orders`.*,
                `users`.`Data` AS `UserData`,
                RIGHT(`UserKey`, 1) AS `Access`
            FROM
                `orders`
                LEFT JOIN `users` ON `orders`.`UserID` = `users`.`ID`
            WHERE
                `orders`.`Status` > 0
         ORDER BY `orders`.`LastUpdate` DESC LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                `orders`.*,
                `users`.`Data` AS `UserData`,
                RIGHT(`UserKey`, 1) AS `Access`
            FROM
                `orders`
                LEFT JOIN `users` ON `orders`.`UserID` = `users`.`ID`
            WHERE
                `orders`.`Status` > 0
         ORDER BY `orders`.`LastUpdate` DESC) AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `orders`.*
            FROM
                `orders`
            WHERE
                `orders`.`ID` = 89 AND
                `orders`.`Status` > 0
            LIMIT 1

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 3
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 33

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 33
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                *
            FROM
                `users`
            WHERE 1
         LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                *
            FROM
                `users`
            WHERE 1
        ) AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                *
            FROM
                `users`
            WHERE 1
         AND `SearchKey` LIKE '%w5h9wpTCpMOaZ8Kow%' LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                *
            FROM
                `users`
            WHERE 1
         AND `SearchKey` LIKE '%w5h9wpTCpMOaZ8Kow%') AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 109 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 3
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 109

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 109
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

(
                    SELECT
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'IR80%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'IR80%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

(
                    SELECT
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'IR808%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'IR808%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `ID` FROM `parts` WHERE `RefNumber` = 'IR8085' LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1934 AND
                    `users`.`ID` = 109
                LIMIT 3
            ) AS `Result`;

SELECT `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8085' AND `Store` = 'BLG'

SELECT `PriceListID` FROM `users` WHERE `ID` = 109 LIMIT 1

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 3
            WHERE
                `parts`.`RefNumber` = 'IR8085'

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8085'

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 109

SELECT `ListName` FROM `pricelist` WHERE `ID` = 711 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    *
                FROM
                    `groups`
                WHERE
                    `URLLabel` = 'starters' AND
                    `Language` = 'bg' AND
                    `Visible` = 1
                LIMIT 1

SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'bg'
                 AND `parts`.`Visible` = 1
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
         LIMIT 0, 12

SELECT COUNT(*) AS NumRows FROM (
            SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'bg'
                 AND `parts`.`Visible` = 1
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
        ) AS CountTable

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'starters' AND
                `Language` = 'bg' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1852

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1854

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8005' AND `Quantity` > 0 ORDER BY `Store` DESC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142427

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8006R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142250

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8038R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1888

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148241

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 120023

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8064' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8072RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1932

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8083' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2190

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8341' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8374' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 139384

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8374V' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `MinQuantity` FROM `parts` WHERE `ID` = 1854

INSERT INTO  `basket`
                        (`UserID`, `PostDate`, `UpdateDate`, `Basket`, `Num`) VALUES
                        (1030, NOW(), NOW(), '{"1854":{"qty":1,"price":0,"note":"","number":"D6RA62, D6RA32, D6RA249"}}', 1)

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT `ID` FROM `orders` WHERE `UserID` = 1030 AND `Status` = 0 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `MinQuantity` FROM `parts` WHERE `ID` = 1854

UPDATE
                            `basket`
                        SET
                            `UpdateDate` = NOW(),
                            `Basket` = '{"1854":{"qty":3,"price":0,"note":"","number":"D6RA62, D6RA32, D6RA249"}}',
                            `Num` = 3
                        WHERE
                            `UserID` = 1030 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT `ID` FROM `orders` WHERE `UserID` = 1030 AND `Status` = 0 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 91 AND `UserID` = 1030 LIMIT 1

SELECT
                `URLLabel`
            FROM
                `pages`
            WHERE
                `Rules` = 'gdpr' AND
                `Language` = 'bg'
         AND `Visible` = 1 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `UserKey`, `Data` FROM `users` WHERE `ID` = 1030 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `MinQuantity` FROM `parts` WHERE `ID` = 1854

UPDATE
                            `basket`
                        SET
                            `UpdateDate` = NOW(),
                            `Basket` = '{"1854":{"qty":3,"price":"29.5","note":"","number":"D6RA62, D6RA32, D6RA249"}}',
                            `Num` = 3
                        WHERE
                            `UserID` = 1030 LIMIT 1

SELECT * FROM `orders` LIMIT 1

SHOW COLUMNS FROM `orders`

UPDATE `orders` SET `ClientOrderNumber` = '', `UserID` = 1030, `TotalPrice` = 0, `TotalWeight` = 0, `DeliveryPrice` = 0, `Currency` = 'EUR', `DeliveryData` = 'YBq3PWrZJCEaAVNSl50eGTXMPRkAGm0vDHEIiLNTf1_qTmoIeuM_-aU9MQSYrIKOiedjdv_XBoiFUhYOCleBK2ne1Q6U5gxCLWpbBpr5LkfcHcyz5jTWAoikSXuRjYrY351ltAjdOLc7WiEZsL4wC2SXNGLLGn_XJkTVvgqSj0Ng97y4YtiwbbvnmxMw_t7DjLtM-S_CSmIcaYxbFEIbfyuMGxrhqBcO0IoKBgykqz-qAjcE3THAQl0N4Kyf4dOGl52JNVRIKd0gxuZ1FvOHFgK0Jrg6XpFSgKssFXx6zo8MduxOvXATFHEymfnzxoirAszC3MOhRcO86OiQCRIDIAyNW8g2UX7V_h-iZerPfA0FfvSZI5rUrDMGYFA-VR75-2FtM5qdzaD0JrdHZnu-XQtGp5BLel3m4drSLiWL3Cw', `InvoiceData` = NULL, `SearchKey` = 'wqfCgX3ChcOswoLCmWrCp8K8esK7w6jCiMKow65mwpDCwqfCgcKawoXDq8KYwplhwqfDicKHwrvDpsKIwqjCq2bCkMKcwrjDgMw5nCosK2wqbDmWbDjsKcw5zDhcKFw57DjMKnw43DpcKZwrHCisOewq7ClsK1w6HCvsKkwo3Dw4R5wrFnw4Z4wqtlw4XDhMKMw6HDgc', `LastUpdate` = '2024-10-25 08:19:00' WHERE `ID` = '91'

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 91 AND `UserID` = 1030 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                `URLLabel`
            FROM
                `pages`
            WHERE
                `Rules` = 'terms' AND
                `Language` = 'bg'
         AND `Visible` = 1 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 91 AND `UserID` = 1030 LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `TotalPrice` = 88.5,
                    `TotalWeight` = 12,
                    `DeliveryPrice` = 17.6,
                    `CurrencyPrice` = '€ 106.10',
                    `CurrencyExchange` = 1.95583,
                    `AccessKey` = 'JC8PAkZU5VS43UZcATO7CnZLWWPRjSZBoRgVccTH2EMGBV2CB0ESyXKRPOJQoE6M'
                WHERE
                    `ID` = 91 AND
                    `UserID` = 1030 AND
                    `Status` = 0
                LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 91 AND `AccessKey` = 'JC8PAkZU5VS43UZcATO7CnZLWWPRjSZBoRgVccTH2EMGBV2CB0ESyXKRPOJQoE6M' LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Status` = `Status` | 1
                WHERE
                    `ID` = 91
                LIMIT 1

SELECT `Data` FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Basket` = '{"1854":{"qty":3,"price":"29.5","note":"","number":"D6RA62, D6RA32, D6RA249"}}'
                WHERE
                    `ID` = 91 AND
                    `UserID` = 1030
                LIMIT 1

DELETE FROM `basket` WHERE `UserID` = 1030

SELECT * FROM `orders` WHERE `ID` = 91 LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                `parts`.*,
                `part-texts`.*,
                `ParentGroup`.`Title` AS `ParentGroupName`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`Title` AS `SubGroupName`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `availabilities`.`Quantity`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'bg'
                LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
            WHERE
                `parts`.`ID` = 1854 AND
                `part-texts`.`Language` = 'bg'
            LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT SUM(`Quantity`) AS Quantity FROM `recepta`.`quantities` WHERE `RefNumber` = 'IR8005'

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Data` FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `ClientOrderNumber`,
                `DeliveryData`
            FROM
                `orders`
            WHERE
                `ID` = 91 AND
                `Status` & 6 = 0
            LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Status` = `Status` | 2
                WHERE
                    `ID` = 91
                LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Status` = `Status` | 4
                WHERE
                    `ID` = 91
                LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 3
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1030
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `orders`.*,
                `users`.`Data` AS `UserData`,
                RIGHT(`UserKey`, 1) AS `Access`
            FROM
                `orders`
                LEFT JOIN `users` ON `orders`.`UserID` = `users`.`ID`
            WHERE
                `orders`.`Status` > 0
         ORDER BY `orders`.`LastUpdate` DESC LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                `orders`.*,
                `users`.`Data` AS `UserData`,
                RIGHT(`UserKey`, 1) AS `Access`
            FROM
                `orders`
                LEFT JOIN `users` ON `orders`.`UserID` = `users`.`ID`
            WHERE
                `orders`.`Status` > 0
         ORDER BY `orders`.`LastUpdate` DESC) AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `orders`.*
            FROM
                `orders`
            WHERE
                `orders`.`ID` = 91 AND
                `orders`.`Status` > 0
            LIMIT 1

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    *
                FROM
                    `groups`
                WHERE
                    `URLLabel` = 'starters' AND
                    `Language` = 'bg' AND
                    `Visible` = 1
                LIMIT 1

SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'bg'
                
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
         LIMIT 0, 12

SELECT COUNT(*) AS NumRows FROM (
            SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'bg'
                
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
        ) AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'starters' AND
                `Language` = 'bg' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1852

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142528

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1854

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8005' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142427

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8006R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142250

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8038R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1888

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148241

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 120023

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8064' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8072RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1932

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8083' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2190

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8341' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8374' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `MinQuantity` FROM `parts` WHERE `ID` = 1854

INSERT INTO  `basket`
                        (`UserID`, `PostDate`, `UpdateDate`, `Basket`, `Num`) VALUES
                        (1030, NOW(), NOW(), '{"1854":{"qty":1,"price":0,"note":"","number":"D6RA62, D6RA32, D6RA249"}}', 1)

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT `ID` FROM `orders` WHERE `UserID` = 1030 AND `Status` = 0 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `MinQuantity` FROM `parts` WHERE `ID` = 1854

UPDATE
                            `basket`
                        SET
                            `UpdateDate` = NOW(),
                            `Basket` = '{"1854":{"qty":2,"price":0,"note":"","number":"D6RA62, D6RA32, D6RA249"}}',
                            `Num` = 2
                        WHERE
                            `UserID` = 1030 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT `ID` FROM `orders` WHERE `UserID` = 1030 AND `Status` = 0 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT `UserKey`, `Data` FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                `URLLabel`
            FROM
                `pages`
            WHERE
                `Rules` = 'gdpr' AND
                `Language` = 'bg'
         AND `Visible` = 1 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `UserKey`, `Data` FROM `users` WHERE `ID` = 1030 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `MinQuantity` FROM `parts` WHERE `ID` = 1854

UPDATE
                            `basket`
                        SET
                            `UpdateDate` = NOW(),
                            `Basket` = '{"1854":{"qty":2,"price":"29.5","note":"","number":"D6RA62, D6RA32, D6RA249"}}',
                            `Num` = 2
                        WHERE
                            `UserID` = 1030 LIMIT 1

SELECT * FROM `orders` LIMIT 1

SHOW COLUMNS FROM `orders`

INSERT INTO `orders` SET `ClientOrderNumber` = '', `UserID` = 1030, `TotalPrice` = 0, `TotalWeight` = 0, `DeliveryPrice` = 0, `Currency` = 'EUR', `DeliveryData` = 'GBlhsrEHxLxfmzh2kaQMwR1n2ZiW9xTdkuHXsVgf35ue-mKRiukh1VL5u7calLxKf-u1eNEbzL0jzYEMbvfH9qulsgDG4N26PbjMAE--Q9phJfIbEuqV1HtwlBCPd0jMeZgMobU3HVu3bSg0n2uDWeOq_Q_WbEAlYd3u_YYQbisYdwcMe58ctdYLnQR13wZGcKADI8hxV9N0Y0tVxwcBMVYApnh2WV1-OH8NIoIGIvsSLW80wwyEsLjQa6vIU3ol55NQsH7IWJHlQM4uYLU58P5ZRxOdQhFFxGrOqJgKrzIFT3U5LLH0WcX5MEAm3QUtLFQZ18__2Qi_NzBiuea5A9hGPydboKRoqEvMn7-TlA3VF8kQqTPBecpbksBk0AD05Ed0KmH0O33CX2egmlDBUOBt6IsFEPUElTAbN4gRavc', `InvoiceData` = NULL, `SearchKey` = 'wqfCgX3ChcOswoLCmWrCp8K8esK7w6jCiMKow65mwpDCwqfCgcKawoXDq8KYwplhwqfDicKHwrvDpsKIwqjCq2bCkMKcwrjDgMw5nCosK2wqbDmWbDjsKcw5zDhcKFw57DjMKnw43DpcKZwrHCisOewq7ClsK1w6HCvsKkwo3Dw4R5wrFnw4Z4wqtlw4XDhMKMw6HDgc', `LastUpdate` = '2024-10-25 08:24:41', `PostDate` = '2024-10-25 08:24:41', `Status` = 0, `IAgree` = 0

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 93 AND `UserID` = 1030 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                `URLLabel`
            FROM
                `pages`
            WHERE
                `Rules` = 'terms' AND
                `Language` = 'bg'
         AND `Visible` = 1 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 93 AND `UserID` = 1030 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `TotalPrice` = 59,
                    `TotalWeight` = 8,
                    `DeliveryPrice` = 10.05,
                    `CurrencyPrice` = '€ 69.05',
                    `CurrencyExchange` = 1.95583,
                    `AccessKey` = '2qcMZKLv3WPEaslaCSG6RQVYOMfBUJGX1EJfxmNByoZRWTZ1MFRCCvWSc829HVcW'
                WHERE
                    `ID` = 93 AND
                    `UserID` = 1030 AND
                    `Status` = 0
                LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 93 AND `AccessKey` = '2qcMZKLv3WPEaslaCSG6RQVYOMfBUJGX1EJfxmNByoZRWTZ1MFRCCvWSc829HVcW' LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Status` = `Status` | 1
                WHERE
                    `ID` = 93
                LIMIT 1

SELECT `Data` FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Basket` = '{"1854":{"qty":2,"price":"29.5","note":"","number":"D6RA62, D6RA32, D6RA249"}}'
                WHERE
                    `ID` = 93 AND
                    `UserID` = 1030
                LIMIT 1

DELETE FROM `basket` WHERE `UserID` = 1030

SELECT * FROM `orders` WHERE `ID` = 93 LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                `parts`.*,
                `part-texts`.*,
                `ParentGroup`.`Title` AS `ParentGroupName`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`Title` AS `SubGroupName`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `availabilities`.`Quantity`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'bg'
                LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
            WHERE
                `parts`.`ID` = 1854 AND
                `part-texts`.`Language` = 'bg'
            LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT SUM(`Quantity`) AS Quantity FROM `recepta`.`quantities` WHERE `RefNumber` = 'IR8005'

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Data` FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `ClientOrderNumber`,
                `DeliveryData`
            FROM
                `orders`
            WHERE
                `ID` = 93 AND
                `Status` & 6 = 0
            LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Status` = `Status` | 2
                WHERE
                    `ID` = 93
                LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Status` = `Status` | 4
                WHERE
                    `ID` = 93
                LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 3
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1030
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `orders`.*,
                `users`.`Data` AS `UserData`,
                RIGHT(`UserKey`, 1) AS `Access`
            FROM
                `orders`
                LEFT JOIN `users` ON `orders`.`UserID` = `users`.`ID`
            WHERE
                `orders`.`Status` > 0
         ORDER BY `orders`.`LastUpdate` DESC LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                `orders`.*,
                `users`.`Data` AS `UserData`,
                RIGHT(`UserKey`, 1) AS `Access`
            FROM
                `orders`
                LEFT JOIN `users` ON `orders`.`UserID` = `users`.`ID`
            WHERE
                `orders`.`Status` > 0
         ORDER BY `orders`.`LastUpdate` DESC) AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `orders`.*
            FROM
                `orders`
            WHERE
                `orders`.`ID` = 93 AND
                `orders`.`Status` > 0
            LIMIT 1

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    *
                FROM
                    `groups`
                WHERE
                    `URLLabel` = 'starters' AND
                    `Language` = 'bg' AND
                    `Visible` = 1
                LIMIT 1

SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'bg'
                
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
         LIMIT 0, 12

SELECT COUNT(*) AS NumRows FROM (
            SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'bg'
                
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
        ) AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'starters' AND
                `Language` = 'bg' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1852

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142528

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1854

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8005' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142427

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8006R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142250

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8038R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1888

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148241

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 120023

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8064' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8072RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1932

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8083' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2190

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8341' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8374' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `MinQuantity` FROM `parts` WHERE `ID` = 1854

INSERT INTO  `basket`
                        (`UserID`, `PostDate`, `UpdateDate`, `Basket`, `Num`) VALUES
                        (1030, NOW(), NOW(), '{"1854":{"qty":1,"price":0,"note":"","number":"D6RA62, D6RA32, D6RA249"}}', 1)

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT `ID` FROM `orders` WHERE `UserID` = 1030 AND `Status` = 0 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT `UserKey`, `Data` FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                `URLLabel`
            FROM
                `pages`
            WHERE
                `Rules` = 'gdpr' AND
                `Language` = 'bg'
         AND `Visible` = 1 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `UserKey`, `Data` FROM `users` WHERE `ID` = 1030 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `MinQuantity` FROM `parts` WHERE `ID` = 1854

UPDATE
                            `basket`
                        SET
                            `UpdateDate` = NOW(),
                            `Basket` = '{"1854":{"qty":1,"price":"29.5","note":"","number":"D6RA62, D6RA32, D6RA249"}}',
                            `Num` = 1
                        WHERE
                            `UserID` = 1030 LIMIT 1

SELECT * FROM `orders` LIMIT 1

SHOW COLUMNS FROM `orders`

INSERT INTO `orders` SET `ClientOrderNumber` = '', `UserID` = 1030, `TotalPrice` = 0, `TotalWeight` = 0, `DeliveryPrice` = 0, `Currency` = 'EUR', `DeliveryData` = 'FrOWNrL1YFuW4YY1ujzm8AHxHawWknJQRI2flW0HQ4jDIRDvHQFPKtHW2H5a4CIl0vJCMxcO8JVYg5B1wGeQaT43kIdADTPWEEGmiwtS2ZTXvjM7jAZsbA4C1jZx__YvYZSc7NhOjLPBVLOYoU26_6BObNBBp4w4zWSdkXBD-VJnALGyBPTSksF2BCkTRzTLaT3zJv5-vVq-hxqaroAUTB4OrlWvu2sg5k223jMrkn1-cJLBIjgd-x8i2Litb9pmayuOlZxRcfuqerimL58IhIwvCjRsZtgkmTWKF4TUjKe5dhyqQdhmIWwX_GPy2xiG_O21eSqjaQiT4eMq6Sx10awqftHUM2ZyZukjppw093TIp8XiY4aKficKBHqlCPQOe6pabUTAG-jPVlWY1h0MMwC-8Z68QFaULIo1qe1jjUI', `InvoiceData` = NULL, `SearchKey` = 'wqfCgX3ChcOswoLCmWrCp8K8esK7w6jCiMKow65mwpDCwqfCgcKawoXDq8KYwplhwqfDicKHwrvDpsKIwqjCq2bCkMKcwrjDgMw5nCosK2wqbDmWbDjsKcw5zDhcKFw57DjMKnw43DpcKZwrHCisOewq7ClsK1w6HCvsKkwo3Dw4R5wrFnw4Z4wqtlw4XDhMKMw6HDgc', `LastUpdate` = '2024-10-25 08:31:27', `PostDate` = '2024-10-25 08:31:27', `Status` = 0, `IAgree` = 0

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 94 AND `UserID` = 1030 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                `URLLabel`
            FROM
                `pages`
            WHERE
                `Rules` = 'terms' AND
                `Language` = 'bg'
         AND `Visible` = 1 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 94 AND `UserID` = 1030 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `TotalPrice` = 29.5,
                    `TotalWeight` = 4,
                    `DeliveryPrice` = 9.3,
                    `CurrencyPrice` = '€ 38.80',
                    `CurrencyExchange` = 1.95583,
                    `AccessKey` = 'hhOhVk8E2LXt6AW4xEJRRoYGJ17WdD9IHR6B8MTnJFIhKNhYJC8NG4H1bM26WPR0'
                WHERE
                    `ID` = 94 AND
                    `UserID` = 1030 AND
                    `Status` = 0
                LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 94 AND `AccessKey` = 'hhOhVk8E2LXt6AW4xEJRRoYGJ17WdD9IHR6B8MTnJFIhKNhYJC8NG4H1bM26WPR0' LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Status` = `Status` | 1
                WHERE
                    `ID` = 94
                LIMIT 1

SELECT `Data` FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Basket` = '{"1854":{"qty":1,"price":"29.5","note":"","number":"D6RA62, D6RA32, D6RA249"}}'
                WHERE
                    `ID` = 94 AND
                    `UserID` = 1030
                LIMIT 1

DELETE FROM `basket` WHERE `UserID` = 1030

SELECT * FROM `orders` WHERE `ID` = 94 LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                `parts`.*,
                `part-texts`.*,
                `ParentGroup`.`Title` AS `ParentGroupName`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`Title` AS `SubGroupName`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `availabilities`.`Quantity`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'bg'
                LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
            WHERE
                `parts`.`ID` = 1854 AND
                `part-texts`.`Language` = 'bg'
            LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT SUM(`Quantity`) AS Quantity FROM `recepta`.`quantities` WHERE `RefNumber` = 'IR8005'

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 94 AND `UserID` = 1030 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    *
                FROM
                    `groups`
                WHERE
                    `URLLabel` = 'starters' AND
                    `Language` = 'bg' AND
                    `Visible` = 1
                LIMIT 1

SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'bg'
                 AND `parts`.`Visible` = 1
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
         LIMIT 0, 12

SELECT COUNT(*) AS NumRows FROM (
            SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'bg'
                 AND `parts`.`Visible` = 1
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
        ) AS CountTable

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'starters' AND
                `Language` = 'bg' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1852

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1854

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8005' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142427

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8006R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142250

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8038R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1888

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148241

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 120023

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8064' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8072RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1932

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8083' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2190

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8341' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8374' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 139384

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8374V' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `MinQuantity` FROM `parts` WHERE `ID` = 1854

INSERT INTO  `basket`
                        (`UserID`, `PostDate`, `UpdateDate`, `Basket`, `Num`) VALUES
                        (1030, NOW(), NOW(), '{"1854":{"qty":1,"price":0,"note":"","number":"D6RA62, D6RA32, D6RA249"}}', 1)

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT `ID` FROM `orders` WHERE `UserID` = 1030 AND `Status` = 0 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `MinQuantity` FROM `parts` WHERE `ID` = 1854

UPDATE
                            `basket`
                        SET
                            `UpdateDate` = NOW(),
                            `Basket` = '{"1854":{"qty":2,"price":0,"note":"","number":"D6RA62, D6RA32, D6RA249"}}',
                            `Num` = 2
                        WHERE
                            `UserID` = 1030 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT `ID` FROM `orders` WHERE `UserID` = 1030 AND `Status` = 0 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT `UserKey`, `Data` FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                `URLLabel`
            FROM
                `pages`
            WHERE
                `Rules` = 'gdpr' AND
                `Language` = 'bg'
         AND `Visible` = 1 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `UserKey`, `Data` FROM `users` WHERE `ID` = 1030 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `MinQuantity` FROM `parts` WHERE `ID` = 1854

UPDATE
                            `basket`
                        SET
                            `UpdateDate` = NOW(),
                            `Basket` = '{"1854":{"qty":2,"price":"29.5","note":"","number":"D6RA62, D6RA32, D6RA249"}}',
                            `Num` = 2
                        WHERE
                            `UserID` = 1030 LIMIT 1

SELECT * FROM `orders` LIMIT 1

SHOW COLUMNS FROM `orders`

INSERT INTO `orders` SET `ClientOrderNumber` = '', `UserID` = 1030, `TotalPrice` = 0, `TotalWeight` = 0, `DeliveryPrice` = 0, `Currency` = 'EUR', `DeliveryData` = 'DJG3W9ZHJCnbdn2tGSCCzpiA3jkswrFtrbeOiNxMeJgfsSBP9jJtBgaVk3h6ypVSujTGcBru9C9BocghzikT0oT5lQv0tymQvKfx5-YJHQ8pzBaB3t__hshwEm3co7uRwMqK-PjZrqeIrMNeaRgGhzJYDjnp4ntY6LcWOdvmXu0GSKu3Fq4IUOlH0E4UTaX0ZRd3ESIKEdiLBoBtK3aXzjWoJBzq5obw9moYslDjkQ4MPYTY3WPvONEgBE62rEpsWVM2PzjSuEVmrJ639ZUbKKbi2LZYf9_k3vNLcZTQf_j_3btTFMxc5LBa8j0z6vw7Y3xMi8E-MFTN4ol0BoOxRRSE8joALUYnNsbQ2GghLsoyi8zhz6nqV-4WGLWm2uEEpHjgXpcGaG9S2CCuTSsLEqfqcGwbjOvH35w977hGgmk', `InvoiceData` = NULL, `SearchKey` = 'wqfCgX3ChcOswoLCmWrCp8K8esK7w6jCiMKow65mwpDCwqfCgcKawoXDq8KYwplhwqfDicKHwrvDpsKIwqjCq2bCkMKcwrjDgMw5nCosK2wqbDmWbDjsKcw5zDhcKFw57DjMKnw43DpcKZwrHCisOewq7ClsK1w6HCvsKkwo3Dw4R5wrFnw4Z4wqtlw4XDhMKMw6HDgc', `LastUpdate` = '2024-10-25 08:50:19', `PostDate` = '2024-10-25 08:50:19', `Status` = 0, `IAgree` = 0

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 95 AND `UserID` = 1030 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                `URLLabel`
            FROM
                `pages`
            WHERE
                `Rules` = 'terms' AND
                `Language` = 'bg'
         AND `Visible` = 1 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 95 AND `UserID` = 1030 LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `TotalPrice` = 59,
                    `TotalWeight` = 8,
                    `DeliveryPrice` = 10.05,
                    `CurrencyPrice` = '€ 69.05',
                    `CurrencyExchange` = 1.95583,
                    `AccessKey` = '5II4pT1MzfXF7PlLMSJPxsGIsdrfAOnqXNM9xZMTOCEwAL5PL9EhGz2VrTRZYW4e'
                WHERE
                    `ID` = 95 AND
                    `UserID` = 1030 AND
                    `Status` = 0
                LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 95 AND `AccessKey` = '5II4pT1MzfXF7PlLMSJPxsGIsdrfAOnqXNM9xZMTOCEwAL5PL9EhGz2VrTRZYW4e' LIMIT 1

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Status` = `Status` | 1
                WHERE
                    `ID` = 95
                LIMIT 1

SELECT `Data` FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030

UPDATE
                    `orders`
                SET
                    `LastUpdate` = NOW(),
                    `Basket` = '{"1854":{"qty":2,"price":"29.5","note":"","number":"D6RA62, D6RA32, D6RA249"}}'
                WHERE
                    `ID` = 95 AND
                    `UserID` = 1030
                LIMIT 1

DELETE FROM `basket` WHERE `UserID` = 1030

SELECT * FROM `orders` WHERE `ID` = 95 LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 95 AND `UserID` = 1030 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `orders` WHERE `ID` = 95 AND `UserID` = 1030 LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 1030 LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    *
                FROM
                    `groups`
                WHERE
                    `URLLabel` = 'starters' AND
                    `Language` = 'bg' AND
                    `Visible` = 1
                LIMIT 1

SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'bg'
                 AND `parts`.`Visible` = 1
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
         LIMIT 0, 12

SELECT COUNT(*) AS NumRows FROM (
            SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'bg'
                 AND `parts`.`Visible` = 1
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
        ) AS CountTable

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'starters' AND
                `Language` = 'bg' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1852

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1854

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8005' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142427

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8006R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142250

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8038R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1888

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148241

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 120023

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8064' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8072RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1932

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8083' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2190

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8341' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8374' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 139384

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8374V' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

