Incio em 19/12/2023 13:52:41
psFileDDS=dd_files/erp_Repres.dda, psTagDDS=Esc_Padrao_1, psAncestrais=131, psIrmasTias=, psLogin=3979, psDSN=, psTDoc=
psMnemTDoc=RAvancModeloI, psOOpLogin=253, psRoot=1
psMarcados=, sInMarcados=00, sInMarcados=00, psCliPasta=desenvolvimento
plMobile=0, plEchoJson=0, plEchoUtf8=0
psDSN=127.0.0.1:/qtux/database/tq/gps_01.gdb
psVars=sRep=EFW/CBD~p0=EFW/CBD
al_Get_fsLoad_include.php-inicio
fsLoadTag
fsLoadBloco
fsLoadFTag
fsLoadFBloco
al_Get_fsLoad_include.php-fim-sTxt=<Padrao_1>   
   sTagMnemTDoc     = CUP
   sTagTit          = Tit1
   sTagCpoTit       = CpoTit1
   sTagCpo          = Cpo1
   sTagSql          = Sql1
   sTagSqlSum       = SqlSum1
   sTagMainTable    = CUP
   sTagMenu         = Menu1
   sTagNr0          = Nr01
   sTagTipoNr0      = TipoNr01
   sTagToolsBar     = Alterar,Zoom,Pesquisar
   sTagRAc          = false
   sTagPesquisar    = Pesquisar1
   sTagDbToVars     = DbToVars1       
   sTagVarsDef      = VarsDefault1   
   sTagScript       = ScriptForm1    
   sTagVarsToServer = VarsToServer1  
   sTagVarsToDb     = VarsToDb1      
   sTagServerVal    = ServerValids1  
   sTagTitulo       = TelaTit1
   sLabelsAlign     = Left
   sTagSubGrid      = 1,2
</Padrao_1>
<Padrao_2>   
   sTagMnemTDoc     = CUP
   sTagTit          = Tit2
   sTagCpoTit       = CpoTit2
   sTagCpo          = Cpo2
   sTagSql          = Sql2
   sTagSqlSum       = SqlSum1
   sTagMainTable    = CUP
   sTagMenu         = Menu2
   sTagNr0          = Nr01
   sTagTipoNr0      = TipoNr01
   sTagToolsBar     = Alterar,Zoom,Pesquisar
   sTagRAc          = false
   sTagPesquisar    = Pesquisar1
   sTagDbToVars     = DbToVars1       
   sTagVarsDef      = VarsDefault1   
   sTagScript       = ScriptForm2
   sTagVarsToServer = VarsToServer1  
   sTagVarsToDb     = VarsToDb1      
   sTagServerVal    = ServerValids2
   sTagTitulo       = TelaTit1
   sLabelsAlign     = Left
   sTagSubGrid      = 1,2
</Padrao_2>
<Padrao_3>   
   sTagMnemTDoc     = CUP
   sTagTit          = Tit3
   sTagCpoTit       = CpoTit3
   sTagCpo          = Cpo3
   sTagSql          = Sql1
   sTagSqlSum       = SqlSum1
   sTagMainTable    = CUP
   sTagMenu         = Menu3
   sTagNr0          = Nr01
   sTagTipoNr0      = TipoNr01
   sTagToolsBar     = Alterar,Zoom,Pesquisar
   sTagRAc          = false
   sTagPesquisar    = Pesquisar1
   sTagDbToVars     = DbToVars1       
   sTagVarsDef      = VarsDefault1   
   sTagScript       = ScriptForm3
   sTagVarsToServer = VarsToServer1  
   sTagVarsToDb     = VarsToDb1      
   sTagServerVal    = ServerValids2
   sTagTitulo       = TelaTit1
   sLabelsAlign     = Left
   sTagSubGrid      = 1,2
</Padrao_3>
<Range_1>   
   sTagMnemTDoc     = CUP
   sTagTit          = Tit1
   sTagCpoTit       = CpoTitRange1
   sTagCpo          = CpoRange1
   sTagSql          = Sql1
   sTagSqlSum       = SqlSum1
   sTagMainTable    = CUP
   sTagMenu         = Menu1
   sTagNr0          = Nr02
   sTagTipoNr0      = TipoNr02
   sTagToolsBar     = Alterar,Zoom,Pesquisar
   sTagEntrarAlterando = true
   sTagDbToVars     = DbToVars1       
   sTagVarsDef      = VarsDefault1
   sTagScript       = ScriptForm1    
   sTagVarsToServer = VarsToServer1  
   sTagVarsToDb     = VarsToDb1      
   sTagServerVal    = ServerValids1  
   sTagTitulo       = TelaTit1
   sLabelsAlign     = Left
   sTagSubGrid      = 1,2
   sTagVarsRange    = VarsRange1
   sTagQryRange     = QryRange1
   sTagScriptRange  = ScriptRange1
   sTagVarsToServerRange  = VarsToServerRange1  
   sTagVarsDefRange = VarsDefaultRange1         
   sTagServerValRange  = ServerValidsRange1     
   sTagTituloRange  = TitRange1
</Range_1>
<Range_3>   
   sTagMnemTDoc     = CUP
   sTagTit          = Tit2
   sTagCpoTit       = CpoTit2
   sTagCpo          = Cpo2
   sTagSql          = Sql2
   sTagSqlSum       = SqlSum1
   sTagMainTable    = CUP
   sTagMenu         = Menu2
   sTagNr0          = Nr01
   sTagTipoNr0      = TipoNr01
   sTagToolsBar     = Alterar,Zoom,Pesquisar
   sTagRAc          = false
   sTagPesquisar    = Pesquisar1
   sTagDbToVars     = DbToVars1       
   sTagVarsDef      = VarsDefault1   
   sTagScript       = ScriptForm3
   sTagVarsToServer = VarsToServer1  
   sTagVarsToDb     = VarsToDb1      
   sTagServerVal    = ServerValids2
   sTagTitulo       = TelaTit1
   sLabelsAlign     = Left
   sTagSubGrid      = 1,2
   sTagVarsRange    = VarsRange3
   sTagQryRange     = QryRange3
   sTagScriptRange  = ScriptRange3
   sTagVarsToServerRange  = VarsToServerRange3
   sTagVarsDefRange = VarsDefaultRange3  
   sTagServerValRange  = ServerValidsRange3
   sTagTituloRange  = TitRange3
</Range_3>
<Esc_Padrao_1>
   sTagMnemTDoc     = CUP
   sTagTit          = Esc_Tit1
   sTagCpoTit       = Esc_CpoTit1
   sTagCpo          = Esc_Cpo1
   sTagSql          = Esc_Sql1
   sTagSqlEscVars   = Esc_SqlVars1
   sTagNr0          = Nr01
   sTagTipoNr0      = TipoNr01
   sTagCpoEscVars   = Esc_VarsServerToClient1
   sTagToolsBar     = Pesquisar
   sTagPesquisar    = Pesquisar1
