ALTER VIEW `vBluesealCatalogMovements` AS SELECT
                                            `sho`.`id`                                        AS `id`,
                                            `sho`.`storehouseId`                              AS `storehouseId`,
                                            `sho`.`shopId`                                    AS `shopId`,
                                            `s`.`name`                                        AS `shop`,
                                            `sho`.`creationDate`                              AS `creationDate`,
                                            `sho`.`operationDate`                             AS `operationDate`,
                                            `s`.`title`                                       AS `friend`,
                                            `shoc`.`name`                                     AS `cause`,
                                            group_concat(concat_ws('-', `shol`.`productId`, `shol`.`productVariantId`,
                                                                   `shol`.`productSizeId`))   AS code,
                                            group_concat(concat_ws(' # ', p.itemno, pv.name)) AS cpf,
                                            sum(ps.value)                                     AS value,
                                            sum(ps.price)                                     AS price,
                                            sum(shol.qty)                                     AS qty
                                          FROM Shop s,
                                            Storehouse sh,
                                            StorehouseOperation sho,
                                            StorehouseOperationCause shoc,
                                            StorehouseOperationLine shol,
                                            ProductSku ps,
                                            Product p,
                                            ProductVariant pv
                                          WHERE
                                            s.id = sh.shopId AND
                                            sh.id = sho.storehouseId AND
                                            sh.shopId = sho.shopId AND
                                            sho.storehouseOperationCauseId = shoc.id AND
                                            sho.id = shol.storehouseOperationId AND
                                            sho.shopId = shol.shopId AND
                                            sho.storehouseId = shol.storehouseId AND
                                            shol.productId = ps.productId AND
                                            shol.productVariantId = ps.productVariantId AND
                                            shol.productSizeId = ps.productSizeId AND
                                            shol.shopId = ps.shopId AND
                                            p.id = ps.productId AND
                                            p.productVariantId = ps.productVariantId AND
                                            p.productVariantId = pv.id
                                          GROUP BY s.id, sh.id, sho.id
