Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. -- Critica CFOP Permitido
  2. INSERT INTO tedi_grid_colunas (
  3. id,
  4. id_grid_tipo,
  5. nome,
  6. tamanho,
  7. alinhamento,
  8. ordenacao,
  9. ordem,
  10. display,
  11. ativo,
  12. in_vinculo_empresa,
  13. in_acao
  14. ) VALUES (
  15. tedi_grid_colunas_seq.nextval,
  16. 94,
  17. 'crit_cfop_permitido',
  18. 150,
  19. 'center',
  20. 'N',
  21. (SELECT MAX(ordem) + 1 FROM tedi_grid_colunas WHERE id_grid_tipo = 94),
  22. 'Crit. CFOP permitido',
  23. 'S',
  24. 'S',
  25. 'N'
  26. );
  27. INSERT INTO tedi_grid_empresa (
  28. cd_grid_empresa,
  29. cd_empresa,
  30. cd_grid_coluna,
  31. nr_ordem,
  32. tx_display
  33. ) VALUES (
  34. tedi_grid_empresa_seq.nextval,
  35. 12021, -- Código da P&G
  36. (SELECT id FROM tedi_grid_colunas WHERE id_grid_tipo = 94 AND nome = 'crit_cfop_permitido'),
  37. (
  38. SELECT
  39. MAX(nr_ordem) + 1
  40. FROM tedi_grid_empresa e
  41. INNER JOIN tedi_grid_colunas c ON e.cd_grid_coluna = c.id
  42. WHERE
  43. c.id_grid_tipo = 94
  44. ),
  45. 'Crit. CFOP permitido'
  46. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement