Jump to content
Fivewin Brasil

CIACPD

Membros
  • Posts

    377
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by CIACPD

  1. Caro Marcio, a melhor forma de fazer é colocar um servidor em cada loja e eles se replicarem, todos terão os mesmos dados em questão de poucos minutos.

    Eu faço desta forma a mais de 10 anos e funciona perfeito.

    Mysql com triggers para controlar os estoque e demais cálculos, nas tabelas tenho um campo com data e hora que foi alterada para saber quais dados devo replicar.

    Daniel Segura

  2. Veja este exemplo se é o que procura.

    #include "FiveWin.ch"
    
    #translate TRUE         => .T.
    #translate FALSE        => .F.
    
    //-------------------------------------------------------------------------//
    Function fitcadexe() // (tip_fun)
       local itcadexe
       local lsalva:=.F.
       Local ncodexe, cdesexe, ocodexe, odesexe
    
       DEFINE DIALOG itcadexe  FROM 0,0 TO  216, 513  TITLE 'Inclui novo exemplo'  PIXEL TRANSPARENT
       itcadexe:lhelpIcon := .F.
    
       tgradtela( itcadexe , (46) ) // altura faixa do BTNBMP 
       
       ncodexe :=space( 04 ) 
       cdesexe :=space( 50 )
    
       @    20,    3 SAY "Codigo do exemplo:"    SIZE  86,  10 PIXEL OF itcadexe
       @    33,    3 SAY "Descricao do exemplo:" SIZE  86,  10 PIXEL OF itcadexe
    
       @    19,   89 GET ocodexe  VAR ncodexe  SIZE   24,  10 PIXEL OF itcadexe readonly
       @    32,   89 GET odesexe  VAR cdesexe  SIZE  162,  10 PIXEL OF itcadexe picture "@!"
    
       @    70,   76 BTNBMP oBtn2_itcadexe PROMPT "Confirma"  2007 CENTER CANCEL UPDATE OF itcadexe PIXEL SIZE 42, 35 action ( lsalva:=.T., itcadexe:end() )
       @    70,  138 BTNBMP oBtn8_itcadexe PROMPT "Voltar"    2007 CENTER CANCEL UPDATE OF itcadexe PIXEL SIZE 42, 35 action ( lsalva:=.F., itcadexe:end() )
    
       ACTIVATE DIALOG itcadexe CENTERED on init odesexe:setfocus()
       If     lsalva // .and. tip_fun=1
              //inclui_cadexe( ncodexe , cdesexe )
       ElseIf lsalva
              //altera_cadexe( ncodexe , cdesexe )
       EndIf
       Release ncodexe, cdesexe, ocodexe, odesexe , itcadexe
    
    Return .T.
    
    //----------------------------------------------------------------------------//
    function tgradtela( par_obj , par_percent )
       local naltura_BTN := par_percent*2
       local npercent_par_obj := round( ( naltura_BTN / par_obj:nHeight ) , 2 )
    	par_obj:aGradcolors := {{ ( 1 - npercent_par_obj ) , nRGB(110,193,248), nRGB(0,64,254)} ,;
    	                         {       npercent_par_obj   , nRGB(255,255,255), nRGB(255,255,255)} }
    Return .T.
    //----------------------------------------------------------------------------//

     

  3. Colega tente da forma abaixo

    aDBs:= sqlArray("Show Databases")
    
    If ASCAN(aDBs,{|X|X[1]="seubanco"}) # 0
       SQLExecute("Use seubanco")
       exit
    Else
       TRY
          SQLExecute("Create Database seubanco")
          SQLExecute("Use seubanco")
       CATCH
          MsgInfo("01->Banco de Dados da CiaCpd não encontrado." + CRLF + ;
                  "02->Não foi possível criar o Banco de Dados."+CRLF+"Confira.", "CIACPD Informa.")
       END
    EndIf

     

  4. Caro Colega, você deve manter uma cópia válida de seu certificado no site da sefaz. vou colocar aqui para facilitar.

    1) Acessar o Sistema de Gestão e Retaguarda do SAT. 

    O acesso deve ser feito como software house

    2) Acessar o Menu <<Software house>>, e depois submenu << Cadastro da Empresa >>, opção "Alterar". 

    3) O sistema irá apresentar a tela "Alteração de Cadastramento como Software House" 

    4) Ao lado do campo "Certificado Digital", clique em "Procurar..."

    Para gerar o certificado .cer (codificado na base 64) para enviar execute Opções da Internet -> Conteúdo e clique no botão <<Certificados>>, selecione o certificado desejado e clique em Exportar... , depois em <<Avançar>> , em exportar a chave privada escolha << Não, não exportar a chave privada >>, depois em <<Avançar>>, o formato do arquivo deve ser <<X.509 codificado na base 64 >>, depois em <<Avançar>> e de um nome para o arquivo para concluir EX: cert2022.cer e confirme a exportação.

    5) Será apresentada uma janela para procurar o arquivo. Na barra de endereço, localizada na parte superior da janela, o usuário pode inserir (colando ou digitando) o local onde o arquivo foi salvo ou navegar até o arquivo utilizando as funções da janela. Selecione o arquivo e clique em “Abrir”. 

    6) O arquivo aparecerá no campo "Certificado Digital". 

    7) Clique em "Anexar" 

    8) Aguarde o sistema fazer o upload do arquivo. 

    9) Clique em "Alterar" 

    Boa Sorte

    Daniel Segura

  5. Bom dia Colega,

    Não sei se é isto, mas...

    CREATE TABLE `products` (
      `ID` INTEGER(11) NOT NULL AUTO_INCREMENT,
      `CESTA` CHAR(2),
      `ITENS` CHAR(2),
      PRIMARY KEY (`ID`))ENGINE=InnoDB;
      
    COMMIT;
    
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'C1' , 'I1' );
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'C2' , 'I2' );
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'C3' , 'I3' );
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'C4' , 'I4' );
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'C5' , 'I5' );
    
    COMMIT;
    
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'C1' , 'I2' );
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'C1' , 'I3' );
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'C2' , 'I3' );
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'C2' , 'I4' );
    
    COMMIT;
    
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'I1' , 'I2' );
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'I1' , 'I3' );
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'I2' , 'C3' );
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'I2' , 'C4' );
    
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'C2' , 'C3' );
    INSERT INTO products ( CESTA , ITENS ) VALUES( 'C2' , 'C4' );
    
    COMMIT;
    
    SELECT * FROM products WHERE CESTA LIKE 'I%'
    UNION ALL
    SELECT * FROM products WHERE ITENS LIKE 'C%' ;

    Daniel Segura

  6. Boa Noite Pessoal

    Estou usando o Adianti Framework e achando ele muito bom, é free mas comprando as vídeo aulas vocês conseguirão entender melhor o funcionamento da ferramenta. Possui um bom suporte e um mini erp para inicio do aprendizado e trabalho.

    https://www.adianti.com.br/framework-cases para ver alguns trabalhos.

    http://www.adianti.com.br/forum/pt/ 

    Sem muito conhecimento em PHP em julho de 2019 fiz um controle financeiro em 15 dias, e passei a usar esta ferramenta para criar a versão web dos meus sistemas.

    Daniel Segura

  7. Sem criar as variáveis não irá funcionar.

       MemoWrit( cdirlocal + 'foto_cli\FU'+ncodfun+'.JPG', cadfun->FOTO )
    
       lsalva:=.F.
    
       DEFINE BRUSH oBrush_pr000016 FILENAME cdirlocal + "TELAS\T600_560.bmp"
    
       DEFINE DIALOG pr000016 ;
                     FROM 0,0 TO  560, 600  ;
                     TITLE if(tip_fun=1,'Inclui novo funcionário','Edita funcionário') ;
                     PIXEL TRANSPARENT BRUSH oBrush_pr000016 // STYLE WS_POPUP
    
                     pr000016:lhelpIcon := .F.
    
       @     5,    4 SAY "Código:" SIZE   28,10 PIXEL OF pr000016  FONT oftgeral
       @     5,   41 GET ocodfun VAR ncodfun SIZE   27,10 PIXEL OF pr000016 readonly FONT oftget
    
       @     5,   73 SAY "Nome:"   SIZE   20,10 PIXEL OF pr000016  FONT oftgeral
       @     5,   93 GET onomfun VAR cnomfun SIZE  201,10 PIXEL OF pr000016 FONT oftget
    
       @    20,    1 FOLDER oFld PROMPT "&1 - Principal", "&2 - Trabalho", "&3 - Cônjuge" , "&4 - Foto";
                     OF pr000016 SIZE 300, 212 PIXEL
    
    //   Início Dados principais do funcionário
    
       @    05,    3 SAY "CPF:"     SIZE   29,  10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @     5,   40 GET oiefun VAR ciefun    SIZE   90,  10 PIXEL OF oFld:aDialogs[ 1 ] PICTURE [@R XXX.XXX.XXX-XX] FONT oftget
       @    05,  135 SAY "RG:"      SIZE   12,  10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @     5,  148 GET ocgcfun VAR ccgcfun  SIZE   90,  10 PIXEL OF oFld:aDialogs[ 1 ] PICTURE [@R XX.XXX.XXX-XX] FONT oftget
       @    05,  244 SAY "Orgão:"   SIZE   23,  10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @     5,  270 GET oorgemi VAR corgemi  SIZE   24,  10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
    
       @    17,    3 SAY "Pai:"          SIZE   16,  10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    17,   40 GET opaifun VAR cpaifun       SIZE  152,  10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
       @    29,    4 SAY "Mãe:"          SIZE   16,  10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    29,   40 GET omaefun VAR cmaefun       SIZE  152,  10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
       @    17,  230 SAY "Sexo:"         SIZE   19,   8 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    17,  249 GET osexfun VAR csexfun       SIZE   45,  10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
       @    29,  197 SAY "Estado Civil:" SIZE   52,   8 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    29,  249 GET oescfun VAR cescfun       SIZE   45,  10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
    
       @    41,    3 SAY "Data Nascimento:" SIZE   65,  10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    41,   70 GET onasfun VAR dnasfun          SIZE   40,  10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
       @    41,  118 SAY "Natural de:"      SIZE   45,  10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    41,  164 GET onatfun VAR cnatfun          SIZE  130,  10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
    
       @    53,    3 SAY "Endereço:" SIZE   37,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    53,   40 GET oruafun VAR cruafun   SIZE  187,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
       @    53,  233 SAY "Cep:"      SIZE   16,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    53,  249 GET ocepfun VAR ccepfun   SIZE   45,10 PIXEL OF oFld:aDialogs[ 1 ] picture [@R 99.999-999] FONT oftget
    
       @    65,    3 SAY "Bairro:" SIZE   27,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    65,   40 GET obaifun VAR cbaifun SIZE   95,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
       @    65,  139 SAY "Cidade:" SIZE   27,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    65,  167 GET ocidfun VAR ccidfun SIZE   95,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
       @    65,  266 SAY "UF:"     SIZE   13,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    65,  279 GET oestfun VAR cestfun SIZE   15,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
    
       @    77,    3 SAY "Cod.Spc:"     SIZE   32,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    77,   40 GET ocdspcfun VAR ccdspcfun  SIZE   55,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
       @    77,  103 SAY "Residente a:" SIZE   49,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    77,  153 GET oanores VAR canores      SIZE   14,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
       @    77,  172 SAY "Ano(s) e:"    SIZE   36,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    77,  228 SAY "meses"        SIZE   22,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    77,  213 GET omesres VAR cmesres      SIZE   14,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
    
    
       @    89,    3 SAY "Fone:"        SIZE   20,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    89,   40 GET ofonfun VAR cfonfun      SIZE   55,10 PIXEL OF oFld:aDialogs[ 1 ] PICTURE [@R (XXX)X XXXX-XXXX] FONT oftget
       @    89,  103 SAY "Ramal:"       SIZE   23,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    89,  128 GET oramfun VAR cramfun      SIZE   25,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
       @    89,  166 SAY "Contato:"     SIZE   32,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @    89,  200 GET oconfun VAR cconfun      SIZE   94,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
    
       @   101,    3 SAY "Fone:"        SIZE   21,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @   101,   40 GET ofonfunex VAR cfonfunex  SIZE   55,10 PIXEL OF oFld:aDialogs[ 1 ] PICTURE [@R (XXX)X XXXX-XXXX] FONT oftget
       @   101,  103 SAY "Ramal:"       SIZE   24,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @   101,  128 GET oramfunex VAR cramfunex  SIZE   25,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
       @   101,  166 SAY "Contato:"     SIZE   32,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @   101,  200 GET oconfunex VAR cconfunex  SIZE   94,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
    
    
       @   119,    3 SAY "Referencias comerciais:" SIZE   97,9  PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @   130,    3 GET orc1fun VAR crc1fun                 SIZE  290,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
       @   142,    3 GET orc2fun VAR crc2fun                 SIZE  290,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
       @   154,    3 GET orc3fun VAR crc3fun                 SIZE  290,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
    
       @   172,    3 SAY "Data do cadastro:"           SIZE   68,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @   172,   72 GET odtcad VAR ddtcad                       SIZE   45,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
       @   172,  140 SAY "Data da última atualização:" SIZE  108,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @   172,  249 GET odatatu VAR ddatatu                     SIZE   45,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
    
       @   184,    3 SAY "Observação:" SIZE   68,10 PIXEL OF oFld:aDialogs[ 1 ]  FONT oftgeral
       @   184,   72 GET oobsspc VAR cobsspc     SIZE  222,10 PIXEL OF oFld:aDialogs[ 1 ] FONT oftget
    
    //   Final Dados principais do funcionário
    //   Inicio Dados do trabalho do funcionário / pode estar vinculado a outro cnpj
    
       @     5,    3 SAY "Digite abaixo os dados referente ao trabalho deste funcionário" SIZE   250,  10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
    
       @    17,    3 SAY "Empresa:"   SIZE   31, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    17,   42 GET oxnomemp VAR cxnomemp  SIZE  252, 10 PIXEL OF oFld:aDialogs[ 2 ] FONT oftget
       @    29,    3 SAY "Atividade:" SIZE   39, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    29,   42 GET oatifun VAR catifun    SIZE  252, 10 PIXEL OF oFld:aDialogs[ 2 ] FONT oftget
    
       @    41,    3 SAY "Endereço:" SIZE   37, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    41,   42 GET oruaemp VAR cruaemp   SIZE  185, 10 PIXEL OF oFld:aDialogs[ 2 ] FONT oftget
       @    41,  233 SAY "Cep:"      SIZE   16, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    41,  249 GET ocepemp VAR ccepemp   SIZE   45, 10 PIXEL OF oFld:aDialogs[ 2 ] picture [@R 99.999-999] FONT oftget
    
       @    53,    3 SAY "Bairro:" SIZE   29, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    53,   42 GET obaiemp VAR cbaiemp SIZE   93, 10 PIXEL OF oFld:aDialogs[ 2 ] FONT oftget
       @    53,  139 SAY "Cidade:" SIZE   29, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    53,  167 GET ocidemp VAR ccidemp SIZE   95, 10 PIXEL OF oFld:aDialogs[ 2 ] FONT oftget
       @    53,  266 SAY "UF:"     SIZE   11, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    53,  279 GET oestemp VAR cestemp SIZE   15, 10 PIXEL OF oFld:aDialogs[ 2 ] FONT oftget
    
       @    65,    3 SAY "Fone:"    SIZE   25, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    65,   42 GET ofonemp VAR cfonemp  SIZE   55, 10 PIXEL OF oFld:aDialogs[ 2 ] PICTURE [@R (XXX)X XXXX-XXXX] FONT oftget
       @    65,  103 SAY "Ramal:"   SIZE   25, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    65,  128 GET oramemp VAR cramemp  SIZE   25, 10 PIXEL OF oFld:aDialogs[ 2 ] FONT oftget
       @    65,  166 SAY "Contato:" SIZE   34, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    65,  200 GET oconemp VAR cconemp  SIZE   94, 10 PIXEL OF oFld:aDialogs[ 2 ] FONT oftget
    
       @    77,    3 SAY "Renda:"      SIZE   27, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    77,   42 GET orenmen VAR nrenmen     SIZE   55, 10 PIXEL OF oFld:aDialogs[ 2 ] right FONT oftget
       @    77,  103 SAY "Trabalha a:" SIZE   49, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    77,  153 GET oanotra VAR canotra     SIZE   14, 10 PIXEL OF oFld:aDialogs[ 2 ] FONT oftget
       @    77,  172 SAY "Ano(s) e:"   SIZE   36, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    77,  213 GET omestra VAR cmestra     SIZE   14, 10 PIXEL OF oFld:aDialogs[ 2 ] FONT oftget
       @    77,  228 SAY "meses"       SIZE   22, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
    
       @    89,    3 SAY "Admissão:"   SIZE   38, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    89,   42 GET oadmissao VAR dadmissao SIZE   55, 10 PIXEL OF oFld:aDialogs[ 2 ] FONT oftget
    
       @    89,  103 SAY "Comissão (%):" SIZE   49, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @    89,  153 GET ocomissao VAR ncomissao   SIZE   55, 10 PIXEL OF oFld:aDialogs[ 2 ] right FONT oftget
    
       @   101,    3 SAY "Demissão:"     SIZE   38, 10 PIXEL OF oFld:aDialogs[ 2 ]  FONT oftgeral
       @   101,   42 GET odemissao VAR ddemissao   SIZE   55, 10 PIXEL OF oFld:aDialogs[ 2 ] FONT oftget
    
    //   Final Dados do trabalho do funcionário
    
    //   Inicio Dados do cônjuge
    
       @     5,    3 SAY "Digite abaixo os dados do cônjuge" SIZE   150,  10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
    
       @    17,    3 SAY "Nome:" SIZE   21,  10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @    17,   40 GET onomcon VAR cnomcon SIZE  254,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
    
       @    29,    3 SAY "Pai:"    SIZE   19,  10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @    29,   40 GET opaicon VAR cpaicon SIZE  254,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
    
       @    41,    3 SAY "Mãe:"    SIZE   18,  10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @    41,   40 GET omaecon VAR cmaecon SIZE  254,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
    
       @    53,    3 SAY "CPF:"  SIZE   20,10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @    53,   40 GET oiecon VAR ciecon SIZE  112,10 PIXEL OF oFld:aDialogs[ 3 ] PICTURE [@R XXX.XXX.XXX-XX] FONT oftget
       @    53,  162 SAY "RG:"   SIZE   14,10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @    53,  182 GET orgcon VAR crgcon SIZE  112,10 PIXEL OF oFld:aDialogs[ 3 ] PICTURE [@R XX.XXX.XXX-XX] FONT oftget
    
       @    65,    3 SAY "Data Nascimento:" SIZE   65,  10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @    65,   69 GET onascon VAR dnascon SIZE   49,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
       @    65,  130 SAY "Código SPC:" SIZE   45,  10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @    65,  182 GET ocdspccon VAR ccdspccon SIZE  112,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
    
       @    77,    3 SAY "Endereço:" SIZE   37,10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @    77,   40 GET oruacon VAR cruacon   SIZE  187,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
       @    77,  233 SAY "Cep:"      SIZE   16,10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @    77,  249 GET ocepcon VAR ccepcon   SIZE   45,10 PIXEL OF oFld:aDialogs[ 3 ] picture [@R 99.999-999] FONT oftget
    
       @    89,    3 SAY "Bairro:" SIZE   29,10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @    89,   40 GET obaicon VAR cbaicon SIZE   95,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
       @    89,  139 SAY "Cidade:" SIZE   29,10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @    89,  167 GET ocidcon VAR ccidcon SIZE   95,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
       @    89,  266 SAY "UF:"     SIZE   11,10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @    89,  279 GET oestcon VAR cestcon SIZE   15,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
    
       @   101,    3 SAY "Fone:"     SIZE   25,10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @   101,   40 GET ofoncon VAR cfoncon   SIZE   55,10 PIXEL OF oFld:aDialogs[ 3 ] PICTURE [@R (XXX)X XXXX-XXXX] FONT oftget
       @   101,  103 SAY "Ramal:"    SIZE   25,10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @   101,  128 GET oramcon VAR cramcon   SIZE   25,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
       @   101,  166 SAY "Contato:"  SIZE   33,10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @   101,  200 GET oconfcon VAR cconfcon SIZE   94,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
    
       @   113,    3 SAY "Infome abaixo o local de trabalho do cônjuge" SIZE  184,  10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
    
       @   125,    4 SAY "Empresa:" SIZE   31,  10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @   125,   40 GET ococemp VAR ccocemp  SIZE  254,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
    
       @   137,    3 SAY "Fone:"    SIZE   25,10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @   137,   40 GET ofocemp VAR cfocemp  SIZE   55,10 PIXEL OF oFld:aDialogs[ 3 ] PICTURE [@R (XXX)X XXXX-XXXX] FONT oftget
       @   137,  103 SAY "Ramal:"   SIZE   25,10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @   137,  128 GET orecemp VAR crecemp  SIZE   25,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
       @   137,  166 SAY "Contato:" SIZE   34,10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @   137,  200 GET ocecemp VAR ccecemp  SIZE   94,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
    
       @   149,    3 SAY "Renda:"  SIZE   27,  10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @   149,   40 GET orecmen VAR nrecmen SIZE   55,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
    
       @   161,    3 SAY "Obs.:"   SIZE   26,  10 PIXEL OF oFld:aDialogs[ 3 ]  FONT oftgeral
       @   161,   40 GET oobscon VAR cobscon SIZE  254,10 PIXEL OF oFld:aDialogs[ 3 ] FONT oftget
    
    //   Final Dados de cônjuge
    
    
    //   Inicio Foto
    
       @   150,   67 BTNBMP oBtnL4_pr000016 PIXEL RESOURCE "BLIG4" 2007 LEFT CANCEL UPDATE  SIZE 42,35 OF oFld:aDialogs[ 4 ] action oWC:Connect()
       @   150,  129 BTNBMP oBtnL5_pr000016 PIXEL RESOURCE "BFOT5" 2007 LEFT CANCEL UPDATE  SIZE 42,35 OF oFld:aDialogs[ 4 ] action ( IF(g_tip_fun=1,(f_inc_kdfuncionario(),g_tip_fun:=2),f_edi_kdfuncionario()), ;
                                  oWC:Clipboard(oImg), oWC:Save(oImg,cdirlocal + 'foto_cli\FU'+ncodfun+'.JPG',80), ;
                                  oImg:LoadBmp( cdirlocal + 'foto_cli\FU'+ncodfun+'.JPG' ), oImg:refresh() ) // oWC:Clipboard(oImg)
       @   150,  191 BTNBMP oBtnL6_pr000016 PIXEL RESOURCE "BDES6" 2007 LEFT CANCEL UPDATE  SIZE 42,35 OF oFld:aDialogs[ 4 ] action oWC:Disconnect()
    
       @    45,  190 IMAGE oImg OF oFld:aDialogs[ 4 ] SIZE 80,60 PIXEL ADJUST
    
       oImg:nProgress:=0
       oImg:LoadBmp( cdirlocal + 'foto_cli\FU'+ncodfun+'.JPG' )
       oImg:refresh()
    
    //   Final Foto
    
       @   242,   98 BTNBMP oBtn2_pr000016 PIXEL RESOURCE "BCON2" 2007 LEFT CANCEL UPDATE SIZE 42,35 OF pr000016 action ( lsalva:=.T., pr000016:end() )
       @   242,  160 BTNBMP oBtn8_pr000016 OF pr000016 SIZE 42, 35 PIXEL RESOURCE "BVLT8" 2007 LEFT CANCEL UPDATE action ( lsalva:=.F., pr000016:end() )
    
       @  1000, 1000 button "&1" size 10,10 OF pr000016 PIXEL action ( oFld:SetOption( 1 ) , xsetfocus(oFld) )   // para facilitar trocar de aba (janela)
       @  1000, 1000 button "&2" size 10,10 OF pr000016 PIXEL action ( oFld:SetOption( 2 ) , xsetfocus(oFld) )
       @  1000, 1000 button "&3" size 10,10 OF pr000016 PIXEL action ( oFld:SetOption( 3 ) , xsetfocus(oFld) )
       @  1000, 1000 button "&4" size 10,10 OF pr000016 PIXEL action ( oFld:SetOption( 4 ) , xsetfocus(oFld) )
    
       ACTIVATE DIALOG pr000016 CENTERED ON INIT ( oWC:CreateWnd(oFld:aDialogs[ 4 ],30,10,320,240) )
    
       oBrush_pr000016:End()
    
       If     lsalva .and. g_tip_fun=1
    	  f_inc_kdfuncionario()
       ElseIf lsalva
    	  f_edi_kdfuncionario()
       EndIf

    Daniel Segura

  8. Olá João, Tenta a rotina abaixo

    // -------------------------------------------------------------------------- //
    function atualiza_hora()
          local xdia_atu , xhora_atu
          try
             oHttp := CreateObject( "winhttp.winhttprequest.5.1" )
             oHttp:Open( "GET", "http://24timezones.com/pt_horamundial/brasilia_hora_local.php" , .F. )
             oHttp:Send()
             cHtml:= oHttp:ResponseText()
          catch
             return .t.
          end
          
          cHora := alltrim(StrExtract(cHtml, '<span id="currentTime">', '</span>' ))
          cHora1 := TRANSF( cHora, "99:99:99" )
          
          x_am_pm  := alltrim( substr( cHora , 10 , 2 ) )
          ntamtot  := len( cHora )
          nposmesi := rat( ',' , cHora ) + 1
          nposmesf := (ntamtot - nposmesi) - 4
          nposanoi := ntamtot - 3
          
          nposdiaf := rat( ',' , cHora ) -1
          nposdiai := nposdiaf - 1
          nposdiaf := nposdiaf - nposdiai
          
          dia := alltrim( substr( cHora , nposdiai , 2        ) )
          mes := alltrim( substr( cHora , nposmesi , nposmesf ) )
          ano := alltrim( substr( cHora , nposanoi , 4        ) )
          
          if x_am_pm = 'PM' .AND. ( val(substr( cHora1 , 1 , 2 )) < 12 )
             xhora1 := zeracod(str( val(substr( cHora1 , 1 , 2 )) + 12 ,2 ))
             cHora1 := xhora1 + substr( cHora1 , 3 )         
          endif
          
          data_atual_site:= dia+'/'+qmesnum(mes)+'/'+ano
          /*
          ? 'cHora'  , cHora  ,;
            'cHora1' , cHora1 ,;
            'Dia' , dia ,;
            'Mes' , mes ,;
            'Ano' , ano ,;
            'x_am_pm' , x_am_pm,;
            'data_atual_site' , data_atual_site,;
            'DataAtual' , date(),;
            'HoraAtual' , time()
          */
          
          xdia_atu  := date()
          xhora_atu := time()
          
          if data_atual_site # dtoc( xdia_atu )
             //xdate := "Date " + data_atual_site
             //try
             //   winexec( xdate )
             //catch
             //end
             msginfo("Favor corrigir a data do seu Equipamento." + CRLF + CRLF +;
                     "Data na Internet: " + data_atual_site + CRLF +;
                     "Data do Equipamento: " + dtoc( xdia_atu ) , "CIACPD Informa." )
          endif
          
          if substr( cHora1 , 1 , 4 ) # substr( xhora_atu , 1 , 4 )
             //try
             //   winexec( cHora1 )
             //catch
             //end
             msginfo("Favor corrigir a hora do seu Equipamento." + CRLF + CRLF +;
                     "Hora na Internet: " + cHora1 + CRLF +;
                     "Hora do Equipamento: " + xhora_atu , "CIACPD Informa." )
          endif
          
    RETURN NIL
    // -------------------------------------------------------------------------- //
    FUNCTION StrExtract(cText,cAfter,cBefore)
       LOCAL cRet := SUBSTR(cText,AT(cAfter,cText) + LEN(cAfter))
       LOCAL n
       IF (n := AT(cBefore,cRet)) > 0
          cRet := LEFT(cRet,n - 1)
       ENDIF*/
    RETURN (cRet)
    // -------------------------------------------------------------------------- //
    
    Function ZeraCod(Cod)
    Return Padl(AllTrim(Cod),Len(cod),[0])
    //----------------------------------------------------------------------------//
    
    Function qmesnum(pmes)
       Local nmesnum
       if len(alltrim(pmes)) < 1
          pmes:='Janeiro'
       endif
       Private Tmes:={"JANEIRO","FEVEREIRO","MARÇO","ABRIL","MAIO","JUNHO","JULHO","AGOSTO","SETEMBRO","OUTUBRO","NOVEMBRO","DEZEMBRO"}
       nmesnum := ascan( tmes, Alltrim(upper(pmes)) )
    return zeracod(str(nmesnum,2))
    //----------------------------------------------------------------------------// 

    Daniel Segura

  9. Olá João, Tenta a rotina abaixo

    // -------------------------------------------------------------------------- //
    function atualiza_hora()
          local xdia_atu , xhora_atu
          try
             oHttp := CreateObject( "winhttp.winhttprequest.5.1" )
             oHttp:Open( "GET", "http://24timezones.com/pt_horamundial/brasilia_hora_local.php" , .F. )
             oHttp:Send()
             cHtml:= oHttp:ResponseText()
          catch
             return .t.
          end
          
          cHora := alltrim(StrExtract(cHtml, '<span id="currentTime">', '</span>' ))
          cHora1 := TRANSF( cHora, "99:99:99" )
          
          x_am_pm  := alltrim( substr( cHora , 10 , 2 ) )
          ntamtot  := len( cHora )
          nposmesi := rat( ',' , cHora ) + 1
          nposmesf := (ntamtot - nposmesi) - 4
          nposanoi := ntamtot - 3
          
          nposdiaf := rat( ',' , cHora ) -1
          nposdiai := nposdiaf - 1
          nposdiaf := nposdiaf - nposdiai
          
          dia := alltrim( substr( cHora , nposdiai , 2        ) )
          mes := alltrim( substr( cHora , nposmesi , nposmesf ) )
          ano := alltrim( substr( cHora , nposanoi , 4        ) )
          
          if x_am_pm = 'PM' .AND. ( val(substr( cHora1 , 1 , 2 )) < 12 )
             xhora1 := zeracod(str( val(substr( cHora1 , 1 , 2 )) + 12 ,2 ))
             cHora1 := xhora1 + substr( cHora1 , 3 )         
          endif
          
          data_atual_site:= dia+'/'+qmesnum(mes)+'/'+ano
          /*
          ? 'cHora'  , cHora  ,;
            'cHora1' , cHora1 ,;
            'Dia' , dia ,;
            'Mes' , mes ,;
            'Ano' , ano ,;
            'x_am_pm' , x_am_pm,;
            'data_atual_site' , data_atual_site,;
            'DataAtual' , date(),;
            'HoraAtual' , time()
          */
          
          xdia_atu  := date()
          xhora_atu := time()
          
          if data_atual_site # dtoc( xdia_atu )
             //xdate := "Date " + data_atual_site
             //try
             //   winexec( xdate )
             //catch
             //end
             msginfo("Favor corrigir a data do seu Equipamento." + CRLF + CRLF +;
                     "Data na Internet: " + data_atual_site + CRLF +;
                     "Data do Equipamento: " + dtoc( xdia_atu ) , "CIACPD Informa." )
          endif
          
          if substr( cHora1 , 1 , 4 ) # substr( xhora_atu , 1 , 4 )
             //try
             //   winexec( cHora1 )
             //catch
             //end
             msginfo("Favor corrigir a hora do seu Equipamento." + CRLF + CRLF +;
                     "Hora na Internet: " + cHora1 + CRLF +;
                     "Hora do Equipamento: " + xhora_atu , "CIACPD Informa." )
          endif
          
    RETURN NIL
    // -------------------------------------------------------------------------- //

    Daniel Segura

  10. Olá,

    Me parece que só quem é do simples que está livre do DIFAL.

    npICMSInterPart := If(Right(Dtoc(dData),4)="2016", 40.00,;
                       If(Right(Dtoc(dData),4)="2017", 60.00,;
                       If(Right(Dtoc(dData),4)="2018", 80.00, 100.00)))
    
    :vBCUFDest      :=  nValor                                    // Valor da base de calculo do icms na UF de destino
    :pFCPUFDest     :=  Esta->Fcp_Esta                            // Percentual de ICMS relativo ao fundo de combate a pobreza
    :pICMSUFDest    :=  Esta->Ali_Esta                            // Aliquota interna da UF de Destino
    :pICMSInter     :=  Prod->Ais_Prod                            // Aliquota intestadual das UF envolvidas 4% 7% 12%
    :pICMSInterPart :=  npICMSInterPart                           // Percentual provisorio da partilha do ICMS interestadual (40%-2016 60%-80 80%-2018 100%-2019)
    :vFCPUFDest     :=  Round(nValor*Esta->Fcp_Esta/100,2)        // Valor do ICMS relativo ao fundo de combate a pobreza (FCP) da UF de destino
    :vICMSUFDest    :=  Round(((((nValor*Esta->Ali_Esta/100)-(nValor*Prod->Ais_Prod/100)) * npICMSInterPart / 100)) + (nValor*Esta->Fcp_Esta/100),2)  // Valor do ICMS Interestadual para UF de destino, ja considerando o valor do ICMS relativo ao fundo de combate a pobreza naquela UF
    :vICMSUFRemet   :=  Round((((nValor*Esta->Ali_Esta/100)-(nValor*Prod->Ais_Prod/100))*(100-npICMSInterPart)/100),2) // Valod do ICMS Interestadual para UF do remetente. Apartir de 2019 este valor sera 0
    // Totais
    nvFCPUFDest = nvFCPUFDest + Round((nValor*Esta->Fcp_Esta/100),2)
    nvICMSUFDest = nvICMSUFDest + Round(((((nValor*Esta->Ali_Esta/100)-(nValor*Prod->Ais_Prod/100)) * npICMSInterPart / 100)) + (nValor*Esta->Fcp_Esta/100),2)
    nvICMSUFRemet = nvICMSUFRemet + Round((((nValor*Esta->Ali_Esta/100)-(nValor*Prod->Ais_Prod/100))*(100-npICMSInterPart)/100),2)

    Verifique se este código te ajuda

    Daniel Segura

  11. Seria mais ou menos assim:

    cadastro de operações=> "Pagamento de Carreto %Nome" // "Despesa com Alimentação %Nome"

    "Pagamento de Carreto Sr. João " // "Despesa com Alimentação Supermercado XYZ"

    nos lançamentos ao informar a operação o programa passaria a trocar (comando strtran) %Nome com o nome do fornecedor do serviço.

    eu uso desta forma e fica mais fácil de ler os relatórios.

    Daniel Segura

    ciacpd@hotmail.com

    daniel_segura@ig.com.br

×
×
  • Create New...