Advertisement
itfinden

Untitled

Oct 4th, 2023
45
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.46 KB | None | 0 0
  1. SELECT
  2. `dia` AS `5922`,
  3. `mes` AS `5923`,
  4. `ano` AS `5924`,
  5. `dua` AS `5925[_af]`,
  6. `serie` AS `5926`,
  7. `select_5927`.`descadu1` AS `5927[_af]`,
  8. `select_5928`.`desctido1` AS `5928[_af]`,
  9. `ruc` AS `5929[_af]`,
  10. IF
  11. (
  12. `nombre_declarante` IS NOT NULL
  13. AND TRIM( `nombre_declarante` ) <> '',
  14. CONCAT(
  15. `nombre_declarante`,
  16. '<br><div style="text-align:center; font-size:1.2rem;"><a style="color:black;" href="https://google.com/search?q=',
  17. SUBSTRING_INDEX( concat( `nombre_declarante`, '|PERU' ), '|', 1 ),
  18. ' ',
  19. SUBSTRING_INDEX( concat( `nombre_declarante`, '|PERU' ), '|',- 1 ),
  20. '" target="_blank"><i style="color:blue; text-align:center;" class="fa fa-google" title="Haga clic para abrir enlace de Google/Click to Google"></i></a>&nbsp;&nbsp;&nbsp;<a style="color:black;" href="https://www.linkedin.com/search/results/companies/?keywords=',
  21. `nombre_declarante`,
  22. '" target="_blank"><i style="color:blue; text-align:center;" class="fa fa-linkedin-square" title="Haga clic para abrir enlace de Linkedin/Click to Linkedin"></i></a></div>'
  23. ),
  24. NULL
  25. ) AS `5930[_af]`,
  26. `direccion_declarante` AS `5931[_af]`,
  27. `departamento` AS `5932[_af]`,
  28. `provincia` AS `5933[_af]`,
  29. `distrito` AS `5934[_af]`,
  30. `telefono` AS `5935`,
  31. `fax` AS `5936`,
  32. `select_5938`.`descvia1` AS `5938[_af]`,
  33. `select_5940`.`descban1` AS `5940[_af]`,
  34. `select_5941`.`descpaisa1` AS `5941[_af]`,
  35. `select_5942`.`descpaisa1` AS `5942[_af]`,
  36. `select_5943`.`nompuer` AS `5943[_af]`,
  37. `posicion_arancelaria` AS `5944[_af]`,
  38. `descripcion_posicion_arancelaria` AS `5945[_af]`,
  39. `producto` AS `5946[_af]`,
  40. `descripcion_comercial_1` AS `5947[_af]`,
  41. `descripcion_comercial_2` AS `5948[_af]`,
  42. `descripcion_comercial_3` AS `5949[_af]`,
  43. `descripcion_comercial_4` AS `5950[_af]`,
  44. `nombre_producto` AS `5951[_af]`,
  45. `marca` AS `5952[_af]`,
  46. `modelo` AS `5953[_af]`,
  47. `caracteristicas` AS `5954[_af]`,
  48. `ano_fabricacion` AS `5955`,
  49. FORMAT( `fob_serie`, 2, 'de_DE' ) AS `5956`,
  50. FORMAT( `flete`, 2, 'de_DE' ) AS `5957`,
  51. FORMAT( `seguro`, 2, 'de_DE' ) AS `5958`,
  52. FORMAT( `cif`, 2, 'de_DE' ) AS `5959`,
  53. FORMAT( `advalorem`, 2, 'de_DE' ) AS `5960[_af]`,
  54. FORMAT( `igv`, 2, 'de_DE' ) AS `5961`,
  55. FORMAT( `ipm`, 2, 'de_DE' ) AS `5962`,
  56. FORMAT( `peso_neto`, 2, 'de_DE' ) AS `5963`,
  57. FORMAT( `peso_bruto`, 2, 'de_DE' ) AS `5964`,
  58. FORMAT( `cantidad`, 2, 'de_DE' ) AS `5965`,
  59. `select_5966`.`descun` AS `5966`,
  60. FORMAT( `cif_unitario`, 2, 'de_DE' ) AS `5967`,
  61. FORMAT( `cantidad_comercial`, 2, 'de_DE' ) AS `5968`,
  62. `select_5969`.`descun1` AS `5969`,
  63. `select_5971`.`descbul1` AS `5971[_af]`,
  64. FORMAT( `cantidad_bulto`, 2, 'de_DE' ) AS `5972`,
  65. `select_5973`.`descesme1` AS `5973[_af]`,
  66. IF
  67. (
  68. `nombre_proveedor` IS NOT NULL
  69. AND TRIM( `nombre_proveedor` ) <> '',
  70. CONCAT(
  71. `nombre_proveedor`,
  72. '<br><div style="text-align:center; font-size:1.2rem;"><a style="color:black;" href="https://google.com/search?q=',
  73. SUBSTRING_INDEX( concat( `nombre_proveedor`, '|', `pais_origen` ), '|', 1 ),
  74. ' ',
  75. SUBSTRING_INDEX( concat( `nombre_proveedor`, '|', `pais_origen` ), '|',- 1 ),
  76. '" target="_blank"><i style="color:blue; text-align:center;" class="fa fa-google" title="Haga clic para abrir enlace de Google/Click to Google"></i></a>&nbsp;&nbsp;&nbsp;<a style="color:black;" href="https://www.linkedin.com/search/results/companies/?keywords=',
  77. `nombre_proveedor`,
  78. '" target="_blank"><i style="color:blue; text-align:center;" class="fa fa-linkedin-square" title="Haga clic para abrir enlace de Linkedin/Click to Linkedin"></i></a></div>'
  79. ),
  80. NULL
  81. ) AS `5974[_af]`,
  82. `agente_aduana` AS `5937[_af]`,
  83. `empresa_transporte` AS `5939[_af]`,
  84. `select_5970`.`descalm1` AS `5970[_af]`,
  85. `incoterm` AS `5975[_af]`,
  86. `manifiesto_de_carga` AS `5976`,
  87. `fecha_llegada` AS `5977[_af]`,
  88. FORMAT( IF ( CANTIDAD > 0, FOB_SERIE / CANTIDAD, '' ), 2, 'de_DE' ) AS `5984`,
  89. `bl_master` AS `5979`,
  90. `bill_of_lading` AS `5981`,
  91. `fecha_embarque` AS `5983[_af]`,
  92. `nave` AS `5982[_af]`,
  93. `agente_destino` AS `5978[_af]`,
  94. `select_5980`.`fpago` AS `5980[_af]`
  95. FROM
  96. `pe`.`PE_DT_00_IM_2023_01` `table`
  97. LEFT JOIN `pe`.`list_aduana` AS `select_5927` ON ( `table`.`aduana` = `select_5927`.`cod` )
  98. LEFT JOIN `pe`.`list_tipo_documento` AS `select_5928` ON ( `table`.`tipo_documento` = `select_5928`.`cod` )
  99. LEFT JOIN `pe`.`list_via_transporte_v2` AS `select_5938` ON ( `table`.`via_transporte` = `select_5938`.`cod` )
  100. LEFT JOIN `pe`.`list_bancos` AS `select_5940` ON ( `table`.`entidad_financiera` = `select_5940`.`cod` )
  101. LEFT JOIN `pe`.`list_pais` AS `select_5941` ON ( `table`.`pais_origen` = `select_5941`.`cod` )
  102. LEFT JOIN `pe`.`list_pais` AS `select_5942` ON ( `table`.`pais_adquisicion` = `select_5942`.`cod` )
  103. LEFT JOIN `pe`.`list_puertos` AS `select_5943` ON ( `table`.`puerto_embarque_num` = `select_5943`.`cod_num` )
  104. LEFT JOIN `pe`.`list_unidad_clean` AS `select_5966` ON ( `table`.`unidad_medida` = `select_5966`.`cod` )
  105. LEFT JOIN `pe`.`list_unidad_medida_comercial` AS `select_5969` ON ( `table`.`unidad_comercial` = `select_5969`.`cod` )
  106. LEFT JOIN `pe`.`list_tipo_bulto` AS `select_5971` ON ( `table`.`tipo_bulto` = `select_5971`.`cod` )
  107. LEFT JOIN `pe`.`list_estado_mercancia` AS `select_5973` ON ( `table`.`estado_mercancia` = `select_5973`.`cod` )
  108. LEFT JOIN `pe`.`list_almacen` AS `select_5970` ON ( `table`.`almacen` = `select_5970`.`cod` )
  109. LEFT JOIN `pe`.`list_formapago` AS `select_5980` ON ( `table`.`forma_pago` = `select_5980`.`cod` )
  110. WHERE
  111. (
  112. `table`.`posicion_arancelaria` LIKE '4011%')
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement