Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Definição da temp-table tt-decla-import-ord:

CampoTipoFormato
num-di-emsNumber>>>>>>>>9
cod-embarqCharacterx(16)
num-ordemNumberzzzzz9,99
num-parcelaNumber>>>>,>>9
num-adicNumber999
cod-estabCharacterx(5)
num-seqNumber>>>>9
log-emite-fabricanNumberyes/no
cdn-fabricanNumber>>>>>>>>9
cdn-fornecNumber>>>>>>>>9
cod-itemCharacterx(16)
cdn-pais-procedenNumber>>>,>>9
qtd-itemNumber>>>,>>>,>>9.99999
val-peso-liqNumber>>>,>>>,>>9.99999
val-peso-brut-mercNumber>>>,>>>,>>9.99999
val-peso-embalNumber>>>,>>>,>>9.99999
idi-ind-pagtoNumber>9
cod-naladi-nccaCharacterx(10)
cdn-naladi-sist-harmonNumber>>>>>>>9
cod-nbmCharacterx(10)
cod-aladiCharacterx(10)
cod-natur-operacCharacterx(06)
idi-tributac-impto-importNumber>9
idi-tributac-ipiNumber>9
idi-tributac-pisNumber>9
idi-tributac-cofinsNumber>9
idi-tributac-icmsNumber>9
val-aliq-ipiNumber>>9.9999
val-aliq-pisNumber>>9.9999
val-aliq-cofinsNumber>>9.9999
val-aliq-icmsNumber>>9.9999
val-aliq-iiNumber>>9.9999
cod-especifCharacterx(3900)
cod-tip-recipCharacterx(2)
qtd-capac-recipNumber>>>,>>>,>>9.99999
val-perc-reduc-pisNumber>>9.9999
val-perc-reduc-cofinsNumber>>9.9999
val-perc-reduc-icmsNumber>>9.9999
val-perc-reduc-impto-importNumber>>9.9999
val-perc-reduc-ipiNumber>>9.9999
log-suspens-impto-importNumberSim/Não
log-suspens-ipi-importNumberSim/Não
log-ipi-unidNumberSim/Não
log-pis-unidNumberSim/Não
log-cofins-unidNumberSim/Não
val-unit-cofinsNumber->>,>>>,>>>,>>9.99999999
val-unit-iiNumber->>,>>>,>>>,>>9.99999999
val-unit-ipiNumber->>,>>>,>>>,>>9.99999999
idi-metod-valNumber99
cod-licenc-importCharacterX(20)
cod-unid-med-fornecCharacterxx
val-unit-pisNumber->>,>>>,>>>,>>9.99999999
val-cub-totNumber->>,>>>,>>>,>>9.99999999
val-unit-icmsNumber->>,>>>,>>>,>>9.99999999
qtd-fornecNumber>>>>,>>>,>>9.99999
cod-unid-medid-itemCharacterX(02)
log-nota-ajust-importNumberSim/Não
nome-fabricanCharacterx(12)
des-modal-pagtoCharacterx(120)
des-moedaCharacterx(12)
nome-corretorCharacterx(12)
nome-bancoCharacterx(30)
nome-agentCharacterx(12)
des-moed-freteCharacterx(12)
des-moed-seguroCharacterx(12)
des-acresc-moedCharacterx(12)
des-moed-deducCharacterx(12)


Definição da temp-table tt-pedido-compr:

CampoTipoFormato
num-pedidoNumber>>>>>,>>9
num-ped-benefNumber>>>>>,>>9
naturezaNumber>9
data-pedidoDate99/99/9999
situacaoNumber>9
cod-emitenteNumber>>>>>>>>9
end-entregaCharacterx(5)
end-cobrancaCharacterx(5)
freteNumber>9
cod-transpNumber>>,>>9
via-transpNumber9
cod-cond-pagNumber>>>9
responsavelCharacterX(12)
cod-mensagemNumber>>9
impr-pedidoNumberSim/Não
comentariosCharacterx(2000)
mot-eliminaCharacterx(2000)
nome-assCharacterx(30)
cargo-assCharacterx(30)
emergencialNumberSim/Não
nr-prox-pedNumber>>>>>,>>9
contr-fornNumberSim/Não
nr-processoNumber999,999
compl-entregaCharacterx(7)
l-tipo-pedNumber>9
l-classificacaoNumber>9
l-ind-profNumberSim/Não
i-importadorNumber>>>>>>>>9
i-situacaoNumber>9
c-cod-tabelaCharacterx(10)
i-moedaNumber9
i-cod-formaNumber999999
i-cod-viaNumber9999
c-prazoCharacterx(20)
c-descr-mercCharacterx(53)
i-cod-portoNumber999999
de-vl-fobNumber>>>>>,>>>,>>9.9999
c-embalagemCharacterx(30)
c-observacaoCharacterx(75)
i-exportadorNumber>>>>>>>>9
desc-formaCharacterx(36)
desc-viaCharacterx(20)
de-vl-frete-iNumber>>>>,>>9.99
ind-orig-entradaNumber>9
ind-via-envioNumber>9
nro-proc-entradaNumber>>>>>>>>9
nro-proc-saidaNumber>>>>>>>>9
nro-proc-alteracaoNumber>>>>>>>>9
cod-maq-origemNumber999
num-processo-mpNumber>>>>>>>>9
num-id-documentoNumber999999999
nr-contratoNumber>>>>>>>>9
cod-estabelCharacterx(5)
check-sumCharacterx(20)
gera-ediNumberSim/Nao
cod-estab-gestorCharacterx(5)
cod-emit-tercNumber>>>>>>>>9
nr-ped-vendaNumber>>>,>>>,>>9
cod-entregaCharacterx(12)
endereco_textCharacterchar(2000)
enderecoCharacterx(40)
bairroCharacterx(30)
cidadeCharacterx(25)
estadoCharacterx(4)
paisCharacterx(20)
cepCharacterx(12)
jurisdicaoCharacterx(20)
local-entregaNumber9
nome-estabelCharacterX(40)
nome-ab-tercCharacterX(12)
nome-ab-transpCharacterX(12)
des-cond-pagCharacterx(30)
des-via-transpCharacter

