
    iH                    ^   S SK Jr  S SK JrJrJrJrJrJrJrJr  S SK	J	r	  S SK
r
S SKrS SKrS SKrS SKJr  S SKrS SKrS SKJr  S SKJr  S SKJr  S S	KJrJrJr  S S
K	J	r	Jr  S SKJr  S SKJr  S SK J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,J-r-J.r.J/r/J0r0J1r1J2r2J3r3J4r4J5r5J6r6J7r7J8r8J9r9J:r:J;r;J<r<J=r=J>r>J?r?J@r@JArAJBrBJCrCJDrDJErEJFrFJGrGJHrHJIrIJJrJJKrKJLrLJMrMJNrNJOrOJPrPJQrQJRrRJSrSJTrTJUrUJVrVJWrWJXrXJYrYJZrZJ[r[J\r\J]r]J^r^J_r_J`r`JaraJbrbJcrcJdrdJereJfrfJgrgJhrhJiriJjrjJkrkJlrlJmrmJnrnJoroJprpJqrqJrrrJsrsJtrtJuru  S SKvJwrw  S SKxJyryJzrz  S r{g)    )current_app)jsonifyrequestredirecturl_forsessionr   render_templateflash)datetimeN)Decimal)send_activation_email)Message)NamedTemporaryFile)HostSCHEME
Productivo)r   date)FileStorage)subir_archivo_ftp_desde_request)Uget_fueltypeget_kw_by_fuelget_engine_brandsget_alternator_brandsget_voltagesget_certificationsget_breaker_catalogget_protection_typesget_control_brandsget_control_modelsget_preheater_voltagesget_battery_chargersget_enclosure_typesget_enclosure_materialsget_enclosure_lights_acget_enclosure_lights_dcget_enclosure_space_heatersget_enclosure_load_centersget_estop_catalogget_spring_catalogget_tank_capacity_catalogget_tank_type_catalogget_spill_containment_catalogget_warranty_catalogget_testing_catalog
save_quoteget_quote_dataget_genset_dataupdate_genset_pricingget_breaker_dataget_protection_dataupdate_breaker_pricingupdate_protection_pricingget_breaker_option_dataupdate_breaker_option_pricingget_controller_dataupdate_controller_pricingget_preheater_dataupdate_preheater_pricingget_battery_charger_dataupdate_battery_charger_pricingget_controller_option_qty_dataupdate_dse2157_pricingupdate_dse2548_pricingupdate_comap_dse2157_pricingupdate_comap_dse2548_pricingget_controller_option_data update_controller_option_pricingget_enclosure_dataget_light_dataget_space_heater_dataget_load_center_dataupdate_enclosure_pricing"update_enclosure_component_pricingget_enclosure_option_qty_dataget_enclosure_option_dataupdate_enclosure_option_pricingget_spring_isolator_dataget_estop_dataupdate_estop_pricingupdate_spring_isolator_pricingget_accessory_option_dataupdate_accessory_option_pricingget_tank_dataget_spill_containment_dataget_tank_option_dataupdate_tank_pricingupdate_tank_option_pricingget_warranty_dataget_testing_dataupdate_warranty_pricingupdate_testing_pricingget_Definitive_quote_dataget_genset_modelget_frecuencyget_seller_infoget_profile_infoupdate_RoutePDFget_RoutePDFget_countrysget_discount_country_value update_commercial_country_valuesgetAll_StopButtonEnclosuregetAll_louvers_ingetAll_louvers_out)CZE_Quotes_Controller)CZE_Quotes_Service"StopButtonEnclosureOptions_Servicec                   ^ ^^$^%^&^'^(^)^*^+^,^-^.^/^0^1^2^3^4^5^6^7^8 T R                  SS/S9S 5       nT R                  SS/S9S 5       nT R                  SS/S9S 5       nT R                  S	S/S9S
 5       nT R                  SS/S9S 5       nT R                  SS/S9S 5       nT R                  SS/S9S 5       nT R                  S5      S 5       n	T R                  S5      S 5       n