</Esc_Padrao_1>
<Esc_Padrao_1a>
   sTagMnemTDoc     = CUP
   sTagTit          = Esc_Tit1
   sTagCpoTit       = Esc_CpoTit1
   sTagCpo          = Esc_Cpo1
   sTagSql          = Esc_Sql1a
   sTagSqlEscVars   = Esc_SqlVars1
   sTagNr0          = Nr01
   sTagTipoNr0      = TipoNr01
   sTagCpoEscVars   = Esc_VarsServerToClient1
   sTagToolsBar     = Pesquisar
   sTagPesquisar    = Pesquisar1
</Esc_Padrao_1a>
<Esc_Padrao_2>
   sTagMnemTDoc     = CUP
   sTagTit          = Esc_Tit2
   sTagCpoTit       = Esc_CpoTit2
   sTagCpo          = Esc_Cpo2
   sTagSql          = Esc_Sql2
   sTagSqlEscVars   = Esc_SqlVars2
   sTagNr0          = Nr01
   sTagTipoNr0      = TipoNr01
   sTagCpoEscVars   = Esc_VarsServerToClient2
   sTagToolsBar     = Pesquisar
   sTagPesquisar    = Pesquisar1
</Esc_Padrao_2>
<Esc_Padrao_2a>
   sTagMnemTDoc     = CUP
   sTagTit          = Esc_Tit2
   sTagCpoTit       = Esc_CpoTit2
   sTagCpo          = Esc_Cpo2a
   sTagSql          = Esc_Sql2a
   sTagSqlEscVars   = Esc_SqlVars2a
   sTagNr0          = Nr01
   sTagTipoNr0      = TipoNr01
   sTagCpoEscVars   = Esc_VarsServerToClient2a
   sTagToolsBar     = Pesquisar
   sTagPesquisar    = Pesquisar1
</Esc_Padrao_2a>
<Tit1>Representantes Comerciais</Tit1>
<Tit2>Polticas por Representante Comercial X Representante Financeiro</Tit2>
<Tit3>Comisso fixa por Representante</Tit3>
<CpoTit1>
   -s-10
   ##-i-10
   Codigo-s-20      ; a.sCodRep
   Nome-s-50        ; a.sCoringa
   Tipo-s-15        ; a.jTipo,a.sCoringa
   CPF/CNPJ-s-30    ; a.sCPF,a.sCNPJ
   Telefone-s-50    ; a.sTel11
</CpoTit1>
<Cpo1>
   ($aLin["FFOTO"]==0 ? '<table border=0 cellspacing="0" cellpadding="3" cellmargin="0"><tr><td>&nbsp_<img style="vertical-align: middle_ width: 30_ height: 30_" src="../../FullPlat/erpImages/semImagem.png"/></td></tr></table>' :    '<table border=0 cellspacing="0" cellpadding="3" cellmargin="0"><tr><td>&nbsp_<img style="vertical-align: middle_ width: 30_ height: 30_" src="../{sCliPasta}/FotosFunc/imgperfil'.$aLin['PPID'].'-'.$aLin['FFOTO'].'.jpg"/></td></tr></table>')
   $aLin["PPID"]
   $aLin["SCODREP"]
   $aLin["SCORINGA"]
   $aPessoas[$aLin["JTIPO"]]  
   $aLin["JTIPO"]==1 ? $aLin["SCPF"] : $aLin["SCNPJ"]
   $aLin["STEL11"]
   $aLin["PPID"]
   $aLin["LREP"]
</Cpo1>
<CpoTit2>
   -l
   Cdigo-s-10
   Representante Comercial-s-50        ; b.sCoringa,c.sCoringa,d.sCoringa
   CFP/CNPJ-s-15
   Rep. Financeiro Comisso-s-50       ; b.sCoringa,c.sCoringa,d.sCoringa
   CFP/CNPJ-s-15
</CpoTit2>
<Cpo2>
   'js.this.flMarcado('.$aLin["PPID"].')'
   $aLin["SCODREPCOM"]
   $aLin["SREPCOM"]
   $aLin["SREPCOMCPF"]!='' ? $aLin["SREPCOMCPF"] : $aLin["SREPCOMCNPJ"]
   $aLin["SREPFIN"]
   $aLin["SREPFINCPF"]!='' ? $aLin["SREPFINCPF"] : $aLin["SREPFINCNPJ"]
   $aLin["PPID"]
</Cpo2>
<CpoTit3>
   ##-i-10
   Codigo-s-20      ; a.sCodRep
   Nome-s-50        ; a.sCoringa
   CPF/CNPJ-s-30    ; a.sCPF,a.sCNPJ
   Comisso-n-18-2        
</CpoTit3>
<Cpo3>
   $aLin["PPID"]
   $aLin["SCODREP"]
   $aLin["SCORINGA"]
   $aLin["JTIPO"]==1 ? $aLin["SCPF"] : $aLin["SCNPJ"]
   $aLin["NCOMFREP"]
   $aLin["PPID"]
   $aLin["LREP"]
</Cpo3>
<Sql1>
   select a.pPId,
          a.sCoringa,
          a.sCodRep,
          a.lRep,
          a.sTel11,
          a.sCPF,
          a.sCNPJ,
          a.jTipo,
          a.fFoto,
          a.nComFRep
   from CUP a
   where a.iVer = a.iVAt
     and a.lExc = 0
     and a.lRep = 1
   order by 2
</Sql1>
<Sql2>
   select a.pPId,
          a.sCoringa   sRepCom,
          a.sCodRep    sCodRepCom,
          a.lRep,
          a.sTel11,
          a.sCPF       sRepComCPF,
          a.sCNPJ      sRepComCNPJ,
          a.jTipo,
          a.fFoto,
          a.pRepFin,
          b.sCoringa    sRepFin,
          b.sCodRep     sCodRepFin,
          b.sCPF        sRepFinCPF,
          b.sCNPJ       sRepFinCNPJ
   from CUP   a  left join CUP   b on a.pRepFin = b.pPId and b.iVer = b.iVAt
   where a.iVer = a.iVAt
     and a.lExc = 0
     and a.lRep = 1
   order by 2
</Sql2>
<Pesquisar1>
   ((upper(a.sCoringa) like '%{p0}%') or (upper(a.sTel11) like '%{p0}%') or (a.sCPF = '{p0}') or (a.sCNPJ = '{p0}') or (cast(a.pPId as varchar(18)) ='{p0}') or (a.sCodRep = '{p0}') )
</Pesquisar1>
<MainTable1>
   CUP
</MainTable1>
<Menu1>
   main1 ; Endereos          ; flGrid(this.oPai,'dd_files/Enderecos.dda','Padrao_6')
   main1 ; Variao Comercial ; flGrid(this.oPai,'dd_files/erp_Repres_VarCom.dda','Padrao_1')
</Menu1>
<Menu2>
   main1 ; Atualizar Representante Financeiro Comisso(marcados)  ; flRangeProcesso("dd_files/erp_Repres_AtualizarRepresFin.dda","Processo_1","processos/Repres_AlterarRepresFinMarcadas.php",this.oPai)
