1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Necessidade de UPC antes da geracao do XML

Discussão em 'Progress 4GL' iniciado por Edbine Dantas, Outubro 16, 2024.

  1. Edbine Dantas

    Edbine Dantas Sem Pontuação

    Boa noite a todos!

    Alguém sabe se temos uma UPC antes da geração do XML no Datasul, onde eu possa testar uma tag?
    Outra duvida é:
    Como é feita a definição so CST de ICMS na geração do XML?
    Nossa nota sai sempre 010, quando deveria ser 000.
  2. bootstrapmaster

    bootstrapmaster Moderator Moderador Equipe de Suporte

    Ve se esse exemplo te ajuda.
    Código:
    /*  ------------------------------------------------------------
        programa .: ems2/upc/upc-axsep027.p
        autor ....: richard edgar - imesul
        data .....: 20/02/2018
        descricao : Tratar situa‡Æo especial de nota fiscal para
                    gera‡Æo da NFCe
        ------------------------------------------------------------ */
        {grid2/error.i}
    
        using totvs.faturamento.NFCe.*.
    
        {utp/ut-glob.i}    
        {cdp/cdcfgdis.i}
        {include/i-epc200.i1}
    
        define input        parameter p-ind-event as character no-undo.
        define input-output parameter table for tt-epc.
    
        define variable error              as ExceptionControl   no-undo.
        define variable transformaParaNFCe as TransformaparaNFCe no-undo.
    
        define variable hBusinessContent as handle no-undo.
        define variable hRoot            as handle no-undo.
    
        delete object hBusinessContent no-error.
        delete object hRoot            no-error.
    
        if p-ind-event = 'AtualizaXML' then do:
            assign error = ExceptionControl:getInstance().
    
            for first tt-epc no-lock
                where tt-epc.cod-event     = 'AtualizaXML'
                  and tt-epc.cod-parameter = 'hBusinessContent':
                create x-document hBusinessContent.
                create x-noderef  hRoot.
                assign hBusinessContent = widget-handle(tt-epc.val-parameter).
            end.
    
            if valid-handle(hBusinessContent) then do:
                assign transformaParaNFCe = new TransformaParaNFCe().
                error:clearExceptions().
                do {&try}:
                    transformaParaNFCe:transformar(hBusinessContent).
                    assign hBusinessContent = transformaParaNFCe:getXML().
                {&catch}
                if not error:catchException() then do:
                    for each tt-epc
                        where tt-epc.cod-event = 'AtualizaXML'
                          and tt-epc.cod-parameter = 'hBusinessContentANFAVEA':
                        delete tt-epc no-error.
                    end.
    
                    create tt-epc.
                    assign tt-epc.cod-event     = 'AtualizaXML'
                           tt-epc.cod-parameter = 'hBusinessContentANFAVEA'
                           tt-epc.val-parameter = string(hBusinessContent).
                end.
                delete object transformaParaNFCe no-error.
            end.
        end.
    

Compartilhe esta Página