T R                  S5      S 5       nT R                  S5      S 5       nT R                  S5      S 5       nT R                  S5      S 5       nT R                  S5      S 5       nT R                  S5      S  5       nT R                  S!5      S" 5       nT R                  S#5      S$ 5       nT R                  S%S/S9S& 5       nT R                  S'S/S9S( 5       nT R                  S)S/S9S* 5       nT R                  S+S/S9S, 5       nT R                  S-S/S9S. 5       nT R                  S/S/S9S0 5       nT R                  S15      S2 5       nT R                  S35      S4 5       nT R                  S5S/S9S6 5       nT R                  S7S/S9S8 5       nT R                  S9S/S9S: 5       nT R                  S;5      S< 5       nT R                  S=S/S9S> 5       nT R                  S?S@/S9U74SA j5       n SB m7T R                  SCSS@/S9U$U%U&U'U(U)U*U+U/U0U1U2U3U4U5U6U84SD j5       n!U,4SE jm*U,4SF jm(U.4SG jm2U,4SH jm%U.4SI jm5U,4SJ jm&U.4SK jm0U,4SL jm$U.4SM jm/U,4SN jm'U.4SO jm1U,4SP jm)U.4SQ jm3U,4SR jm+SS m6U.4ST jm4SU m8SV m.SW m,T R                  SXS@/S9U$U%U&U'U(U)U*U+U U-U/U0U1U2U3U4U5U6UU84SY j5       n"T R                  SZS/S9S[ 5       n#S\ m-g )]Nz+/Ventas/Ventas_EUA/Cotizador_EUA/fuel-typesGET)methodsc                       [        5       n [        U 5      S4$ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = fN   error  )r   r   	Exceptionstr
fuel_typeses     dC:\Users\victor.barrera\Documents\proyectos\elepV3\Elep\src\App\Ventas_Module\VentasEUA\Cotizador.pyget_fuel_types(get_optionsimput.<locals>.get_fuel_types;   sG    	3%J:&++ 	3GSV,-s22	3    
AA A Az4/Ventas/Ventas_EUA/Cotizador_EUA/StopButtonEnclosurec                       [        5       n [        U 5      S4$ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = frr   )rh   r   rv   rw   rx   s     r{   end_getAll_StopButtonEnclosure8get_optionsimput.<locals>.end_getAll_StopButtonEnclosureD   sH    	335J:&++ 	3GSV,-s22	3r~   z0/Ventas/Ventas_EUA/Cotizador_EUA/load_louvers_inc                       [        5       n [        U 5      S4$ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = frr   )ri   r   rv   rw   rx   s     r{   end_getAll_louvers_in/get_optionsimput.<locals>.end_getAll_louvers_inM   sH    	3*,J:&++ 	3GSV,-s22	3r~   z1/Ventas/Ventas_EUA/Cotizador_EUA/load_louvers_outc                       [        5       n [        U 5      S4$ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = frr   )rj   r   rv   rw   rx   s     r{   end_getAll_louvers_out0get_optionsimput.<locals>.end_getAll_louvers_outV   sH    	3+-J:&++ 	3GSV,-s22	3r~   z8/Ventas/Ventas_EUA/Cotizador_EUA/capacidades/<fuel_type>c                      [        U 5      n[        U5      S4$ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = frr   )r   r   rv   rw   )	fuel_typecapacidadesrz   s      r{   get_capacidades)get_optionsimput.<locals>.get_capacidades_   sJ    	3(3K;',, 	3GSV,-s22	3    
AAAAzF/Ventas/Ventas_EUA/Cotizador_EUA/engine-brands/<fuel_type>/<kw_output>c                      [        X5      n[        U5      S4$ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = frr   )r   r   rv   rw   )r   	kw_outputbrandsrz   s       r{   get_engine_brands_route1get_optionsimput.<locals>.get_engine_brands_routeh   sI    	3&y<F6?C'' 	3GSV,-s22	3r   z\/Ventas/Ventas_EUA/Cotizador_EUA/alternator-brands/<fuel_type>/<kw_output>/<engine_brand_id>c                      [        XU5      n[        U5      S4$ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = frr   )r   r   rv   rw   )r   r   engine_brand_idr   rz   s        r{   get_alternator_brands_route5get_optionsimput.<locals>.get_alternator_brands_routeq   sK    	3*9QF6?C'' 	3GSV,-s22	3    
AAAAzi/Ventas/Ventas_EUA/Cotizador_EUA/voltages/<fuel_type>/<kw_output>/<engine_brand_id>/<alternator_brand_id>c                      [        XX#5      n[        U5      S4$ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = frr   )r   r   rv   rw   )r   r   r   alternator_brand_idvoltagesrz   s         r{   get_voltages_route,get_optionsimput.<locals>.get_voltages_routez   sL    	3#I/_H8$c)) 	3GSV,-s22	3r   z|/Ventas/Ventas_EUA/Cotizador_EUA/certifications/<fuel_type>/<kw_output>/<engine_brand_id>/<alternator_brand_id>/<voltage_id>c                      [        XX#U5      n[        U5      $ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = fNrt   ru   )r   r   rv   rw   )r   r   r   r   
voltage_idcertificationsrz   s          r{   get_certifications_route2get_optionsimput.<locals>.get_certifications_route   sJ    	3/	olvwN>** 	3GSV,-s22	3r   z0/Ventas/Ventas_EUA/Cotizador_EUA/breaker-optionsc                       [        5       n [        U 5      $ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = fr   )r   r   rv   rw   )breakersrz   s     r{   get_breaker_catalog_route3get_optionsimput.<locals>.get_breaker_catalog_route   sC    	3*,H8$$ 	3GSV,-s22	3s    
A>AAz@/Ventas/Ventas_EUA/Cotizador_EUA/protection-types/<breaker_type>c                      [        U 5      n[        U5      $ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = fr   )r   r   rv   rw   )breaker_typeprotectionsrz   s      r{   get_protection_types_route4get_optionsimput.<locals>.get_protection_types_route   sE    	3.|<K;'' 	3GSV,-s22	3    
A?AAz/Ventas/Ventas_EUA/Cotizador_EUA/control-brands/<fuel_type>/<kw_output>/<engine_brand_id>/<alternator_brand_id>/<voltage_id>/<certification_id>c                      [        XX#XE5      n[        U5      $ ! [         a0  n[        SU 35        [        S[	        U5      05      S4s S nA$ S nAff = f)Nz$Error obteniendo marcas de control: rt   ru   )r   r   rv   printrw   )r   r   r   r   r   certification_idr   rz   s           r{   get_control_brands_route2get_optionsimput.<locals>.get_control_brands_route   s\    	3'	odn  BF6?" 	38<=GSV,-s22	3s    
A%A	AAzB/Ventas/Ventas_EUA/Cotizador_EUA/control-models/<control_brand_id>c                      [        U 5      n[        U5      $ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = fr   )r   r   rv   rw   )control_brand_idmodelsrz   s      r{   get_control_models_route2get_optionsimput.<locals>.get_control_models_route   sE    	3'(89F6?" 	3GSV,-s22	3r   z3/Ventas/Ventas_EUA/Cotizador_EUA/preheater-voltagesc                       [        5       n [        U 5      $ ! [         a0  n[        SU 35        [        S[	        U5      05      S4s S nA$ S nAff = f)Nz,Error obteniendo voltajes de precalentador: rt   ru   )r    r   rv   r   rw   )r   rz   s     r{   get_preheater_voltages_route6get_optionsimput.<locals>.get_preheater_voltages_route   sS    	3-/H8$$ 	3@DEGSV,-s22	3    
A%AAAz1/Ventas/Ventas_EUA/Cotizador_EUA/battery-chargersc                       [        5       n [        U 5      $ ! [         a0  n[        SU 35        [        S[	        U5      05      S4s S nA$ S nAff = f)Nu)   Error obteniendo cargadores de batería: rt   ru   )r!   r   rv   r   rw   )chargersrz   s     r{   get_battery_chargers_route4get_optionsimput.<locals>.get_battery_chargers_route   sS    	3+-H8$$ 	3=aSABGSV,-s22	3r   z[/Ventas/Ventas_EUA/Cotizador_EUA/enclosure-types/<fuel_type>/<kw_output>/<certification_id>c                      [        XU5      n[        U5      $ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = fr   )r"   r   rv   rw   )r   r   r   typesrz   s        r{   get_enclosure_types_route3get_optionsimput.<locals>.get_enclosure_types_route   sG    	3'	>NOE5>! 	3GSV,-s22	3r~   zp/Ventas/Ventas_EUA/Cotizador_EUA/enclosure-materials/<fuel_type>/<kw_output>/<certification_id>/<enclosure_type>c                      [        XX#5      n[        U5      $ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = fr   )r#   r   rv   rw   )r   r   r   enclosure_type	materialsrz   s         r{   get_enclosure_materials_route7get_optionsimput.<locals>.get_enclosure_materials_route   sH    	3/	FVgI9%% 	3GSV,-s22	3r~   z4/Ventas/Ventas_EUA/Cotizador_EUA/enclosure-lights-acc                       [        5       n [        U 5      $ ! [         a0  n[        SU 35        [        S[	        U5      05      S4s S nA$ S nAff = f)Nz%Error obteniendo luces AC de caseta: rt   ru   )r$   r   rv   r   rw   lightsrz   s     r{   get_enclosure_lights_ac_route7get_optionsimput.<locals>.get_enclosure_lights_ac_route   R    	3,.F6?" 	39!=>GSV,-s22	3r   z4/Ventas/Ventas_EUA/Cotizador_EUA/enclosure-lights-dcc                       [        5       n [        U 5      $ ! [         a0  n[        SU 35        [        S[	        U5      05      S4s S nA$ S nAff = f)Nz%Error obteniendo luces DC de caseta: rt   ru   )r%   r   rv   r   rw   r   s     r{   get_enclosure_lights_dc_route7get_optionsimput.<locals>.get_enclosure_lights_dc_route   r   r   z8/Ventas/Ventas_EUA/Cotizador_EUA/enclosure-space-heatersc                       [        5       n [        U 5      $ ! [         a0  n[        SU 35        [        S[	        U5      05      S4s S nA$ S nAff = f)Nz*Error obteniendo calentadores de espacio: rt   ru   )r&   r   rv   r   rw   )heatersrz   s     r{   !get_enclosure_space_heaters_route;get_optionsimput.<locals>.get_enclosure_space_heaters_route   sS    	313G7## 	3>qcBCGSV,-s22	3r   z7/Ventas/Ventas_EUA/Cotizador_EUA/enclosure-load-centersc                       [        5       n [        U 5      $ ! [         a0  n[        SU 35        [        S[	        U5      05      S4s S nA$ S nAff = f)Nz#Error obteniendo centros de carga: rt   ru   )r'   r   rv   r   rw   )centersrz   s     r{    get_enclosure_load_centers_route:get_optionsimput.<locals>.get_enclosure_load_centers_route   sS    	302G7## 	37s;<GSV,-s22	3r   z1/Ventas/Ventas_EUA/Cotizador_EUA/additional-estopc                       [        5       n [        U 5      S4$ ! [         a0  n[        SU 35        [        S[	        U5      05      S4s S nA$ S nAff = f)Nrs   z%Error en ruta de paro de emergencia: rt   ru   )r(   r   rv   r   rw   optionsrz   s     r{   get_estop_catalog_route1get_optionsimput.<locals>.get_estop_catalog_route   sX    	3')G7#S(( 	39!=>GSV,-s22	3    
A%AAAz2/Ventas/Ventas_EUA/Cotizador_EUA/additional-springc                       [        5       n [        U 5      S4$ ! [         a0  n[        SU 35        [        S[	        U5      05      S4s S nA$ S nAff = f)Nrs   z&Error en ruta de resorte de aislador: rt   ru   )r)   r   rv   r   rw   r   s     r{   get_spring_catalog_route2get_optionsimput.<locals>.get_spring_catalog_route   sX    	3(*G7#S(( 	3:1#>?GSV,-s22	3r   z:/Ventas/Ventas_EUA/Cotizador_EUA/tank-capacity/<kw_output>c                      [        U 5      n[        U5      $ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = fr   )r*   r   rv   rw   )r   
capacitiesrz   s      r{   get_tank_capacity_route1get_optionsimput.<locals>.get_tank_capacity_route	  sE    	329=J:&& 	3GSV,-s22	3r   zF/Ventas/Ventas_EUA/Cotizador_EUA/tank-type/<kw_output>/<tank_autonomy>c                      [        X5      n[        U5      $ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = fr   )r+   r   rv   rw   )r   tank_autonomyr   rz   s       r{   get_tank_type_route-get_optionsimput.<locals>.get_tank_type_route  sD    	3))CE5>! 	3GSV,-s22	3r   z2/Ventas/Ventas_EUA/Cotizador_EUA/spill-containmentc                       [        5       n [        U 5      S4$ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = frr   )r,   r   rv   rw   r   s     r{   get_spill_containment_route5get_optionsimput.<locals>.get_spill_containment_route  sH    	335G7#S(( 	3GSV,-s22	3r~   z)/Ventas/Ventas_EUA/Cotizador_EUA/countrysc                       [        5       n [        U 5      S4$ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = frr   )re   r   rv   rw   r   s     r{   get_countrys_route,get_optionsimput.<locals>.get_countrys_route"  sG    	3"nG7#S(( 	3GSV,-s22	3r~   z1/Ventas/Ventas_EUA/Cotizador_EUA/warranty-optionsc                       [        5       n [        U 5      S4$ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = frr   )r-   r   rv   rw   r   s     r{   get_warranty_options_route4get_optionsimput.<locals>.get_warranty_options_route*  sH    	3*,G7#S(( 	3GSV,-s22	3r~   z</Ventas/Ventas_EUA/Cotizador_EUA/testing-options/<kw_output>c                      [        U 5      n[        U5      $ ! [         a"  n[        S[        U5      05      S4s S nA$ S nAff = fr   )r.   r   rv   rw   )r   r   rz   s      r{   get_testing_options_route3get_optionsimput.<locals>.get_testing_options_route2  sE    	3))4G7## 	3GSV,-s22	3r   z1/Ventas/Ventas_EUA/Cotizador_EUA/get-profile-infoc                      [         R                  " S5      n U (       d  [        SS05      S4$ [        U 5      nU(       d  [        SS05      S4$ UR                  S5      S;   a/  UR                  S	5      (       a  [	        US	   5      nU(       a  X!S
'   [        U5      S4$ ! [
         a0  n[        SU 35        [        S[        U5      05      S4s S nA$ S nAff = f)Nuser_idrt   zUsuario no autenticadoi  zPerfil no encontrado  RequestTypeID)DISEUADISCANSellerUserID
SellerInfors   u*   Error obteniendo información del perfil: ru   )r   getr   rb   ra   rv   r   rw   )r   profile_infoseller_inforz   s       r{   get_profile_info_route0get_optionsimput.<locals>.get_profile_info_route:  s    	3kk),G)ABCSHH+G4L)?@A3FF 04HH\M]M]^lMmMm-l>.JK1<.<(#-- 	3>qcBCGSV,-s22	3s)   +B   B  AB   
C*%CCCz+/Ventas/Ventas_EUA/Cotizador_EUA/save-quotePOSTc                  .  >  [         R                  " 5       n [        S5        [        U 5        [        U 5      nT" U5        [	        SUSS.5      $ ! [
         a:  n[        S[        U5       35        [	        S[        U5      S.5      S4s S nA$ S nAff = f)	Nu)   Datos recibidos para guardar cotización:Tu!   Cotización guardada exitosamente)successquote_idmessageu   Error al guardar cotización: F)r  rt   ru   )r   get_jsonr   r/   r   rv   rw   )datar  rz   pricing_Gensets      r{   save_quote_route*get_optionsimput.<locals>.save_quote_routeQ  s    	##%D=>$K!$'H8$$>    	23q6(;< Q   	s   AA 
B/B	BBc                 6    [        U 5      nU(       d  [        S5      e[        US   US   US   US   US   US   US   US	   US
   5	      nU(       ao  [        U US   US   US   US   US   US   US   US   US   US   US   US   US   US   US   US   US   US   US   US   US   US    US!   US"   US#   5        US	   nUS   nS$US
   -
  S$-  nS%nS&n[	        S5       Hk  nXU-      S':w  a'  [        XU-      X55      n	U	(       a  [        XS-   U	5        XU-      S(:w  d  MB  [        XU-      X55      n
U
(       d  M\  [        XS-   U
5        Mm     / S)Q/ S*Q/ S+Q/ S,Q/ S-Q/ S.QS/.n[	        S5       HZ  nUR                  5        HC  u  pX   u  nnX   nUU   nUS0:w  d  M  [        UX55      nU(       d  M2  [        U US-   UU5        ME     M\     US1   S2:w  a"  [        US1   X55      nU(       a  [        U U5        US3   S':w  a"  [        US3   X55      nU(       a  [        U U5        US4   S':w  a"  [!        US4   X55      nU(       a  [#        U U5        US5   nUS6   nUS7   S0:w  a$  [%        US5   UUU5      nU(       a  ['        U U5        US8   S0:w  a'  [%        US9   UUS:   U5      nU(       a  [)        U U5        US;   S0:w  a'  [%        US<   UUS=   U5      nU(       a  [+        U U5        US>   S0:w  a'  [%        US?   UUS@   U5      nU(       a  [-        U U5        / SAQnU H5  u  pnUU   S0:w  d  M  [/        X   UU5      nU(       d  M)  [1        XU5        M7     [3        US   US   US   USB   USC   UU5      nU(       a  [5        U U5        USD   S':w  a'  [7        USD   UUSE   USFSG9nU(       a  [9        U SHU5        USI   S':w  a'  [7        USI   UUSJ   USKSG9nU(       a  [9        U SLU5        USM   S':w  a(  [;        USM   UUSN   U5      nU(       a  [9        U SOU5        USP   S':w  a$  [=        USP   UU5      nU(       a  [9        U SQU5        SRSS/nUST   n U SU:w  a&  [>        R>                  " 5       n!U!RA                  U 5        USV   n"U"SU:w  a&  [>        R>                  " 5       n#U#RC                  U 5        USW   n$U$SU:w  a&  [>        R>                  " 5       n#U#RE                  U 5        U H:  u  pnn%UU   S0:w  d  M  [G        X   UUU%   U5      nU(       d  M.  [I        XU5        M<     / SXQn&U& H5  u  pnUU   S0:w  d  M  [K        X   UU5      nU(       d  M)  [I        XU5        M7     USY   S':w  a'  [M        USY   UUSZ   U5      n'U'(       a  [O        U U'5        US[   S':w  a#  [Q        US[   UU5      n(U((       a  [S        U U(5        / S\QnU H5  u  pnUU   S0:w  d  M  [U        X   UU5      nU(       d  M)  [W        XU5        M7     [Y        UUS]   US^   UU5      n)U)(       a  [[        U U)5        US_   S':w  a$  []        US_   UU5      n*U*(       a  [_        U S`U*5        / SaQnU H5  u  pnUU   S0:w  d  M  [a        X   UU5      nU(       d  M)  [_        XU5        M7     USb   S':w  a$  [c        USb   UUU5      n+U+(       a  [e        U U+5        [        U 5      nUSc   S':w  a'  [g        USc   UUSd   U5      n,U,(       a  [i        U U,5        gF! [         a  n-[k        SeU- 35        e SUn-A-ff = f)fuB   Procesa todos los precios y fichas técnicas para una cotización.u   Cotización no encontradar                           cost_id
unit_price
tech_sheetGenset_PriceTotEngineModelEngineTSheetE_TierE_RpmE_PowerE_NumberOfCylinderE_AspirationE_Governor_typeE_Control_voltageE_Battery_typeE_Hotstart_modelE_RadiatorTempAlternatorModelAlternatorTSheetA_PowerfactorA_Insulation_SystemA_Control_SystemA_Protection
A_AvrModelA_Voltage_RegulationA_Class_temp_rised            Seleccione una opción"Seleccione un modelo de interrptor))      )      )&   '   ))      )      )(   )   ))      )      )*   +   ))      )    !   ),   -   ))      )"   #   ).   /   ))      )$   %   )0   1   )sunt_tsunt_wgfiaux_c	breaker_l	motorizedNo2   Selecciona la marca de control4   6   8   :   9   <   ;   =   ?   >   @   B   A   C   ))comap_dse890D   E   )panel_heaterF   G   )remote_displayH   I   )antenaJ   K   )dse890L   M   )panel_heaterCMP      )remote_displayCMP      )	antenaCMP      N   O   P   R   T)is_aclight_acS   U   Flight_dcV   X   space_heaterY   load_center)gfci[   \   ]   )
receptable^   _   `      N      ))prewirea   b   )autolouversc   r/  )receptautolouverse   f   )openingEnclousure      g   i   j   ))band_heaterl   m   )
pmg_updaten   o   )digital_regulatorp   q   )voltage_rheostatr   s   )thermal_wrapt   u   )base_heaterv   w   )battery_switchx   y   )battery_holderz   {   )
oil_heater|   }   )oil_level_switch~      )common_alarm_relay      )function_relay      )coolant      )oil      )disconnect_switch      )remote_estop               
spill_cont))
break_tray      )
fuel_level      )overfill      )	dual_fuel      )	high_fuel      )remote_alarm      )	vent_pipe      )	flammable      )nfpa      )
no_smoking      )tank_number      )
fluid_cont               zError procesando precios: )6r0   rv   r1   r2   ranger3   r5   r4   r6   itemsr7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rJ   rG   rK   rH   rI   rl   updateQuote_stopButtonEnclosureupdate_quote_louvers_inupdate_quote_louvers_outrL   rN   rM   rP   rQ   rO   rR   rS   rT   rU   rX   rV   rY   rW   r[   r]   rZ   r\   r   ).r  
quote_datagenset_data
qty_gensetr   Discountbreaker_start_indexprotection_start_indexibreaker_dataprotection_databreaker_optionsbreaker_idxoption_typeindices_listitem_idxdesc_idx
item_value
desc_valueoption_datacontroller_datapreheater_datacharger_dataa56a58r   enclosure_datalight_ac_datalight_dc_dataheater_datacenter_dataqty_optionsstop_id
czeService
louvers_inlouversServicelouvers_outqty_idxsimple_options
estop_dataspring_data	tank_data
spill_datatesting_datawarranty_datarz   s.                                                 r{   r
  (get_optionsimput.<locals>.pricing_Gensetj  s   r	'1J ;<<
 *111111113
K %	*-- 12./)(	* 45/ 12 34 01 23 01 12 230 56 23/- 67 345< $AJ"1Iz#.#5H #$%'"1XA56:RR#3JUV?V4WYc#nL#.xQMq89=aa&9*^_E_:`bl&wO&1(E?S  9857;;O  %Qx1@1F1F1H-K)5)B&Hh!+!5J!+H!5J!T)&=j*&_&;9 ( +a + +	 2I  (& "~!AA"5jnj"["-hH "~!99!3JrNJ!Y!,X~F "~!997
2
]28\J BCBC"~%<rN	 *8[A "~%<rNrN	 *8[A "~%<rNrN	 0;G "~%<rNrN	 0;GG 4;/xh'4/"<"," #K
 #{8P[\ 4; 011122N (>B "~!99 .rNrN! !6x][ "~!99 .rNrN! !6x][ "~!993rNrN	 6xQ\] "~!992rN
 6xP[\ %*K %S/G$/BBD
::8D $CJT!!3!F!F!H66x@ %S/Kd"!3!F!F!H77A =H8xh'4/"?",""7+ 	#K #{7{[ =HN 4B/xh'4/";"," #K
 #{7{[ 4B #"::+sOsO	
 (:> #"::6sO
 28[IG& 4;/xh'4/";"," #K
 #{7{[ 4; &33I #Hi8 #"::7sO

 .xzRG 4;/xh'4/"6"," #K
 #{28+V 4; #"::/sO	   *8\B (1J #":: 1sOsO	! !+HmD 	.qc23	sr   D#[: )[: A[: &[: ;E4[: 3[: F([: 7[: #[: :[: A?[: [: -A8[: )[: A8[: :
\\\z"/Ventas/VentasEUA/VEUcotizadorbasec                    > [         R                  S:X  ac  [         R                  R                  S5      n U (       d   [	        SS5        [        [        S5      5      $ U [        S'   [        [        S5      5      $ [         R                  R                  S5      nU(       a	  U[        S'   [        R                  " S5      n U (       d   [	        SS5        [        [        S5      5      $ T$" U 5      nT"" U 5      nT)" U5      nT." U5      nT" U 5      nT," U5      nT." U5      nT " U 5      n	T'" U	5      n
T." U
5      nT!" U 5      nT(" U5      nT." U5      nT" U 5      nT&" U5      nT." U5      nT#" U 5      nT*" U5      nT." U5      nXX-   U-   U-   U-   U-   nT%" U U5      nT+" U5      nT." U5      nUU-   nT-" U U5      n[        [        U5      5      US   -   n[        U US   U5        S	S
1n0 SU_SU_SU_SU
_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_U[        R                  " 5       R                  S5      USU S.En[        S0 UD6$ ) Nr  r  u/   No se proporcionó un ID de cotización válidort   indexcotizador_baseu/   No se encontró el ID de cotización en sesióntotalzalexis.moreno@igsa.com.mxzcarlos.velazquezm@igsa.com.mxr	  table_CotizacionGensettable_CotizacionBreakerstable_CotizacionControltable_CotizacionEnclosuretable_CotizacionAccesoriestable_CotizacionTanktable_WarrantyAndTestprice_CotizacionGensetprice_CotizacionBreakersprice_CotizacionControlprice_CotizacionEnclosureprice_CotizacionAccesoriesprice_CotizacionTankprice_WarrantyAndTest	GranTotalcountryData%d/%m/%YT)ofertaComercial
today_dateemails_Quotes_NrtAmeshow_send_buttonr  )z&Ventas/VentasEUA/VEUcotizadorbase.html)r   methodformr   r
   r   r   r   argsr   rw   rg   r   nowstrftimer	   )/r  url_quote_idGeneral_InformationCotizacionGenset_datar=  rD  CotizacionBreakers_datar>  rE  CotizacionControl_datar?  rF  CotizacionEnclosure_datar@  rG  CotizacionAccesories_datarA  rH  CotizacionTank_datarB  rI  Genset_priceCotizacionWarrantyAndTest_datarC  rJ  rK  countryDiscountDatarN  rP  contextGet_CotizacionAccesories_dataGet_CotizacionBreakers_dataGet_CotizacionControl_dataGet_CotizacionEnclosure_dataGet_CotizacionGenset_dataGet_CotizacionTank_dataGet_General_Information Get_warranty_and_testing_pricinggenerate_quote_table_Accesoriesgenerate_quote_table_Controlgenerate_quote_table_Enclosuregenerate_quote_table_Gensetgenerate_quote_table_Tankgenerate_quote_table_WTgenerate_quote_table_breakersget_country_discontsum_total_pricess/                                 r{   r;  (get_optionsimput.<locals>.cotizador_base   s]   >>V#||''
3HGQ 011"*GJG$4566 ||''
3".GJ ;;z*CWMGG,-- 6h? !:( C!<=R!S!12H!I #>h"G#@AX#Y #34L#M  "<H!E">?U"V"23J"K $@#I $BC[$\!$45N$O! %B($K!%DE^%_"%56P%Q" 6h?89LM/0DE-HKbbe~~  B\  \  _s  s *J(T`)a& 78V W 01F G #88	 2(IF "#i.14G4PP 	)3Fw3OQ`a ;=\]
'
$'=
 '(@
 &'>	

 ()B
 )*D
 #$8
 $%:
 %&<
 '(@
 &'>
 ()B
 )*D
 #$8
 $%:
  !
" .#
$  /",,.11*=%9 $ -
2 S7SS    c                   > [        U 5      nU(       d  gUR                  5        VVs0 s H  u  p#UT
" U5      _M     nnn[        R                  " 5       R	                  S5      nUS   n[        U5      nUS   n[        U5      nU US   US   S.SU0UUS	   US
    S3US    S3US    S3US   US   S.US   US   US   US   US   US   US   US   US   US   S.US   S.US   US    US!   US"   US#   US$   US%   US&   US'   S(.US)   S*.S+US+   0S,US,   0S-US-   0S..US/   S0US0   0S1.US2   US3   S4.S5US5   0US6   US7   US8   US9   US:   S;.US<   US=   US>   S?.S@.n	U	$ s  snnf )ANu2   Error: No se encontraron datos para la cotizaciónr   %Y-%m-%dGenset_CostID	VoltageIDProjectReqCustomerprojectcustomer_requirementsDATEFuelTypeFrontKWOutputz KW	Frecuencyz Hzz VPhasesCertification)Genset_modelr  r  r  rz  r  r  EngineBrandr  Engine_Tier
Engine_RpmEngine_PowerEngine_NumberOfCylinderEngine_AspirationEngine_Governor_typeEngine_Control_voltageEngine_RadiatorTemp)r  r  r  r  r  r  r  r  Engine_TSheet)r  r  specificationsr  AlternatorBrandr&  Altern_PowerfactorAltern_Insulation_SysAltern_Control_SystemAltern_ProtectionAltern_AvrModelAltern_VoltageRegulatAltern_Class_temp_rise)r  r  r  r  r  r  r  Altern_TSheet)r  r&  r  r  Breaker1Breaker2Breaker3r  r  r  ControlModelBateryCharger)r  AdicionalyConfigControllerBaseTankTankAutonomy)r  r  AcousticEnclosureCustomerCompanyCustomerAddressCustomerContactCustomerEmailCustomerTelr  r  r  r  r  
SellerNameSellerEmailSellerPhoner  r  r  )r  project_infor   general_infoengine
alternatorBreakers
controllerTank	EnclosureCustomerSeller)r^   r
  r   rU  rV  r_   r`   )r  r  kvr  ry  r  rz  Datos_voltajesrX  convert_decimals             r{   ri  1get_optionsimput.<locals>.Get_General_Information  s    /x8
L8B8H8H8JK8Ja++8J
K||~&&z2 #?3'6{+	&y1 %))4-7-F!
 D
 %1%/%@#-j#9":# >$2;$?#@!D$.{$;#<B!?,X6%/%@	! $.m#<#-m#<'1-'@&0&>(2>(B3=>W3X-78K-L0:;Q0R2<=U2V/9:O/P	' &0%@  (22C'D'12C'D.89M.N1;<S1T1;<S1T-78K-L+56G+H1;<S1T2<=U2V' &0%@  #Jz$:! #Jz$:! #Jz$:!
 %/~$>'O)D3 !+: 6$.~$>
 (4G)H (22C'D'12C'D'12C'D%/%@#-m#< #-\":#-m#<#-m#<_Tl #"E Ls   E+c                 `  > [        U 5      nU(       d  gUR                  5        VVs0 s H  u  p#UT" U5      _M     nnn[        R                  " 5       R	                  S5      nUS   n[        U5      nUS   n[        U5      nUR                  SS5       SU SUR                  S	S5       S
UR                  SS5       SUR                  SS5       SUR                  SS5       S
UR                  SS5       SUR                  SS5       S3n	US   n
U UU	U
US   US   US   S.S.nU$ s  snnf )Nrw  rx  ry  rz  r   z GENERATOR SET MODEL z, STANDBY POWER r  z, Voltage_Frontz. r  z ENGINE r  r  z ALTERNATOR r&  z, STANDARD ACCESSORIES	QtyGensetGenset_Unit_PriceGenset_TSheetr  )r  
GensetDESCGensetQTYTOTr  r  r  )r  Genset)r^   r
  r   rU  rV  r_   r`   r   )r  r  r  r  r  ry  r  rz  r  r  r  rY  r  s               r{   rg  3get_optionsimput.<locals>.Get_CotizacionGenset_data  st    /x8
L8B8H8H8JK8Ja++8J
K||~&&z2 #?3'6{+	&y1 ~~or233H W'^^J;<Bz~~o_a?b>cce~~mR01*..XZ:[9\\^~~/45\*..QbdfBgAh i## 	 "+. %$0",$0)34G)H%/%@'12C'D
! %$A Ls   D*c                 V  > SnSU4S jjnU R                  S0 5      nU(       a  UR                  S5      (       ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S	5      5      -  nUS
-  nU$ )u   
Genera el HTML para la tabla del generador (Genset) con enlaces a fichas técnicas

Args:
    CotizacionGenset_data (dict): Datos del generador

Returns:
    str: HTML para la tabla del generador

        <tbody>
        c                    > Ub  US:X  a  gT	" U5      nT	" U5      nU(       a(  UR                  5       (       a  SU SU =(       d    S S3nOU =(       d    SnSU SU=(       d    S SU=(       d    S SU SU S3$ Nr  	<a href="*" target="_blank" class="tech-sheet-link"></a>&
            <tr>
                <td></td>
                <td>$</td>
            </tr>
            strip
itemdescriptionqtyr  total_pricer  formatted_unit_priceformatted_total_price	item_cellformat_prices
            r{   
render_rowIget_optionsimput.<locals>.generate_quote_table_Genset.<locals>.render_row+      "kR&7 $0
#; $0$=! j..00'
|3]^b^hfh]iimn	 JB	K   &B' (YBK  )* +*+ , ru  r  r  r  r  r  r  r  
        </tbody>
        Nr   )rY  htmlr  gensetr  s       r{   rn  5get_optionsimput.<locals>.generate_quote_table_Genset  s    
	2 '**8R8 fjj..J

>*

<(

>*

./

,-

?+ D 	  	 ru  c                   > [        U 5      nU(       d  gUR                  5        VVs0 s H  u  p#UT/" U5      _M     nnnUS   nSnUS   nSnUS   nSn	US   n
US   nSnUS   nSnUS   nSnUS   nUS   nSnUS   nSnUS   nSnUS   nUS   nSnUS   nSnUS   nSnUS   nUS   n Sn!US   n"Sn#US   n$Sn%US   n&US   n'Sn(US   n)Sn*US   n+Sn,US   n-U US	   US
   UUS   US   US   0 SUS   _SUS   _SU_SU_SUS   _SUS   _SUS   _SUS   _SUS   _SU_SU_SUS   _SUS   _SUS   _SUS   _SUS   _SU	_0 SU
_S US    _S!US!   _S"US"   _S#US#   _S$US$   _S%U_S&US&   _S'US'   _S(US(   _S)US)   _S*US*   _S+U_S,U_S-US-   _S.US.   _S/US/   _EUS   US0   UUUS1   US2   US3   US4   US5   UUUS6   US7   US8   S9.ES:.US;   US<   UUS=   US>   US?   0 S@US@   _SAUSA   _SBU_SCU_SDUSD   _SEUSE   _SFUSF   _SGUSG   _SHUSH   _SIU_SJU_SKUSK   _SLUSL   _SMUSM   _SNUSN   _SOUSO   _SPU_0 SQU_SRUSR   _SSUSS   _STUST   _SUUSU   _SVUSV   _SWU_SXUSX   _SYUSY   _SZUSZ   _S[US[   _S\US\   _S]U_S^U_S_US_   _S`US`   _SaUSa   _EUSb   USc   UUUSd   USe   USf   USg   USh   UUUSi   USj   USk   Sl.ESm.USn   USo   U USp   USq   USr   0 SsUSs   _StUSt   _SuU!_SvU"_SwUSw   _SxUSx   _SyUSy   _SzUSz   _S{US{   _S|U#_S}U$_S~US~   _SUS   _SUS   _SUS   _SUS   _SU%_0 SU&_SUS   _SUS   _SUS   _SUS   _SUS   _SU'_SUS   _SUS   _SUS   _SUS   _SUS   _SU(_SU)_SUS   _SUS   _SUS   _EUS   US   U*U+US   US   US   US   US   U,U-US   US   US   S.ES.S.S.n.U.$ s  snnf )Nrw  r  z
Shunt tripzShunt trip wiringzGFI (Ground fault indication)zAuxiliary contactsItem_Breaker_L1zMotorized BreakerItem_breaker1r  Breaker1_PriceBreaker1_TSheetBreaker1_PriceTotItem_Sunt_t1Shunt_trip1Shunt_trip1DESCShunt_trip1_QTYTOTSunt_t1_PriceSunt_t1_TSheetSunt_t1_PriceTotItem_Sunt_w1Shunt_trip_wiring1Shunt_trip_wiring1DESCShunt_trip_wiring1_QTYTOTSunt_w1_PriceSunt_w1_TSheetSunt_w1_PriceTot	Item_GFI1GFI1Item_GFI1DESCItem_GFI1_QTYTOT
GFI1_PriceGFI1_TSheetGFI1_PriceTotItem_Proyection_t1Protection_type1Protection_type1_QTYTOTProyection_t1_PriceProyection_t1_TSheetProyection_t1_PriceTotItem_Auxiliary_c1Auxiliary_contacts1Auxiliary_contactsDESCAuxiliary_contacts_QTYTOTAuxiliary_c1_PriceAuxiliary_c1_TSheetAuxiliary_c1_PriceTotBreaker_Lock1Breaker_L1_PriceBreaker_L1_TSheetBreaker_L1_PriceTotItem_Motorized_B1Motorized_Breaker1Motorized_B1_PriceMotorized_B1_TSheetMotorized_B1_PriceTot)r  r  Breaker_LockDESCBreaker_Lock_QTYTOTr  r  r  r  r  Motorized_BreakerDESCMotorized_Breaker_QTYTOTr  r  r  )r  r  Breaker1QTYTOTr  r  r  ConfigAndAccesories_Breaker1Item_breaker2r  Breaker2_PriceBreaker2_TSheetBreaker2_PriceTotItem_Sunt_t2Shunt_trip2Shunt_trip2DESCShunt_trip2_QTYTOTSunt_t2_PriceSunt_t2_TSheetSunt_t2_PriceTotItem_Sunt_w2Shunt_trip_wiring2Shunt_trip_wiring2DESCShunt_trip_wiring2_QTYTOTSunt_w2_PriceSunt_w2_TSheetSunt_w2_PriceTot	Item_GFI2GFI2Item_GFI2DESCItem_GFI2_QTYTOT
GFI2_PriceGFI2_TSheetGFI2_PriceTotItem_Proyection_t2Protection_type2Protection_type2_QTYTOTProyection_t2_PriceProyection_t2_TSheetProyection_t2_PriceTotItem_Auxiliary_c2Auxiliary_contacts2Auxiliary_contacts2DESCAuxiliary_contacts2_QTYTOTAuxiliary_c2_PriceAuxiliary_c2_TSheetAuxiliary_c2_PriceTotItem_Breaker_L2Breaker_Lock2Breaker_L2_PriceBreaker_L2_TSheetBreaker_L2_PriceTotItem_Motorized_B2Motorized_Breaker2Motorized_B2_PriceMotorized_B2_TSheetMotorized_B2_PriceTot)rC  rD  Breaker_Lock2DESCBreaker_Lock2_QTYTOTrE  rF  rG  rH  rI  Motorized_Breaker2DESCMotorized_Breaker2_QTYTOTrJ  rK  rL  )r  r  Breaker2QTYTOTr  r  r   ConfigAndAccesories_Breaker2Item_breaker3r  Breaker3_PriceBreaker3_TSheetBreaker3_PriceTotItem_Sunt_t3Shunt_trip3Shunt_trip3DESCShunt_trip3_QTYTOTSunt_t3_PriceSunt_t3_TSheetSunt_t3_PriceTotItem_Sunt_w3Shunt_trip_wiring3Shunt_trip_wiring3DESCShunt_trip_wiring3_QTYTOTSunt_w3_PriceSunt_w3_TSheetSunt_w3_PriceTot	Item_GFI3GFI3Item_GFI3DESCItem_GFI3_QTYTOT
GFI3_PriceGFI3_TSheetGFI3_PriceTotItem_Proyection_t3Protection_type3Protection_type3_QTYTOTProyection_t3_PriceProyection_t3_TSheetProyection_t3_PriceTotItem_Auxiliary_c3Auxiliary_contacts3Auxiliary_contacts3DESCAuxiliary_contacts3_QTYTOTAuxiliary_c3_PriceAuxiliary_c3_TSheetAuxiliary_c3_PriceTotItem_Breaker_L3Breaker_Lock3Breaker_L3_PriceBreaker_L3_TSheetBreaker_L3_PriceTotItem_Motorized_B3Motorized_Breaker3Motorized_B3_PriceMotorized_B3_TSheetMotorized_B3_PriceTot)ry  rz  Breaker_Lock3DESCBreaker_Lock3_QTYTOTr{  r|  r}  r~  r  Motorized_Breaker3DESCMotorized_Breaker3_QTYTOTr  r  r  )rS  r  Breaker3QTYTOTrT  rU  rV  ConfigAndAccesories_Breaker3r  )r  r  r^   r
  )0r  r  r  r  r  r  r  r  r  r  r  r  r	  r
  r  r  r  r  rQ  r#  r$  r*  r+  r1  r2  r8  r>  r?  rM  rN  rO  rP  r  rY  rZ  r`  ra  rg  rh  rn  rt  ru  r  r  r  r  rZ  r  s0                                                  r{   rd  5get_optionsimput.<locals>.Get_CotizacionBreakers_dataW  s
    /x8
L8B8H8H8JK8Ja++8J
K $K0&'4!4$.{$;!7%k2",["9!5$.{$;!,(5 3#-k#: #K0&'4!4$.{$;!7%k2",["9"6%/%<"-)+6!4$.{$;! $K0&'4!4$.{$;!7%k2",["9"6%/%<"-)+6!4$.{$;! % *4O)D$.z$:*8*45E*F+56G+H-78K-L?8 +J~,F?8 *:m+D	?8
 .?8 12D?8 ,Z-H?8 -j9I.J?8 /
;M0N?8 +J~,F?8 1*=Q2R?8 56L?8 89R?8  ,Z-H!?8" -j9I.J#?8$ /
;M0N%?8* (K)@+?8, #Jv$6-?8. ,]/?80 /0@1?82 )*\*B3?84 *:m+D5?86 ,Z-H7?8< 1*=Q2R=?8> /
;M0N??8@ 67NA?8B 2:>S3TC?8D 3J?U4VE?8F 5jAY6ZG?8L 0<O1PM?8N 2:>S3TO?8P 56LQ?8R 89RS?8T 1*=Q2RU?8V 2:>S3TW?8X 4Z@W5XY?8^ 0::K/L-7-H0@3F0:;M0N1;<O1P3=>S3T 2<<O1P2<=Q2R5J8P2<=Q2R3=>S3T5?@W5X}?8H!V *4O)D$.z$:*8*45E*F+56G+H-78K-L?8 +J~,F?8 *:m+D	?8
 .?8 12D?8 ,Z-H?8 -j9I.J?8 /
;M0N?8 +J~,F?8 1*=Q2R?8 56L?8 89R?8  ,Z-H!?8" -j9I.J#?8$ /
;M0N%?8* (K)@+?8, #Jv$6-?8. ,]/?80 /0@1?82 )*\*B3?84 *:m+D5?86 ,Z-H7?8< 1*=Q2R=?8> /
;M0N??8@ 66MA?8B 2:>S3TC?8D 3J?U4VE?8F 5jAY6ZG?8L 0<O1PM?8N 2:>S3TO?8P 67NQ?8R 9:TS?8T 1*=Q2RU?8V 2:>S3TW?8X 4Z@W5XY?8^ 0::K/L-7-H1B4H0:;M0N1;<O1P3=>S3T 2<<O1P2<=Q2R6L9R2<=Q2R3=>S3T5?@W5X}?8H!V *4O)D$.z$:*8*45E*F+56G+H-78K-L?8 +J~,F?8 *:m+D	?8
 .?8 12D?8 ,Z-H?8 -j9I.J?8 /
;M0N?8 +J~,F?8 1*=Q2R?8 56L?8 89R?8  ,Z-H!?8" -j9I.J#?8$ /
;M0N%?8* (K)@+?8, #Jv$6-?8. ,]/?80 /0@1?82 )*\*B3?84 *:m+D5?86 ,Z-H7?8< 1*=Q2R=?8> /
;M0N??8@ 67NA?8B 2:>S3TC?8D 3J?U4VE?8F 5jAY6ZG?8L 0<O1PM?8N 2:>S3TO?8P 67NQ?8R 9:TS?8T 1*=Q2RU?8V 2:>S3TW?8X 4Z@W5XY?8^ 0::K/L-7-H0A4H0:;M0N1;<O1P3=>S3T 2<<O1P2<=Q2R5K9R2<=Q2R3=>S3T5?@W5X}?8H!g\_#
B '&Q	 Ls   Oc                   > SnSU4S jjnU R                  S0 5      nUR                  S0 5      nU(       Ga  UR                  S5      S;  Ga  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S	5      UR                  S
5      5      -  nSU;   Gaw  US   nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S 5      UR                  S!5      5      -  nUR                  S"5      S;  ai  X" UR                  S#5      UR                  S"5      UR                  S$5      UR                  S%5      UR                  S&5      UR                  S'5      5      -  nUR                  S(5      S;  ai  X" UR                  S)5      UR                  S*5      UR                  S+5      UR                  S,5      UR                  S-5      UR                  S.5      5      -  nUR                  S/5      S;  ai  X" UR                  S05      UR                  S15      UR                  S25      UR                  S35      UR                  S45      UR                  S55      5      -  nUR                  S65      S;  ai  X" UR                  S75      UR                  S85      UR                  S95      UR                  S:5      UR                  S;5      UR                  S<5      5      -  nUR                  S=0 5      nU(       Ga  UR                  S=5      S;  Ga  X" UR                  S>5      UR                  S=5      UR                  S?5      UR                  S@5      UR                  SA5      UR                  SB5      5      -  nSCU;   Gaw  USC   nUR                  SD5      S;  ai  X" UR                  SE5      UR                  SF5      UR                  SG5      UR                  SH5      UR                  SI5      UR                  SJ5      5      -  nUR                  SK5      S;  ai  X" UR                  SL5      UR                  SM5      UR                  SN5      UR                  SO5      UR                  SP5      UR                  SQ5      5      -  nUR                  SR5      S;  ai  X" UR                  SS5      UR                  ST5      UR                  SU5      UR                  SV5      UR                  SW5      UR                  SX5      5      -  nUR                  SY5      S;  ai  X" UR                  SZ5      UR                  SY5      UR                  S[5      UR                  S\5      UR                  S]5      UR                  S^5      5      -  nUR                  S_5      S;  ai  X" UR                  S`5      UR                  Sa5      UR                  Sb5      UR                  Sc5      UR                  Sd5      UR                  Se5      5      -  nUR                  Sf5      S;  ai  X" UR                  Sg5      UR                  Sh5      UR                  Si5      UR                  Sj5      UR                  Sk5      UR                  Sl5      5      -  nUR                  Sm5      S;  ai  X" UR                  Sn5      UR                  So5      UR                  Sp5      UR                  Sq5      UR                  Sr5      UR                  Ss5      5      -  nUR                  St0 5      nU(       Ga  UR                  St5      S;  Ga  X" UR                  Su5      UR                  St5      UR                  Sv5      UR                  Sw5      UR                  Sx5      UR                  Sy5      5      -  nSzU;   Gaw  USz   nUR                  S{5      S;  ai  X" UR                  S|5      UR                  S}5      UR                  S~5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUS-  nU$ )u   
Genera el HTML para la tabla de breakers con enlaces a fichas técnicas

Args:
    CotizacionBreakers_data (dict): Datos de los breakers

Returns:
    str: HTML para la tabla de breakers
r  c                   > Ub  US:X  d  US:X  a  gUS;   a  gT	" U5      nT	" U5      nU(       a(  UR                  5       (       a  SU SU =(       d    S S3nOU =(       d    SnSU SU=(       d    S SU=(       d    S SU SU S	3$ )
Nr  r^  )r2  Select an optionr3  Select a breaker modelr  r  r  r  r  r  r  r  s
            r{   r  Kget_optionsimput.<locals>.generate_quote_table_breakers.<locals>.render_row      "kR&7;$;N \ \ $0
#; $0$=! j..00'
|3]^b^hfh]iimn	 JB	K   &B' (YBK  )* +*+ , ru  r  r  )Nr  r2  r  r3  r  r  r  r  r  r  r  r  Nr  r^  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r	  r
  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rQ  r  r   r  rR  r"  r!  r#  r$  r%  r'  r&  r)  r(  r*  r+  r,  r.  r-  r0  r/  r1  r2  r3  r5  r4  r7  r6  r8  r9  r;  r:  r=  r<  r>  r?  r@  rB  rA  rD  rC  rM  rN  rE  rG  rF  rI  rH  rO  rP  rJ  rL  rK  r  rS  r  rT  rV  rU  r  rX  rW  rY  rZ  r[  r]  r\  r_  r^  r`  ra  rb  rd  rc  rf  re  rg  rh  ri  rk  rj  rm  rl  rn  ro  rq  rp  rs  rr  rt  ru  rv  rx  rw  rz  ry  r  r  r{  r}  r|  r  r~  r  r  r  r  r  r  r  r  )	rZ  r  r  r   breaker1accessoriesbreaker2breaker3r  s	           r{   rq  7get_optionsimput.<locals>.generate_quote_table_breakers  s   
	: +..z2> <<
B/Z0  9p  pJ_-Z(-.-.01./ D .9&'EF ??=19IIJ#7#(9:#(<=#8#(:;#(89 D ??#78@PPJ#7#(@A#(CD#8#(:;#(89 D ??6*2BBJ#4#8#(:;#5#8#6 D ??#56  ?w  wJ#(<=#(:;#(AB#(=>#(@A#(>? D ??#89AQQJ#(;<#(@A#(CD#(<=#(?@#(=> D ???3;KKJ#(9:#(:;#(=>#(:;#(=>#(;< D ??#78@PPJ#(;<#(?@#(BC#(<=#(?@#(=> D <<
B/Z0  9p  pJ_-Z(-.-.01./ D .9&'EF ??=19IIJ#7#(9:#(<=#8#(:;#(89 D ??#78@PPJ#7#(@A#(CD#8#(:;#(89 D ??6*2BBJ#4#8#(:;#5#8#6 D ??#56  ?w  wJ#(<=#(:;#(AB#(=>#(@A#(>? D ??#89AQQJ#(;<#(AB#(DE#(<=#(?@#(=> D ???3;KKJ#(9:#(;<#(>?#(:;#(=>#(;< D ??#78@PPJ#(;<#(@A#(CD#(<=#(?@#(=> D <<
B/Z0  9p  pJ_-Z(-.-.01./ D .9&'EF ??=19IIJ#7#(9:#(<=#8#(:;#(89 D ??#78@PPJ#7#(@A#(CD#8#(:;#(89 D ??6*2BBJ#4#8#(:;#5#8#6 D ??#56  ?w  wJ#(<=#(:;#(AB#(=>#(@A#(>? D ??#89AQQJ#(;<#(AB#(DE#(<=#(?@#(=> D ???3;KKJ#(9:#(;<#(>?#(:;#(=>#(;< D ??#78@PPJ#(;<#(@A#(CD#(<=#(?@#(=> D 	  	 ru  c                   > [        U 5      nU(       d  gUR                  5        VVs0 s H  u  p#UT"" U5      _M     nnnUS   nSnUS   nSnUS   nSn	US   US   -  n
SnUS   US   -  nSnS	nUS
   US   -  nSnUS   US   -  nSnUS   nSnUS   nSnUS   nSnUS   nSnUS   nSnUS   nSnUS   nUS   n U US   US   UUS   US   US   0 SUS   _SUS   _SU_SU_SUS   _SUS   _SUS   _SUS   _SU_S U_S!US!   _S"US"   _S#US#   _S$US$   _S%U_S&U_S'US'   _0 S(US(   _S)US)   _S*US*   _S+US+   _S,U_S-U_S.US.   _S/US/   _S0US0   _S1US1   _S2US2   _S3U_S4U_S5US5   _S6US6   _S7US7   _S8US8   _E0 S9US9   _S:U_S;U_S<US<   _S=US=   _S>US>   _S?US?   _S@US@   _SAU_SBU_SCUSC   _SDUSD   _SEUSE   _S@US@   _SAU_SBU_SCUSC   _E0 SDUSD   _SEUSE   _SFUSF   _SGUSG   _SHU_SIU_SJUSJ   _SKUSK   _SLUSL   _SM0 SNUSN   _SOUSO   _SPU_SQU_SRUSR   _SSUSS   _STUST   _SUUSU   _SVU_SWU_SXUSX   _SYUSY   _SZUSZ   _S[US[   _S\US\   _SUS   _S]U	_U
US^   US_   US`   USa   USb   US
   UUUSc   USd   USe   Sf.E_SgUSg   _ShUSh   _SiU_SjU_SkUSk   _SlUSl   _SmUSm   _EUSn   USo   U USp   USq   USr   Ss.ESt.Su.n!U!$ s  snnf )vNrw  r  zControl Panel Heaterz'DSE2157 Output Module  (8 dry contacts)
QtyDSE2157z$I-RB8 Output module (8 dry contacts)QtyComapDSE2157zDSE-2548zDSE2548 Remote Annunciator
QtyDSE2548zIGL-RA15 Remote AnnunciatorQtyComapDSE2548z!DSE890 Ethernet/4G gateway devicezCM3-ETHERNETz1GSM/GPS ANTENNA 3M RG-174, GSM-SMA(M), GPS-SMA(F)zRemote Display Module DSEzRemote Display Module COMAPItem_controllerr  controller_Pricecontroller_TSheetControlModel_PriceTotCtrlPanelHeaterItem_CtrlPanelHeaterCPHDESC	CPHQTYTOTCtrlPanelHeater_PriceCtrlPanelHeater_TSheetCtrlPanelHeat_PriceTotItem_CtrlPanelHeaterCMPCMP_CPH_DESCRIPTIONCMP_CPH_QTYTOTALCtrlPanelHeaterCMP_PriceCtrlPanelHeaterCMP_TSheetCtrlPanelHeatCMP_PriceTotItem_RempteDisplModCMPCMP_RDMDSE_DESCRIPTIONCMP_RDMDSE_QTYTOTALRempteDisplModCMP_PriceRempteDisplModCMP_TSheetRempteDisplModCMP_PriceTotItem_AntenaCMP	AntenaCMPCMP_GSM_GSP_DESCRIPTIONCMP_GSM_GSP_QTYTOTALAntenaCMP_PriceAntenaCMP_TSheetAntenaCMP_PriceTotItem_ComapDSE2157ComapDSE2157CMP_2157_DESCRIPTIONCMP_2157_QTYTOTALComapDSE2157_PriceComapDSE2157_TSheetComapDSE2157_PriceTotItem_ComapDSE2548ComapDSE2548CMP_2548_DESCRIPTIONCMP_2548_QTYTOTOTALComapDSE2548_PriceComapDSE2548_TSheetComapDSE2548_PriceTotItem_RempteDisplModRemoteDisplayModule
RDMDSEDESCRDMDSEQTYTOTRempteDisplMod_PriceRempteDisplMod_TSheetRempteDisplMod_PriceTotItem_AntenaAntenaGSM_GSPDESCGSM_GSPQTYTOTAntena_PriceAntena_TSheetAntena_PriceTotConfigAndAccesories_DeepSeaItem_DSE890DSE890
DSE890DESCDSE890QTYTOTDSE890_PriceDSE890_TSheetDSE890_PriceTotItem_ComapDSE890CMP_890_DESCRIPTIONCMP_890_QTYTOTALComapDSE890_PriceComapDSE890_TSheetComapDSE890_PriceTotItem_DSE2157DSE2157DSE2157DESCDSE2157_PriceDSE2157_TSheetDSE2157_PriceTotItem_DSE2548DSE2548DSE2548_PriceDSE2548_TSheetDSE2548_PriceTot)DSE2157QTYTOTr  r  r  r  r  r  DSE2548DESCDSE2548QTYTOTr  r  r  Item_CtrlVotlOperCtrlVotlOperCtrlVotlOperDESCCtrlVotlOperQTYTOTCtrlVotlOper_PriceCtrlVotlOper_TSheetCtrlVotlOper_PriceTotItem_BateryChargerr  BateryCharger_PriceBateryCharger_TSheetBateryCharger_PriceTot)r  r  BateryChargerQTYTOTr  r  r  )r  r  ControlModelQTYr  r  r  ConfigAndAccesories_Controller)r  r  r  )#r  r  r  r  r  r  r  r  r  r  r  r  r  Item_controller_options_DSE2548r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r[  r  s#                                     r{   re  4get_optionsimput.<locals>.Get_CotizacionControl_data  sS   .x8
L8B8H8H8JK8Ja++8J
K &k2 ){+	4%k2?"<0:k3JJ  F&'89J{<SS*4'2"<0:k3JJ  =():;j>UU8
!+. -%k2I";/ #V)+60
!+.6'4!>(5(5 % (22C'D$.~$>'6(23E(F)34G)H-78O-PI7 *:6L+MI7 *:6G+H	I7
 "7I7 $YI7 0<S1TI7 1*=U2VI7 1*=U2VI7 2:>W3XI7 ./BI7 +,<I7 3J?Y4ZI7 4Z@[5\I7  4Z@[5\!I7( 1*=U2V)I7* 12H+I7, ./B-I7. 2:>W3X/I70 3J?Y4Z1I72 5jA]6^3I78 )*5E*F9I7: $Z%<;I7< 23J=I7> /0D?I7@ *:6G+HAI7B +J7I,JCI7D -j9M.NEI7J ,Z8K-LKI7L '
>(BMI7N /0DOI7P ,->QI7R -j9M.NSI7T .z:O/PUI7V 0<S1TWI7\ ,Z8K-L]I7^ '
>(B_I7` /0DaI7b ./BcI7d -j9M.NeI7f .z:O/PgI7h 0<S1TiI7p .z:O/PqI7r .z:O/PsI7t %juI7v 'wI7x /
;Q0RyI7z 0<S1T{I7| 2:>W3X}I7@ .z:O/PAI7B %jCI7D 'EI7F /
;Q0RGI7H 0<S1TII7J 2:>W3XKI7P &z-'@QI7R !*X"6SI7T &{UI7V (WI7X '
>(BYI7Z (O)D[I7\ *:6G+H]I7` 6 '8 *:m+D'8 %j&:	'8
 )*'8 +L'8 +J~,F'8 ,Z-H'8 .z:K/L'8 /
;M0N'8 23F'8 /0@'8 0<O1P'8  1*=Q2R!'8" 3J?U4V#'8* +J~,F+'8, &z)'<-'8. )*\*B/'80 *;1'82 .;-7-H.89I.J0:;M0N -7~,F'1)'<*4\*B+6-:-7-H.89I.J0:;M0NM'8aI7t ,Z8K-LuI7v '
>(BwI7x +,<yI7z -.@{I7| -j9M.N}I7~ .z:O/PI7@ 0<S1TAI7F /99M.N)3O)D/B/9:O/P0:;Q0R2<=U2VQI7RU"n &%W Ls   Kc                 P  > SnSnU4S jjnU R                  S0 5      nU(       Ga{  UR                  S5      S;  Gae  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S	5      UR                  S
5      5      -  nSU;   Ga  US   nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S 5      5      -  nUR                  S!5      S;  ai  X" UR                  S!5      UR                  S"5      UR                  S#5      UR                  S$5      UR                  S%5      UR                  S&5      5      -  nUR                  S'5      S;  ai  X" UR                  S(5      UR                  S)5      UR                  S*5      UR                  S+5      UR                  S,5      UR                  S-5      5      -  nUR                  S.5      S;  ai  X" UR                  S/5      UR                  S05      UR                  S15      UR                  S25      UR                  S35      UR                  S45      5      -  nS5U;   Ga  US5   nUR                  S65      S;  ai  X" UR                  S75      UR                  S85      UR                  S95      UR                  S:5      UR                  S;5      UR                  S<5      5      -  nUR                  S=5      S;  ai  X" UR                  S=5      UR                  S>5      UR                  S?5      UR                  S@5      UR                  SA5      UR                  SB5      5      -  nUR                  SC5      S;  ai  X" UR                  SD5      UR                  SE5      UR                  SF5      UR                  SG5      UR                  SH5      UR                  SI5      5      -  nUR                  SJ5      S;  ai  X" UR                  SK5      UR                  SL5      UR                  SM5      UR                  SN5      UR                  SO5      UR                  SP5      5      -  nUR                  SQ5      S;  ai  X" UR                  SR5      UR                  SS5      UR                  ST5      UR                  SU5      UR                  SV5      UR                  SW5      5      -  nUR                  SX5      S;  ai  X" UR                  SY5      UR                  SZ5      UR                  S[5      UR                  S\5      UR                  S]5      UR                  S^5      5      -  nUR                  S_5      S`;  ai  X" UR                  Sa5      UR                  Sb5      UR                  Sc5      UR                  Sd5      UR                  Se5      UR                  Sf5      5      -  nUR                  Sg5      S;  ai  X" UR                  Sh5      UR                  Sg5      UR                  Si5      UR                  Sj5      UR                  Sk5      UR                  Sl5      5      -  nUSm-  nU$ )ou   
Genera el HTML para la tabla de controladores con enlaces a fichas técnicas

Args:
    CotizacionControl_data (dict): Datos de los controladores

Returns:
    str: HTML para la tabla de controladores
r  c                   > Ub  US:X  d  US:X  a  gUS;   a  gT	" U5      nT	" U5      nU(       a(  UR                  5       (       a  SU SU =(       d    S S3nOU =(       d    SnSU SU=(       d    S SU=(       d    S SU SU S	3$ )
Nr  r^  )r2  r  r`  Select the cotroller brandr  r  r  r  r  r  r  r  s
            r{   r  Jget_optionsimput.<locals>.generate_quote_table_Control.<locals>.render_row  r  ru  r  r  )Nr  r2  r  r`  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  Nr  r2  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  )r[  r  r  r  r  deep_sear  s         r{   rl  6get_optionsimput.<locals>.generate_quote_table_Control  s   
	: ,//bA
 *..8 A@ @J01~.01126723 D 0:=()IJ ??#45=MMJ#(>?#	2#4#(?@#(@A#(@A D ??#<=EUUJ#(AB#(=>#(:;#(BC#(CD#(CD D ??#89AQQJ#(=>#5#7#(>?#(AB#(?@ D ??#;<DTTJ'OO,DE'OO,DE'OO,AB'OO,EF'OO,HI'OO,FG D ??8,4DDJ#6#6#8#7#(9:#8 D ??;/7GGJ#(89#(AB#(>?#(9:#(<=#(:; D 1K?*+HIH  ||H-5EE
$LL7$LL6$LL8$LL8$LL):;$LL9!   ||$67?OO
$LL);<$LL)>?$LL);<$LL)<=$LL)?@$LL)=>!   ||I.6FF
$LL8$LL7$LL9$LL9$LL);<$LL)9:!  #~6>NN
'OO,?@'OO,BC'OO,?@'OO,@A'OO,CD'OO,AB!   ||I.6FF
$LL8$LL7$LL9$LL9$LL);<$LL)9:!  #~6>NN
'OO,?@'OO,BC'OO,AB'OO,@A'OO,CD'OO,AB!  ??>2:rrJ#(;<#(:;#(<=#(<=#(?@#(=> D ???3;KKJ#(<=#8#(=>#(=>#(@A#(>? D 	  	 ru  c           	        > [        U 5      nU(       d  gUR                  5        VVs0 s H  u  p#UT'" U5      _M     nnnSnUS   nSnUS   nSnUS   n	Sn
US   nSnUS   nSnUS   nS	nUS   nS
nUS   nSnUS   nSnUS   nSnUS   nSnUS   nSnUS   nSnUS   nSn US   n!US   n"Sn#US   n$US   n%U 0 SUS   _SUS   _SU_SU_SUS   _SUS   _SUS   _SUS   _SUS   _SU_SU_SUS   _SUS   _S US    _S!US!   _S"US"   _S#U	_0 S$U_S%US%   _S&US&   _S'US'   _S(US(   _S)US)   _S*U_S+U
_S,US,   _S-US-   _S.US.   _S/US/   _S0US0   _S1U_S2U_S3US3   _S4US4   _E0 S5US5   _S6US6   _S7US7   _S8U_S9U_S:US:   _S;US;   _S<US<   _S=US=   _S>US>   _S?U_S@U_SAUSA   _SBUSB   _SCUSC   _SDUSD   _SEUSE   _E0 SFU_SGU_SHUSH   _SIUSI   _SJUSJ   _SKUSK   _SLUSL   _SMU_SNU_SOUSO   _SPUSP   _SQUSQ   _SRUSR   _SSUSS   _STU_SUU_SVUSV   _E0 SWUSW   _SXUSX   _SYUSY   _SZUSZ   _S[U_S\U_S]US]   _S^US^   _S_US_   _S`US`   _SaUSa   _SbU_ScU_SdUSd   _SeUSe   _SfUSf   _SgUSg   _E0 ShUSh   _SiU_SjU_SkUSk   _SlUSl   _SmUSm   _SnUSn   _SoUSo   _SpU_SqU_SrUSr   _SsUSs   _StUSt   _SuUSu   _SvUSv   _SwU!_SxU _E0 SyUSy   _SzUSz   _S{US{   _S|US|   _S}US}   _S~US~   _SU"_SUS   _SUS   _SUS   _SUS   _SUS   _SU$_SU#_SUS   _SUS   _SUS   _EUS   US   U%US   US   US   S.ES.n&U&$ s  snnf )Nrw  zAlternator strip heaterr  zMX321 - PMG UpgradezDM110 Digital voltage regulatorzVoltage adjust rheostatzBattery thermal wrapzBattery pad heaterzBattery disconnect switchzBattery restraintzOil pan heaterzOil level switch-murphy 129zRelay - 10A Common alarmzRelay - 10A Run relayzCoolant in Gen-setzOil in Gen-SetzHeater Disconnect Switchesz-Remote E-Stop - Visual / Plastic hinged coverItem_BandHeater
BandHeaterBandHeaterQTYTOTBandHeaterDESCBandHeater_PriceBandHeater_TSheetBandHeater_PriceTotItem_PMGUpdate	PMGUpdatePMGUpdateQTYTOTPMGUpdateDESCPMGUpdate_PricePMGUpdate_TSheetPMGUpdate_PriceTotItem_DigitalRegulatorDigitalRegulatorDigitalRegulatorQTYTOTDigitalRegulatorDESCDigitalRegulator_PriceDigitalRegulator_TSheetDigitalRegulat_PriceTotItem_VoltageRheostatVoltageRheostatVoltageRheostatQTYTOTVoltageRheostatDESCVoltageRheostat_PriceVoltageRheostat_TSheetVoltageRheosta_PriceTotItem_ThermalWrapThermalWrapThermalWrapQTYTOTThermalWrapDESCThermalWrap_PriceThermalWrap_TSheetThermalWrap_PriceTotItem_BaseHeater
BaseHeaterBaseHeaterQTYTOTBaseHeaterDESCBaseHeater_PriceBaseHeater_TSheetBaseHeater_PriceTotItem_BatterySwitchBatterySwitchBatterySwitchQTYTOTBatterySwitchDESCBatterySwitch_PriceBatterySwitch_TSheetBatterySwitch_PriceTotItem_BatteryHolderBatteryHolderBatteryHolderQTYTOTBatteryHolderDESCBatteryHolder_PriceBatteryHolder_TSheetBatteryHolder_PriceTotItem_OilHeater	OilHeaterOilHeaterQTYTOTOilHeaterDESCOilHeater_PriceOilHeater_TSheetOilHeater_PriceTotItem_OilLevelSwitchOilLevelSwitchOilLevelSwitchQTYTOTOilLevelSwitchDESCOilLevelSwitch_PriceOilLevelSwitch_TSheetOilLevelSwitch_PriceTotItem_CommonAlarmRelayCommonAlarmRelayCommonAlarmRelayQTYTOTCommonAlarmRelayDESCCommonAlarmRelay_PriceCommonAlarmRelay_TSheetCommonAlarmRel_PriceTotItem_FunctionRelayFunctionRelayFunctionRelayQTYTOTFunctionRelayDESCFunctionRelay_PriceFunctionRelay_TSheetFunctionRelay_PriceTotItem_CoolantCoolantCoolantQTYTOTCoolantDESCCoolant_PriceCoolant_TSheetCoolant_PriceTotItem_OilOil	OilQTYTOTOilDESC	Oil_Price
Oil_TSheetOil_PriceTotItem_DisconnectSwitchesDisconnectSwitchesDisconnectSwitchesQTYTOTDisconnectSwitchesDESCDisconnectSwitch_PriceDisconnectSwitch_TSheetDisconnectSwit_PriceTotItem_AddAccesory_EstopEStopQtyEStopEStopQTYTOTEStop_priceEStop_TSheetEStop_PriceTotItem_RemoteEStopRemoteEStopRemoteEStopQTYTOTRemoteEStopDESCRemoteEStop_PriceRemoteEStop_TSheetRemoteEStop_PriceTotItem_AddAccesory_SpringSpringIsolatorSpringIsolator_priceSpringIsolator_TSheetSpringIsolator_PriceTot)r  r  SpringIsolatorQTYTOTr  r  r  )r  AdditionalAccesories_Gensetr  )(r  r  r  r  r  r  r  r  r  r  r"  r!  r)  r(  r0  r/  r7  r6  r>  r=  rE  rD  rL  rK  rS  rR  rZ  rY  ra  r`  rh  rg  ro  rn  rv  r}  r|  r  r]  r  s(                                          r{   rc  7get_optionsimput.<locals>.Get_CotizacionAccesories_data  s
   .x8
L8B8H8H8JK8Ja++8J
K 3%k2-$[1@!+K!87 *; 70&{3-%k27(5/(5($[1:)+69!+K!83(5*";/"{+	!=#-k#: !+.I&{3)+6 %a0%z2C'Da0 !*\":a0 '(8	a0
 %na0 '
3E(Fa0 (4G)Ha0 *:6K+La0 %j1A&Ba0  K!8a0 &a0 $Ma0 &z2C'Da0  '
3E(F!a0" )*5I*J#a0( ,Z8O-P)a0* '
3E(F+a0, -.D-a0. +,@/a00 -j9Q.R1a02 .z:S/T3a04 .z:S/T5a0: +J7M,N;a0< &z2C'D=a0> ,-B?a0@ *+>Aa0B ,Z8O-PCa0D -j9Q.REa0F .z:S/TGa0L '
3E(FMa0N ":m#<Oa0P ():Qa0R &Sa0T (4G)HUa0V )*5I*JWa0X +J7M,NYa0^ &z2C'D_a0` !*\":aa0b '(8ca0d %nea0f '
3E(Fga0h (4G)Hia0j *:6K+Lka0p )*5I*Jqa0r $Z%@sa0t *+>ua0v ():wa0x *:6K+Lya0z +J7M,N{a0| -j9Q.R}a0B )*5I*JCa0D $Z%@Ea0F *+>Ga0H ():Ia0J *:6K+LKa0L +J7M,NMa0N -j9Q.ROa0T %j1A&BUa0V  K!8Wa0X &Ya0Z $][a0\ &z2C'D]a0^ '
3E(F_a0` )*5I*Jaa0f *:6K+Lga0h %j1A&Bia0j +,@ka0l )*<ma0n +J7M,Noa0p ,Z8O-Pqa0r .z:S/Tsa0x ,Z8O-Pya0z '
3E(F{a0| -.D}a0~ +,@a0@ -j9Q.RAa0B .z:S/TCa0D .z:S/TEa0J )*5I*JKa0L $Z%@Ma0N *+>Oa0P ():Qa0R *:6K+LSa0T +J7M,NUa0V -j9Q.RWa0\ #J~$>]a0^ z)4_a0` $]aa0b ";ca0d $Z%@ea0f %j1A&Bga0h '
3E(Fia0n 
: 6oa0p :e,qa0r  sa0t wua0v  K!8wa0x !*\":ya0z #J~$>{a0@ .z:S/TAa0B )*5I*JCa0D /0HEa0F -.DGa0H -j9Q.RIa0J .z:S/TKa0L .z:S/TMa0R -j9Q.RSa0T Z0Ua0V 
: 6Wa0X ";Ya0Z ":m#<[a0\ #J~$>]a0^ %j1A&B_a0d '
3E(Fea0f ":m#<ga0h ():ia0j &ka0l (4G)Hma0n )*5I*Joa0p +J7M,Nqa0v 0::S/T&01A&B,@,67M,N-78O-P/9:S/TAa0d%!L )(} Ls   Mc                   > SnSU4S jjnU R                  S0 5      nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S	5      UR                  S
5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S 5      5      -  nUR                  S!5      S;  ai  X" UR                  S"5      UR                  S#5      UR                  S$5      UR                  S%5      UR                  S&5      UR                  S'5      5      -  nUR                  S(5      S;  ai  X" UR                  S)5      UR                  S*5      UR                  S+5      UR                  S,5      UR                  S-5      UR                  S.5      5      -  nUR                  S/5      S;  ai  X" UR                  S05      UR                  S15      UR                  S25      UR                  S35      UR                  S45      UR                  S55      5      -  nUR                  S65      S;  ai  X" UR                  S75      UR                  S85      UR                  S95      UR                  S:5      UR                  S;5      UR                  S<5      5      -  nUR                  S=5      S;  ai  X" UR                  S>5      UR                  S?5      UR                  S@5      UR                  SA5      UR                  SB5      UR                  SC5      5      -  nUR                  SD5      S;  ai  X" UR                  SE5      UR                  SF5      UR                  SG5      UR                  SH5      UR                  SI5      UR                  SJ5      5      -  nUR                  SK5      S;  ai  X" UR                  SL5      UR                  SM5      UR                  SN5      UR                  SO5      UR                  SP5      UR                  SQ5      5      -  nUR                  SR5      S;  ai  X" UR                  SS5      UR                  ST5      UR                  SU5      UR                  SV5      UR                  SW5      UR                  SX5      5      -  nUR                  SY5      S;  ai  X" UR                  SZ5      UR                  S[5      UR                  S\5      UR                  S]5      UR                  S^5      UR                  S_5      5      -  nUR                  S`5      S;  ai  X" UR                  Sa5      UR                  Sb5      UR                  Sc5      UR                  Sd5      UR                  Se5      UR                  Sf5      5      -  nUR                  Sg5      S;  ai  X" UR                  Sh5      UR                  Si5      UR                  Sj5      UR                  Sk5      UR                  Sl5      UR                  Sm5      5      -  nUR                  Sn5      So;  ai  X" UR                  Sp5      UR                  Sn5      UR                  Sq5      UR                  Sr5      UR                  Ss5      UR                  St5      5      -  nUR                  Su5      S;  ai  X" UR                  Sv5      UR                  Sw5      UR                  Sx5      UR                  Sy5      UR                  Sz5      UR                  S{5      5      -  nUR                  S|5      So;  ai  X" UR                  S}5      UR                  S|5      UR                  S~5      UR                  S5      UR                  S5      UR                  S5      5      -  nUS-  nU$ )u   
Genera el HTML para la tabla de accesorios adicionales con enlaces a fichas técnicas

Args:
    CotizacionAccesories_data (dict): Datos de los accesorios adicionales

Returns:
    str: HTML para la tabla de accesorios adicionales
r  c                   > Ub  US:X  d  US:X  a  gUS;   a  gT	" U5      nT	" U5      nU(       a(  UR                  5       (       a  SU SU =(       d    S S3nOU =(       d    SnSU SU=(       d    S SU=(       d    S SU SU S	3$ )
Nr  r^  )r2  r  r  r  r  r  r  r  r  r  s
            r{   r  Mget_optionsimput.<locals>.generate_quote_table_Accesories.<locals>.render_row	  s    "kR&7;$;NLL $0
#; $0$=! j..00'
|3]^b^hfh]iimn	 JB	K   &B' (YBK  )* +*+ , ru  r  r  r  r
  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r"  r!  r#  r%  r$  r'  r&  r)  r(  r*  r,  r+  r.  r-  r0  r/  r1  r3  r2  r5  r4  r7  r6  r8  r:  r9  r<  r;  r>  r=  r?  rA  r@  rC  rB  rE  rD  rF  rH  rG  rJ  rI  rL  rK  rM  rO  rN  rQ  rP  rS  rR  rT  rV  rU  rX  rW  rZ  rY  r[  r]  r\  r_  r^  ra  r`  rb  rd  rc  rf  re  rh  rg  ri  rk  rj  rm  rl  ro  rn  rp  rr  rq  rt  r  rs  rv  rw  ry  rx  r{  rz  r}  r|  r~  r  r  r  r  r  r  r  r  r  r  r  )r]  r  r  r  r  s       r{   rk  9get_optionsimput.<locals>.generate_quote_table_Accesoriesq	  sI   
	8 0334QSUV ??<(0@@J 12 01 23 23 56 34 D ??;'/??J 010 12 12 45 23 D ??-.6FFJ 78 67 89 89 9: 9: D ??,-5EEJ 67 56 78 78 9: 89 D ??=)1AAJ 23 12 34 34 67 45 D ??<(0@@J 12 01 23 23 56 34 D ???+3CCJ 45 34 56 56 89 67 D ???+3CCJ 45 34 56 56 89 67 D ??;'/??J 010 12 12 45 23 D ??+,4DDJ 56 45 67 67 9: 78 D ??-.6FFJ 78 67 89 89 9: 9: D ???+3CCJ 45 34 56 56 89 67 D ??9%-==J/.00 23 01 D ??5!)99J
+	*,,/- D ??/08HHJ 9: 89 :; 89 9: 9: D ??7#+ccJ 89(.. 01/ D ??=)1AAJ 23 12 34 34 67 45 D ??+,4llJ 9: 01 67 67 9: 78 D 	  	 ru  c                   > [         R                  " 5       n[        U 5      nU(       d  gUR                  5        VVs0 s H  u  p4UT" U5      _M     nnnUR	                  SS5       SUR	                  SS5       3R                  5       nUS   nSnUS   US   -  nS	n	US
   US   -  n
SnUS   nSnUS   nSnUS   nSnUS   nUS   US   -  nUS   US   -  nUS   US   -  nUS   nSnU US   US   UUUS   US   US   0 SUS   _SUS   _SUS   _SU_SU_SUS   _SUS   _SUS   _SUS   _SUS   _S
US
   _S U	_S!U
_S"US"   _S#US#   _S$US$   _S%US%   _0 S&US&   _SUS   _S'U_S(US(   _S)US)   _S*US*   _S+US+   _S,US,   _SUS   _S-U_S.US.   _S/US/   _S0US0   _S1US1   _S2US2   _SUS   _S3U_E0 S4US4   _S5US5   _S6US6   _S7US7   _S8US8   _S9U_S:US:   _S;US;   _S<US<   _S=US=   _S>US>   _S?U_S@U_SAUSA   _SBUSB   _SCUSC   _SDUSD   _E0 SEUSE   _SFU_SGU_SHUSH   _SIUSI   _SJUSJ   _SKUSK   _SLUSL   _SMU_SNU_SOUSO   _SPUSP   _SQUSQ   _SRUSR   _SUS   _SSU_STU_E0 SUUSU   _SVUSV   _SWUSW   _SXUSX   _SYUSY   _SZUSZ   _S[US[   _S\US\   _S]US]   _S^US^   _S_US_   _S`USa   _SbUSb   _ScUSc   _SdUSd   _SeUSe   _SfUSf   _EUSg   USh   Si.ESj.Sk.nU$ s  snnf )lNrw  EnclosureTyper   - Enclosure_ConfigIDr  z120V GFCI ReceptacleQtyGFCI120Vz240V ReceptacleQtyReceptable120Vz)Prewire gen-set accesories to load centerzAutomatic LouverszOpening enclosurez*Louver fail contact wired to control panel
QtylightAC
QtylightDCQtySpaceHeaterOpeningEnclousureItem_Enclosuree_typeEnclosure_priceEnclosure_TSheetEnclosure_PriceTotItem_GFCI120VGFCI120VGFCI120VDESCGFCI120VQTYTOTGFCI120V_PriceGFCI120V_TSheetGFCI120V_PriceTotItem_Receptable120VReceptable120VReceptable120VDESCReceptable120VQTYTOTReceptable120V_PriceReceptable120V_TSheetReceptable120V_PriceTotItem_Enclosure_ligthAClightACEnclosure_ligthACQTYTOTlightAC_pricelightAC_TSheetlightAC_PriceTotItem_Enclosure_ligthDClightDCEnclosure_ligthDCQTYTOTlightDC_pricelightDC_TSheetlightDC_PriceTotItem_Enclosure_SHeaterSpaceHeaterEnclosure_SHeaterQTYTOTSpaceHeater_priceSpaceHeater_TSheetSpaceHeater_PriceTotItem_Enclosure_LCenter
LoadCenterEnclosure_LCenterQTYTOTLoadCenter_priceLoadCenter_TSheetLoadCenter_PriceTotItem_PrewireAccsEnclPrewireAccsEnclousurePWCDESC	PWCQTYTOTPrewireAccsEnclo_PricePrewireAccsEnclo_TSheetPrewireAccsEnc_PriceTotItem_autolouversr  AUTLOVEDESCAUTLOVEQTYTOTautolouvers_Priceautolouvers_TSheetautolouvers_PriceTotItem_ReceptautolouversReceptautolouversItem_ReceptautolouversDESCItem_ReceptautolouversQTYTOTReceptautolouver_PriceReceptautolouver_TSheetReceptautolouv_PriceTotItem_OpeningEnclousureOpeningEnclosure_DescriptionOpeningEnclosure_QtytotalOpeningEnclousure_PriceOpeningEnclousure_TSheetOpeningEnclousure_PriceTotItem_StopButtonEnclosureStopButtonEnclosureStopButtonEnclosure_QtyStopButtonEnclosure_PriceStopButtonEnclosure_TSheetStopButtonEnclosure_PriceTotItem_louvers_inr-  zlouvers_in_price:louvers_in_pricelouvers_in_tsheetlouvers_in_pricetotItem_louvers_outr/  louvers_out_pricelouvers_out_tsheetlouvers_out_pricetot)r  r  )r  r  EnclosureDESCEnclosureQTYTOTr  r  r  ConfigAndAccesories_Enclosure)r  r  )rm   !StopButtonEnclosureOptionsServicer^   r
  r   r  )r  stop_servicer  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r\  r  s                           r{   rf  6get_optionsimput.<locals>.Get_CotizacionEnclosure_dataj
  s4   9[[] /x8
L8B8H8H8JK8Ja++8J
K &>>/2>?s:>>RfhjCkBlmssu$[1-#M2Z5LL.)*=>KAXX={+	)";/(;$$.{$;!%Q"'1+'>$",\":Z=T"T",\":Z=T"T",-=">KAX"X",["9%8$ % -77M,N%/%@%2'6'12C'D(23E(F*45I*Jn6 (O)Dn6 #Jz$:	n6
 &z-'@n6 'n6 ).n6 )*5E*Fn6 *:6G+Hn6 ,Z8K-Ln6 .z:O/Pn6 )*5E*Fn6 ,Z8K-Ln6  -.@!n6" /0D#n6$ /
;Q0R%n6& 0<S1T'n6( 2:>W3X)n6. 1*=U2V/n60 ":i#81n62 %j&>3n64 23J5n66 (O)D7n68 )*5E*F9n6: +J7I,J;n6@ 1*=U2VAn6B ":i#8Cn6D %j&>En6F 23JGn6H (O)DIn6J )*5E*FKn6L +J7I,JMn6R 1*=U2VSn6T &z-'@Un6V )*5E*FWn6X 23JYn6Z ,Z8K-L[n6\ -j9M.N]n6^ /
;Q0R_n6d 1*=U2Ven6f %j&>gn6h 23Jin6j +J7I,Jkn6l ,Z8K-Lmn6n .z:O/Pon6t /
;Q0Run6v 0<S1Twn6x "7yn6z $Y{n6| 1*=U2V}n6~ 2:>W3Xn6@ 2:>W3XAn6F +J7I,JGn6H &z-'@In6J &{Kn6L (Mn6N ,Z8K-LOn6P -j9M.NQn6R /
;Q0RSn6X 1*=U2VYn6Z ,Z8K-L[n6\ 56P]n6^ 78T_n6` 1*=U2Van6b 2:>W3Xcn6d 2:>W3Xen6h 1*=U2Vin6j ,Z8K-Lkn6l 78Tmn6n 45Non6p 2:>W3Xqn6r 3J?Y4Zsn6t 5jA]6^un6x 3J?Y4Zyn6z .z:O/P{n6| 2:>W3X}n6~ 4Z@[5\n6@ 5jA]6^An6B 7
Ca8bCn6F *:6G+HGn6H %z,'?In6J ,j9K.LKn6L ,j9L.MMn6N .
;P0QOn6R +J7I,JSn6T &
=(AUn6V ,j9L.MWn6X 0::N/O1;<R1S[n6x{$ z ('A Ls   K-c                    > SnScU4S jjnU R                  S0 5      nU(       Ga  UR                  S5      S;  Ga  X" UR                  S5      UR                  S5      UR                  S5      UR                  S	5      UR                  S
5      UR                  S5      5      -  nSU;   GaM  US   nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S 5      UR                  S!5      UR                  S"5      5      -  nUR                  S#5      S;  ai  X" UR                  S$5      UR                  S#5      UR                  S%5      UR                  S&5      UR                  S'5      UR                  S(5      5      -  nUR                  S)5      S;  ai  X" UR                  S*5      UR                  S)5      UR                  S+5      UR                  S,5      UR                  S-5      UR                  S.5      5      -  nUR                  S/5      S;  ai  X" UR                  S05      UR                  S/5      UR                  S15      UR                  S25      UR                  S35      UR                  S45      5      -  nUR                  S55      S;  ai  X" UR                  S65      UR                  S75      UR                  S85      UR                  S95      UR                  S:5      UR                  S;5      5      -  nUR                  S<5      S;  ai  X" UR                  S=5      UR                  S>5      UR                  S?5      UR                  S@5      UR                  SA5      UR                  SB5      5      -  nUR                  SC5      S;  ai  X" UR                  SD5      UR                  SC5      UR                  SE5      UR                  SF5      UR                  SG5      UR                  SH5      5      -  nUR                  SI5      S;  ai  X" UR                  SJ5      UR                  SK5      UR                  SL5      UR                  SM5      UR                  SN5      UR                  SO5      5      -  nUR                  SP5      S;  ai  X" UR                  SQ5      UR                  SR5      UR                  SS5      UR                  ST5      UR                  SU5      UR                  SV5      5      -  nUR                  SW5      S;  aZ  X" UR                  SX5      UR                  SW5      SYUR                  SZ5      UR                  S[5      UR                  S\5      5      -  nUR                  S]5      S;  aZ  X" UR                  S^5      UR                  S]5      SYUR                  S_5      UR                  S`5      UR                  Sa5      5      -  nUSb-  nU$ )du   
Genera el HTML para la tabla de la caseta (enclosure) con enlaces a fichas técnicas

Args:
    CotizacionEnclosure_data (dict): Datos de la caseta y sus accesorios

Returns:
    str: HTML para la tabla de la caseta
r  c                   > Ub  US:X  d  US:X  a  gUS;   a  gT	" U5      nT	" U5      nU(       a(  UR                  5       (       a  SU SU =(       d    S S3nOU =(       d    SnSU SU=(       d    S SU=(       d    S SU SU S	3$ )
Nr  r^  )r2  r  Select the enclosureSeleccione el tipo de casetar  r  r  r  r  r  r  r  s
            r{   r  Lget_optionsimput.<locals>.generate_quote_table_Enclosure.<locals>.render_row&  s    "kR&7;$;N T T $0
#; $0$=! j..00'
|3]^b^hfh]iimn	 JB	K   &B' (YBK  )* +*+ , ru  r  r  )Nr  r2  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r-  r  1r  r  r  r/  r  r  r  r  r  r  r  )r\  r  r  	enclosurer  r  s        r{   rm  8get_optionsimput.<locals>.generate_quote_table_Enclosure  s   
	: -00bA	 7 @t tJ45o./0/02301 D /);'(GH ??:.6FFJ#8#7#(89#(89#(;<#(9: D ??#34<LLJ#(=>#(<=#(>?#(>?#(AB#(?@ D ??9-5mmJ#(@A#	2#(AB#8#(:;#(89 D ??9-5mmJ#(@A#	2#(AB#8#(:;#(89 D ??=19qqJ#(@A#6#(AB#(;<#(>?#(<= D ??<08ppJ#(@A#5#(AB#(:;#(=>#(;< D ??#:;CSSJ#(>?#	2#4#(@A#(AB#(AB D ??#67?OOJ#(@A#(FG#(CD#(AB#(DE#(BC D ??#89AQQJ#(BC#(=>#(AB#(CD#(FG#(DE D ??=19IIJ#(:;#6#8#(;<#(>?#(<= D ??#67?OOJ#(@A#(DE#(FG#(@A#(AB#(AB D ??<08HHJ#(9:#5#(:;#(=>#(;< D ??=19IIJ#(:;#6#(;<#(>?#(<= D 	  	 ru  c                   > [        U 5      nU(       d  gUR                  5        VVs0 s H  u  p#UT " U5      _M     nnnUR                  SS5       SUR                  SS5       SUR                  SS5       S3R                  5       nUS   nS	nUS   nS
nUS   n	Sn
US   nSnUS   nSnUS   nSnUS   nSnUS   nSnUS   nSnUS   nSnUS   nSnUS   nSnUS   nUS   nU US   US   UUUS   US   US   0 SUS   _SUS   _SU_SU_SUS   _SUS   _SUS   _S US    _S!US!   _S"U_S#U	_S$US$   _S%US%   _S&US&   _S'US'   _S(US(   _S)U_0 S*US*   _S+US+   _S,US,   _S-US-   _S.US.   _S/U
_S0U_S1US1   _S2US2   _S3US3   _S4US4   _S5US5   _S6U_S7U_S8US8   _S9US9   _S:US:   _E0 S;US;   _S<US<   _S=U_S>U_S?US?   _S@US@   _SAUSA   _SBUSB   _SCUSC   _SDU_SEU_SFUSF   _SGUSG   _SHUSH   _SIUSI   _SJUSJ   _SKU_E0 SLU_SMUSM   _SNUSN   _SOUSO   _SPUSP   _SQUSQ   _SRU_SSU_STUST   _SUUSU   _SVUSV   _SWUSW   _SXUSX   _SYU_SZU_S[US[   _S\US\   _E0 S]US]   _S^US^   _S_US_   _S`U_SaU_SbUSb   _ScUSc   _SdUSd   _SeUSe   _SfUSf   _SgU_ShU_SiUSi   _SjUSj   _SkUSk   _SlUSl   _SmUSm   _EUUUSn   USo   USp   Sq.ESr.Ss.nU$ s  snnf )tNrw  TankCapacityr  r  TankTypeTank_CapacityGALz galr  zRupture basin switchzFuel level sensorzOverfill protection valvezDual fuel switcheszHigh fuel level switch (FDEP)zRemote Alarm Panelz(12 Ft above grade (extended vent piping)z+Combustible liquids- Keep fire away (qty.2)z NFPA 7044 identification (qty 2)zNo Smoking (qty 2)z)TTank number and safe fill height (qty.2)z100% Engine containmentTank_ConfigID
Tank_priceTank_TSheetTank_PriceTotItem_BreakTraySwitchBreakTraySwitchBreakTraySwitchDESCBreakTraySwitchQTYTOTBreakTraySwitch_PriceBreakTraySwitch_TSheetBreakTraySwitc_PriceTotItem_FuelLevelSensorFuelLevelSensorFuelLevelSensorDESCFuelLevelSensorQTYTOTFuelLevelSensor_PriceFuelLevelSensor_TSheetFuelLevelSenso_PriceTotItem_Tank_SpillContSpillContainmentTank_SpillContQTYTOTSpillContainment_PriceSpillContainment_TSheetSpillContainme_PriceTotItem_OverfillValveOverfillValveOverfillValveDESCOverfillValveQTYTOTOverfillValve_PriceOverfillValve_TSheetOverfillValve_PriceTotItem_DualFuelSwitchDualFuelSwitchesDualFuelSwitchDESCDualFuelSwitchQTYTOTDualFuelSwitches_PriceDualFuelSwitches_TSheetDualFuelSwitch_PriceTotItem_HighFuelSwitchHighFuelSwitchHighFuelSwitchDESCHighFuelSwitchQTYTOTHighFuelSwitch_PriceHighFuelSwitch_TSheetHighFuelSwitch_PriceTotItem_RemoteAlarmPRemoteAlarmPanelRemoteAlarmPDESCRemoteAlarmPQTYTOTRemoteAlarmPanel_PriceRemoteAlarmPanel_TSheetRemoteAlarmPan_PriceTotItem_VentPipeVentPipeVentPipeDESCVentPipeQTYTOTVentPipe_PriceVentPipe_TSheetVentPipe_PriceTotItem_FlammableLFlammableLiquidsFlammableLDESCFlammableLQTYTOTFlammableLiquids_PriceFlammableLiquids_TSheetFlammableLiqui_PriceTotItem_NFPAIdentificatNFPAIdentificationNFPAIdentificatDESCNFPAIdentificatQTYTOTNFPAIdentificat_PriceNFPAIdentificat_TSheetNFPAIdentifica_PriceTotItem_NoSmoking	NoSmokingNoSmokingDESCNoSmokingQTYTOTNoSmoking_PriceNoSmoking_TSheetNoSmoking_PriceTotItem_TankNumber
TankNumberTankNumberDESCTankNumberQTYTOTTankNumber_PriceTankNumber_TSheetTankNumber_PriceTotItem_FluidContainmentFluidContainmentFluidContainment_PriceFluidContainment_TSheetFluidContainme_PriceTot)FluidContainmentDESCFluidContainmentQTYTOTrT  rU  rV  )r  r  TankDESC
TankQTYTOTr  r  r  ConfigAndAccesories_Tank)r  r  )r^   r
  r   r  )!r  r  r  r  rY  rZ  r  r  r  r	  r  r  r  r  r#  r$  r*  r+  r1  r2  r8  r9  r?  r@  rF  rG  rM  rN  rW  rX  r  r^  r  s!                                   r{   rh  1get_optionsimput.<locals>.Get_CotizacionTank_data  sW   .x8
L8B8H8H8JK8Ja++8J
K !nn^R89Z^^JXZ=[<\\_`j`n`n  pB  DF  aG  `H  HL  M  S  S  U,
4 *; 71 *; 77(51)+6<)+6/'4A#K0F%k2@ *; 7,$[1D%k28!+K!8)+6 % !+: 6%/%@!)#-",\":#-m#<%/%@t1.
;Q0Rt1 *:6G+Ht1 ./B	t1
 01Ft1 0<S1Tt1 1*=U2Vt1 2:>W3Xt1 /
;Q0Rt1 *:6G+Ht1 ./Bt1 01Ft1 0<S1Tt1  1*=U2V!t1" 2:>W3X#t1( .z:O/P)t1* +J7I,J+t1, /0D-t1. 1*=U2V/t10 2:>W3X1t12 2:>W3X3t18 -j9M.N9t1: (O)D;t1< ,->=t1> ./B?t1@ .z:O/PAt1B /
;Q0RCt1D 1*=U2VEt1J .z:O/PKt1L +J7I,JMt1N -.@Ot1P /0DQt1R 1*=U2VSt1T 2:>W3XUt1V 2:>W3XWt1\ .z:O/P]t1^ )*5E*F_t1` -.@at1b /0Dct1d /
;Q0Ret1f 0<S1Tgt1h 2:>W3Xit1n ,Z8K-Lot1p +J7I,Jqt1r +,<st1t -.@ut1v 1*=U2Vwt1x 2:>W3Xyt1z 2:>W3X{t1@ (O)DAt1B #Jz$:Ct1D 'Et1F ).Gt1H )*5E*FIt1J *:6G+HKt1L ,Z8K-LMt1R *:6G+HSt1T +J7I,JUt1V ).Wt1X +,<Yt1Z 1*=U2V[t1\ 2:>W3X]t1^ 2:>W3X_t1d /
;Q0Ret1f -j9M.Ngt1h ./Bit1j 01Fkt1l 0<S1Tmt1n 1*=U2Vot1p 2:>W3Xqt1v )*5E*Fwt1x $Z%<yt1z ({t1| */}t1~ *:6G+Ht1@ +J7I,JAt1B -j9M.NCt1H *:6G+HIt1J %j&>Kt1L ).Mt1N +,<Ot1P +J7I,JQt1R ,Z8K-LSt1T .z:O/PUt1Z 0<S1T[t1\ +J7I,J]t1^ 1E2H2<=U2V3=>W3X3=>W3Xgt1~AF #"a Ls   Kc                 <  > SnSjU4S jjnU R                  S0 5      nU(       Ga  UR                  S5      S;  Ga  X" UR                  S5      UR                  S5      UR                  S5      UR                  S	5      UR                  S
5      UR                  S5      5      -  nSU;   Gak  US   nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUR                  S5      S;  ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S 5      UR                  S!5      UR                  S"5      5      -  nUR                  S#5      S;  ai  X" UR                  S$5      UR                  S%5      UR                  S&5      UR                  S'5      UR                  S(5      UR                  S)5      5      -  nUR                  S*5      S;  ai  X" UR                  S+5      UR                  S,5      UR                  S-5      UR                  S.5      UR                  S/5      UR                  S05      5      -  nUR                  S15      S;  ai  X" UR                  S25      UR                  S35      UR                  S45      UR                  S55      UR                  S65      UR                  S75      5      -  nUR                  S85      S;  ai  X" UR                  S95      UR                  S:5      UR                  S;5      UR                  S<5      UR                  S=5      UR                  S>5      5      -  nUR                  S?5      S;  ai  X" UR                  S@5      UR                  SA5      UR                  SB5      UR                  SC5      UR                  SD5      UR                  SE5      5      -  nUR                  SF5      S;  ai  X" UR                  SG5      UR                  SH5      UR                  SI5      UR                  SJ5      UR                  SK5      UR                  SL5      5      -  nUR                  SM5      S;  ai  X" UR                  SN5      UR                  SO5      UR                  SP5      UR                  SQ5      UR                  SR5      UR                  SS5      5      -  nUR                  ST5      S;  ai  X" UR                  SU5      UR                  SV5      UR                  SW5      UR                  SX5      UR                  SY5      UR                  SZ5      5      -  nUR                  S[5      S;  ai  X" UR                  S\5      UR                  S]5      UR                  S^5      UR                  S_5      UR                  S`5      UR                  Sa5      5      -  nUR                  Sb5      S;  ai  X" UR                  Sc5      UR                  Sd5      UR                  Se5      UR                  Sf5      UR                  Sg5      UR                  Sh5      5      -  nUSi-  nU$ )ku   
Genera el HTML para la tabla del tanque de combustible con enlaces a fichas técnicas

Args:
    CotizacionTank_data (dict): Datos del tanque y sus accesorios

Returns:
    str: HTML para la tabla del tanque
r  c                   > Ub  US:X  d  US:X  a  gUS;   a  gT	" U5      nT	" U5      nU(       a(  UR                  5       (       a  SU SU =(       d    S S3nOU =(       d    SnSU SU=(       d    S SU=(       d    S SU SU S	3$ )
Nr  r^  )r2  r  z!Seleccionela capacidad del tanqueSelect the base tankr  r  r  r  r  r  r  r  s
            r{   r  Gget_optionsimput.<locals>.generate_quote_table_Tank.<locals>.render_row  s    "kR&7;$;N Y Y $0
#; $0$=! j..00'
|3]^b^hfh]iimn	 JB	K   &B' (YBK  )* +*+ , ru  r  r  )Nr  r2  r  z"Seleccione la capacidad del tanquer_  r  rY  rZ  r  r  r  r[  r   r  r  r  r  r  r  r  r  r  r  r	  r
  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r"  r!  r#  r$  r%  r'  r&  r)  r(  r*  r+  r,  r.  r-  r0  r/  r1  r2  r3  r5  r4  r7  r6  r8  r9  r:  r<  r;  r>  r=  r?  r@  rA  rC  rB  rE  rD  rF  rG  rH  rJ  rI  rL  rK  rM  rN  rO  rQ  rP  rS  rR  rW  rX  rT  rV  rU  r  r  r  )r^  r  r  tankr  r  s        r{   ro  3get_optionsimput.<locals>.generate_quote_table_Tank  s   
	: #&&vr2 DHHZ( 1j jJ)$&&)' D *T1"#=> ??#45=MMJ#(>?#(=>#(?@#(?@#(AB#(@A D ??#45=MMJ#(>?#(=>#(?@#(?@#(AB#(@A D ??#56>vvJ#(=>#(:;#(>?#(@A#(AB#(AB D ???3;KKJ#(<=#(;<#(=>#(=>#(@A#(>? D ??#56>NNJ#(=>#(<=#(>?#(@A#(AB#(AB D ??#34<LLJ#(=>#(<=#(>?#(>?#(AB#(?@ D ??#56>NNJ#(;<#(:;#(<=#(@A#(AB#(AB D ??:.6FFJ#8#7#(89#(89#(;<#(9: D ??#56>NNJ#(9:#(89#(:;#(@A#(AB#(AB D ??#78@PPJ#(>?#(=>#(?@#(?@#(AB#(@A D ??;/7GGJ#(89#8#(9:#(9:#(<=#(:; D ??<08HHJ#(9:#(89#(:;#(:;#(=>#(;< D ??#56>NNJ#(?@#(>?#(@A#(@A#(AB#(AB D 	  	 ru  c           
        > [        U 5      nU(       d  gUR                  5        VVs0 s H  u  p4UT" U5      _M     nnn[        US   [        5      (       a  [	        US   5      OUS   nUS   nX-  nXu-  nXu-  U-  n	US   n
U US   US   UUS   US   UUS   U	S.US	   US
   US   U
US   US   US   S.XS   -   S.nU$ s  snnf )u?   
Agrega información de garantías y pruebas a la cotización.
rw  Garanty_Percentager  Item_PrjWar_WarrantyGarantyGaranty_priceGaranty_PriceTot)re  rf  GarantyQTYTOTrd  Garanty_priceTABrg  Garanty_PriceTotTABrh  Item_PrjWar_TestingTeastingTeasting_ConfigIDTeasting_priceTeasting_DocumentTeasting_PriceTot)rl  rm  rn  TestingQTYTOTro  rp  rq  )r  WarrantyTestingPriceWarrantyAndTest)r^   r
  
isinstancerw   float)r  r_  r  r  r  rd  ri  unitaryprice_gensetrg  rh  rr  r`  r  s               r{   rj  :get_optionsimput.<locals>.Get_warranty_and_testing_pricingt  sO    /x8
L8B8H8H8JK8Ja++8J
KHRS]^rSsuxHyHyU:.B#CD  @J  K_  @`";/*:+@.CmS";/ %,67M,N))4%2*45I*J(2?(C%2+56H+I(8	 ,66K+L *: 6)34G)H&3&01A&B)34G)H)34G)H )9FY;Z(Z+*&0 .-K Ls   Cc                    [        U 5      nU(       d  g[        U 5      nUS   US   US   US   S.nSnUS   [        S	5      :  a<  [        [        U5      5      nUS   U-  nUS
   S:X  a  Xg-
  nOXg-   nUUS   US
   S.nU$ SU0nU$ )z 
Retorna el valor del descuento
)u2   Error: No se encontraron datos para al cotizaciónr   r  r  r  r  )isoCodestate
isDiscount	descuentor   r~  0r}  T)r<  discountr}  r<  )r^   rf   r   rw   )	r  rK  r  country_discount_datarCountryDatar<  granTotalDecimalr~  payloads	            r{   rr  -get_optionsimput.<locals>.get_country_discont  s     /x8
L "<H!E -Q/*1-/2.q1	
 %4&s9~6%k25EEI L)T1*6 )4 (5+L9G 	 G
 ru  c                 h  > SnSU4S jjnU R                  S0 5      nU(       ap  UR                  S5      (       aZ  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S	5      S5      -  nU R                  S
0 5      nU(       a  UR                  S5      (       ai  X" UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      5      -  nUS-  nU$ )u   
Genera el HTML para la tabla de garantía y pruebas con enlaces a fichas técnicas

Args:
    CotizacionWarrantyAndTest_data (dict): Datos de garantía y pruebas

Returns:
    str: HTML para la tabla de garantía y pruebas
r  Nc                    > Ub  US:X  a  gT	" U5      nT	" U5      nU(       a(  UR                  5       (       a  SU SU =(       d    S S3nOU =(       d    SnSU SU=(       d    S SU=(       d    S SU SU S3$ r  r  r  s
            r{   r  Eget_optionsimput.<locals>.generate_quote_table_WT.<locals>.render_row  r  ru  rs  rf  re  ri  rg  rh  rt  rm  rl  rr  ro  rq  rp  r  r  r  )r`  r  r  warrantytestingr  s        r{   rp  1get_optionsimput.<locals>.generate_quote_table_WT  s$   
	2 255j"E Y//J34Y'_-_-/0 D 144YC w{{:..J12J'O,,-/0/0 D 	  	 ru  c                     SSK nSnSnUR                  X0UR                  5      nU H4  nSR                  S U 5       5      n U(       a  [	        U5      nX'-  nM4  M6     U$ ! [
         a     MG  f = f)z
Suma todos los importes totales de una tabla HTML.

Args:
    html_table (str): HTML de la tabla generada
    
Returns:
    float: La suma total de todos los importes
r   Ng        zY<tr>.*?<td>.*?</td>.*?<td>.*?</td>.*?<td>.*?</td>.*?<td>.*?</td>.*?<td>(.*?)</td>.*?</tr>r  c              3   ^   #    U  H#  oR                  5       (       d  US :X  d  M  Uv   M%     g7f).N)isdigit).0cs     r{   	<genexpr>=get_optionsimput.<locals>.sum_total_prices.<locals>.<genexpr>8  s!     !X_		qTWx!!_s   -	-)refindallDOTALLjoinrw  
ValueError)
html_tabler  	total_sumpatternmatchesformatted_priceclean_priceprice_values           r{   rs  *get_optionsimput.<locals>.sum_total_prices   s     		 o **W"))<&O ''!X_!XXK"'"4K,I   ' 	  s   A!!
A/.A/c                 l    U c  g SR                  [        U 5      5      $ ! [        [        4 a     gf = f)z
Formatea un precio a formato de moneda (USD)

Args:
    price (float): Precio a formatear
    
Returns:
    str: Precio formateado
z$0.00z${:,.2f})formatrw  	TypeErrorr  )prices    r{   r  &get_optionsimput.<locals>.format_priceE  s=     =	$$U5\22:& 		s     33c                 F    [        U [        5      (       a  [        U 5      $ U $ )u:   Convierte objetos Decimal a float para serialización JSON)rv  r   rw  )objs    r{   r  )get_optionsimput.<locals>.convert_decimalW  s    c7##:
ru  z(/Ventas/VentasEUA/generar_pdf/<quote_id>c                 x  >  U (       d  [        SSS.5      S4$ U [        S'   [        [        R                  " 5       5      n[
        R                  R                  S5      nU SU  3n[        R                  n[        R                  R                  USS	S
S5      n[        R                  " USS9  [        R                  R                  USU S35      n[        R                  R                  USS
SS5      n[        R                  " SUUUU/SS9nUR!                  5       n	TE" U 5      n
U
S   S   nU
S   S   nUn[#        US5       n[%        USU S3SS9nSnSnSU SU  3n['        UUUU5      nUS   (       GaZ  US   n[)        UU 5        UnTH" U5      nUnX/n[        R*                  R-                  S S!5      (       + n[.        S!:X  Ga	   S"n[1        U 5      nTC" U 5      nTL" U5      nTR" U5      nT@" U 5      nTO" U5      nTR" U5      n TA" U 5      n!TJ" U!5      n"TR" U"5      n#TB" U 5      n$TK" U$5      n%TR" U%5      n&T?" U 5      n'TI" U'5      n(TR" U(5      n)TD" U 5      n*TM" U*5      n+TR" U+5      n,UU -   U#-   U&-   U)-   U,-   n-TF" U U-5      n.TN" U.5      n/TR" U/5      n0U-U0-   n1TP" U U15      n2[2        R4                  " 5       R7                  S#5      n3U S$U30US%   US&   S'.US(   US)   US*   US   US+   S,.US-   US   US.   S/.UU U#U&U)U,U0U1U2US0   [2        R4                  " 5       R7                  S15      U S2.S3.n4UR9                  S45      (       ab   [:        R,                  " U5      n
U
R=                  5         [?        S!SS59 n5U5RA                  U
RB                  5        U5RD                  n6S S S 5        OD[        R                  RK                  U5      (       d  [I        S7U S835        [M        S9U S835      eUn6[O        S:U4S;9n8[Q        UTGR*                  S<   US=9n9U8U9l)        [        R                  RU                  U5      =(       d    S>n: [#        W6S5       n;U;RW                  5       n<U9RY                  U:S?U<S@9  S S S 5         TQR[                  U95        UR9                  S45      (       a:  [        R                  RK                  U65      (       a  [        R`                  " U65        OO[        SUSG   05      S4sS S S 5        $ S S S 5        [        SHUSISJ.5      $ ! , (       d  f       GN-= f! [F         a  n7[I        S6[        U75       35        e S n7A7ff = f! , (       d  f       N= f! [F         a  n7[I        SA[        U75       35        e S n7A7ff = f! [F         a=  n7[I        SB[        U75       35        SCS K.n=[I        SDU=R_                  5        35        e S n7A7ff = f! [F         a  n7SE[c        5       ;   aP  [        R                  RK                  W65      (       a,  UR9                  S45      (       a  [        R`                  " U65        [I        SF[        U75       35         S n7A7GN]S n7A7ff = f! , (       d  f       GNl= f! [F         aH  n7SCS K.n=U=R_                  5       n>[I        SKU> 35        [        SSL[        U75       3S.5      SM4s S n7A7$ S n7A7ff = f)NNrt   u   ID de cotización no válido)statusr  i  r  /z,/Ventas/VentasEUA/VEUcotizadorbase?quote_id=staticpdfVentas	VentasEUAT)exist_okcotizacion_z.pdfpuppeteer_pdfzVEUcotizador.jsnode)start_new_sessionr  r  r  r  rbTechnicalSheet)streamfilenamenamezB/domains/sycelephant.com/public_html/file/Ventas/EUA/Cotizaciones/z/Ventas/EUA/Cotizaciones/_exitourl_webDEBUGFu   Cotización del proyectorx  r  r{  r|  r}  r  r  r  r  r  r  r  r  Country_DiscountrM  )rD  rE  rF  rG  rH  rI  rJ  rK  rL  countryDiscountrO  r  )r  r   r  r  r  rb  )zhttp://zhttps://)deletesuffixzERROR: Fallo al descargar PDF: zERROR: El archivo z
 no existezEl archivo z,/Ventas/VentasEUA/Mail/VEUcotizadormail.html)r	  MAIL_USERNAME)sender
recipientszdocumento.pdfzapplication/pdf)r  content_typer	  z"ERROR: Error al adjuntar archivo: u$   ERROR: Excepción al enviar correo: r   zERROR: Detalles del error: 	temp_pathzC-------------Error al enviar el correo:----------------------------mensaje
processingu#   La generación del PDF ha iniciado.)r  tokenr  zError detallado: zError: ru   )2r   r   rw   uuiduuid4r   host_urlrstripr   	root_pathospathr  makedirs
subprocessPopenwaitopenr   r   rc   configr   r   r^   r   rU  rV  
startswithrequestsraise_for_statusr   writecontentr  rv   r   existsFileNotFoundErrorr	   r   r  basenamereadattachsend	traceback
format_excunlinklocals)Sr  r  base_url	quote_urlbase_dir
output_diroutput_pathscript_pathprocessreturn_code	respuestacorreo_customercorreo_Sellerruta_archivo_localftechnicalSheetruta_pdfcarpetar  	resultador  
directoriourl_pdfcorreos_destinois_productionasunto_correor  rY  r=  rD  rZ  r>  rE  r[  r?  rF  r\  r@  rG  r]  rA  rH  r^  rB  rI  r_  r`  rC  rJ  rK  ra  r  r	  	temp_filer  rz   cuerpo_htmlmsgnombre_archivofile	file_datar  traceback_strrc  rd  re  rf  rg  rh  ri  rj  appeliminar_pdfs_en_directoriork  rl  rm  rn  ro  rp  rq  rr  mailrs  sS                                                                  r{   generar_pdf_cotizador/get_optionsimput.<locals>.generar_pdf_cotizador]  s   e	%=    
 #+GJ

%E ''..s3H#*$PQYPZ[I",,H h%;WJKK
T2'',,z[t3LMK '',,/8[BSK !&&( "&'G ",,.K/9I'
3ODO%h/>M!, ($/1!,*5'6)" `5$UG1XJ7;NDRZ\cd	W%%(3H#HX6!+J ;J GI&G'6&FO(3(:(:(>(>w(N$NM!U*Jr,FM)B8)LJ4Mh4W15PQf5g25EF\5]26QRZ6[37TUl7m47GH`7a45OPX5Y26RSi6j36FG^6_37ST\7]48VWo8p58HIb8c58UV^8_59XYr9s69IJd9e62I(2S/3LM`3a03CDX3Y0+AD\+\_v+v  zS  ,S  Vp  ,p  sG  ,GL=]^fht=u:4KLj4k14DEZ4[1(47L(LI 3FhPY2Z/ $,<<>#:#::#FD(0 &% 0:)/D=G=V-"
 8BBS7T7ABS7T7ABS7T5?5P3=m3L)" 3=\2J3=m3L3=m3L'" ?U@X?VE^B\<P=R1:3F7ABT7U2:,,.2I2I*2U08)+#$DJ  '112IJJ	!*08W0EI$-$>$>$@);5QW)X\e(1	8I8I(J4=NN	 *Y)X (*ww~~g'>'>$),>wiz*R$S*;k'R\<]*^$^,3	 +::hos*tK") -'*zz/'B+:#C (3CH-/WW-=-=g-F-Y/N
&%))T%:d04		I$'JJ1?5F-6 %/ %& &;& $		#  '112IJJrww~~^gOhOh "		) 4K +\ #GYy-A#BCSHK 0//R &@  y *Y)X (1 !*$),KCPQF8*T$U$)!*. &;%: $- & %(J3q6(&S T %& $- & %(LSQRVH&U V 0 %(CIDXDXDZC[&\ ] %&  ) r*fh6277>>);T;TY`YkYk  mD  ZE  ZE "		) 4!$ghklmhngo"pqq	r} 0/\  	%002M%m_56!$SVH-   		s  Y' D,Y' BYE7W0T4(TT$BW;U"U)U2U>AWY&	Y' 0Y' 
T	TWT
U #T;;U  W
U	UWU
U;U66U;;W>
W8W  WW
YA5YYYY
Y$Y' '
Z91=Z4.Z94Z9z,/Ventas/VentasEUA/check_pdf_status/<quoteId>c                     [        U 5      n[        U5      n[        R                  R	                  SS5      (       + n[
        S:X  a  US   nO$[        R                  R                  S5      nU S3n[        SUUS.5      $ )	Nr  FTRoutePDFr  z /Ventas/Ventas_EUA/Cotizador_EUA	completed)r  pdf_pathruta)
rd   rw   r   r  r   r   r   r  r  r   )quoteIdRutapdfRuta_pdfr  r  r  s         r{   check_pdf_status*get_optionsimput.<locals>.check_pdf_statusG  s     w'w<'..227EBB:&D''..s3HZ?@D%$  	ru  c                 $   [         R                  R                  U S5      n[        R                  " U5      nSnSnU H  n [         R                  " U5        US-  nM!     X4S.$ ! [
         a	    US-  n M9  [         a  nUS-  n S nAMM  S nAff = f)Nz*.pdfr   r  )
eliminadosfallidos)r  r  r  globremovePermissionErrorrv   )r  patron_busquedaarchivos_pdfr  r  archivorz   s          r{   r  5get_optionsimput.<locals>.eliminar_pdfs_en_directorioZ  s    '',,z7;yy1 
 $G		'"a
 $ )?? # A As   A$$B6	B?B

B)route)9r  r  r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r;  r  r  rc  rd  re  rf  rg  rh  ri  rj  r  r  r  rk  rl  rm  rn  ro  rp  rq  rr  r
  rs  s9   ``                                  @@@@@@@@@@@@@@@@@@@@@r{   get_optionsimputr  9   sk   YY<ugYN3 O3 	YYEPUwYW3 X3 	YYAE7YS3 T3 	YYBUGYT3 U3 	YYITYSZY[3 \3 	YYWbgahYi3 j3 	YYmx}w~Y3 @3 	YYz{3 |3 	YY  N  O3 O3 	YYAB3 C3 	YYQR3 S3 	YY  a  b3 b3 	YYST3 U3 	YYDE3 F3 	YYBC3 D3 	YYlm3 n3 	YY  B  C3 C3 	YYEPUwYW3 X3 	YYEPUwYW3 X3 	YYITYSZY[3 \3 	YYHSXRYYZ3 [3 	YYBUGYT3 U3 	YYCeWYU3 V3 	YYKL3 M3 	YYWX3 Y3 	YYCeWYU3 V3 	YY:UGYL3 M3 	YYBUGYT3 U3 	YYMN3 O3 	YYBUGYT3 U3, 	YY<vhYO P0tl 	YY3eV_YMfT fT fT NfTPi#V'%P9vo'`	IV
Q&dfPd)Jwrl(ZQfv#nQf/.b0dGR#J$ 	YY9F8YLf f f MfR 	YY=wYO P$@ru  )|flaskr   r   r   r   r   r   r	   r
   r   r  r  r  r  decimalr   r   App.Security_Module.UserPasswordr   
flask_mailr   tempfiler   r  r   r   r   r   werkzeug.datastructuresr   App.Subir_Archivor   +Consultas_SQL.Ventas.VentasEUA.CotizadorSQLr   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   App.api.controllerrk   App.api.servicesrl   rm   r   ru  r{   <module>r)     s   
  c c c  	       B  ' + + # / =                     6 5 Rt<@ru  