</Menu2>
<Nr01>alert("Qtux-Dialog\n\nNada a relacionar ...")</Nr01>
<Nr02>oGrid.flGridInc()</Nr02>
<TipoNr01>0</TipoNr01>
<TipoNr02>1</TipoNr02>
<TipoNr03>2</TipoNr03>
<Esc_Tit1>Representantes Comerciais, resultado da busca por: [{p0}]</Esc_Tit1>    
<Esc_CpoTit1>
   Cdigo-s-30
   Representante-s-50
   CNPJ/CPF-s-20
</Esc_CpoTit1>  
<Esc_Cpo1>  
   $aLin["SCODREP"]
   $aLin["SCUP"]
   $aLin["JTIPO"]==1 ? $aLin["SCPF"] : $aLin["SCNPJ"] 
   $aLin["PPID"]
</Esc_Cpo1>
<Esc_Sql1>
   select a.pPId,
          a.sCoringa sCup,
          a.sCPF,
          a.sCNPJ,
          a.jTipo,
          a.sCodRep
   from CUP a
   where a.iVer   = a.iVAt
     and a.lExc   = 0
     and a.lRep   = 1
     and (upper(a.sCoringa) like upper('%{p0}%') or upper(a.sCodRep) like upper('%{p0}%') or upper(a.sCPF) like upper('%{p0}%') or upper(a.sCNPJ) like upper('%{p0}%'))
   order by a.sCodRep
</Esc_Sql1>
<Esc_Sql1a>
   select a.pPId,
          a.sCoringa sCup,
          a.sCPF,
          a.sCNPJ,
          a.jTipo,
          a.sCodRep
   from CUP a
   where a.iVer   = a.iVAt
     and a.lExc   = 0
     and a.lRep   = 1
     and a.sCodRep<>''
     and (upper(a.sCoringa) like upper('%{p0}%') or upper(a.sCodRep) like upper('%{p0}%') or upper(a.sCPF) like upper('%{p0}%') or upper(a.sCNPJ) like upper('%{p0}%'))
   order by a.sCodRep
</Esc_Sql1a>
<Esc_SqlVars1>
   select a.pPId     pCUP,
          a.sCoringa sCUP,
          a.sTel11,
          a.sCPF,
          a.sCNPJ,
          a.sCodRep,
          a.iVer
   from CUP a
   where a.pPId   = {pEscId}                
     and a.iVer   = a.iVAt
</Esc_SqlVars1>
<Esc_VarsServerToClient1>
   $aLin["PCUP"] 
   $aLin["SCUP"]
   $aLin["IVER"]
   $aLin["STEL11"]
   $aLin["SCODREP"] 
   $aLin["SCPF"]
   $aLin["SCNPJ"]
</Esc_VarsServerToClient1>  
<Esc_Tit2>Representantes Comerciais, resultado da busca por: [{p0}]</Esc_Tit2>    
<Esc_CpoTit2>
   Representante-s-50
   CNPJ/CPF-s-20
   Default-l
</Esc_CpoTit2>  
<Esc_Cpo2>  
   $aLin["SCUP"]
   $aLin["JTIPO"]==0 ? $aLin["SCPF"] : $aLin["SCNPJ"] 
   $aLin["LDEFAULT"]
   $aLin["PPID"].'/'.$aLin["PTAB"]
</Esc_Cpo2>
<Esc_Cpo2a>  
   $aLin["SCUP"]
   $aLin["JTIPO"]==0 ? $aLin["SCPF"] : $aLin["SCNPJ"] 
   "[".$aLin["SCODTAB"]."] - ".$aLin["STAB"]
   $aLin["PPID"]
</Esc_Cpo2a>
<Esc_Sql2>
   select a.pPId,
          b.pPId     pRep,
          b.sCoringa sCup,
          b.sCPF,
          b.sCNPJ,
          b.jTipo,
          a.lDefault,
          coalesce(d.pPId,0)        pTab,
          d.sCodigo     sTab,
          d.sDescricao  sCodTab
   from PRepUNeg a left join PRepUNeg_TabPrecos c on c.pPRepUNeg = a.pPId and c.iVer = c.iVAt
                   left join TabPrecos          d on c.pTabPreco = d.pPId and d.iVer = d.iVAt,
        CUP      b
   where a.iVer   = a.iVAt
     and a.pRep   = b.pPId and b.iVer   = b.iVAt
     and a.lExc   = 0
     and a.pEmi  = {p1}
     and a.pDest = {p2}
     and a.jTipo = {p3}
     and upper(b.sCoringa) like upper('%{p0}%')
   order by 2
</Esc_Sql2>
<Esc_Sql2a>
   select a.pPId,
          b.pPId     pRep,
          b.sCoringa sCup,
          b.sCPF,
          b.sCNPJ,
          a.jTipo
   from PRepUNeg a,
        CUP      b
   where a.iVer   = a.iVAt
     and a.pRep   = b.pPId and b.iVer   = b.iVAt
     and a.lExc   = 0
     and a.pEmi  = {p1}
     and a.pDest = {p2}
     and a.jTipo = {p3}
     and upper(b.sCoringa) like upper('%{p0}%')
   order by 2
</Esc_Sql2a>
<Esc_SqlVars2>
   select a.pPId,
          a.iVer,
          b.pPId pRep,
          b.iVer fRep,
          b.sCoringa sCUP,
          a.lComissao,
          a.lACC,
          d.sCodigo     sTab,
          d.sDescricao  sCodTab,
          c.pTabPreco,
          c.fTabPreco,
          a.pGestor,
          a.fGestor,
          e.sCoringa sGestor,
          a.nPGestor,
          a.jTpLip,
          a.sObsRep
   from PRepUNeg a left join PRepUNeg_TabPrecos c on c.pPRepUNeg = a.pPId and c.iVer = c.iVAt
                   left join TabPrecos          d on c.pTabPreco = d.pPId and d.iVer = d.iVAt
                   left join CUP                e on a.pGestor   = e.pPId and e.iVer = e.iVAt,
        CUP      b
   where a.pPId||'/'||coalesce(d.pPId,0)   = '{pEscId}'                
     and a.pRep   = b.pPId and b.iVer = b.iVAt
     and a.iVer   = a.iVAt and a.lExc = 0
</Esc_SqlVars2>
<Esc_SqlVars2a>
   select a.pPId,
          a.iVer,
          b.pPId pRep,
          b.iVer fRep,
          b.sCoringa sCUP,
          a.lComissao,
          a.lACC
   from PRepUNeg a, 
        CUP      b
   where a.pPId   = {pEscId}                
     and a.pRep   = b.pPId and b.iVer = b.iVAt
     and a.iVer   = a.iVAt and a.lExc = 0
</Esc_SqlVars2a>
<Esc_VarsServerToClient2>
   $aLin["PPID"] 
   $aLin["IVER"] 
   $aLin["PREP"] 
   $aLin["FREP"] 
   $aLin["SCUP"]
   $aLin["LCOMISSAO"]
   $aLin["LACC"]
   $aLin["PTABPRECO"]
   $aLin["FTABPRECO"]
   $aLin["STAB"]
   $aLin["SCODTAB"]
   $aLin["PGESTOR"]
   $aLin["FGESTOR"]
   $aLin["SGESTOR"]
   $aLin["NPGESTOR"]
   $aLin["JTPLIP"]
   $aLin["SOBSREP"]
