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

EMS ERRO: DEV maior que REQ para o item no período na OP!

Discussão em 'EMS , HCM e Totvs 11' iniciado por ds201, Dezembro 11, 2021.

  1. bootstrapmaster

    bootstrapmaster Moderator Moderador Equipe de Suporte

    mais ou menos isso, movto-mat eu não entendo muito bem dela, teria que avaliar os tipos de movimento que ela registra ...
    Código:
    /*  ------------------------------------------------------------
        programa .:
        autor ....: richard edgar - imesul
        data .....:
        descricao :
        ------------------------------------------------------------ */
    
        define variable totalACA as decimal no-undo.
        define variable totalREQ as decimal no-undo.
    
        define variable totalROP as decimal no-undo.
        define variable totalSOB as decimal no-undo.
    
        assign totalACA = 0
               totalREQ = 0
               totalROP = 0
               totalSOB = 0.
    
        for each movto-estoq no-lock
            where movto-estoq.nr-ord-produ = 123:
            case {ininc/i03in218.i 4 movto-estoq.esp-docto}:
                when 'ACA' then assign totalACA = totalACA + movto-estoq.quantidade.
                when 'EAC' then assign totalACA = totalACA - movto-estoq.quantidade.
                when 'REQ' then assign totalREQ = totalREQ + movto-estoq.quantidade.
                when 'RRQ' then assign totalREQ = totalREQ - movto-estoq.quantidade.
            end case.
    
            case  {ininc/i01in218.i 4 movto-estoq.tipo-trans}:
                when 'Entrada' then do:
                    if {ininc/i03in218.i 4 movto-estoq.esp-docto} = 'ROP' then assign totalROP = totalROP + movto-estoq.quantidade.
                    if {ininc/i03in218.i 4 movto-estoq.esp-docto} = 'SOB' then assign totalSOB = totalSOB + movto-estoq.quantidade.
                end.
                when 'Saida' then do:
                    if {ininc/i03in218.i 4 movto-estoq.esp-docto} = 'ROP' then assign totalROP = totalROP - movto-estoq.quantidade.
                    if {ininc/i03in218.i 4 movto-estoq.esp-docto} = 'SOB' then assign totalSOB = totalSOB - movto-estoq.quantidade.
                end.
            end case.
        end.
    
        message 'TOTAL REPORTADO   : ' totalACA skip
                'TOTAL REQUISITADO : ' totalREQ skip
                'TOTAL SUCATA      : ' totalROP skip
                'TOTAL CO-PRODUTO  : ' totalSOB skip
            view-as alert-box info buttons ok.
        if (totalACA + totalROP + totalSOB) <> totalREQ then do:
            message 'ERRO DE REPORTE'
                view-as alert-box info buttons ok.
        end.
    
  2. ds201

    ds201 Membro Participativo

    Valeu pelo apoio.
    Muito obrigado.

Compartilhe esta Página