Exemplo de EPC para utilização no Relatório Gerencial de ExportaçãoImportação:

Bloco de código
titleVeja aqui o código fonte de exemplo
collapsetrue
{include/i-epc200.i1} /* Definição tt-epc         */
DEFINE VARIABLE h-ttDados    AS HANDLE      NO-UNDO.
DEFINE VARIABLE bf-ttDados   AS HANDLE      NO-UNDO.
DEFINE VARIABLE qttDados     AS HANDLE      NO-UNDO.
DEFINE VARIABLE h-codEstabel AS HANDLE      NO-UNDO.
DEFINE VARIABLE h-serie      AS HANDLE      NO-UNDO.
DEFINE VARIABLE h-nrNotaFis  AS HANDLE      NO-UNDO.
DEFINE VARIABLE h-nrSeqFat   AS HANDLE      NO-UNDO.
DEFINE VARIABLE h-itCodigo   AS HANDLE      NO-UNDO.

DEFINE INPUT        PARAM p-ind-event  AS CHAR NO-UNDO.
DEFINE INPUT-OUTPUT PARAM TABLE for tt-epc.

IF (p-ind-event = "Custom-literals") THEN DO:

    CREATE tt-epc.
    ASSIGN tt-epc.cod-event = "Custom-literals"
           tt-epc.cod-parameter = "#lit-var-espec-teste1"
           tt-epc.val-parameter = "Lit teste 1".

    CREATE tt-epc.
    ASSIGN tt-epc.cod-event = "Custom-literals"
           tt-epc.cod-parameter = "#lit-var-espec-teste2"
           tt-epc.val-parameter = "Lit teste 2".

END.
ELSE IF (p-ind-event = "Custom-Fields-tt-dados-notas") THEN DO:

    /* Handle ttDados */
    FIND FIRST tt-epc
        WHERE tt-epc.cod-parameter = "Handle_tt-dados-nota":u NO-ERROR.

    IF AVAIL tt-epc THEN DO:

        ASSIGN h-ttDados = WIDGET-HANDLE(tt-epc.val-parameter) NO-ERROR.

        IF ERROR-STATUS:ERROR THEN
            NEXT.

        CREATE BUFFER bf-ttDados FOR TABLE h-ttDados BUFFER-NAME "tt-dados-nota".
        CREATE QUERY qttDados.
        qttDados:SET-BUFFERS(bf-ttDados).

        IF VALID-HANDLE(qttDados) THEN
            ASSIGN qttDados:FORWARD-ONLY = YES.

        qttDados:QUERY-PREPARE("FOR EACH tt-dados-nota").
        qttDados:QUERY-OPEN.
        qttDados:GET-FIRST.

        DO WHILE NOT(qttDados:QUERY-OFF-END):

            ASSIGN h-codEstabel       = bf-ttDados:BUFFER-FIELD("cod-estabel") 
                   h-serie            = bf-ttDados:BUFFER-FIELD("serie")
                   h-nrNotaFis        = bf-ttDados:BUFFER-FIELD("nr-nota-fis")
                   h-nrSeqFat         = bf-ttDados:BUFFER-FIELD("nr-seq-fat")
                   h-itCodigo         = bf-ttDados:BUFFER-FIELD("it-codigo").
          
        CREATE tt-epc.
        ASSIGN tt-epc.cod-event = "Custom-Fields-tt-dados-notas"
               tt-epc.cod-parameter = "#var-espec-teste1"
               tt-epc.val-parameter = "Estabelecimento: " + h-codEstabel:BUFFER-VALUE + "| Série: " + h-serie:BUFFER-VALUE + "| Nr Nota Fis: " + h-nrNotaFis:BUFFER-VALUE.
    
        CREATE tt-epc.
        ASSIGN tt-epc.cod-event = "Custom-Fields-tt-dados-notas"
               tt-epc.cod-parameter = "#var-espec-teste2"
               tt-epc.val-parameter = "Nr Seq Fat: " + h-nrSeqFat:BUFFER-VALUE + "| Item: " + h-itCodigo:BUFFER-VALUE.

            qttDados:GET-NEXT.
        END.

    END.

END.

RETURN "OK":U.

...