</Esc_VarsServerToClient2>  
<Esc_VarsServerToClient2a>
   $aLin["PPID"] 
   $aLin["IVER"] 
   $aLin["PREP"] 
   $aLin["FREP"] 
   $aLin["SCUP"]
   $aLin["LCOMISSAO"]
   $aLin["LACC"]
</Esc_VarsServerToClient2a>  
<TelaTit1>
   Ficha do Representante
</TelaTit1>
<DbToVars1>  
   select a.tInc,
          a.iVer,
          a.iVAt,
          a.pPId,
          a.jTipo-1 jTipo,
          a.sVer,
          a.sNome,
          a.sCPF,
          a.sRG,
          a.sOE,
          a.jSexo,
          a.dNas,
          a.sRazao,
          a.sFanta,
          a.sCNPJ,
          a.sIE,
          a.sIM,
          a.sEmail,
          a.sWWW,
          a.sTel11,
          a.sTel12,
          a.sPass sSenha,
          a.sPass sSenha2,
          a.sPass sSenha3,
          a.lFun,
          a.lUsu,
          a.lRep,
          a.pReg1,  
          a.pReg2,  
          a.pReg3,  
          a.pReg4,  
          a.pReg5,
          o.sCodigo sRegCod1,
          o.sRegiao sReg1,
          p.sCodigo sRegCod2,
          p.sRegiao sReg2,
          q.sCodigo sRegCod3,
          q.sRegiao sReg3,
          r.sCodigo sRegCod4,
          r.sRegiao sReg4,
          s.sCodigo sRegCod5,
          s.sRegiao sReg5,
          a.pRepGer, 
          t1.pUsu       pUsuGer,
          t1.pUO        pUOGer,
          h1.sDescricao sCOp1,
          u1.sCoringa   sUsuGer,
          g1.sDescricao sUO1,
          t1.iSerial    iVaga1,
          a.fRepGer, 
          a.pRepSup, 
          t2.pUsu       pUsuSup,
          t2.pUO        pUOSup,
          u2.sCoringa   sUsuSup,
          h2.sDescricao sCOp2,
          g2.sDescricao sUO2,
          t2.iSerial    iVaga2,
          a.fRepSup, 
          a.pRepAnj,
          t3.pUsu       pUsuAnj,
          t1.pUO        pUOAnj,
          u3.sCoringa   sUsuAnj,
          h3.sDescricao sCOp3,
          g3.sDescricao sUO3,
          g3.iSerial    iVaga3,   
          a.fRepAnj, 
          a.pRepPol,
          d1.sCodigo     sCodRepPol,
          d1.sDescricao  sDesRepPol, 
          d1.jTipo       jEntSai,
          d1.pCPgmto,
          e1.sCodigo     sCodCPgmto,
          e1.sCPgmto     sDesCPgmto,
          d1.pTipoCob,
          f1.sCodigo     sCodTipCob,
          f1.sDescricao  sDesTipCob,
          d1.pFPgmto,
          i1.sDescricao  sFPgmto,
          d1.pMoe,
          j1.sDescricao  sMoe,
          d1.nDescFin,
          d1.nMulEnt,
          d1.nMulAtrsPg,
          d1.iDiasAtrsPg,
          d1.lCtrlBloqFin,
          d1.lBloqAuto,	
          d1.lFinanc,
          d1.lCttos,
          a.fRepPol,
          a.sRepNumCheque,
          a.sRepPortador, 
          a.dRepData,     
          a.sCorrRepCom,  
          a.sCCRepCom,    
          a.sDigRepCom,
          a.fFoto,
          a.pAgRepCom,    
          c2.sAgencia   sAgenciaRep,
          c2.pBanco,
          c3.sDescricao sBancoRep,
          a.sCodRep,
          a.pRepRegComU,
          a.fRepRegComU,
          i2.sCodigo  sCodRepRegComU,
          i2.sRegiao  sRepRegComU,
          a.pCC,
          a.fCC,
          gg.pAgencia,
          gg.fAgencia,
          gg.sCC        sCC,
          gg.sDac       sDac,
          hh.sAgencia   sAgeNr,
          hh.sCoringa   sAge,
          hh.pBanco     pBanco,
          hh.fBanco     fBanco,
          ii.sCodigo    sCodBanco,
          ii.sDescricao sDesBanco,
          jj.sCoringa   sCorrentista,
          a.jModCom,
          a.pRepFin,
          a.fRepFin,
          t.sCoringa    sRepFin,
          t.sCodRep     sCodRepFin,
          t.sCPF        sRepFinCPF,
          t.sCNPJ       sRepFinCNPJ,
          a.nComFRep,
          a.tCadRep   dCadRep,
          z.sCoringa
   from   CUP     a left join RegiaoCom o on a.pReg1       = o.pPId and o.iVer=o.iVAt 
                    left join RegiaoCom p on a.pReg2       = p.pPId and p.iVer=p.iVAt 
                    left join RegiaoCom q on a.pReg3       = q.pPId and q.iVer=q.iVAt 
                    left join RegiaoCom r on a.pReg4       = r.pPId and r.iVer=r.iVAt 
                    left join RegiaoCom s on a.pReg5       = s.pPId and s.iVer=s.iVAt
                    left join CUP       t on a.pRepFin     = t.pPId and t.iVer=t.iVAt
                    left join OOp      t1 on a.pRepGer     = t1.pPId and t1.iVer=t1.iVAt
                    left join CUP      u1 on t1.pUsu       = u1.pPId and u1.iVer=u1.iVAt
                    left join UO       g1 on t1.pUO        = g1.pPId and g1.iVer=g1.iVAt
                    left join COp      h1 on t1.pCOp       = h1.pPId and h1.iVer=h1.iVAt  
                    left join OOp      t2 on a.pRepSup     = t2.pPId and t2.iVer=t2.iVAt
                    left join CUP      u2 on t2.pUsu       = u2.pPId and u2.iVer=u2.iVAt
                    left join UO       g2 on t2.pUO        = g2.pPId and g2.iVer=g2.iVAt
                    left join COp      h2 on t2.pCOp       = h2.pPId and h2.iVer=h2.iVAt  
                    left join OOp      t3 on a.pRepAnj     = t3.pPId and t3.iVer=t3.iVAt
                    left join CUP      u3 on t3.pUsu       = u3.pPId and u3.iVer=u3.iVAt
                    left join UO       g3 on t3.pUO        = g3.pPId and g3.iVer=g3.iVAt
                    left join COp      h3 on t3.pCOp       = h3.pPId and h3.iVer=h3.iVAt  
                    left join CUP      c2 on a.pAgRepCom   = c2.pPId and c2.iVer=c2.iVAt
                    left join Banco    c3 on c2.pBanco     = c3.pPId and c3.iVer=c3.iVAt
                    left join POL_Financeiras d1 on a.pRepPol  = d1.pPId and d1.iVer=d1.iVAt
                    left join CPgmto          e1 on d1.pCPgmto = e1.pPId and e1.iVer=e1.iVAt
                    left join Moeda           j1 on d1.pMoe    = j1.pPId and j1.iVer=j1.iVAt
                    left join Tipo_Cobrancas  f1 on d1.pTipoCob  = f1.pPId and f1.iVer=f1.iVAt
                    left join FPgmto          i1 on d1.pFPgmto   = i1.pPId and i1.iVer=i1.iVAt
                    left join RegiaoCom        i2 on a.pRepRegComU = i2.pPId and i2.iVer=i2.iVAt
                    left join CC      gg on a.pCC        = gg.pPId and gg.iVer = gg.iVAt
                    left join CUP     jj on gg.pCUP      = jj.pPId and jj.iVer = jj.iVAt
                    left join CUP     hh on gg.pAgencia  = hh.pPid and hh.iVer = hh.iVAt
                    left join Banco   ii on hh.pBanco    = ii.pPid and ii.iVer = ii.iVAt,
         CUP z
   where a.pPId = {pId}
     and a.pInc = z.pPId
     and a.iVer = {a.iVer}
     and z.iVer = z.iVAt
