/****************************************************************************** 
*      Programa .....: rc0210b.f                                              *
*      Data .........: 28 de Maio de 1998                                     *
*      Sistema ......: RC - Revisao de Contas Medicas                         *
*      Empresa ......: DZSET Solucoes e Sistemas                              *
*      Cliente ......: Cooperativas Medicas                                   *
*      Programador ..: Nemora da Silva Berdete                                *
*      Objetivo .....: Definicao dos frames utilizados pela opcao de Informa- *
*                      coes de Movimentos (F3) - include RC/0210B1.i          *
*-----------------------------------------------------------------------------*
*      VERSAO    DATA        RESPONSAVEL     MOTIVO                           *
*      D.00.000  28/05/1998  Nemora          Desenvolvimento                  *
*      D.00.001  27/10/1998  Leonardo        Realinhamento da tela de dados   *
*                                            adicionais.                      *
*      D.01.000  17/11/1998  Leonardo        Inclusao do campo:               *
*                                            vl-base-valor-sistema            *
*                                            na tela de valores de pagamento  *
*      D.02.000  24/06/1999  Leonardo        Nova logica para glosas          *
*      D.03.000  05/08/1999  Leonardo        Retirar definicao glosas         *
*      E.00.000  25/10/2000  Nora            Mudanca Versao Banco             *
*      E.01.000  15/02/2001  Nora            Acrescimo qt-faixa-participacao  *
*      E.02.000  13/07/2001  Nora            Acrescimo ds-observacoes         *
*      E.03.000  18/03/2002  Alex            Acrescimo ds-cobra-partic-aux    *
******************************************************************************/
/* ----------------------- DEFINICAO DE VARIAVEIS -------------------------- */
def var  ds-limpa                  as char format "x(70)"              no-undo.
def var  ds-unidade-solic-aux      like unimed.nm-unimed               no-undo.
def var  ds-unidade-cob-aux        like unimed.nm-unimed               no-undo.
def var  ds-unidade-pag-aux        like unimed.nm-unimed               no-undo.
def var  nm-prest-solic-aux        like preserv.nm-prestador           no-undo.
def var  nm-prest-cob-aux          like preserv.nm-prestador           no-undo.
def var  nm-prest-pag-aux          like preserv.nm-prestador           no-undo.
def var  ds-vinc-solic-aux         like tipovinc.ds-tipo-vinculo       no-undo.
def var  ds-vinc-cob-aux           like tipovinc.ds-tipo-vinculo       no-undo.
def var  ds-especialid-cob-aux     like esp-med.ds-especialid          no-undo.
def var  ds-nivel-aux              as char format "x(18)"              no-undo.
def var  ds-validacao-aux          as char format "x(23)"              no-undo.
def var  ds-tipo-cob-aux           as char format "x(33)"              no-undo.
def var  ds-tipo-pag-aux           as char format "x(27)"              no-undo.
def var  ds-contas-aux             as char format "x(09)"              no-undo.
def var  ds-faturamento-aux        as char format "x(04)"              no-undo.
def var  ds-pagto-aux              as char format "x(04)"              no-undo.
def var  ds-porte-anest-cob-aux    like portanes.ds-porte-anestesico   no-undo.
def var  ds-tab-preco-cob-aux      like precproc.ds-tab-preco          no-undo.
def var  ds-tab-preco-proc-cob-aux like tabprepr.ds-tab-preco-proc     no-undo.
def var  ds-forma-pagto-cob-aux    like formpaga.ds-forma-pagto        no-undo.
def var  id-regra-fat-aux          as int                              no-undo. 
def var  id-regra-pag-aux          as int                              no-undo. 
def var  ds-regra-pag-aux          as char format "x(30)"              no-undo.
def var  ds-regra-fat-aux          as char format "x(30)"              no-undo.
def var  ds-cobra-partic-aux       as char                             no-undo.
def var  ds-tipo-doenca-aux        as char                             no-undo.
def var  ds-indic-acidente-aux     as char                             no-undo.
def var  ds-tipo-consulta-aux      as char                             no-undo.
def var  ds-tipo-saida-aux         as char                             no-undo.
def var  ds-tp-atend-aux           as char                             no-undo.
def var  cd-proc-aux               as int64                            no-undo.
def var  tm-doenca-aux             as char                             no-undo.
def var  ds-importante-aux         as char format "x(35)"              no-undo.
def var  ds-importante-aux1        as char format "x(35)"              no-undo.
def var  tp-tec-util-aux           as char format "x(35)"              no-undo.
def var  cd-pos-equipe-mov         as char format "x(30)"              no-undo. /* like moviproc.cd-pos-equipe */ 
def var  ds-motiv-encerra-aux      as char format "x(45)"              no-undo. /* like docto-revis-ctas-comp.cdn-motiv-encerra */

def var  ds-observacao1            as char format "x(35)"              no-undo.
def var  ds-observacao2            as char format "x(35)"              no-undo.
def var  ds-observacao3            as char format "x(35)"              no-undo.
def var  ds-observacao4            as char format "x(35)"              no-undo.
def var  ds-observacao5            as char format "x(35)"              no-undo.
def var  ds-observacao6            as char format "x(35)"              no-undo.
def var  ds-observacao7            as char format "x(35)"              no-undo.
def var  ds-fat-aux                as char format "x(08)"              no-undo.
def var  lg-continua-aux           as log                              no-undo.      
def var  cd-unidade-ptu-aux        like moviproc.cd-unidade            no-undo.  
def var  nr-carteira-ptu-aux       like moviproc.cd-carteira-usuario   no-undo.  
def var  nm-usuario-ptu-aux        like usuario.nm-usuario             no-undo.  
def var  tp-tabela-ptu-aux         as int  format "99"                 no-undo.
def var  cd-movimento-ptu-aux      as dec  format "9999999999"         no-undo.  
def var  ds-descricao-ptu-aux      as char format "x(35)"              no-undo.
def var  lg-pacote-ptu-aux         as log  format "Sim/Nao"            no-undo.
def var  cd-pacote-ptu-aux         as int  format "99999999"           no-undo.
def var  dt-servico-ptu-aux        as date format "99/99/9999"         no-undo.
def var  hr-realizacao-ptu-aux     as char format "99999999"           no-undo.
def var ds-status-aux              as char format "x(42)"              no-undo.
def var vl-contestado-aux          like refmoviproc.vl-movto-refat     no-undo.
def var vl-contestado-tx-aux       like refmoviproc.vl-movto-refat     no-undo.
def var vl-acordo-aux              like refmoviproc.vl-movto-refat     no-undo.
def var vl-acordo-tx-aux           as dec  format "->>>,>>>,>>9.99"    no-undo.
def var tp-acordo-aux              as int  format 99                   no-undo.
def var ds-acordo-aux              as char format "x(54)"              no-undo. 
def var ft-mult-serv-aux           as dec  format "9.99"               no-undo.
def var cd-unidade-prest-aux       as int                              no-undo.
def var cd-prest-aux               as int                              no-undo.
def var nm-prest-aux               as char format "x(60)"              no-undo.
def var nm-particip-aux            as char format "x(30)"              no-undo.
def var nm-porte-ane-aux           as char format "x(30)"              no-undo.
def var nm-via-acesso-aux          as char format "x(26)"              no-undo.
def var ds-rec-proprio-aux         as char  format "x(16)"             no-undo.                            
def var lg-alto-custo-aux          as log  format "Sim/Nao"            no-undo.
def var nr-nota-ptu-aux            as char format "x(20)"              no-undo.
def var nr-nota-princ-ptu-aux      as char format "x(20)"              no-undo.
def var ds-aceite-aux              as char format "x(20)"              no-undo.  /*like aceite-contstdo.des-aceite*/
def var ds-situacao-aux            as char format "x(23)"              no-undo.
def var ds-vl-aceito-aux           like refmoviproc.dec-2              no-undo.
def var ds-observacao-aux          as char format "x(20)"              no-undo.  /*like refmoviproc.char-1*/
def var nm-tp-autoriz-aux          as char format "x(15)"              no-undo.
def var nm-esp-prest-aux		     as char format "x(20)"			     no-undo.  

