U
    i                     @   s   d dl mZ dd ZdS )    )get_connectionbdproductivoc               
   C   s   d} zz@t }|std| }||  | }dd |D W W BS  tk
r } ztd|  g  W Y W S d}~X Y nX W 5 |r|   X dS )z,Obtiene los Breakers desde la base de datos.u%  
    SELECT 
           isnull (DES_Reporte_financiero_Cont.ContractNum, '')as ContractNum,
    isnull (DES_Reporte_financiero_Cont.EntryDate, '')as EntryDate,
    isnull (DES_Reporte_financiero_Cont.EntryPerson, '')as EntryPerson,
    isnull (DES_Reporte_financiero_Cont.Folio, '')as Folio,
    isnull (DES_Reporte_financiero_Cont.ContractCode, '')as ContractCode,
    isnull (DES_Reporte_financiero_Cont.Division, '')as Division,
    isnull (DES_Reporte_financiero_Cont.Clasificación, '')as Clasificación,
    isnull (DES_Reporte_financiero_Cont.Departamento, '')as Departamento,
    isnull (DES_Reporte_financiero_Cont.DepartamentClass, '')as DepartamentClass,
    isnull (DES_Reporte_financiero_Cont.ContractDescription, '')as ContractDescription,
    isnull (DES_Reporte_financiero_Cont.CustNum, '')as CustNum,
    isnull (DES_Reporte_financiero_Cont.CustID, '')as CustID,
    isnull (DES_Reporte_financiero_Cont.Cliente, '')as Cliente,
    isnull (DES_Reporte_financiero_Cont.Importe, '')as Importe,
    isnull (DES_Reporte_financiero_Cont.ImporteMXN, '')as ImporteMXN,
    isnull (DES_Reporte_financiero_Cont.CurrencyCode, '')as CurrencyCode,
    isnull (DES_Reporte_financiero_Cont.ExchangeRate, '')as ExchangeRate,
    isnull (DES_Reporte_financiero_Cont.Duration, '')as Duration,
    isnull (DES_Reporte_financiero_Cont.Modifier, '')as Modifier,
    isnull (DES_Reporte_financiero_Cont.ActiveDate, '')as ActiveDate,
    isnull (DES_Reporte_financiero_Cont.ExpireDate, '')as ExpireDate,
    isnull (DES_Reporte_financiero_Cont.ContractComment, '')as ContractComment,
    isnull (DES_Reporte_financiero_Cont.InvoiceComment, '')as InvoiceComment,
    isnull (DES_Reporte_financiero_Cont.TipoDeContrato, '')as TipoDeContrato,
    isnull (DES_Reporte_financiero_Cont.Facturado, '')as Facturado,
    isnull (DES_Reporte_financiero_Cont.FacturadoIVA, '')as FacturadoIVA,
    isnull (DES_Reporte_financiero_Cont.FacturadoIVAMXN, '')as FacturadoIVAMXN,
    isnull (DES_Reporte_financiero_Cont.ListaDeFacturas, '')as ListaDeFacturas

    FROM
        DES_Reporte_financiero_Cont
    u4   No se pudo establecer conexión con la base de datosc                 S   s   g | ]}|d  |d |d |d |d |d |d |d |d |d	 |d
 |d |d |d |d |d |d |d |d |d |d |d |d |d |d |d |d |d dqS )r                           	   
                                                      )ContractNum	EntryDateEntryPersonFolioContractCodeDivisionu   ClasificaciónDepartamentoZDepartamentClassContractDescriptionCustNumCustIDClienteImporte
ImporteMXNCurrencyCodeExchangeRateDurationModifier
ActiveDate
ExpireDateContractCommentInvoiceCommentTipoDeContrato	FacturadoFacturadoIVAFacturadoIVAMXNListaDeFacturas ).0rowr8   r8   C:\Users\victor.barrera\Documents\proyectos\elepV3\Elep\src\Consultas_SQL\SupYCtrol\GerenteSyC\GSYCReporte_financiero_ContratosSQL.py
<listcomp>3   s<   z get_Consulta.<locals>.<listcomp>z.[Error inesperado] Error obteniendo breakers: N)closer   ConnectionErrorcursorexecutefetchall	Exceptionprint)queryconnr?   resultser8   r8   r;   get_Consulta   s     "
"rH   N)Consultas_SQL.conexionr   rH   r8   r8   r8   r;   <module>   s   