</DbToVars1>
<1>
   select a.pPId       pRepres_RegiaoCom_i,
          b.pPId       pRCom_i,
          a.fRCom      fRCom_i,
          b.sRegiao    sRegiao_i
   from Repres_RegiaoCom       a,
        RegiaoCom      	       b
   where a.iVer    = a.iVAt
     and a.lExc    = 0
     and a.pRep    = {ChaveAtual_0}
     and a.pRCom   = b.pPId
     and b.iVer    = b.iVAt
  order by b.sRegiao
</1>
<2>
   select a.pPId       pCUP_Contatos_i,
          a.sNomeCont  sNomeCont_i,
          a.sCargoCont sCargoCont_i,
          a.sDptoCont  sDptoCont_i,
          a.sEmailCont sEmailCont_i
   from CUP_Contatos a
   where a.iVer       = a.iVAt
     and a.lExc       = 0
     and a.pCUP       = {ChaveAtual_0}
  order by a.sNomeCont
</2>
<VarsDefault1>
   sVerVAt = {iVer+'/'+iVAt}
   sRastro = {sVerVAt+', '+sCoringa+', '+tInc}
   aTipo   = Pessoa Fsica, Pessoa Jurdica
   aSexo   = Masculino,Feminino
   lDPag    =0 
   aEntSai  = Entrada,Sada,Entrada/Sada
   sOOpGer = {sCOp1+'['+iVaga1+'], '+sUO1}
   sOOpSup = {sCOp2+'['+iVaga2+'], '+sUO2}
   sOOpAnj = {sCOp3+'['+iVaga3+'], '+sUO3}
   jTipo = {this.oPai.oPai.fsGetVar('jTipo')} ;
   sCPF  = {this.oPai.oPai.fsGetVar('sCPF')}  ;
   sCNPJ = {this.oPai.oPai.fsGetVar('sCNPJ')} ;
</VarsDefault1>
<ScriptForm1>  
Rastreabilidade                     ; sRastro-100      ; fontweight='bold' ; editable=false    ; visible=(iDDFChamada>0)
   <img style='width: 80_ height 80_' src='../{sCliPasta}/FotosFunc/imgperfil{pPId}-{fFoto}.jpg'> ;; identlabel=5 ; colspan=true ; visible=(fFoto>0)
   ;
Identificao                       ;                  ; fontweight='bold'
   Id                               ; pPId-6           ; identlabel=5     ; visible=(iDDFChamada>0); editable=false
   Tipo Pessoa                      ; aTipo[jTipo]-30  ; identlabel=5     ; 
   Verso                           ; sVer-80          ; identlabel=5     ; visible=(iDDFChamada>0); editable=false
   ;
   Cdigo                           ; sCodRep-15   ; identlabel=5 
   ;
   Nome completo                    ; sNome-80         ; identlabel=5     ; visible=(jTipo==0) ; valid=( ( (jTipo!=0) || (fiLen(sNome) >0))  ,'O Nome deve ser preenchido')
   Nmero CPF (sem formatao)      ; sCPF-20          ; identlabel=5     ; visible=(jTipo==0) ; editable=(iDDFChamada==0) ; 
   Nmero RG  (sem formatao)      ; sRG-20           ; identlabel=5     ; visible=(jTipo==0) ; 
   Orgo Expedido do RG             ; sOE-5            ; identlabel=5     ; visible=(jTipo==0) ; 
   Razo Social                     ; sRazao-80        ; identlabel=5     ; visible=(jTipo==1) ; valid=( ( (jTipo!=1) || (fiLen(sRazao)>0))  ,'A Razao Social deve ser preenchida') ; exec=((iDDFChamada==0)&&(sFanta.length==0)&&this.flResetVar('sFanta',sRazao))
   Nome Fantasia                    ; sFanta-80        ; identlabel=5     ; visible=(jTipo==1) ; 
   CNPJ           (sem formatao)  ; sCNPJ-20         ; identlabel=5     ; visible=(jTipo==1) ; editable=(iDDFChamada==0) ; 
   Insc.Estadual  (sem formatao)  ; sIE-14           ; identlabel=5     ; visible=(jTipo==1) ; 
   Insc.Municipal (sem formatao)  ; sIM-20           ; identlabel=5     ; visible=(jTipo==1) ; 
   ;
   Data do Cadastro                 ; dCadRep-20      ; identlabel=5     ;
   ;
Endereos Eletrnicos e Acesso do Sistema      ;                  ; fontweight='bold'
   E.Mail                           ; sEmail-80        ; identlabel=5     ; valid=( (lFun==0) || (fiLen(sEmail)>0), 'O Email deve ser preenchido')
   WWW                              ; sWWW-80          ; identlabel=5  
   Senha                            ; sSenha-20        ; identlabel=5     ; password=true ; 
   Senha (redigitar)                ; sSenha2-20       ; identlabel=5     ; password=true ; valid=((sSenha==sSenha2),'As senhas estao diferentes')
   ;
   #1) Nr/Contato                   ; sTel11-50        ; identlabel=5     ;
   #2) Nr/Contato                   ; sTel12-50        ; identlabel=5     ; 
   ;
   Regio Comercial do Representante Unico  ; sRepRegComU-50           ; identlabel=5      ; esc=('dd_files/erp_RegiaoComercial.dda','Esc_Padrao_1','sRepRegComU','pRepRegComU,sRepRegComU')
   ;
   Regies Comerciais ;; fontweight='bold';
   SubGrid-1 {
      (i)) ; sRegiao_i-50 ; identlabel=5 ; esc=('dd_files/erp_RegiaoComercial.dda','Esc_Padrao_1','sRegiao_i','pRCom_i,sRegiao_i,fRCom_i') ; visible=(((i))<=(iTotLinSubGridPreenchidos_1)) ; 
   }
   <span style='color: #00AA00_ text-decoration: underline_ cursor: pointer_' onclick='oTelaDefault.flIncSubGrid(1,"pRCom")_'>Incluir</span>         ; ; identlabel=10 ; visible=(iDDFChamada<2)
   ;;
