== Descripción ==
Vista Transacciones de CRM
== Composición ==
== Estructura ==
<pre>
</pre>
== SQL ==
<pre>
CREATE VIEW `fzggestion`.`vistranscrm` AS
(
SELECT DISTINCT
    T1.VidQuoteCliente AS VidQuoteCliente,
    'QT' AS TTransaccion,
    T2.VidQuoteID AS NTransaccion,
    T1.VidQuoteObra AS VidQuoteObra,
    T1.VidQuoteFecha AS VidQuoteFecha,
    T1.VidQuoteEstado AS VidQuoteEstado,
    SUM(T2.VidQuotePrecioP) * - 1 AS VidQuotePrecioP
FROM
    vidquoten1 AS T1,
    vidquoten3 AS T2
WHERE
    T1.VidQuoteEstado = '1' AND T1.VidQuoteID = T2.VidQuoteID
GROUP BY T2.VidQuoteID
ORDER BY VidQuoteCliente ASC , VidQuoteID ASC)
UNION
(SELECT 
    T3.ClienteAR AS VidQuoteCliente,
    T3.TTransaccion AS TTransaccion,
    T3.NTransaccion as NTransaccion,
    ' ' AS VidQuoteObra,
    T3.FechaAR AS VidQuoteFecha,
    '1' AS VidQuoteEstado,
    T3.ImporteAR AS VidQuotePrecioP
FROM
    accreceiv AS T3
)
ORDER BY VidQuoteCliente
</pre>
== Bitácora ==
== Uso ==
*[[FORM:ConsultaClientesCRM]]
== URL ==