def var nr-cnpj-fornec-aux         like preserv.nr-cgc-cpf             no-undo.
def var id-pagto-fornec-aux        as char format "x(15)"              no-undo.
def var nm-fornecedor-aux          as char format "x(60)"              no-undo.
def var nm-det-reg-anvisa-aux      as char format "x(50)"              no-undo. 
def var nr-nota-fiscal-fornec-aux  as char format "x(20)"              no-undo.
def var ds-excecao-aux             as char format "x(60)"              no-undo.
def var ds-tp-paciente-aux         as char format "x(20)"              no-undo.

def var cdn-unid-prestdra-aux      like docrecon.cd-unidade-prestadora no-undo.
def var cdn-trans-aux              like docrecon.cd-transacao          no-undo.
def var cod-ser-docto-origin-aux   like docrecon.nr-serie-doc-original no-undo.
def var num-docto-origin-aux       like docrecon.nr-doc-original       no-undo.
def var num-docto-sist-aux         like docrecon.nr-doc-sistema        no-undo.

/* Campos novos PTU 8 */
def var lg-demanda-judicial-aux	  as log  format "Sim/Nao" init no	  no-undo.
def var in-tipo-rede-aux           as char format "x(30)"              no-undo.
def var in-tipo-pessoa-cont-aux	  as char format "x(8)"     		     no-undo. 
def var in-cnpj-cpf-cont-aux	     as char format "x(14)"			     no-undo.	      
def var cd-cnes-cont-aux		     as char format "9999999"			     no-undo.
def var cd-ibge-cont-aux		     as char format "x(40)" 		        no-undo.
def var lg-acres-urg-aux           as log  format "Sim/Nao"            no-undo.
def var nm-hospital-aux            as char format "x(60)"              no-undo.	
def var cd-uni-hosp-aux            as char format "x(04)"              no-undo.
def var cd-hosp-aux                as char format "x(08)"              no-undo.
	
/* Campos aviso A520 */
def var lg-aviso-aux               as log  format "Sim/Nao" init no	   no-undo.
def var lg-continuado-aux          as log  format "Sim/Nao" init no	   no-undo.
def var nr-lote-prest-aux          as char format "x(12)"	   		   no-undo.
def var dt-conhecimento-aux        as date format "99/99/9999"          no-undo.
def var lg-aviso-item-aux          as log  format "Sim/Nao" init no	   no-undo.
	
/*-------------------- VARIAVEIS FRAME REEMBOLSO ---------------------------*/ 
def var in-tipo-pessoa-reemb-aux  as char format "x(01)"               no-undo.
def var ds-tipo-pessoa-reemb-aux  as char format "x(10)"               no-undo.
def var nr-cpf-cnpj-reemb-aux     like preserv.nr-cgc-cpf              no-undo. 
def var nm-prest-reemb-aux        as char format "x(57)"               no-undo.        
def var nm-profissional-reemb-aux as char format "x(57)"               no-undo.  
def var nm-conselho-reemb-aux     as char format "x(07)"               no-undo.
def var cd-conselho-reemb-aux     as char format "x(15)"               no-undo.
def var uf-profissional-reemb-aux as char format "x(02)"               no-undo.

def var vl-cob-reemb-aux          like moviproc.vl-cobrado             no-undo.
def var vl-real-pago-aux          like moviproc.vl-real-pago           no-undo.
def var vl-base-valor-sistema-aux like moviproc.vl-base-valor-sistema  no-undo.   
def var dt-reembolso-aux          like titupres.dt-vencimento          no-undo.
                               
def var vl-difer-interc-aux       like moviproc.vl-real-pago           no-undo.
def var in-sit-cobr-aux           as char format "x(30)"               no-undo.  

def var vl-dif-cob-aux            like moviproc.vl-cobrado             no-undo.
def var vl-dif-pri-aux            like moviproc.vl-principal           no-undo.
def var vl-dif-sis-aux            like moviproc.vl-principal           no-undo.
def var vl-reemb-aux              like moviproc.dec-20                 no-undo.
def var vl-dif-glo-aux            like moviproc.vl-cobrado             no-undo.
def var vl-sistema-aux            like moviproc.vl-base-valor-sistema  no-undo.
def var vl-real-deflator-aux      as dec                               no-undo.

def var vl-cob-aux                like moviproc.vl-cobrado             no-undo.
def var vl-pri-aux                like moviproc.vl-principal           no-undo.
def var vl-sis-aux                like moviproc.vl-principal           no-undo.
def var vl-glo-aux                like moviproc.vl-cobrado             no-undo.
def var in-sit-cobr-imp-aux       as char format "x(10)"               no-undo.  
def var in-seq-item-aux           as int                               no-undo.

def button bt-historico           label "Histor. Auditoria"   size 19 by 1.5.  
def button bt-indicadores         label "Indicadores de Performance"   size 30 by 1.5.  

def temp-table tmp-mot-quest       no-undo
    field cd-motivo-gp             like refmoviproc.cd-motivo-gp
    field cd-motivo-ptu            like ptumotquest.cd-motivo-ptu
    field ds-motivo-ptu            like ptumotquest.ds-motivo-ptu
    field ds-observacao            like refmoviproc.ds-observacao.

/* ----------- Defini��o do frame dados guia ptu ----------------------------*/
def var nr-guia-arquivo-aux        as char format "x(25)"              no-undo.
def var ds-guia-valida-aux         as char format "x(60)"              no-undo.


/* ----- DEFINICAO DE VARIAVEIS PARA O PRESTADOR VALIDADE -------------------*/         
def buffer bf-unimed  for unimed. 
def buffer b-moviproc-con-glosa for moviproc.
def buffer b-movinsu-con-glosa for mov-insu.
def buffer bf-esp-med for esp-med.
    
/* ----------- Defini��o do frame de Eventos ---------------------------------*/
def var ds-movto-aux              as char format "x(12)"               no-undo.      
def var cd-grupo-proc-aux         as int                               no-undo.
def var cd-procedimento1-aux    like ambcbhpm.cd-amb                   no-undo.
def var cd-modalidade1-aux      like propost.cd-modalidade             no-undo.
def var cd-plano1-aux           like propost.cd-plano                  no-undo.
def var cd-tipo-plano1-aux      like propost.cd-tipo-plano             no-undo.
def var cd-modulo1-aux          like moviproc.cd-modulo                no-undo.
def var nr-nota-aux               as char format "x(11)"               no-undo.
def var nr-parcela-aux            as char format "x(02)"               no-undo.
def var nm-usuario-sistema-aux    as char format "x(50)"               no-undo.
def var cd-userid-aux            like movipres.cd-userid               no-undo.

/*------------------------ rtvinculoeventomov  --------------------------------*/
{rtp/rtvinculoeventomov.i}
def var lg-error-aux           as log                                   no-undo.
def var ds-error-aux           as char                                  no-undo.    
def var ind-proc-ins-aux      as char                                   no-undo.
def var count-total-aux       as int                                    no-undo.
def var count-aux             as int                                    no-undo. 
def var vl-abatimento-aux       like movipres.vl-movto                  no-undo.
def var vl-complemento-aux      like movipres.vl-movto                  no-undo.
def var vl-perc-deflator-aux      as dec                                no-undo.

  
/* ----- DEFINICAO DE VARIAVEIS PARA LER AS GLOSAS GRAVADAS NA (MOVRCGLO) -- */
def var  cd-unidade-glo            like moviproc.cd-unidade            no-undo.
def var  cd-unidade-prest-glo      like moviproc.cd-unidade-prestadora
                                                                       no-undo.