Contatos ;; fontweight='bold'; identlabel=5 ; 
   SubGrid-2 {
      (i)) Nome         ; sNomeCont_i-60  ; identlabel=10 ; visible=(((i))<=(iTotLinSubGridPreenchidos_2))
      Cargo        ; sCargoCont_i-60 ; identlabel=10 ; visible=(((i))<=(iTotLinSubGridPreenchidos_2))
      Departamento ; sDptoCont_i-60  ; identlabel=10 ; visible=(((i))<=(iTotLinSubGridPreenchidos_2))
      Email        ; sEmailCont_i-60 ; identlabel=10 ; visible=(((i))<=(iTotLinSubGridPreenchidos_2))
   ;;  visible=(((i))<=(iTotLinSubGridPreenchidos_2))
   }
   <span style='color: #00AA00_ text-decoration: underline_ cursor: pointer_' onclick='oTelaDefault.flIncSubGrid(2,"sNomeCont")_'>Incluir</span> ; ; identlabel=10; visible=(iDDFChamada<2)
   ;
   Gerente                          ; sUsuGer-60            ; identlabel=5 ; esc=('dd_files/OOp.dda','Esc_Padrao_1','sUsuGer','pRepGer,fRepGer,sUsuGer,sCOp1,sUO1,sOOpGer,sUn11,sUn21,sUn31,sUn41,sUn51,sUn61,sUn71,pUsuGer,stmp,pUOGer')
                                    ; sOOpGer-70            ; identlabel=5 ; editable=false ; visible=(pRepGer>0)
;
   Supervisor                       ; sUsuSup-60            ; identlabel=5 ; esc=('dd_files/OOp.dda','Esc_Padrao_1','sUsuSup','pRepSup,fRepSup,sUsuSup,sCOp1,sUO1,sOOpSup,sUn11,sUn21,sUn31,sUn41,sUn51,sUn61,sUn71')                                                              
                                    ; sOOpSup-70            ; identlabel=5 ; editable=false ; visible=(pRepSup>0)
;
   Apoio de Vendas                  ; sUsuAnj-60            ; identlabel=5 ; esc=('dd_files/OOp.dda','Esc_Padrao_1','sUsuAnj','pRepAnj,fRepAnj,sUsuAnj,sCOp1,sUO1,sOOpAnj,sUn11,sUn21,sUn31,sUn41,sUn51,sUn61,sUn71')
                                    ; sOOpAnj-70            ; identlabel=5 ; editable=false ; visible=(pRepAnj>0)
;
Conta corrente do Cedente para Titulos de pagamento;; fontweight='bold' ; colspan=true
      Nmero da Conta                 ; sCC-8                ; identlabel=10 ; esc=('dd_files/erp_CC.dda','Esc_Padrao_2','sCC','pCC,sAgeNr,sCC,sDac,pBanco,sCodBanco,sDesBanco,fCC,sAge,sCorrentista,pCUP') 
      Dgito                          ; sDac-1               ; identlabel=13 ; editable=false 
      Nr da Agncia                   ; sAgeNr-30            ; identlabel=13 ; editable=false 
      Nome da Agncia                 ; sAge-50              ; identlabel=13 ; editable=false 
      Correntista                     ; sCorrentista-50      ; identlabel=13 ; editable=false 
      Codigo do Banco                 ; sCodBanco-50         ; identlabel=13 ; editable=false 
      Nome do Banco                   ; sDesBanco-50         ; identlabel=13 ; editable=false 
</ScriptForm1>
<ScriptForm2>  
Rastreabilidade                     ; sRastro-100      ; fontweight='bold' ; editable=false    ; visible=(iDDFChamada>0)
   ;
   Cdigo                           ; sCodRep-15       ; identlabel=5     ; editable=false
   Nome completo                    ; sNome-80         ; identlabel=5     ; editable=false     ; visible=(jTipo==0)
   Nmero CPF (sem formatao)      ; sCPF-20          ; identlabel=5     ; visible=(jTipo==0) ; editable=false 
   Razo Social                     ; sRazao-80        ; identlabel=5     ; visible=(jTipo==1) ; editable=false 
   Nome Fantasia                    ; sFanta-80        ; identlabel=5     ; visible=(jTipo==1) ; editable=false 
   CNPJ           (sem formatao)  ; sCNPJ-20         ; identlabel=5     ; visible=(jTipo==1) ; editable=false 
   ;
   Rep. Financeiro Comisso         ; sRepFin-60       ; identlabel=5    ; esc=('dd_files/erp_Fornec.dda','Esc_Padrao_1','sRepFin','pRepFin,sRepFin,fRepFin,stmp,sRepFinCNPJ,sRepFinCPF')
   CPF                              ; sRepFinCPF-15         ; identlabel=5 ;  editable=false ; visible=(sRepFinCPF!='')
   CNPJ                             ; sRepFinCNPJ-15        ; identlabel=5 ;  editable=false ; visible=(sRepFinCNPJ!='')
</ScriptForm2>
<ScriptForm3>  
Rastreabilidade                     ; sRastro-100      ; fontweight='bold' ; editable=false    ; visible=(iDDFChamada>0)
   ;
   Cdigo                           ; sCodRep-15       ; identlabel=5     ; editable=false
   Nome completo                    ; sNome-80         ; identlabel=5     ; editable=false     ; visible=(jTipo==0)
   Nmero CPF (sem formatao)      ; sCPF-20          ; identlabel=5     ; visible=(jTipo==0) ; editable=false 
   Razo Social                     ; sRazao-80        ; identlabel=5     ; visible=(jTipo==1) ; editable=false 
   Nome Fantasia                    ; sFanta-80        ; identlabel=5     ; visible=(jTipo==1) ; editable=false 
   CNPJ           (sem formatao)  ; sCNPJ-20         ; identlabel=5     ; visible=(jTipo==1) ; editable=false 
   ;
   Comisso Fixa                    ; nComFRep-18-2    ; identlabel=5     ;
   ;
</ScriptForm3>
<VarsToServer1>
   pPId   
   jTipo 
   sNome    = (jTipo==0 ) ? sNome  : '' 
   sCoringa = (jTipo==0 ) ? sNome  : sRazao 
   sCPF     = (jTipo==0 ) ? sCPF   : '' 
   sRG      = (jTipo==0 ) ? sRG    : '' 
   sOE      = (jTipo==0 ) ? sOE    : ''
   sRazao   = (jTipo==1 ) ? sRazao : ''
   sFanta   = (jTipo==1 ) ? sFanta : ''
   sCNPJ    = (jTipo==1 ) ? sCNPJ  : ''
   sIE      = (jTipo==1 ) ? sIE    : ''
   sIM      = (jTipo==1 ) ? sIM    : ''
   sEmail
   sWWW
   sSenha
   sSenha3
   sTel11
   sTel12
   sCodRep
   nComFRep
   pCC
   fCC
   pRepFin
   fRepFin
   tCadRep = dCadRep
   pRepRegComU
   fRepRegComU
   jModCom
   pRepGer
   pRepSup
   pRepAnj
   fRepGer
   fRepSup
   fRepAnj
   dNas     = (jTipo==0 ) ? dNas   : ''
   dAdm     = (lFun==1  ) ? dAdm   : ''
   lFun
   lUsu
   pRepPol
   fRepPol
   pReg1 
   pReg2 
   pReg3 
   pReg4 
   pReg5 
   sRepNumCheque
   sRepPortador 
   dRepData     
   sCorrRepCom  
   pAgRepCom    
   sCCRepCom    
   sDigRepCom   
   pRepres_RegiaoCom_{i}
   pRCom_{i}
   fRCom_{i}
   pCUP_Contatos_{i}
   sNomeCont_{i}
   sCargoCont_{i}
   sDptoCont_{i}
   sEmailCont_{i}
   iVer
