a
    §0ia6  ã                   @   s   d dl mZ dd„ ZdS )é    )Úget_connectionTEST101c               
   C   s¸   d} z zJt ƒ }|stdƒ‚| ¡ }| | ¡ | ¡ }dd„ |D ƒW W |rP| ¡  S  ty” } z,td|› ƒ g W  Y d}~W |rŠ| ¡  S d}~0 0 W |r´| ¡  n|r²| ¡  0 dS )z,Obtiene los Breakers desde la base de datos.u0  
     SELECT
        isnull (ScoreV2temp.OrderNum, '')as OrderNum,
        isnull (ScoreV2temp.Departamento, '')as Departamento,
        isnull (ScoreV2temp.Vendedor, '')as Vendedor,
        isnull (ScoreV2temp.Name, '')as Name,
        isnull (ScoreV2temp.TotalLines, '')as TotalLines,
        isnull (ScoreV2temp.OrderLine, '')as OrderLine,
        isnull (ScoreV2temp.PartNum, '')as PartNum,
        isnull (ScoreV2temp.LineDesc, '')as LineDesc,
        isnull (ScoreV2temp.Capacidad, '')as Capacidad,
        isnull (ScoreV2temp.Voltaje, '')as Voltaje,
        isnull (ScoreV2temp.Tipo, '')as Tipo,
        isnull (ScoreV2temp.RevisionNum, '')as RevisionNum,
        isnull (ScoreV2temp.ProdCode, '')as ProdCode,
        isnull (ScoreV2temp.DecriptionProd, '')as DecriptionProd,
        isnull (ScoreV2temp.Caseta, '')as Caseta,
        isnull (ScoreV2temp.Tanque, '')as Tanque,
        isnull (ScoreV2temp.OrderDate, '')as OrderDate,
        isnull (ScoreV2temp.NeedByDate, '')as NeedByDate,
        isnull (ScoreV2temp.LiberacionCXP, '')as LiberacionCXP,
        isnull (ScoreV2temp.[OrderNum&Line], '')as [OrderNum&Line],
        isnull (ScoreV2temp.ProjectID, '')as ProjectID,
        isnull (ScoreV2temp.JobNum2, '')as JobNum2,
        isnull (ScoreV2temp.Revision_OV, '')as Revision_OV,
        isnull (ScoreV2temp.Revision_Project, '')as Revision_Project,
        isnull (ScoreV2temp.Revision_Job, '')as Revision_Job,
        isnull (ScoreV2temp.FechaVentas, '')as FechaVentas,
        isnull (ScoreV2temp.ComentarioSyC, '')as ComentarioSyC,
        isnull (ScoreV2temp.Chk, '')as Chk,
        isnull (ScoreV2temp.FechaSyC, '')as FechaSyC,
        isnull (ScoreV2temp.FechaSimulaciones, '')as FechaSimulaciones,
        isnull (ScoreV2temp.ConsideradaPreasignacion, '')as ConsideradaPreasignacion,
        isnull (ScoreV2temp.ConsideradaMateriales, '')as ConsideradaMateriales,
        isnull (ScoreV2temp.FechaProducciÃ³n, '')as FechaProducciÃ³n,
        isnull (ScoreV2temp.ComentarioProducciÃ³n, '')as ComentarioProducciÃ³n,
        isnull (ScoreV2temp.AvanceProducciÃ³n, '')as AvanceProducciÃ³n,
        isnull (ScoreV2temp.FechaPlaneaciÃ³n, '')as FechaPlaneaciÃ³n,
        isnull (ScoreV2temp.EstadoFecha, '')as EstadoFecha,
        isnull (ScoreV2temp.ComentarioPlaneaciÃ³n, '')as ComentarioPlaneaciÃ³n,
        isnull (ScoreV2temp.FechaMG, '')as FechaMG,
        isnull (ScoreV2temp.FechaMat, '')as FechaMat,
        isnull (ScoreV2temp.AvanceDeSurtimiento, '')as AvanceDeSurtimiento,
        isnull (ScoreV2temp.MaterialSinSurtir, '')as MaterialSinSurtir,
        isnull (ScoreV2temp.AvisoDeTerminacion, '')as AvisoDeTerminacion,
        isnull (ScoreV2temp.TerminadoConFaltante, '')as TerminadoConFaltante,
        isnull (ScoreV2temp.FechaActualizaciÃ³n, '')as FechaActualizaciÃ³n,
        isnull (ScoreV2temp.MaterialFaltante, '')as MaterialFaltante,
        isnull (ScoreV2temp.ValidaciÃ³nFisica, '')as ValidaciÃ³nFisica,
        isnull (ScoreV2temp.ResultadoValidaciÃ³n, '')as ResultadoValidaciÃ³n,
        isnull (ScoreV2temp.FechaDeCierre, '')as FechaDeCierre,
        isnull (ScoreV2temp.ComentarioCalidad, '')as ComentarioCalidad,
        isnull (ScoreV2temp.InsumosDemandados, '')as InsumosDemandados,
        isnull (ScoreV2temp.InsumosEmitidos, '')as InsumosEmitidos,
        isnull (ScoreV2temp.AvaceDeEmisiones, '')as AvaceDeEmisiones,
        isnull (ScoreV2temp.FechaDeTermino, '')as FechaDeTermino,
        isnull (ScoreV2temp.AvanceManufacturaSyC, '')as AvanceManufacturaSyC,
        isnull (ScoreV2temp.AvanceEnsambleSyC, '')as AvanceEnsambleSyC,
        isnull (ScoreV2temp.ComentarioSupervisiÃ³n, '')as ComentarioSupervisiÃ³n,
        isnull (ScoreV2temp.EnFilaPruebasSyC, '')as EnFilaPruebasSyC,
        isnull (ScoreV2temp.PendientesCalidSyC, '')as PendientesCalidSyC,
        isnull (ScoreV2temp.PartNum_M, '')as PartNum_M,
        isnull (ScoreV2temp.Description_M, '')as Description_M,
        isnull (ScoreV2temp.PartClass_M, '')as PartClass_M,
        isnull (ScoreV2temp.RefCategory_M, '')as RefCategory_M,
        isnull (ScoreV2temp.QtyPer_M, '')as QtyPer_M,
        isnull (ScoreV2temp.IssuedQty_M, '')as IssuedQty_M,
        isnull (ScoreV2temp.Demandado_M, '')as Demandado_M,
        isnull (ScoreV2temp.OnhandQty_M, '')as OnhandQty_M,
        isnull (ScoreV2temp.Preasignado_M, '')as Preasignado_M,
        isnull (ScoreV2temp.NoSerie_M, '')as NoSerie_M,
        isnull (ScoreV2temp.Faltante_M, '')as Faltante_M,
        isnull (ScoreV2temp.En_PO_M, '')as En_PO_M,
        isnull (ScoreV2temp.NoPO_M, '')as NoPO_M,
        isnull (ScoreV2temp.EnRequisicion_M, '')as EnRequisicion_M,
        isnull (ScoreV2temp.NoRequisicion_M, '')as NoRequisicion_M,
        isnull (ScoreV2temp.Alternativa_M, '')as Alternativa_M,
        isnull (ScoreV2temp.En_PO_Altern_M, '')as En_PO_Altern_M,
        isnull (ScoreV2temp.NoPO_Alern_M, '')as NoPO_Alern_M,
        isnull (ScoreV2temp.Req_M, '')as Req_M,
        isnull (ScoreV2temp.Comment_M, '')as Comment_M,
        isnull (ScoreV2temp.FechaReq_M, '')as FechaReq_M,
        isnull (ScoreV2temp.PO_M, '')as PO_M,
        isnull (ScoreV2temp.Cantidad_Pedida_M, '')as Cantidad_Pedida_M,
        isnull (ScoreV2temp.Estatus_M, '')as Estatus_M,
        isnull (ScoreV2temp.Fecha_Llegada_M, '')as Fecha_Llegada_M,
        isnull (ScoreV2temp.PartNum_G, '')as PartNum_G,
        isnull (ScoreV2temp.Description_G, '')as Description_G,
        isnull (ScoreV2temp.PartClass_G, '')as PartClass_G,
        isnull (ScoreV2temp.RefCategory_G, '')as RefCategory_G,
        isnull (ScoreV2temp.QtyPer_G, '')as QtyPer_G,
        isnull (ScoreV2temp.IssuedQty_G, '')as IssuedQty_G,
        isnull (ScoreV2temp.Demandado_G, '')as Demandado_G,
        isnull (ScoreV2temp.OnhandQty_G, '')as OnhandQty_G,
        isnull (ScoreV2temp.Preasignado_G, '')as Preasignado_G,
        isnull (ScoreV2temp.NoSerie_G, '')as NoSerie_G,
        isnull (ScoreV2temp.Faltante_G, '')as Faltante_G,
        isnull (ScoreV2temp.En_PO_G, '')as En_PO_G,
        isnull (ScoreV2temp.NoPO_G, '')as NoPO_G,
        isnull (ScoreV2temp.EnRequisicion_G, '')as EnRequisicion_G,
        isnull (ScoreV2temp.NoRequisicion_G, '')as NoRequisicion_G,
        isnull (ScoreV2temp.Alternativa_G, '')as Alternativa_G,
        isnull (ScoreV2temp.En_PO_Altern_G, '')as En_PO_Altern_G,
        isnull (ScoreV2temp.NoPO_Alern_G, '')as NoPO_Alern_G,
        isnull (ScoreV2temp.Req_G, '')as Req_G,
        isnull (ScoreV2temp.Comment_G, '')as Comment_G,
        isnull (ScoreV2temp.FechaReq_G, '')as FechaReq_G,
        isnull (ScoreV2temp.PO_G, '')as PO_G,
        isnull (ScoreV2temp.Cantidad_Pedida_G, '')as Cantidad_Pedida_G,
        isnull (ScoreV2temp.Estatus_G, '')as Estatus_G,
        isnull (ScoreV2temp.Fecha_Llegada_G, '')as Fecha_Llegada_G,
        isnull (ScoreV2temp.PartNum_T, '')as PartNum_T,
        isnull (ScoreV2temp.Description_T, '')as Description_T,
        isnull (ScoreV2temp.PartClass_T, '')as PartClass_T,
        isnull (ScoreV2temp.RefCategory_T, '')as RefCategory_T,
        isnull (ScoreV2temp.QtyPer_T, '')as QtyPer_T,
        isnull (ScoreV2temp.IssuedQty_T, '')as IssuedQty_T,
        isnull (ScoreV2temp.OnhandQty_T, '')as OnhandQty_T,
        isnull (ScoreV2temp.PartNum_R, '')as PartNum_R,
        isnull (ScoreV2temp.Description_R, '')as Description_R,
        isnull (ScoreV2temp.PartClass_R, '')as PartClass_R,
        isnull (ScoreV2temp.RefCategory_R, '')as RefCategory_R,
        isnull (ScoreV2temp.QtyPer_R, '')as QtyPer_R,
        isnull (ScoreV2temp.IssuedQty_R, '')as IssuedQty_R,
        isnull (ScoreV2temp.OnhandQty_R, '')as OnhandQty_R,
        isnull (ScoreV2temp.ComentarioLINE, '')as ComentarioLINE
		
    FROM
        ScoreV2temp
    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 |d |d |d |d  |d! |d" |d# |d$ |d% |d& |d' |d( |d) |d* |d+ |d, |d- |d. |d/ |d0 |d1 |d2 |d3 |d4 |d5 |d6 |d7 |d8 |d9 |d: |d; |d< |d= |d> |d? |d@ |dA |dB |dC |dD |dE |dF |dG |dH |dI |dJ |dK |dL |dM |dN |dO |dP |dQ |dR |dS |dT |dU |dV |dW |dX |dY |dZ |d[ |d\ |d] |d^ |d_ |d` |da |db |dc |dd |de |df |dg |dh |di |dj |dk |dl |dm |dn |do |dp |dq |dr |ds |dt |du |dv |dw |dx |dy |dz |d{ d|œ|‘qS )}r   é   é   é   é   é   é   é   é   é	   é
   é   é   é   é   é   é   é   é   é   é   é   é   é   é   é   é   é   é   é   é   é   é    é!   é"   é#   é$   é%   é&   é'   é(   é)   é*   é+   é,   é-   é.   é/   é0   é1   é2   é3   é4   é5   é6   é7   é8   é9   é:   é;   é<   é=   é>   é?   é@   éA   éB   éC   éD   éE   éF   éG   éH   éI   éJ   éK   éL   éM   éN   éO   éP   éQ   éR   éS   éT   éU   éV   éW   éX   éY   éZ   é[   é\   é]   é^   é_   é`   éa   éb   éc   éd   ée   éf   ég   éh   éi   éj   ék   él   ém   én   éo   ép   éq   ér   és   ét   éu   év   éw   éx   éy   éz   é{   )|ZOrderNumÚDepartamentoZVendedorÚNameZ