def var  cd-transacao-glo          like moviproc.cd-transacao          no-undo.
def var  nr-serie-doc-orig-glo     like moviproc.nr-serie-doc-original
                                                                       no-undo.
def var  nr-doc-orig-glo           like moviproc.nr-doc-original       no-undo.
def var  nr-doc-sistema-glo        like moviproc.nr-doc-sistema        no-undo.
def var  nr-processo-glo           like moviproc.nr-processo           no-undo.
def var  nr-seq-digitacao-glo      like moviproc.nr-seq-digitacao      no-undo.
def var  vl-cobrado-aux            as dec format "->>>,>>>,>>9.99"     no-undo.
def var  vl-pago-benef-aux         as dec format "->>>,>>>,>>9.99"     no-undo.

{rtp/rtsit-ini.i}
/* ------------------------------------------------------------------------ */
def var ds-indic-um-aux       as character   format "x(40)"          no-undo.
def var ds-perce-um-aux       as character   format "x(40)"          no-undo.
def var ds-valor-um-aux       as character   format "x(40)"          no-undo.

def var ds-indic-dois-aux     as character   format "x(40)"          no-undo.
def var ds-perce-dois-aux     as character   format "x(40)"          no-undo.
def var ds-valor-dois-aux     as character   format "x(40)"          no-undo.
def var ds-previsao-aux       as character   format "x(40)"          no-undo.

/* ----------- DEFINICAO DOS FRAMES INFORMACOES MOVIMENTOS ---------------- */
assign ds-limpa = "".

define {1} shared frame f-branco
       ds-limpa
        with no-box no-labels overlay row 19.

/* ----------------- DEFINICAO DO FRAME DE PRESTADORES -------------------- */
def rectangle r-f-prestadores
      edge-pixels 3 graphic-edge no-fill size 75 by 17.20.

define {1} shared frame f-prestadores
     skip(1)
     docrecon.cd-unidade-principal                               view-as text colon 27 
     unimed.nm-unimed                  format "x(31)"  no-label  view-as text colon 36 
     docrecon.cd-prestador-principal                             view-as text colon 27 
     preserv.nm-prestador              format "x(31)"  no-label  view-as text colon 36 
     docrecon.cd-vinculo-principal                               view-as text colon 27               
     tipovinc.ds-tipo-vinculo          format "x(31)"  no-label  view-as text colon 36 
     docrecon.cd-unidade-solicitante                             view-as text colon 27                   
     ds-unidade-solic-aux              format "x(35)"   no-label view-as text colon 36         
     docrecon.cd-prestador-solicitante                           view-as text colon 27                  
     nm-prest-solic-aux                format "x(35)"   no-label view-as text colon 36 
     docrecon.cd-vinculo-solicitante                             view-as text colon 27                      
     ds-vinc-solic-aux                 format "x(35)"   no-label view-as text colon 36 
     docrecon.cd-especialid                                      view-as text colon 27                                     
     esp-med.ds-especialid             format "x(35)"  no-label  view-as text colon 36                                                                       
     moviproc.cd-unidade-prestador                               view-as text colon 27         
     ds-unidade-cob-aux                format "x(35)"   no-label view-as text colon 36 
     moviproc.cd-prestador                                       view-as text colon 27 
     nm-prest-cob-aux                  format "x(35)"  no-label  view-as text colon 36 
     moviproc.cd-tipo-vinculo                                    view-as text colon 27 
     ds-vinc-cob-aux                   format "x(35)"  no-label  view-as text colon 36 
     moviproc.cd-esp-prest-executante                            view-as text colon 27         
     ds-especialid-cob-aux             format "x(35)"   no-label view-as text colon 36
     moviproc.cd-unidade-pagamento                               view-as text colon 27         
     ds-unidade-pag-aux                format "x(35)"   no-label view-as text colon 36 
     moviproc.cd-prestador-pagamento                             view-as text colon 27 
     nm-prest-pag-aux                  format "x(35)"   no-label view-as text colon 36 
     moviproc.cd-unidade-prest-valida                            view-as text colon 27 
     bf-unimed.nm-unimed               format "x(35)"  no-label  view-as text colon 36
     moviproc.cd-prestador-valida                                view-as text colon 27
     moviproc.nm-prestador-valida      format "x(35)"  no-label  view-as text colon 36     
     moviproc.cd-esp-prest-valida                                view-as text colon 27
     bf-esp-med.ds-especialid          format "x(35)"  no-label  view-as text colon 36
     skip(1)                                                        
     with three-d overlay row 2 side-labels 1 down centered  title " PRESTADORES ".
     
/* ----------------- DEFINICAO DO FRAME DADOS TISS -------------------- */
def rectangle r-f-tiss
      edge-pixels 3 graphic-edge no-fill size 90 by 30.

define {1} shared frame f-tiss   
     "  ---------------------- DADOS DOCUMENTO ---------------------- "           
     skip(0.5)                 
     docrecon.tp-doenca                      label "Tipo Doenca"            view-as text colon 20                       
     ds-tipo-doenca-aux                      format "x(12)" no-label        view-as text colon 21                       
     docrecon.int-4                          format ">9" label "Tm. Doenca" view-as text  
     tm-doenca-aux                           no-label                       view-as text 
     docrecon.in-acidente                    label "Ind.Acidente"           view-as text colon 20                 
     ds-indic-acidente-aux                   format "x(35)" no-label        view-as text colon 24                  
     docrecon.tp-consulta                    label "Tipo Consulta"          view-as text colon 20                      
     ds-tipo-consulta-aux                    format "x(35)" no-label        view-as text colon 24 
     docrecon.tp-saida                       label "Tipo Saida"             view-as text colon 20 
     ds-tipo-saida-aux                       format "x(35)" no-label        view-as text colon 24 
     docrecon.nm-prof-sol                    format "x(35)"                 
                                             label "Nm.Prof.Sol."           view-as text colon 20                
     ds-tp-atend-aux                         label "Tp.Atendimento"         
                                             format "x(35)"                 view-as text colon 20 
     docto-revis-ctas-comp.log-atendim-rn    label "Atendimento a RN"       
                                             format "Sim/Nao"               view-as text colon 20                                                                    
     ds-motiv-encerra-aux                    label "Mot.Encerram. SADT"     view-as text colon 20                                             
     ds-observacao1                          label "Observacao"         
                                             format "x(35)"                 view-as text colon 20
     ds-observacao2                          no-label  
                                             format "x(35)"                 view-as text colon 20
     ds-observacao3                          no-label  
                                             format "x(35)"                 view-as text colon 20
     ds-observacao4                          no-label
                                             format "x(35)"                 view-as text colon 20
     ds-observacao5                          no-label 
                                             format "x(35)"                 view-as text colon 20
     ds-observacao6                          no-label 
                                             format "x(35)"                 view-as text colon 20
     ds-observacao7                          no-label 
                                             format "x(35)"                 view-as text colon 20
     skip (.2)                                 
                                                                                             
     "  ---------------------- DADOS MOVIMENTO ---------------------- "       
     skip(0.5)                  
     moviproc.char-4                     label "Nm.Prof.Exec."                                   
                                                  format "x(35)"        view-as text colon 20                
     moviproc.dt-realizacao                                             view-as text colon 20       
     moviproc.hr-realizacao                       format "99:99"        view-as text colon 20       
     moviproc.char-5                     label "    Hr.Final Real."  
                                                  format "99:99"        view-as text 
     moviproc.in-liberado-contas         label "Liberado Contas"        view-as text colon 20                                            
     tp-tec-util-aux                     label "Tp.Tecnica.Util."       view-as text colon 20              
     cd-proc-aux                         label "Movimento"              view-as text colon 20
     mov-insu.cd-tipo-insumo             label "Tp.Insumo"              view-as text colon 45
     in-seq-item-aux                     label "Sequencia Item"         view-as text colon 20 
     ds-importante-aux                   label "***Importante"             
                                         format "x(35)"                 view-as text colon 20
     ds-importante-aux1                  format "x(35)" no-label        view-as text colon 20
     with three-d overlay row 1 side-labels centered  title " DADOS TISS " view-as dialog-box.     
           