</VarsToServer1>
<VarsToDb1>  
   sDDFTabela = CUP             
   jTipo    = $_POST[jTipo]+1   
   sNome    = ($_POST[jTipo]==0)      ? $_POST[sNome]  : '' 
   sCPF     = ($_POST[jTipo]==0)      ? fsTrataCPFeCNPJ($_POST[sCPF])  : ''
   sRG      = ($_POST[jTipo]==0)      ? $_POST[sRG]    : ''  
   sOE      = ($_POST[jTipo]==0)      ? $_POST[sOE]    : '' 
   sRazao   = ($_POST[jTipo]==1)      ? $_POST[sRazao] : '' 
   sFanta   = ($_POST[jTipo]==1)      ? $_POST[sFanta] : '' 
   sCNPJ    = ($_POST[jTipo]==1)      ? fsTrataCPFeCNPJ($_POST[sCNPJ])  : ''
   sIE      = ($_POST[jTipo]==1)      ? $_POST[sIE]    : '' 
   sIM      = ($_POST[jTipo]==1)      ? $_POST[sIM]    : '' 
   sEmail 
   sWWW   
   sTel11 
   sTel12 
   lRep = 1
   pRepPol
   fRepPol
   nComFRep
   pCC
   fCC
   sCodRep
   pRepRegComU
   fRepRegComU
   jModCom
   pRepFin
   fRepFin
   pRepGer
   pRepSup
   pRepAnj
   fRepGer
   fRepSup
   fRepAnj
   tCadRep
   sRepNumCheque
   sRepPortador 
   dRepData     
   sCorrRepCom  
   pAgRepCom    
   sCCRepCom    
   sDigRepCom   
   sCoringa
   lFun   
   lUsu   
   dNas     = ($_POST[jTipo]==0)      ? $_POST[dNas]   : '' 
   sPass    = ($_POST[sSenha]==$_POST[sSenha3] ? $_POST['sSenha'] :  SenhaHash::Hash($_POST['sSenha']))
   dAdm     = ($_POST[lFun]==1)       ? $_POST[dAdm]   : ''
   pReg1 
   pReg2 
   pReg3 
   pReg4 
   pReg5
   sDDFSubTabela = Repres_RegiaoCom
   pSubPId       = $_POST[pRepres_RegiaoCom_{i}]
   pRep          = {ChaveAtual_0}
   fRep          = $_POST[iVer]
   pRCom         = $_POST[pRCom_{i}]
   fRCom         = $_POST[fRCom_{i}] 
   sDDFSubTabela = CUP_Contatos
   pSubPId       = $_POST[pCUP_Contatos_{i}]
   pCUP          = {ChaveAtual_0}
   sNomeCont       = $_POST[sNomeCont_{i}]
   sCargoCont      = $_POST[sCargoCont_{i}]
   sDptoCont       = $_POST[sDptoCont_{i}]
   sEmailCont      = $_POST[sEmailCont_{i}]
</VarsToDb1>
<ServerValids1>
   sNome   ; ($_POST[jTipo]!=0) or  (strlen(trim($_POST[.]))>0)     ; O Nome deve ser preenchido
   sCPF    ; ($_POST[jTipo]!=0) or  flValidaCPF(trim($_POST[.]))    ; O CPF no  valido
   sCPF    ; ($_POST[jTipo]!=0) or  flEhUnico("select count(*) from CUP where sCPF= '$_POST[.]' and iVer=iVAt and lExc=0 and pPId!=$_POST[pPId]") ; Esse CPF ja esta cadastrado
   sRazao  ; ($_POST[jTipo]!=1) or  (strlen(trim($_POST[.]))>0)     ; A Razao Social deve ser preenchida
   sCNPJ   ; ($_POST[jTipo]!=1) or  flValidaCNPJ(trim($_POST[.]))   ; O CNPJ no  valido
   sCNPJ   ; ($_POST[jTipo]!=1) or  flEhUnico("select count(*) from CUP where sCNPJ='$_POST[.]' and iVer=iVAt and lExc=0 and pPId!=$_POST[pPId] and sCNPJ!='00000000000000'") ; Esse CNPJ ja esta cadastrado
</ServerValids1>
<ServerValids2>
</ServerValids2>
<LabelsAlignLeft>
   left
</LabelsAlignLeft>
<LabelsAlignCenter>
   center
</LabelsAlignCenter>
<LabelsAlignRight>
   right
</LabelsAlignRight>
<TitRange1>
   Incluindo, alterando Representantes Comerciais
</TitRange1>
<VarsRange1>  
   sCPF   ;(($_POST[jTipo]==0) and ($_POST[.])!='') ; "sCPF  ='".strtoupper(trim($_POST[.]))."'"   
   sCNPJ  ;(($_POST[jTipo]==1) and ($_POST[.])!='') ; "sCNPJ ='".strtoupper(trim($_POST[.]))."'"
</VarsRange1>
<QryRange1>
   select a.pPId,
          a.sCoringa,
          a.sTel11,
          a.sCPF,
          a.sCNPJ,
          a.jTipo
   from CUP a 
   where a.lExc  = 0
     and a.iVer  = a.iVAt
     and {VarsRange}
   order by 2
</QryRange1>
<ScriptRange1>
   Tipo Pessoa     ; aTipo[jTipo]-30       ;
   CPF             ; sCPF-11               ; visible=(jTipo==0)
   CNPJ            ; sCNPJ-14              ; visible=(jTipo==1)
   apenas os nmeros (*) ;; fontcolor='#00AA00'
</ScriptRange1>
<VarsDefaultRange1>
   aTipo    = Pessoa Fisica,Pessoa Juridica
</VarsDefaultRange1>
<VarsToServerRange1>
   jTipo 
   sCPF     = (jTipo==0) ? sCPF   : '' 
   sCNPJ    = (jTipo==1) ? sCNPJ  : ''
</VarsToServerRange1>
<ServerValidsRange1>
     sCPF    ; (strlen(trim($_POST[.]).trim($_POST[sCNPJ]))>0) ; O CPF ou CNPJ devem ser preenchidos
</ServerValidsRange1>
<CpoTitRange1>
   Nome, Razo Social-s-50   
   Tipo-s-15   
   CPF/CNPJ
   Telefone-s-50
