[[Category:PROC]]
== Descripción ==
Copia Módulo Boceto
== Biblioteca ==

== Composición ==
== Código ==
<small><pre>
DELIMITER $$

CREATE DEFINER=`sas_admin`@`%` PROCEDURE `CopiaModuloBoceto`(IN pModuloID CHAR(8),IN pBocetoID CHAR(8), IN pBocetoDSC VARCHAR(50))
BEGIN
    -- ------------------------------------------------------
    -- Insert from moduloscab into bocetoscab
    -- ------------------------------------------------------
--     CALL DebugCheckPoint(
--         CONCAT(
--         "PROC:CopiaModuloBoceto","/VAR/",
--         pModuloID,"-",
--         pBocetoID,"-",
--         pBocetoDSC
--         ));
    DELETE FROM bocetoscab WHERE BocetoID=pBocetoID;
    DELETE FROM bocetosdet WHERE BocetoID=pBocetoID;
    INSERT INTO bocetoscab (
        `BocetoID`,
        `ModuloID`,
        `BocetoDSC`,
        `BocetoVW`,
        `BocetoVH`,
        `BocetoIMG`,
        `BocetoATH`,
        `BocetoFec`)
    SELECT
        pBocetoID,
        pModuloID,
        pBocetoDSC,
        `moduloscab`.`ModuloVW`,
        `moduloscab`.`ModuloVH`,
        `moduloscab`.`ModuloIMG`,
        `moduloscab`.`ModuloATH`,
        CURDATE()
    FROM
        `fzggestion`.`moduloscab`
    WHERE 
        `moduloscab`.`ModuloID` = pModuloID;
    -- ------------------------------------------------------
    -- Insert from modulosdet into bocetosdet
    -- ------------------------------------------------------
    INSERT INTO `fzggestion`.`bocetosdet` (
        `BocetoID`,
        `ProductoID`,
        `ComposicID`,
        `CantidadPR`,
        `AnchoPredef`,
        `AltoPredef`,
        `DimensionChg`,
        `CantidadChg`,
        `ProductoChg`,
        `SubSetAncho`,
        `SubSetAlto`,
        `ProductoVsb`,
        `PosX`,
        `PosY`)
    SELECT
        pBocetoID,
        `modulosdet`.`ProductoID`,
        `modulosdet`.`ComposicID`,
        `modulosdet`.`CantidadPR`,
        `modulosdet`.`AnchoPredef`,
        `modulosdet`.`AltoPredef`,
        `modulosdet`.`DimensionChg`,
        `modulosdet`.`CantidadChg`,
        `modulosdet`.`ProductoChg`,
        `modulosdet`.`SubSetAncho`,
        `modulosdet`.`SubSetAlto`,
        `modulosdet`.`ProductoVsb`,
        `modulosdet`.`PosX`,
        `modulosdet`.`PosY`
    FROM
        `fzggestion`.`modulosdet`
    WHERE
        `modulosdet`.`ModuloID` = pModuloID;
END
</pre></small>

== Bitácora ==
== Uso ==