/* ------------------- DEFINICAO DO FRAME DE TABELAS ---------------------- */
define {1} shared frame f-tabelas
       skip(1)
       moviproc.cd-tab-preco-proc              view-as text colon 22 
       tabprepr.ds-tab-preco-proc     no-label view-as text colon 33 
       moviproc.cd-tab-preco                   view-as text colon 22                  
       precproc.ds-tab-preco          no-label view-as text colon 33      
       moviproc.cd-forma-pagto                 view-as text colon 22                                 
       formpaga.ds-forma-pagto        no-label view-as text colon 33 
       moviproc.qt-repasse                     view-as text colon 22 
       moviproc.cd-tab-preco-proc-cob          view-as text colon 22         
       ds-tab-preco-proc-cob-aux      no-label view-as text colon 33     
       moviproc.cd-tab-preco-cob               view-as text colon 22
       ds-tab-preco-cob-aux           no-label view-as text colon 33
       moviproc.cd-forma-pagto-cob             view-as text colon 22
       ds-forma-pagto-cob-aux         no-label view-as text colon 33
       moviproc.qt-repasse-cob                 view-as text colon 22             
       moviproc.qt-procedimentos               view-as text colon 22
       id-regra-pag-aux               label "Regra Pagamento"
                                               view-as text colon 22
       ds-regra-pag-aux               no-label view-as text colon 33                                       
       id-regra-fat-aux               label "Regra Faturamento"
                                               view-as text colon 22                                       
       ds-regra-fat-aux               no-label view-as text colon 33                                                                                
       skip(1)
       with three-d overlay row 4 side-labels 1 down centered  title " TABELAS E MOEDAS DE VALORIZACOES ".
          

/* ------------------ DEFINICAO DOS FRAMES DE VALORES --------------------- */
define {1} shared frame f-valores-proc
    skip(1)
    vl-cobrado-aux                      view-as text colon 22 label "Vl.cobrado"
    moviproc.vl-honorarios-medicos      view-as text colon 60
    moviproc.vl-principal               view-as text colon 22              
    moviproc.vl-operacional             view-as text colon 60
    moviproc.vl-auxiliar                view-as text colon 22
    moviproc.vl-filme                   view-as text colon 60
    moviproc.vl-glosado                 view-as text colon 22
    moviproc.vl-desconto-prestador      view-as text colon 60
    moviproc.vl-base-valor-sistema      view-as text colon 22 format "->>>,>>>,>>9.99"
    moviproc.vl-dif-pagto-prestador     view-as text colon 60
    moviproc.vl-taxa-out-uni-cobrado    view-as text colon 22
    moviproc.vl-rateio-prestador        view-as text colon 60                                  
    moviproc.vl-taxa-out-uni-prin       view-as text colon 22
    moviproc.vl-taxa-out-uni-auxi       view-as text colon 22
    moviproc.vl-real-pago               view-as text colon 22
    moviproc.dec-17                     view-as text colon 60 label "Vl. Real Pago Taxa"
    moviproc.vl-real-glosado            view-as text colon 22
    moviproc.dec-18                     view-as text colon 60 label "Vl Real Glosado Tx"
    vl-abatimento-aux                   view-as text colon 22 label "Vl. Abatimento"
    vl-complemento-aux                  view-as text colon 60 label "Vl. Complemento"
    vl-perc-deflator-aux                view-as text colon 22 label "Vl Perc. Deflator"
    vl-real-deflator-aux                view-as text colon 60 label "Vl. Real Deflator"
    bt-indicadores                      at row 14 col 42
    skip(1)
    with three-d overlay row 4 side-labels 1 down centered  title "VALORES DE PAGAMENTO ".
      
define {1} shared frame f-valores-insu
       skip(1)
       vl-cobrado-aux                   view-as text colon 29 label "Vl.cobrado"
       mov-insu.vl-insumo               view-as text colon 29
       mov-insu.vl-glosado              view-as text colon 29
       mov-insu.vl-base-valor-sistema   view-as text colon 29 format "->>>,>>>,>>9.99"
       mov-insu.vl-taxa-out-insumo      view-as text colon 29             
       mov-insu.vl-taxa-out-uni-cobrado view-as text colon 29                    
       mov-insu.vl-desconto-prestador   view-as text colon 29
       mov-insu.vl-dif-pagto-prestador  view-as text colon 29
       mov-insu.vl-rateio-prestador     view-as text colon 29
       mov-insu.vl-real-pago            view-as text colon 29
       mov-insu.dec-17                  view-as text colon 29 label "Vl. Real Pago Taxa"
       mov-insu.vl-real-glosado         view-as text colon 29
       mov-insu.dec-18                  view-as text colon 29 label "Vl Real Glosado Tx"
       vl-abatimento-aux                view-as text colon 29 label "Vl. Abatimento"
       vl-complemento-aux               view-as text colon 29 label "Vl. Complemento"
       vl-perc-deflator-aux             view-as text colon 29 label "Vl Perc. Deflator"
       vl-real-deflator-aux             view-as text colon 60 label "Vl Real Deflator"
       skip(1)
       with three-d overlay row 4 side-labels 1 down centered  title "VALORES DE PAGAMENTO ".

/* ------------------- DEFINICAO DO FRAMES DE DATAS ----------------------- */
def rectangle r-datas
    edge-pixel 2 graphic-edge no-fill size 70 by 9.5.

define new shared frame f-datas
       skip(1)
       moviproc.dt-realizacao         view-as text colon 24
       moviproc.hr-realizacao         view-as text at 44
       moviproc.dt-base-valor         view-as text colon 24
       moviproc.dt-digitacao          view-as text colon 24
       moviproc.hr-digitacao          view-as text at 43
       moviproc.date-3                view-as text label "Data Conhecimento" colon 24 
       moviproc.cd-userid-digitacao   view-as text label "Usu. Conhecimento" at 40
       moviproc.dt-liberacao          view-as text colon 24
       moviproc.hh-liberacao          view-as text at 43
       moviproc.dt-desfazlib          view-as text label "Desf. liberacao movto." colon 24
       moviproc.cd-userid-desfazlib   view-as text label "Usuario desf. lib." at 39
       moviproc.cd-userid-liberacao   view-as text colon 24
       r-datas                        at row 1.3 col 1.5
       with three-d overlay row 4 size 71 by 11.7
              side-labels 1 down centered  title " DATAS E HORAS ".

      
/* -------------- DEFINICAO DOS FRAMES DE DADOS ADICIONAIS ---------------- */
def query q-histor-audit-pos for histor-protocolo-audit-pos.