</CpoTitRange1>
<CpoRange1>
   $aLin["SCORINGA"]
   $aPessoas[$aLin["JTIPO"]]  
   $aLin["SCPF"] . $aLin["SCNPJ"]
   $aLin["STEL11"]
   $aLin["PPID"]
</CpoRange1>
<TitRange3>
   Consulta Avanada por Representante Comercial X Representante Financeiro
</TitRange3>
<VarsRange3>
     pRepCom              ; ($_POST[.]>0)    ; "a.pPId         = ".$_POST[.]
     pRepFin              ; ($_POST[.]>0)    ; "a.pRepFin      = ".$_POST[.]
</VarsRange3>
<QryRange3>
   select a.pPId,
          a.sCoringa   sRepCom,
          a.sCodRep    sCodRepCom,
          a.lRep,
          a.sTel11,
          a.sCPF       sRepComCPF,
          a.sCNPJ      sRepComCNPJ,
          a.jTipo,
          a.fFoto,
          a.pRepFin,
          b.sCoringa    sRepFin,
          b.sCodRep     sCodRepFin,
          b.sCPF        sRepFinCPF,
          b.sCNPJ       sRepFinCNPJ
   from CUP   a  left join CUP   b on a.pRepFin = b.pPId and b.iVer = b.iVAt
   where {VarsRange}
     and a.iVer = a.iVAt
     and a.lExc = 0
     and a.lRep = 1
   order by 2
</QryRange3>
<VarsDefaultRange3>
   pRepCom=0
   pRepFin=0
</VarsDefaultRange3>
<ScriptRange3>
   ;
   Representante Comercial               ; sRepCom-60            ; identlabel=5 ; esc=('dd_files/erp_Repres.dda','Esc_Padrao_1','sRepCom','pRepCom,sRepCom,fRepCom,stmp,sCodRepCom,sRepComCPF,sRepComCNPJ')           
   Cdigo                                ; sCodRepCom-10         ; identlabel=5 ;  editable=false ; visible=(sCodRepCom!='') 
   CPF                                   ; sRepComCPF-15         ; identlabel=5 ;  editable=false ; visible=(sRepComCPF!='')
   CNPJ                                  ; sRepComCNPJ-15        ; identlabel=5 ;  editable=false ; visible=(sRepComCNPJ!='')
   ; ; visible=(pRepCom>0)
   Rep. Financeiro Comisso         ; sRepFin-60       ; identlabel=5    ; esc=('dd_files/erp_Fornec.dda','Esc_Padrao_1','sRepFin','pRepFin,sRepFin,fRepFin,stmp,sRepFinCNPJ,sRepFinCPF')
   CPF                                   ; sRepFinCPF-15         ; identlabel=5 ;  editable=false ; visible=(sRepFinCPF!='')
   CNPJ                                  ; sRepFinCNPJ-15        ; identlabel=5 ;  editable=false ; visible=(sRepFinCNPJ!='')
   ;
</ScriptRange3>
<VarsToServerRange3>
   pRepCom
   pRepFin
</VarsToServerRange3>
<ServerValidsRange3>
</ServerValidsRange3>
<WM_1>
   <Tit>Representantes Comerciais</Tit>
   <Options>
;
      <span style="font-weight: bold_">Representantes Comerciais</span> ;;; identlabel=5
;
         <input type="text" id="InputRep1" size="30" style="color: #0000AA_ background-color: #EEEEEE_ font-family: Verdana_ font-size: 10_ "> , <span style="color: #00AA00_ text-decoration: underline">buscar</span>    ; ; + flGrid(null,"dd_files/erp_Repres.dda","Padrao_1","",document.getElementById("InputRep1").value,this.iSss)    ; identlabel=15
;
         Consultar todos                                 ;; flGrid(null,"dd_files/erp_Repres.dda","Padrao_1","","",this.iSss) ; identlabel=15
;
         Incluir - alterar                               ;; flRange(null,"dd_files/erp_Repres.dda","Range_1",this.iSss)       ; identlabel=15
   </Options>
</WM_1>
psFileDDS/psTagDDS = dd_files/erp_Repres.dda / Esc_Padrao_1
sQry=   select a.pPId     pCUP,          a.sCoringa sCUP,          a.sTel11,          a.sCPF,          a.sCNPJ,          a.sCodRep,          a.iVer   from CUP a   where a.pPId   = {pEscId}                     and a.iVer   = a.iVAt
   select a.pPId     pCUP,          a.sCoringa sCUP,          a.sTel11,          a.sCPF,          a.sCNPJ,          a.sCodRep,          a.iVer   from CUP a   where a.pPId   = {pEscId}                     and a.iVer   = a.iVAt
dd_files/erp_Repres.dda
psEscId=177
psEscIdIrma1=-1
sVarCont=177
sQry=   select a.pPId     pCUP,          a.sCoringa sCUP,          a.sTel11,          a.sCPF,          a.sCNPJ,          a.sCodRep,          a.iVer   from CUP a   where a.pPId   = 177                     and a.iVer   = a.iVAt
sQry=   select a.pPId     pCUP,          a.sCoringa sCUP,          a.sTel11,          a.sCPF,          a.sCNPJ,          a.sCodRep,          a.iVer   from CUP a   where a.pPId   = 177                     and a.iVer   = a.iVAt
sQry=   select a.pPId     pCUP,          a.sCoringa sCUP,          a.sTel11,          a.sCPF,          a.sCNPJ,          a.sCodRep,          a.iVer   from CUP a   where a.pPId   = 177                     and a.iVer   = a.iVAt
sQry=   select a.pPId     pCUP,          a.sCoringa sCUP,          a.sTel11,          a.sCPF,          a.sCNPJ,          a.sCodRep,          a.iVer   from CUP a   where a.pPId   = 177                     and a.iVer   = a.iVAt
sUser=sysdba, ghBase=Resource id #32
psQry=select current_transaction from rdb$database
durao 0, iDb=1
fhDBConnect - sUser=sysdba, Transaction ID=47420 , hBase=Resource id #32, hTr=Resource id #34, ghBase=Resource id #32
no  um processo -> sQry=select a.pPId     pCUP,          a.sCoringa sCUP,          a.sTel11,          a.sCPF,          a.sCNPJ,          a.sCodRep,          a.iVer   from CUP a   where a.pPId   = 177                     and a.iVer   = a.iVAt
sQryXXX = select a.pPId     pCUP,          a.sCoringa sCUP,          a.sTel11,          a.sCPF,          a.sCNPJ,          a.sCodRep,          a.iVer   from CUP a   where a.pPId   = 177                     and a.iVer   = a.iVAt
1) fhDbIbaseQuery
inicio-
sRes=177~EFW/CBD~25~1132666610~01.01.04~~^
sQry=select a.pPId     pCUP,          a.sCoringa sCUP,          a.sTel11,          a.sCPF,          a.sCNPJ,          a.sCodRep,          a.iVer   from CUP a   where a.pPId   = 177                     and a.iVer   = a.iVAt
flDBDisconnect - phBase=Resource id #34, ghBase=Resource id #32
5
sRet=
sRes=177~EFW/CBD~25~1132666610~01.01.04~~
fim