== Descripción ==
== Biblioteca ==
== Composición ==
== Código ==
<small><pre>
</pre></small>
== Bitácora ==
*20120409
**Alta para [[FORM:Presupuesto.v1.0]]
<small><pre>
delimiter $$

CREATE PROCEDURE `CopiaPresupuesto` (IN pVidQuoteID INT(5))

BEGIN

INSERT INTO vidquoten1 (
`VidQuoteID`,
`VidQuoteObra`,
`VidQuoteCliente`,
`VidQuoteFecha`,
`VidQuoteValidez`,
`VidQuoteFechaEst`,
`VidQuoteEstado`,
`VidQuoteACom`)
SELECT
NULL,
`vidquoten1`.`VidQuoteObra`,
`vidquoten1`.`VidQuoteCliente`,
`vidquoten1`.`VidQuoteFecha`,
`vidquoten1`.`VidQuoteValidez`,
`vidquoten1`.`VidQuoteFechaEst`,
`vidquoten1`.`VidQuoteEstado`,
`vidquoten1`.`VidQuoteACom`
FROM `fzggestion`.`vidquoten1`
WHERE `vidquoten1`.`VidQuoteID`= pVidQuoteID;

SET @npr = LAST_INSERT_ID();

INSERT INTO `fzggestion`.`vidquoten2`
(`VidQuoteID`,
`VidQuoteLPre`,
`VidQuoteItem`,
`VidQuoteProdID`,
`VidQuoteProdCantidad`,
`VidQuoteAncho`,
`VidQuoteAlto`,
`VidQuotePrecio`,
`VidQuoteDetalle`)
SELECT
@npr,
`vidquoten2`.`VidQuoteLPre`,
`vidquoten2`.`VidQuoteItem`,
`vidquoten2`.`VidQuoteProdID`,
`vidquoten2`.`VidQuoteProdCantidad`,
`vidquoten2`.`VidQuoteAncho`,
`vidquoten2`.`VidQuoteAlto`,
`vidquoten2`.`VidQuotePrecio`,
`vidquoten2`.`VidQuoteDetalle`
FROM `fzggestion`.`vidquoten2`
WHERE `vidquoten2`.`VidQuoteID`= pVidQuoteID;

INSERT INTO `fzggestion`.`vidquoten3`
(`VidQuoteID`,
`VidQuoteLPre`,
`VidQuoteItem`,
`VidQuoteProdID`,
`VidQuoteProdCantidad`,
`VidQuoteAncho`,
`VidQuoteAlto`,
`VidQuoteElementoID`,
`VidQuotePrecio`,
`VidQuotePrecioP`,
`VidQuoteIncluyeDet`)
SELECT
@npr,
`vidquoten3`.`VidQuoteLPre`,
`vidquoten3`.`VidQuoteItem`,
`vidquoten3`.`VidQuoteProdID`,
`vidquoten3`.`VidQuoteProdCantidad`,
`vidquoten3`.`VidQuoteAncho`,
`vidquoten3`.`VidQuoteAlto`,
`vidquoten3`.`VidQuoteElementoID`,
`vidquoten3`.`VidQuotePrecio`,
`vidquoten3`.`VidQuotePrecioP`,
`vidquoten3`.`VidQuoteIncluyeDet`
FROM `fzggestion`.`vidquoten3`
WHERE `vidquoten3`.`VidQuoteID`= pVidQuoteID;

INSERT INTO `fzggestion`.`vidquoten4`
(`VidQuoteID`,
`VidQuoteItem`,
`VidQuoteProdID`,
`VidQuoteElementoID`,
`VidQuoteValorID`,
`VidQuoteVTipo`,
`VidQuoteVNecesario`,
`VidQuoteVEntero`,
`VidQuoteVDecimal`,
`VidQuoteVTexto`)
SELECT
@npr,
`vidquoten4`.`VidQuoteItem`,
`vidquoten4`.`VidQuoteProdID`,
`vidquoten4`.`VidQuoteElementoID`,
`vidquoten4`.`VidQuoteValorID`,
`vidquoten4`.`VidQuoteVTipo`,
`vidquoten4`.`VidQuoteVNecesario`,
`vidquoten4`.`VidQuoteVEntero`,
`vidquoten4`.`VidQuoteVDecimal`,
`vidquoten4`.`VidQuoteVTexto`
FROM `fzggestion`.`vidquoten4`
WHERE `vidquoten4`.`VidQuoteID`= pVidQuoteID;
END$$
</pre></small>
== Uso ==
*[[FORM:Presupuesto]]
*[[MACRO:PresupuestoCopia]]