def browse b-histor-audit-pos query q-histor-audit-pos no-lock
   display histor-protocolo-audit-pos.cdd-protocolo-atual   column-label "Protocolo Atual"
           
           if (histor-protocolo-audit-pos.cod-status = "E")
               then "Envio"
               else if (histor-protocolo-audit-pos.cod-status = "R")
                  then "Reenvio"
                  else if (histor-protocolo-audit-pos.cod-status = "C")
                     then "Contingencia"
                     else ""                                column-label "Status"
           histor-protocolo-audit-pos.des-observacao        column-label "Observacao"
           with size 72.5 by 14.5 overlay separators. 
           
define frame f-browse
    b-histor-audit-pos at row 2 col 2
with title "Historico dos Protocolos de Auditoria Sistema Externo" row 6 centered size 75 by 17 side-labels overlay three-d.
 
define {1} shared frame f-dados-adicionais-proc
       moviproc.cd-modulo                                             view-as text colon 21
       mod-cob.ds-modulo                no-label                      view-as text         
       moviproc.lg-anestesista                                        view-as text colon 21
       moviproc.cd-via-acesso                                         view-as text colon 21
       via-ace.ds-via-acesso            no-label                      view-as text colon 25
       moviproc.cd-porte-anestesico                                   view-as text colon 21
       portanes.ds-porte-anestesico     no-label                      view-as text colon 25
       moviproc.cd-porte-anestesico-cob                               view-as text colon 21
       ds-porte-anest-cob-aux           no-label                      view-as text colon 25
       moviproc.lg-trab-cooperado                                     view-as text colon 21
       moviproc.in-nivel-prestador                                    view-as text colon 21
       ds-nivel-aux                     no-label                      view-as text colon 25
       moviproc.lg-urgencia                                           view-as text colon 21
       moviproc.lg-adicional-urgencia                                 view-as text colon 66
       moviproc.cd-cod-glo                                            view-as text colon 21
       codiglos.ds-cod-glo              no-label                      view-as text colon 25
       moviproc.cd-tipo-percentual                                    view-as text colon 21
       tip-perc.ds-tipo-percentual      no-label                      view-as text colon 25
       moviproc.cd-validacao                                          view-as text colon 21
       ds-validacao-aux                 no-label                      view-as text colon 25
       moviproc.date-11                 label "Data Validacao"        view-as text colon 66
       moviproc.cd-user-validacao                                     view-as text colon 21
       moviproc.cd-userid-digitacao     format "x(9)"                view-as text colon 66
       moviproc.cd-tipo-cob                                           view-as text colon 21
       ds-tipo-cob-aux                  no-label                      view-as text colon 25
       moviproc.cd-tipo-pagamento                                     view-as text colon 21
       ds-tipo-pag-aux                  no-label                      view-as text colon 25
       ds-contas-aux                       label "Liberado do RC"     view-as text colon 21
       ds-faturamento-aux                  label "Liberado do FP"     view-as text colon 48
       ds-pagto-aux                        label "Liberado do PP"     view-as text colon 70
       moviproc.lg-cobrado-participacao                               view-as text colon 21
       moviproc.qt-faixa-participacao                                 view-as text colon 67
       moviproc.in-cobra-participacao                                 view-as text colon 21
       ds-cobra-partic-aux              no-label                      view-as text colon 25
       moviproc.cd-classe-erro                                        view-as text colon 21
       claserro.ds-classe-erro          no-label                      view-as text colon 25
       moviproc.dec-14                     label "Nr. Seq Imp A500"   
                                                  format "99999999"   view-as text colon 21
       moviproc.dec-3                      label "Nr.Linha Arq.Exp"    
                                                  format "99999999"   view-as text colon 67
       cd-pos-equipe-mov                   label "Grau de participacao"
                                                  format "x(30)"      view-as text colon 21
       temp-movi.in-contest-glosa          label "Contest.Glosa"      format "Sim/Nao"
                                                                      view-as text colon 67
       bt-historico                                                   at row 13.5 col 58
                                                                      
       with three-d side-labels overlay row 2 centered title " DADOS ADICIONAIS ".    
    
    
      
/* ------------------------------------------------------------------------- */
define {1} shared frame f-dados-adicionais-insu
       skip(1)
       mov-insu.cd-modulo                                       view-as text colon 21
       mod-cob.ds-modulo                no-label                view-as text 
       mov-insu.cd-cod-glo                                      view-as text colon 21                                            
       codiglos.ds-cod-glo              no-label                view-as text colon 25
       mov-insu.cd-validacao                                    view-as text colon 21                         
       ds-validacao-aux                 no-label                view-as text colon 25
       mov-insu.date-11                 label "Data Validacao"  view-as text colon 66                         
       mov-insu.cd-user-validacao                               view-as text colon 21 
       mov-insu.cd-userid-digitacao     format "x(9)"           view-as text colon 66
       mov-insu.cd-tipo-cob                                     view-as text colon 21 
       ds-tipo-cob-aux                  no-label                view-as text colon 25
       mov-insu.cd-tipo-pagamento                               view-as text colon 21 
       ds-tipo-pag-aux                  no-label                view-as text colon 25
       ds-contas-aux                    label "Liberado do RC"  view-as text colon 21                                                                       
       ds-faturamento-aux               label "Liberado do FP"  view-as text colon 45                                                                       
       ds-pagto-aux                     label "Liberado do PP"  view-as text colon 66                                                                        
       mov-insu.lg-cobrado-participacao                         view-as text colon 21
       mov-insu.qt-faixa-participacao                           view-as text colon 66
       mov-insu.in-cobra-participacao                           view-as text colon 21   
       ds-cobra-partic-aux              no-label                view-as text colon 25
       mov-insu.cd-classe-erro                                  view-as text colon 21 
       claserro.ds-classe-erro          no-label                view-as text colon 25
       mov-insu.log-11                  label "Utilizado UTI?"   
                                        format "Sim/Nao"        view-as text colon 21 
       mov-insu.dec-14                  label "Nr. Seq Imp A500" 
                                        format "99999999"       view-as text colon 21
       mov-insu.dec-13                  label "Nr.Linha Arq.Exp" 
                                        format "99999999"       view-as text colon 66 
       bt-historico                                                  at row 7.5 col 58 
       skip(1)
       with three-d overlay row 2 side-labels 1 down centered  title " DADOS ADICIONAIS ".
      
/*------------------ Frame para observacoes do moviproc -------------------- */
define frame f-observacao-moviproc
       moviproc.ds-observacao view-as editor size 76 by 4  max-chars 255
       with no-labels three-d centered overlay side-labels 1 down row 17.5 
            title " Observacoes ".
 
/*------------------ Frame para observacoes do moviproc -------------------- */
define frame f-observacao-mov-insu
       mov-insu.ds-observacao view-as editor size 76 by 4  max-chars 255
       with no-labels three-d centered overlay side-labels 1 down row 17.5
            title " Observacoes ".
            
/* ------------------------------------------------ DADOS ODONTOLOGIA --- */            
def button bt-sit-inicial label "Situacao Inicial" size 20 by 1.2 auto-go.

