SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE  [dbo].[paQrytm_PreCuotasSim] @pmtmNumero VARCHAR(5)
AS
SELECT tmItem,tmItemPre,tmCuota,tmConcepto,tmFecCausa,tmFecVence,tmVrTotal,tmTipoTasa,tmDTF_EA,tmTasaNom,tmSpread,tmTasaEfe,tmDiasLiq
,tmDetalle,tmLinCred,L.LinCredito,L.PuntosTI,tmIdCliente,N.RazonSocial AS NomCliente,tmIdAgencia,NomAgencia AS Agencia,tmIdVend,V.RazonSocial AS NomVendedor
,tmVrIntCorr,tmTotAbono,tmVrSaldo,tmVrAcumCap,tmVrSeguro,tmVrProrroga,tmVrCustodia,tmTasaCustod,tmNitConv,tmTarifIva,tmVrIva,tmTarifRet,tmVrRet
,tmPMInicio,tmPMFinal,tmPMDias,tmPMValorInt
 FROM tm_PreCuotas AS T LEFT JOIN Terceros AS N ON T.tmIdCliente=N.IdTercero
 LEFT JOIN Terceros AS V ON T.tmIdVend=V.IdTercero
 LEFT JOIN TercCliePrestamo AS A ON T.tmIdCliente=A.IdClie AND T.tmIdAgencia=A.IdAgencia
 LEFT JOIN LineasCred AS L ON T.tmLinCred=L.IdLinea
 WHERE tmNumero=@pmtmNumero
 
