alter view vBluesealProductList as SELECT
                                     concat(`p`.`id`, '-', `pv`.`id`)                                                                      AS `code`,
                                     `p`.`id`                                                                                              AS `id`,
                                     `p`.`productVariantId`                                                                                AS `productVariantId`,
                                     concat(`pse`.`name`, ' ', `pse`.`year`)                                                               AS `season`,
                                     `pse`.`isActive`                                                                                      AS `isActive`,
                                     concat(`p`.`itemno`, ' # ', `pv`.`name`)                                                              AS `cpf`,
                                     `s`.`name`                                                                                            AS `shop`,
                                     concat(ifnull(`p`.`externalId`, ''), '-', ifnull(`dp`.`extId`, ''), '-', ifnull(`ds`.`extSkuId`, '')) AS `externalId`,
                                     `p`.`externalId`                                                                                      AS `a`,
                                     `dp`.`extId`                                                                                          AS `b`,
                                     `ds`.`extSkuId`                                                                                       AS `c`,
                                     `pb`.`name`                                                                                           AS `brand`,
                                     `ps`.`name`                                                                                           AS `status`,
                                     `p`.`creationDate`                                                                                    AS `creationDate`,
                                     `s`.`id`                                                                                              AS `shopId`,
                                     `t`.`slug`                                                                                            AS `tag`,
                                     `pc`.`slug`                                                                                           AS `slug`,
                                     `pcg`.`name`                                                                                          AS `colorGroup`,
                                     cast(`psk`.`isOnSale` AS CHAR CHARSET utf8)                                                           AS `isOnSale`,
                                     if((`psk`.`isOnSale` = 1), `psk`.`price`,
                                        `psk`.`salePrice`)                                                                                 AS `currentPrice`,
                                     if((`pse`.`isActive` = 0), `s`.`pastSeasonMultiplier`,
                                        if((`psk`.`isOnSale` = 1), `s`.`saleMultiplier`, `s`.`currentSeasonMultiplier`))                   AS `multiplier`,
                                     (`psk`.`value` + ((`psk`.`value` * if((`pse`.`isActive` = 0), `s`.`pastSeasonMultiplier`,
                                                                           if((`psk`.`isOnSale` = 1), `s`.`saleMultiplier`,
                                                                              `s`.`currentSeasonMultiplier`))) /
                                                       100))                                                                               AS `friendRevenue`,
                                     ((((if((`psk`.`isOnSale` = 1), `psk`.`price`, `psk`.`salePrice`) / 1.22) - (`psk`.`value` + ((`psk`.`value` * if(
                                         (`pse`.`isActive` = 0), `s`.`pastSeasonMultiplier`,
                                         if((`psk`.`isOnSale` = 1), `s`.`saleMultiplier`, `s`.`currentSeasonMultiplier`))) / 100))) /
                                       (if((`psk`.`isOnSale` = 1), `psk`.`price`, `psk`.`salePrice`) / 1.22)) * 100)                       AS `mup`,
                                     if(((SELECT sum(`psk`.`stockQty`) AS `summ`
                                          FROM `ProductSku` `psk`
                                          WHERE ((`psk`.`productId` = `p`.`id`) AND (`psk`.`productVariantId` = `p`.`productVariantId`))) > 0), 'sì',
                                        'no')                                                                                              AS `available`
                                   FROM ((((((((((((((`Product` `p`
                                     JOIN `ProductVariant` `pv` ON ((`p`.`productVariantId` = `pv`.`id`)))
                                     JOIN `ProductBrand` `pb` ON ((`p`.`productBrandId` = `pb`.`id`)))
                                     JOIN `ProductStatus` `ps` ON ((`ps`.`id` = `p`.`productStatusId`)))
                                     JOIN `ShopHasProduct` `sp` ON (((`p`.`id` = `sp`.`productId`) AND (`p`.`productVariantId` = `sp`.`productVariantId`))))
                                     JOIN `Shop` `s` ON ((`s`.`id` = `sp`.`shopId`)))
                                     LEFT JOIN `ProductSeason` `pse` ON ((`p`.`productSeasonId` = `pse`.`id`))
                                     LEFT JOIN `ProductSku` `psk` ON (((`p`.`id` = `psk`.`productId`) AND (`p`.`productVariantId` = `psk`.`productVariantId`))))
                                     LEFT JOIN `ProductHasProductCategory` `ppc` ON (((`p`.`id` = `ppc`.`productId`) AND (`p`.`productVariantId` = `ppc`.`productVariantId`))))
                                     LEFT JOIN  `ProductCategory` `pc` ON ((`ppc`.`productCategoryId` = `pc`.`id`)))
                                     LEFT JOIN `ProductHasTag` `pht`ON (((`pht`.`productId` = `p`.`id`) AND (`pht`.`productVariantId` = `p`.`productVariantId`))))
                                     LEFT JOIN `Tag` `t` ON ((`pht`.`tagId` = `t`.`id`)))
                                     LEFT JOIN `ProductHasProductColorGroup` `phcg` ON (((`phcg`.`productId` = `p`.`id`) AND (`phcg`.`productVariantId` = `p`.`productVariantId`))))
                                     LEFT JOIN `ProductColorGroup` `pcg` ON ((`phcg`.`productColorGroupId` = `pcg`.`id`)))
                                     LEFT JOIN `DirtyProduct` `dp` ON (((`sp`.`productId` = `dp`.`productId`) AND (`sp`.`productVariantId` = `dp`.`productVariantId`) AND (`sp`.`shopId` = `dp`.`shopId`))))
                                     LEFT JOIN `DirtySku` `ds` ON ((`dp`.`id` = `ds`.`dirtyProductId`)))
                                   WHERE (`pcg`.`langId` = 1)