def {1} shared frame f-dados-odonto                                                                  
    skip(.2)     
    "              ---------- DADOS DOCUMENTO ------------"
    docrecon.nm-prof-sol     format "x(35)"    label "Nm.Prof.Solic."         colon 23 view-as text
    docrecon.char-16         format "x(07)"    label "Conselho Prof.Solic."   colon 23 view-as text
    docrecon.char-17         format "x(15)"    label "Nro Conselho"           colon 23 view-as text
    docrecon.char-18         format "x(02)"    label "UF Conselho"            colon 23 view-as text
    docrecon.char-19         format "x(07)"    label "CBO-S Prof.Solic."      colon 23 view-as text
    docrecon.dt-termino-tratamento             label "Dt.Termino Tratamento"  colon 23 view-as text
    docrecon.tp-atend                          label "Tipo de Atendimento"    colon 23 view-as text
    ds-tp-atend-aux          format "x(25)" no-label                                   view-as text
    docrecon.cd-faturamento                    label "Tipo de Faturamento"    colon 23 view-as text
    ds-fat-aux               format "x(25)" no-label                                   view-as text
    docto-revis-ctas-comp.log-atendim-rn       label "Atendimento a RN"       
                                               format "Sim/Nao"               colon 23 view-as text

    skip(.2)
    "              ---------- DADOS MOVIMENTO ------------"
    moviproc.char-4          format "x(35)"    label "Nm.Prof.Exec."          colon 23 view-as text
    moviproc.char-13         format "x(07)"    label "Conselho Prof.Exec."    colon 23 view-as text
    moviproc.char-14         format "x(15)"    label "Nro do Conselho"        colon 23 view-as text
    moviproc.char-15         format "x(02)"    label "UF Conselho"            colon 23 view-as text
    moviproc.char-11         format "x(07)"    label "CBO-S Prof.Exec."       colon 23 view-as text

    skip(.5)
    bt-sit-inicial                             label "Situacao Inicial"       colon 23
    skip(.3)     
    with row 01 size 70 by 21 side-labels overlay title " DADOS TISS (Odontologia) " three-d centered. 
        
on choose of bt-sit-inicial in frame f-dados-odonto
do:
  empty temp-table tmp-rtsit-ini-entrada.

  create tmp-rtsit-ini-entrada.
  assign tmp-rtsit-ini-entrada.in-modulo             = "RC"
         tmp-rtsit-ini-entrada.in-funcao             = "CON"
         tmp-rtsit-ini-entrada.cd-unidade            = docrecon.cd-unidade
         tmp-rtsit-ini-entrada.cd-unidade-prestadora = docrecon.cd-unidade-prestadora
         tmp-rtsit-ini-entrada.cd-transacao          = docrecon.cd-transacao
         tmp-rtsit-ini-entrada.nr-serie-doc-original = docrecon.nr-serie-doc-original
         tmp-rtsit-ini-entrada.nr-doc-original       = docrecon.nr-doc-original
         tmp-rtsit-ini-entrada.nr-doc-sistema        = docrecon.nr-doc-sistema.

  run rtp/rtsit-ini.p(input  table tmp-rtsit-ini-entrada,
                      output table tmp-rtsit-ini-saida,
                      output lg-continua-aux) no-error.

  if error-status:error 
  then do:
         message "Ocorreram erros na execucao da rotina RTSIT-INI." skip
                 substr(error-status:get-message(error-status:num-messages),1,72)
             view-as alert-box title "Atencao !!!".
         return no-apply.
       end.

  if keyfunction(lastkey) = "end-error"
  or lg-continua-aux      = no
  then return no-apply.
end.
      
/*------------------ Frame para observacoes do moviproc -------------------- 
define frame f-observacao-moviproc
       moviproc.ds-observacao view-as editor size 70 by 3  max-chars 255
       with no-labels three-d centered overlay side-labels 1 down row 15
            title " Observacoes ".
 
------------------ Frame para observacoes do moviproc -------------------- 
define frame f-observacao-mov-insu
       mov-insu.ds-observacao view-as editor size 70 by 3  max-chars 255
       with no-labels centered overlay side-labels 1 down row 15 three-d
            title " Observacoes ".      
------------------------------------------------------------------------- */

/* ----------------- DEFINICAO DO FRAME DE DADOS GUIA PTU ------------------- */
define {1} shared frame f-dados-guia-ptu
   skip(1)
   
   nr-guia-arquivo-aux                  label "Guia Arquivo"   view-as text   colon 15
   ds-guia-valida-aux                   label "Motivo"         view-as editor inner-chars 40 inner-lines 2 colon 15
   space(2)
   skip(1)
   with three-d overlay row 8 side-labels 1 down centered title " DADOS GUIA PTU A500 ".
     
/* ------------------- DEFINICAO DO FRAME DE DADOS PTU ---------------------- */
define {1} shared frame f-dados-ptu
   
   cd-unidade-ptu-aux                     label "Carteira"        	 view-as text colon 17
   nr-carteira-ptu-aux                 no-label                   	 view-as text 
   nm-usuario-ptu-aux    format "x(50)"   label "Beneficiario"    	 view-as text colon 17
   nr-nota-ptu-aux                        label "Nota"            	 view-as text colon 17
   nr-nota-princ-ptu-aux                  label "Nota Principal"  	 view-as text colon 17
   tp-tabela-ptu-aux                      label "Tp.Tabela"       	 view-as text colon 17
   nr-nota-fiscal-fornec-aux              label "Nr. Nota Fornec." 	 view-as text colon 57
   cd-movimento-ptu-aux                   label "Movimento"       	 view-as text colon 17
   lg-acres-urg-aux                       label "Id. Acres. Urg."     view-as text colon 57
   ds-descricao-ptu-aux                   label "Descricao"       	 view-as text colon 17
   lg-pacote-ptu-aux                      label "Pacote"          	 view-as text colon 17
   cd-pacote-ptu-aux                      label "Cod. Pacote"     	 view-as text colon 17
   nm-esp-prest-aux                       label "Esp. Prest."        view-as text colon 57
   dt-servico-ptu-aux                     label "Data Serv."         view-as text colon 17
   hr-realizacao-ptu-aux                  label "Hora Realiz."       view-as text colon 57
   ds-tp-paciente-aux                     label "Tipo Paciente"      view-as text colon 17
   ds-excecao-aux                         label "Codigo Excecao"     view-as text colon 17
   ft-mult-serv-aux                       label "Fat.Mult.Serv"      view-as text colon 17
   cd-unidade-prest-aux format "9999"     label "Unid. Prest"        view-as text colon 40 
   cd-prest-aux         format "99999999" label "Prest."             view-as text colon 60
   nm-prest-aux                           label "Nome Prestador"     view-as text colon 17
   nm-particip-aux                        label "Tp Participacao"    view-as text colon 17
   nm-porte-ane-aux                       label "Port Anestesico"    view-as text colon 17
   nm-via-acesso-aux                      label "Via de Acesso"      view-as text colon 17
   ds-rec-proprio-aux                     label "ID rec proprio"     view-as text colon 60
   lg-alto-custo-aux                      label "Alto Custo"         view-as text colon 17
   nm-tp-autoriz-aux                      label "Tipo Autorizacao"   view-as text colon 57
   nr-cnpj-fornec-aux                     label "CNPJ Fornecedor"    view-as text colon 17
   id-pagto-fornec-aux                    label "Pagto. Fornec."   	 view-as text colon 57
   nm-fornecedor-aux                      label "Nome Fornecedor"  	 view-as text colon 17
   nm-det-reg-anvisa-aux                  label "Det. Reg. ANVISA" 	 view-as text colon 17 
   
   with three-d overlay row 1 side-labels 1 down centered  title " DADOS PTU 1/2".
   
def rectangle r-prest-prin
    edge-pixels 3 graphic-edge no-fill size 75 by 8.
	  
def rectangle r-dados-aviso
    edge-pixels 3 graphic-edge no-fill size 75 by 6.
	  