TotalLinesZ	OrderLineZPartNumZLineDescZ	CapacidadZVoltajeZTipoZRevisionNumZProdCodeZDecriptionProdZCasetaZTanqueZ	OrderDateZ
NeedByDateZLiberacionCXPZOrderNumAndLineZ	ProjectIDZJobNum2ZRevision_OVZRevision_ProjectZRevision_JobZFechaVentasZComentarioSyCZChkZFechaSyCZFechaSimulacionesZConsideradaPreasignacionZConsideradaMaterialesu   FechaProducciÃ³nu   ComentarioProducciÃ³nu   AvanceProducciÃ³nu   FechaPlaneaciÃ³nZEstadoFechau   ComentarioPlaneaciÃ³nZFechaMGZFechaMatZAvanceDeSurtimientoZMaterialSinSurtirZAvisoDeTerminacionZTerminadoConFaltanteu   FechaActualizaciÃ³nZMaterialFaltanteu   ValidaciÃ³nFisicau   ResultadoValidaciÃ³nZFechaDeCierreZComentarioCalidadZInsumosDemandadosZInsumosEmitidosZAvaceDeEmisionesZFechaDeTerminoZAvanceManufacturaSyCZAvanceEnsambleSyCu   ComentarioSupervisiÃ³nZEnFilaPruebasSyCZPendientesCalidSyCZ	PartNum_MZDescription_MZPartClass_MZRefCategory_MZQtyPer_MZIssuedQty_MZDemandado_MZOnhandQty_MZPreasignado_MZ	NoSerie_MZ
Faltante_MZEn_PO_MZNoPO_MZEnRequisicion_MZNoRequisicion_MZAlternativa_MZEn_PO_Altern_MZNoPO_Alern_MZReq_MZ	Comment_MZ
FechaReq_MZPO_MZCantidad_Pedida_MZ	Estatus_MZFecha_Llegada_MZ	PartNum_GZDescription_GZPartClass_GZRefCategory_GZQtyPer_GZIssuedQty_GZDemandado_GZOnhandQty_GZPreasignado_GZ	NoSerie_GZ
Faltante_GZEn_PO_GZNoPO_GZEnRequisicion_GZNoRequisicion_GZAlternativa_GZEn_PO_Altern_GZNoPO_Alern_GZReq_GZ	Comment_GZ
FechaReq_GZPO_GZCantidad_Pedida_GZ	Estatus_GZFecha_Llegada_GZ	PartNum_TZDescription_TZPartClass_TZRefCategory_TZQtyPer_TZIssuedQty_TZOnhandQty_TZ	PartNum_RZDescription_RZPartClass_RZRefCategory_RZQtyPer_RZIssuedQty_RZOnhandQty_RZComentarioLINE© )Ú.0Úrowr€   r€   úD/var/www/html/src/Consultas_SQL/SupYCtrol/GerenteSyC/GSYCScoreSQL.pyÚ
<listcomp>“   sü   ƒ„z get_Consulta.<locals>.<listcomp>z.[Error inesperado] Error obteniendo breakers: N)r   ÚConnectionErrorÚcursorÚexecuteÚfetchallÚcloseÚ	ExceptionÚprint)ÚqueryÚconnr†   ÚresultsÚer€   r€   rƒ   Úget_Consulta   s8     
 € û ý
ÿr   N)ÚConsultas_SQL.conexionr   r   r€   r€   r€   rƒ   Ú<module>   s   