define {1} shared frame f-dados-ptu2
	skip(0.5)
    lg-demanda-judicial-aux		  label "Demanda Judicial"      view-as text colon 18
    in-tipo-rede-aux               label "Tipo de Rede"          view-as text colon 18 
    skip(0.5)                                                    
    "Dados do Prestador Principal (Contratado Executante)"       view-as text at 2
    in-tipo-pessoa-cont-aux		  label "Tipo Pessoa"		     view-as text colon 15 
    in-cnpj-cpf-cont-aux		     label "CNPJ/CPF"		        view-as text colon 15 
    cd-cnes-cont-aux			        label "CNES"		              view-as text colon 15 
    cd-ibge-cont-aux			        label "Municipio"             view-as text colon 15
    nm-hospital-aux                label "Hospital"              view-as text colon 15
    cd-uni-hosp-aux                label "Unid.Hospital"         view-as text colon 15
    cd-hosp-aux                    label "Cod.Hospital"          view-as text colon 15
    skip(0.5)
	"Dados do Aviso de Cobranca"                               view-as text at 2
    lg-aviso-aux                   label "           Ind. Aviso" view-as text colon 23
    lg-continuado-aux              label "Benef. Compart. Risco" view-as text colon 23
    nr-lote-prest-aux              label "   Nr. Lote Prestador" view-as text colon 23
    dt-conhecimento-aux            label "    Data Conhecimento" view-as text colon 23
    lg-aviso-item-aux              label "  Ind. Aviso por Item" view-as text colon 23
	
	&if "{&window-system}" <> "TTY"
    &then
          r-prest-prin  at row 4.5 col 1.2
          r-dados-aviso at row 13  col 1.2
          with three-d overlay row 1 side-labels 1 down centered  title " DADOS PTU 2/2".
    &else
          with three-d overlay row 1 side-labels 1 down centered  title " DADOS PTU 2/2".
    &endif.
    
   
/* ------------------ DEFINICAO DO FRAME DE CONTESTACAO ---------------------- */
def query q-mot-quest for tmp-mot-quest scrolling.

def browse b-mot-quest query q-mot-quest no-lock 
    display tmp-mot-quest.cd-motivo-gp   column-label "Mot.GP"
            tmp-mot-quest.cd-motivo-ptu  column-label "Mot.PTU"
            tmp-mot-quest.ds-motivo-ptu  column-label "Descricao"
            tmp-mot-quest.ds-observacao  column-label "Complemento"
            with overlay separators size 77 by 12 title "Motivos Questionamento".
            
def {1} shared frame f-contestacao

    ds-status-aux                 label "Status"           view-as text at 9 skip
                                                           
    tp-acordo-aux                 label "Tp.Acordo"        view-as text at 6
                                                           
    ds-acordo-aux              no-label                    view-as text      skip(1)
                                                           
    vl-contestado-aux             label "Vl.Contestado"    view-as text at 2 
    
    vl-contestado-tx-aux          label "Vl.Contestado Tx." view-as text at 35 skip
    
    vl-acordo-aux                 label "Vl.Acordo"        view-as text at 6 
    
    vl-acordo-tx-aux              label "Vl.Acordo Tx."    view-as text at 39 skip
    
    ds-situacao-aux               label "Situacao"           view-as text at 7
    
    ds-aceite-aux                 label "Aceite"         view-as text at 46 skip
    
    ds-vl-aceito-aux              label "Vl.Aceito"        view-as text at 6
    
    ds-observacao-aux             label "Observacao"       view-as text at 42 skip(0.5)
    
    b-mot-quest                                                       at 2
    
    "Enter - Detalhar Complemento      F4 - Sair"                     at 2 skip(0.5)

    with side-labels overlay title " CONTESTACAO " no-underline three-d centered row 1 width 80.

/* ------------------------------------- COMPLEMENTO MOTIVO QUESTIONAMENTO --- */
def {1} shared frame f-compl-contest

    skip(0.5)
    
    tmp-mot-quest.ds-observacao              no-label
     view-as editor inner-chars  57
                    buffer-chars 57
                    inner-lines 9
                    buffer-lines 9 
                    max-chars 500            at 2
                    
    skip(0.5)                
    
    with side-labels overlay title " CONTESTACAO - COMPLEMENTO " no-underline three-d centered row 7 width 61.
/* --------------------------------------------------------------------------- */
def rectangle r-dados-eventos
    edge-pixels 3 graphic-edge no-fill size 75 by 21.00.
    
def rectangle r-divisoria-eventos1
    edge-pixels 3 graphic-edge no-fill size 73 by 0.2.  


define new shared frame f-dados-eventos
      tmp-rtvinculo-output.cd-unidade-prestador label "Unid.Prestador"               view-as fill-in size 05 by 1.2  at row 1.2   col 05
      tmp-rtvinculo-output.cd-tipo-medicina     label "Tp.Medicina"                  view-as fill-in size 03 by 1.2  at row 1.2   col 45
      tmp-rtvinculo-output.cd-prestador         label "Prestador"                    view-as fill-in size 09 by 1.2  at row 2.5   col 10
      preserv.nm-prestador           no-label                                view-as fill-in size 43 by 1.2
      tmp-rtvinculo-output.cd-evento            label "Evento"                       view-as fill-in size 04 by 1.2  at row 3.8   col 13
      evenfatu.ds-evento             no-label                                view-as fill-in size 48 by 1.2
      ds-movto-aux                      label "Tp.Movto."                    view-as fill-in size 13 by 1.2  at row 5.1   col 10
      tmp-rtvinculo-output.in-tipo-pagto        label "Extra/Desconto"               view-as fill-in size 03 by 1.2  at row 5.1   col 36
      cd-grupo-proc-aux                 label "Grupo Proc."                  view-as fill-in size 03 by 1.2  at row 6.4   col 08
      gru-pro.nm-grupo-proc          no-label                                view-as fill-in size 49 by 1.2
      cd-procedimento1-aux              label "Procedimento"                 view-as fill-in size 09 by 1.2  at row 7.9   col 07
      ambproce.ds-procedimento[1]    no-label                                view-as fill-in size 43 by 1.2
      cd-modalidade1-aux                label "Modalidade"                   view-as fill-in size 03 by 1.2  at row 9.2   col 09
      cd-plano1-aux                     label "Plano."                       view-as fill-in size 03 by 1.2  at row 9.2   col 28
      cd-tipo-plano1-aux                label "Tipo plano"                   view-as fill-in size 03 by 1.2  at row 9.2   col 42
      cd-modulo1-aux                    label "Modulo"                       view-as fill-in size 04 by 1.2  at row 9.2   col 62
      tmp-rtvinculo-output.aa-fatura            label "Ano fat."                     view-as fill-in size 05 by 1.2  at row 10.5  col 11
      tmp-rtvinculo-output.cd-serie-nf          label "Serie NF"                     view-as fill-in size 05 by 1.2  at row 10.5  col 27
      nr-nota-aux                       label "Nr.Nota/Parc"                 view-as fill-in size 12 by 1.2  at row 10.5  col 44
      nr-parcela-aux                 no-label                                view-as fill-in size 03 by 1.2
      tmp-rtvinculo-output.dt-realizacao        label "Dt.Realizacao"                view-as fill-in size 11 by 1.2  at row 11.8  col 06
      tmp-rtvinculo-output.dt-anoref            label "Ano periodo"                  view-as fill-in size 05 by 1.2  at row 11.8  col 35
      tmp-rtvinculo-output.nr-perref            label "Periodo ref."                 view-as fill-in size 04 by 1.2  at row 11.8  col 56
      tmp-rtvinculo-output.vl-movto             label "Valor Evento"                 view-as fill-in size 20 by 1.2  at row 14.5  col 3
      tmp-rtvinculo-output.val-livre-7          label "Vl.Corresp.Mov."              view-as fill-in size 19 by 1.2  at row 14.5  col 38
      tmp-rtvinculo-output.referencia           label "Referencia"                   view-as fill-in size 20 by 1.2  at row 15.8  col 5
      tmp-rtvinculo-output.lg-processado        label "Processado"                   view-as fill-in size 04 by 1.2  at row 17.1  col 5
      tmp-rtvinculo-output.ds-observacao[1]     label "Observacoes"                  view-as fill-in size 48 by 1.2  at row 18.4  col 4
      tmp-rtvinculo-output.cd-userid            label "Usuario"                      view-as fill-in size 13 by 1.2  at row 19.7  col 8
      nm-usuario-sistema-aux         no-label                                view-as fill-in size 34 by 1.2
      r-divisoria-eventos1                                                                                   at row 13.6  col 02
      r-dados-eventos                                                                                        at row 01    col 01
      with three-d overlay row 1 side-labels 1 down centered  title " EVENTOS DO MOVIMENTO - ABATIMENTOS/COMPLEMENTOS ".
      
      
/* ----------------------------------------------------------- DOCTO COPIA --- */
def button btnCopia                     label "Copia de"
     tooltip "Mostrar os dados referentes ao documento original."   
                                                        size 9 by 1.3 auto-go.

def rectangle r-dados-copia
   edge-pixel 3 graphic-edge no-fill size 69 by 9. 

def {1} shared frame f-dados-copia
                                                                                              skip(1)
    cdn-unid-prestdra-aux                         label "Unid.Prestadora"  view-as text at 4
    unimed.nm-unimed                           no-label                    view-as text at 26 skip
    cdn-trans-aux                                 label "      Transacao"  view-as text at 4     
    tranrevi.ds-transacao                      no-label                    view-as text at 26 skip
    cod-ser-docto-origin-aux                      label "          Serie"  view-as text at 4  skip
    num-docto-origin-aux                          label "      Documento"  view-as text at 4  skip
    num-docto-sist-aux                            label "      Sequencia"  view-as text at 4  skip (1)
    with three-d overlay row 5 side-labels 1 down centered  title " DOCUMENTO UTILIZADO PARA COPIA ".
    
define {1} shared frame f-indicadores-performance
    ds-indic-um-aux                              label "Indicador"         view-as text at col 11  row 2.5
    ds-perce-um-aux                              label "Percentual"        view-as text at col 10  row 3.5
    ds-valor-um-aux                              label "Valor bonificacao" view-as text at col 03  row 4.5 

    ds-indic-dois-aux                            label "Indicador"         view-as text at col 11  row 6.5 
    ds-perce-dois-aux                            label "Percentual"        view-as text at col 10  row 7.5 
    ds-valor-dois-aux                            label "Valor bonificacao" view-as text at col 03  row 8.5

    ds-previsao-aux                              no-label view-as text at col 03  row 10.5
    with size 75 by 14 three-d overlay row 5 side-labels 1 down centered  title " INDICADORES DE PERFORMANCE ".
    
def rectangle r-valores-reemb
   edge-pixel 3 graphic-edge no-fill size 77 by 7. 
   
def rectangle r-exec-reemb
   edge-pixel 3 graphic-edge no-fill size 77 by 6.5. 
    
    
define {1} shared frame f-dados-reembolso  
    r-valores-reemb                                                                at col 1.5  row 1.5
    " Valores "                                                                    at col 35.5 row 1
    /* ----- campos procedimentos da base/de fora e insumos -----*/                                                               
    vl-cob-reemb-aux            label "Vl.Solic. p/Reembolso"         view-as text at col 2    row 2.5
    dt-reembolso-aux            label "Dt.Reembolso"                  view-as text at col 49   row 2.5
    vl-real-pago-aux            label "Valor de Reembolso"            view-as text at col 5    row 3.5
	vl-pago-benef-aux           label "Vl.Pago p/Benef."              view-as text at col 45   row 3.5
    vl-base-valor-sistema-aux   label "Valor Sistema"                 view-as text at col 10   row 4.5
                                                                                              
    /* ----- campos procedimentos de fora -----*/                                                                                                                           
    vl-difer-interc-aux         label "Vl.Dif.Interc."                view-as text at col 9    row 5.5
    in-sit-cobr-aux             label "Tipo Cobranca"         	      view-as text at col 10   row 6.5
                                                                                                 
    /* ----- campos procedimento importados com tipo de reembolso igual a cobrar diferenca -----*/                                                                
    vl-dif-cob-aux              label "Vl.Dif.Interc.Cobrado"         view-as text at col 3    row 2.5
    vl-dif-pri-aux              label "Vl.Dif.Interc.Pri/Aux"         view-as text at col 3    row 3.5
    vl-dif-sis-aux              label "Vl.Dif.Interc.Sistema"         view-as text at col 3    row 4.5
    vl-reemb-aux                label "Vl.Reembolsado"                view-as text at col 47   row 4.5
    vl-dif-glo-aux              label "Vl.Dif.Interc.Glosado"         view-as text at col 3    row 5.5
    vl-sistema-aux              label "Vl.Sistema"                    view-as text at col 51   row 5.5
    
    /* ----- campos procedimento importados com tipo de reembolso integral -----*/                                                                
    vl-cob-aux              	label "Vl.Interc. Cobrado"            view-as text at col 5    row 2.5
    vl-pri-aux              	label "Vl.Interc. Pri/Aux"            view-as text at col 5    row 3.5
    vl-sis-aux                  label "Vl.Interc. Sistema"            view-as text at col 5    row 4.5
    vl-glo-aux              	label "Vl.Interc. Glosado"         	  view-as text at col 5    row 5.5
    in-sit-cobr-imp-aux         label "Tipo Cobranca"         	      view-as text at col 48   row 6.5
    
    /* ----- campos em comum -----*/                                                            
    r-exec-reemb                                                                   at col 1.5  row 9
    " Dados do Executante "                                                        at col 29.5 row 8.5                                      
    ds-tipo-pessoa-reemb-aux    label "Tipo de Pessoa"                view-as text at col 5    row 10
    nr-cpf-cnpj-reemb-aux       label "CPF/CNPJ"                      view-as text at col 45   row 10
    nm-prest-reemb-aux          label "Nome Prestador"                view-as text at col 5    row 11
    nm-profissional-reemb-aux   label "Nome Profissional"             view-as text at col 2    row 12
    nm-conselho-reemb-aux       label "Conselho Prof."                view-as text at col 5    row 13
    cd-conselho-reemb-aux       label "Numero do Conselho"            view-as text at col 35   row 13
    uf-profissional-reemb-aux   label "UF Prof."                      view-as text at col 11   row 14
	
    with size 78 by 16 three-d overlay row 5 side-labels 1 down centered  title " REEMBOLSO ".
    
	def frame f-lote-export-520
    skip(1)
    docto-aviso-cob.ind-sit            label  "              Situacao" format "x(35)" skip
    docto-aviso-cob.dat-conhecto       label  "     Data Conhecimento"   skip
    docto-aviso-cob.cod-lote-prestador label  "           Numero lote"   skip
    docto-aviso-cob.dat-gerac          label  "     Data/Hora geracao"
    "-"
    docto-aviso-cob.hra-geracao       no-label                          skip
    docto-aviso-cob.nom-arq           label  "          Nome Arquivo" format "x(25)" skip
    docto-aviso-cob.nom-arq-ret       label  "  Nome arquivo Retorno" format "x(25)" skip
    docto-aviso-cob.dat-import-ret    label  " Dt./Hora Imp. Retorno"
    "-"
    docto-aviso-cob.hra-import-ret    no-label                          skip
    skip(1)
    with three-d overlay centered side-labels row 5 title "Lote Exportacao - Aviso de Cobranca".          
    
/* --------------------------------------------------------------------------- */    
    
