Jump to content
Fivewin Brasil

rochinha

Membros
  • Posts

    623
  • Joined

  • Last visited

  • Days Won

    70

Everything posted by rochinha

  1. Amiguinhos, Não vejo também problema em usar interface com outros programas: ... if file( cPathDados+"curl.exe" ) cParameters := ' --get http://api.labelary.com/v1/printers/8dpmm/labels/4x6/0/' + ; ' --data-urlencode "' + charRem( chr(13)+chr(10), cEtiqueta ) + '" > ' + cArquivo2 cMacro := cPathDados+"ZPLCURL.BAT" cComando := cPathDados+"CURL.EXE " + cParameters // errhandle := fCreate( cMacro ) fWrite( errhandle, cComando ) fClose( errhandle ) // MsgRun( "Aguarde o termino do processo", "Envio da Etiqueta...", {|| WaitRun( cMacro, 0 ) } ) endif ... O curl.exe pode ser baixado deste link
  2. Amiguinhos, Deve-se usar SetRequestHeader par imputar variaveis e parâmetros como chaves, tokens ou keys: :SetRequestHeader( "Minha-Key", "9jj348ygfyrdd09rj3-8u54-sdlkewru854" )
  3. Amiguinhos, Não li as respostas anteriores e nem se alguém já deu solução mas mais aí meus 20 centavos: // curl -X POST http://ws.prefeituradeatibaia.com.br/WSNfses/nfseresources/ws/v2/emissao/simula \ cUrlWS := "http://ws.prefeituradeatibaia.com.br/WSNfses/nfseresources/ws/v2/emissao/simula" oServerWS := Win_OleCreateObject("MSXML2.ServerXMLHTTP.6.0") With Object oServerWS :Open( "POST", cUrlWS, .F. ) // -H 'authorization: 999991-2EU2TPWLJBP2H57HL605K24778989PPP' \ :SetRequestHeader( "authorization", "999991-2EU2TPWLJBP2H57HL605K24778989PPP" ) // -H 'cache-control: no-cache' :SetRequestHeader( "cache-control", "no-cache" ) // -H 'content-type: application/xml' :SetRequestHeader( "content-type: application/xml" ) // -H 'postman-token: 25a25272-851b-1763-f96f-6ac0017ad209' \ :SetRequestHeader( "postman-token", "25a25272-851b-1763-f96f-6ac0017ad209" ) // -d ' XML A SER ENVIADO' :Send( memoread( 'XML A SER ENVIADO' ) ) Do While :readyState != 4 :WaitForResponse( 500 ) Enddo End
  4. Amiguinhos, A string do QRCode para PIX não tem muito problema de geração já que é concatenação de palavras. O problema reside na geração do verificador de 4 digitos que vai no final da string principal para completar e gerar o QRCode. Fontes de Teste: Gerar PIX Online Gerador QRCode PIX Gerador de QRCode do PIX Gerador de QRCode PIX Estático Gerador QRCode PIX CIGAM Teste de CRC e outros: Testes variados Explicaç~pes sobre CRC: Manual do cálculo de redundância
  5. Amiguinhos, Vailton A partir de qual versão do Harbour?
  6. Amiguinhos, informax o Kapiaba tinha colocado para download um editor de RC diferente do WS. Dê uma pesquisada, talvez ele não altere a linguagem dos RCs. A linguagem do WS é proprietária e usa { e } para iniciar e fechar diálogos enquanto outros podem usar BEGIN e END para isto.
  7. Amiguinhos, Como sabemos os PIS/COFINS deve ser lançado na Notas Eletronicas conforme criticas de regime empresarial seguindo também a critica da CST envolvida. Na apuração do PIS e da COFINS é importante identificar as formas de tributação das contribuições, pois, a depender dessa análise, veremos a formação da base de cálculo e as alíquotas aplicáveis. Desse modo, temos duas formas de apuração da base de cálculo do PIS e da COFINS: cumulativa e não cumulativa. Na modalidade de PIS e COFINS cumulativos, a formação da base de cálculo é a receita operacional bruta da pessoa jurídica. Nesse tipo de apuração, não temos direito a créditos dos custos e das despesas. Além disso, as alíquotas da Contribuição para o PIS/PASEP e da COFINS são, respectivamente, de 0,65% e de 3%. Por exemplo: Receita Operacional Bruta x 3,65%, sendo 0,65% de PIS e 3% de COFINS. Já em relação ao PIS e COFINS não cumulativos, nessa modalidade temos direito a crédito dos custos e despesas, e as alíquotas aplicáveis são, por exemplo: Receita bruta x 9,25%, sendo 1,65% de PIS e 7,6% de COFINS nas operações que geram faturamento. Crédito de Custos e despesas nas alíquotas de total de 9,25%, sendo 1,65% de PIS e 7,6% de COFINS. Exemplo: O valor total da nota fiscal de venda é de R$ 5.000,00. *Alíquota de ICMS: 18,00% *Alíquota PIS (regime não cumulativo): 7,60% *Alíquota COFINS (regime não cumulativo): 1,65% *Total dos impostos em alíquotas = 27,25% Apuração da base de cálculo: Base de cálculo: R$ 5.000,00 ICMS devido na operação / destacado em nota: 5.000 x 18% = 900,00 PIS devido na operação: 5.000 x 1,65% = 82,00 COFINS devido na operação: 5.000 x 7,6% = 380,00 Baseado no exposto acima e incluindo os cálculos de Aliquota Zero e Aliquota Diferenciada formulei os resultados através de algums P.O.G. Apresento alguns trechos de meus cálculos e criticas para gerar o XML // Referente a CST relacionadas a PIS/COFINS // 1-Lucro Real, 2-Lucro Presumido, 3-Simples Nacional // Lucro Real - Regime não cumulativo: Pis - 1,65% Cofins 7,6% // Lucro Presumido - Regime Cumulativo: Pis - 0,65% Cofins - 3% cRegimeTrib := substr( VerifyINI("REGIME" , "RegimeTributario", "", cPathDados+"nfw.ini", .f.), 1, 1 ) lRegimeCumulativo := iif( cRegimeTrib="2", .t., .f. ) // Aliquota Basica pPIS := iif( cSimples = "S",0,iif(lRegimeCumulativo,0.65,1.65) ) pCOFINS := iif( cSimples = "S",0,iif(lRegimeCumulativo,3.00,7.60) ) if cCSTPIS = "02" .or. cCSTPIS = "04" // Aliquota Diferenciada - forcar pela busca na nova tabela - funcao esta no NFWHFAT.PRG pPISDif := NCMCST( es->nCmfiscal, es->nBmfiscal )[2] // cCSTPIS // Verifica se NCM esta na lista de Aliquota Zero forcando CST 04 if NCMAliquotaZero( strtran( cNCMIPI,".","" ) ) // Somente para SIMPLES cCSTPIS := "04" endif // Verifica se NCM esta na lista de Aliquota Zero forcando CST 02 aAliquotaDifer := NCMAliquotaDifer( strtran( cNCMIPI,".","" ) ) if LEN(aAliquotaDifer) > 0 cCSTPIS := "02" pPISDif := aAliquotaDifer[2] // cCSTPIS endif pPIS := pPISDif endif if cCSTCOFINS = "02" .or. cCSTCOFINS = "04" // Aliquota Diferenciada - forcar pela busca na nova tabela - funcao esta no NFWHFAT.PRG pCOFINSDif := NCMCST( es->nCmfiscal, es->nBmfiscal )[3] // cCSTCOFINS // Verifica se NCM esta na lista de Aliquota Zero forcando CST 04 if NCMAliquotaZero( strtran( cNCMIPI,".","" ) ) // Somente para SIMPLES cCSTCOFINS := "04" endif // Verifica se NCM esta na lista de Aliquota Zero forcando CST 02 aAliquotaDifer := NCMAliquotaDifer( strtran( cNCMIPI,".","" ) ) if LEN(aAliquotaDifer) > 0 cCSTCOFINS := "02" pCOFINSDif := aAliquotaDifer[3] // cCSTCOFINS endif pCOFINS := pCOFINSDif endif As CSTs de PIS/COFINS em meu sistema estão atreladas à CST do ICMS em uma tabela. A função NCMCST() recebe NCM e NBM, já que através do NBM eu tenho desmembrados o mesmo NCM(mas isto não vem ao caso) mas a mesma pode pesquisar somente pelo NCM. FUNCTION NCMCST( _nCmfiscal_, _nBmfiscal_ ) // Base Legal // PIS – Lei Complementar nº 7, de 7 de setembro de 1970. // COFINS – Lei Complementar nº 70, de 30 de dezembro de 1991. oldArea := select() cNCMIPI := charrem( ".", _nCmfiscal_ ) nNCMIPI := 0 nNCMPIS := 0 nNCMCOFINS := 0 dbSelectArea( "NCM" ) // Pesquisa pelos dois campos OrdSetFocus( 1 ) // Pesquisa por campos NCMFiscal e NBMFiscal dbSeek( charrem( ".", _nCmfiscal_ )+charrem( ".", _nBmfiscal_ ) ) if !found() OrdSetFocus( 2 ) // Pesquisa somente pelo campo NCMFiscal dbSeek( charrem( ".", _nCmfiscal_ ) ) if !found() cNCMIPI := "99" // "99999900" // Tentar passar o cupom mesmo com falha de NCM nNCMIPI := 0 nNCMPIS := 0 nNCMCOFINS := 0 else nNCMIPI := NCM->ALIQUOTA // PESQ(es->ncmfiscal+es->nbmfiscal,"NCM",1,"ALIQUOTA") nNCMPIS := iif( IsField( "PIS" ) , NCM->PIS , 0 ) nNCMCOFINS := iif( IsField( "COFINS" ), NCM->COFINS, 0 ) endif OrdSetFocus( 1 ) else nNCMIPI := NCM->ALIQUOTA // PESQ(es->ncmfiscal+es->nbmfiscal,"NCM",1,"ALIQUOTA") nNCMPIS := NCM->PIS nNCMCOFINS := NCM->COFINS endif dbSelectArea( oldArea ) return { nNCMIPI, nNCMPIS, nNCMCOFINS, cNCMIPI } As tabelas verificadas pela função são pequenas e coloquei em vetor. FUNCTION NCMAliquotaZero( cNCMQTenho ) aNCMRRAY := {} aadd( aNCMRRAY, "07133319" ) // 01 aadd( aNCMRRAY, "07133329" ) // 02 aadd( aNCMRRAY, "07133399" ) // 03 aadd( aNCMRRAY, "11010010" ) // 04 aadd( aNCMRRAY, "19012000" ) // 05 aadd( aNCMRRAY, "19059090" ) // 06 aadd( aNCMRRAY, "05111000" ) // 07 aadd( aNCMRRAY, "05119910" ) // 08* aadd( aNCMRRAY, "05119920" ) // 09 aadd( aNCMRRAY, "19021100" ) // 10 aadd( aNCMRRAY, "19021900" ) // 11 aadd( aNCMRRAY, "19022000" ) // 12* aadd( aNCMRRAY, "19023000" ) // 13 aadd( aNCMRRAY, "19021100" ) // 14 aadd( aNCMRRAY, "19021900" ) // 15 aadd( aNCMRRAY, "19022000" ) // 16 aadd( aNCMRRAY, "19023000" ) // 17 aadd( aNCMRRAY, "02061000" ) // 18 aadd( aNCMRRAY, "02102000" ) // 19 aadd( aNCMRRAY, "05069000" ) // 20 aadd( aNCMRRAY, "05100010" ) // 21 aadd( aNCMRRAY, "02063000" ) // 22 aadd( aNCMRRAY, "17019900" ) // 23 aadd( aNCMRRAY, "17011400" ) // 24 aadd( aNCMRRAY, "04051000" ) // 25 aadd( aNCMRRAY, "48181000" ) // 26 aadd( aNCMRRAY, "84433222" ) // 27 aadd( aNCMRRAY, "84690039" ) // 28 aadd( aNCMRRAY, "87142000" ) // 29 aadd( aNCMRRAY, "90214000" ) // 30 aadd( aNCMRRAY, "84433222" ) // 31 aadd( aNCMRRAY, "87142000" ) // 32 aadd( aNCMRRAY, "90214000" ) // 33 aadd( aNCMRRAY, "90219082" ) // 34 aadd( aNCMRRAY, "90219092" ) // 35 aadd( aNCMRRAY, "84690039" ) // 36 aadd( aNCMRRAY, "84701000" ) // 37 aadd( aNCMRRAY, "84716090" ) // 38 aadd( aNCMRRAY, "84719014" ) // 39 aadd( aNCMRRAY, "84721000" ) // 40 aadd( aNCMRRAY, "84716053" ) // 41 aadd( aNCMRRAY, "85258019" ) // 42 aadd( aNCMRRAY, "22011000" ) // 43 aadd( aNCMRRAY, "22011000" ) // 44 aadd( aNCMRRAY, "27101921" ) // 45 aadd( aNCMRRAY, "1502101" ) // 46 aadd( aNCMRRAY, "100620" ) // 47 aadd( aNCMRRAY, "100630" ) // 48 aadd( aNCMRRAY, "110620" ) // 49 aadd( aNCMRRAY, "300230" ) // 50* aadd( aNCMRRAY, "110220" ) // 51 aadd( aNCMRRAY, "110313" ) // 52 aadd( aNCMRRAY, "010511" ) // 53 aadd( aNCMRRAY, "902110" ) // 54 aadd( aNCMRRAY, "90213" ) // 55 aadd( aNCMRRAY, "02062" ) // 56 aadd( aNCMRRAY, "02064" ) // 57* aadd( aNCMRRAY, "02101" ) // 58 aadd( aNCMRRAY, "0201" ) // 59 aadd( aNCMRRAY, "0202" ) // 60 aadd( aNCMRRAY, "0203" ) // 61 aadd( aNCMRRAY, "0204" ) // 62 aadd( aNCMRRAY, "0207" ) // 63 aadd( aNCMRRAY, "0209" ) // 64 aadd( aNCMRRAY, "0302" ) // 65 aadd( aNCMRRAY, "0303" ) // 66 aadd( aNCMRRAY, "0304" ) // 67 aadd( aNCMRRAY, "1507" ) // 68 aadd( aNCMRRAY, "1508" ) // 69* aadd( aNCMRRAY, "1509" ) // 70 aadd( aNCMRRAY, "1510" ) // 71 aadd( aNCMRRAY, "1511" ) // 72 aadd( aNCMRRAY, "1512" ) // 73 aadd( aNCMRRAY, "1513" ) // 74 aadd( aNCMRRAY, "1514" ) // 75 aadd( aNCMRRAY, "3306" ) // 76 aadd( aNCMRRAY, "8802" ) // 77 aadd( aNCMRRAY, "8713" ) // 78 aadd( aNCMRRAY, "1001" ) // 79 aadd( aNCMRRAY, "0407" ) // 80 aadd( aNCMRRAY, "07" ) // 81* aadd( aNCMRRAY, "08" ) // 82 lAliquotaZero := .f. for nI2I := 1 to len( aNCMRRAY ) for nI3I = 1 to 8 if alltrim( substr( cNCMQTenho, 1, 9-nI3I ) ) = alltrim( aNCMRRAY[nI2I] ) lAliquotaZero := .t. exit endif next if lAliquotaZero //? "nI3I",9-nI3I,nI2I,alltrim( substr( cNCMQTenho, 1, 9-nI3I ) ),alltrim( aNCMRRAY[nI2I] ) exit endif next return lAliquotaZero FUNCTION NCMAliquotaDifer( cNCMQTenho ) aNCMRRAY := {} aadd( aNCMRRAY, { "30029020", 2.10, 9.90 } ) aadd( aNCMRRAY, { "30029092", 2.10, 9.90 } ) aadd( aNCMRRAY, { "30029099", 2.10, 9.90 } ) aadd( aNCMRRAY, { "30051010", 2.10, 9.90 } ) aadd( aNCMRRAY, { "30066000", 2.10, 9.90 } ) aadd( aNCMRRAY, { "34011190", 2.20, 10.30 } ) aadd( aNCMRRAY, { "34012010", 2.20, 10.30 } ) aadd( aNCMRRAY, { "96032100", 2.20, 10.30 } ) aadd( aNCMRRAY, { "84324000", 2.00, 9.60 } ) aadd( aNCMRRAY, { "84328000", 2.00, 9.60 } ) aadd( aNCMRRAY, { "84333000", 2.00, 9.60 } ) aadd( aNCMRRAY, { "84334000", 2.00, 9.60 } ) aadd( aNCMRRAY, { "87162000", 2.00, 9.60 } ) aadd( aNCMRRAY, { "76129012", 2.00, 9.60 } ) aadd( aNCMRRAY, { "84324000", 2.00, 9.60 } ) aadd( aNCMRRAY, { "84328000", 2.00, 9.60 } ) aadd( aNCMRRAY, { "84333000", 2.00, 9.60 } ) aadd( aNCMRRAY, { "84334000", 2.00, 9.60 } ) aadd( aNCMRRAY, { "3002101", 2.10, 9.90 } ) aadd( aNCMRRAY, { "3002102", 2.10, 9.90 } ) aadd( aNCMRRAY, { "3002103", 2.10, 9.90 } ) aadd( aNCMRRAY, { "3002201", 2.10, 9.90 } ) aadd( aNCMRRAY, { "3002202", 2.10, 9.90 } ) aadd( aNCMRRAY, { "3006301", 2.10, 9.90 } ) aadd( aNCMRRAY, { "3006302", 2.10, 9.90 } ) aadd( aNCMRRAY, { "843320", 2.00, 9.60 } ) aadd( aNCMRRAY, { "731029", 2.00, 9.60 } ) aadd( aNCMRRAY, { "842481", 2.00, 9.60 } ) aadd( aNCMRRAY, { "843320", 2.00, 9.60 } ) aadd( aNCMRRAY, { "84335", 2.00, 9.60 } ) aadd( aNCMRRAY, { "7309", 2.00, 9.60 } ) aadd( aNCMRRAY, { "8429", 2.00, 9.60 } ) aadd( aNCMRRAY, { "8701", 2.00, 9.60 } ) aadd( aNCMRRAY, { "8702", 2.00, 9.60 } ) aadd( aNCMRRAY, { "8703", 2.00, 9.60 } ) aadd( aNCMRRAY, { "8704", 2.00, 9.60 } ) aadd( aNCMRRAY, { "8705", 2.00, 9.60 } ) aadd( aNCMRRAY, { "8706", 2.00, 9.60 } ) aadd( aNCMRRAY, { "3001", 2.10, 9.90 } ) aadd( aNCMRRAY, { "3003", 2.10, 9.90 } ) aadd( aNCMRRAY, { "3004", 2.10, 9.90 } ) aadd( aNCMRRAY, { "3303", 2.20, 10.30 } ) aadd( aNCMRRAY, { "3304", 2.20, 10.30 } ) aadd( aNCMRRAY, { "3305", 2.20, 10.30 } ) aadd( aNCMRRAY, { "3306", 2.20, 10.30 } ) aadd( aNCMRRAY, { "3307", 2.20, 10.30 } ) lAliquotaDifer := .f. aAliquotaDifer := {} for nI2I := 1 to len( aNCMRRAY ) for nI3I = 1 to 8 if alltrim( substr( cNCMQTenho, 1, 9-nI3I ) ) = alltrim( aNCMRRAY[nI2I][1] ) // Se a pesquisa do NCM ou trecho estiver no array... lAliquotaDifer := .t. aAliquotaDifer := aNCMRRAY[nI2I] exit endif next if lAliquotaDifer //? "nI3I",9-nI3I,nI2I,alltrim( substr( cNCMQTenho, 1, 9-nI3I ) ),alltrim( aNCMRRAY[nI2I][1] ),aNCMRRAY[nI2I][2],aNCMRRAY[nI2I][3] exit endif next return aAliquotaDifer Segue um trecho de formatação das tags PIS/COFINS para efeito de analise: // Joguei os calculos dentro das criticas de PIS w COFINS vBCPIS := round( nSubtotal, 2 ) // -nDesconto // vBC // Vania-ContiMax-Nao calcular pela base reduzida e nao descontar vBCCOFINS := round( nSubtotal, 2 ) // -nDesconto // vBC // Vania-ContiMax-Nao calcular pela base reduzida e nao descontar vCSTPIS := round( (vBCPIS)*(pPIS*.01), 2 ) vCSTCOFINS := round( (vBCCOFINS)*(pCOFINS*.01), 2 ) if cPISNat = "S" //.and. empty(ClInscrMun) EDX OPEN MARK "PIS" OF oEDX cTAGPIS := "PISAliq" /* PISAliq 01 Basica */ if alltrim(cCSTPIS) $ "01" ; cTAGPIS := "PISAliq"; endif /* PISAliq 02 Diferenciada */ if alltrim(cCSTPIS) $ "02" ; cTAGPIS := "PISAliq"; endif /* PISQtde 03 */ if alltrim(cCSTPIS) $ "03" ; cTAGPIS := "PISQtde"; endif /* PISNT 04...09 */ if alltrim(cCSTPIS) $ "04|05|06|07|08|09"; cTAGPIS := "PISNT" ; pPIS := 0; endif /* Somente para emitentes Simples Nacional */ /* PISOutr 49...99 */ if alltrim(cCSTPIS) $ "49|50|51|52|53|54|55|56|60|61|62|63|64|65|66|67|70|71|72|73|74|75|98|99"; cTAGPIS := "PISOutr"; endif EDX OPEN MARK cTAGPIS OF oEDX EDX OPEN MARK "CST" TYPE "" TAG cCSTPIS AUTOCLOSE OF oEDX /* PISAliq 01|02" */ if alltrim(cCSTPIS) $ "01|02" EDX OPEN MARK "vBC" TYPE "" TAG str( vBCPIS,9,2 ) AUTOCLOSE OF oEDX EDX OPEN MARK "pPIS" TYPE "" TAG str( pPIS,7,4 ) AUTOCLOSE OF oEDX // ERRO: Estava dividindo por 100 EDX OPEN MARK "vPIS" TYPE "" TAG str( vCSTPIS,9,2 ) AUTOCLOSE OF oEDX vTTCSTPIS := vTTCSTPIS + vCSTPIS endif /* PISQtde 03 */ if alltrim(cCSTPIS) $ "03" EDX OPEN MARK "qBCProd" TYPE "" TAG str( IIF(ES->IDOP>0,ES->PRODUZIDAS,ES->QUANTIDADE),12,4 ) AUTOCLOSE OF oEDX EDX OPEN MARK "vAliqProd" TYPE "" TAG str( IIF(ES->IDOP>0,ES->PRODUZIDAS,ES->QUANTIDADE)*(pPIS),12,4 ) AUTOCLOSE OF oEDX EDX OPEN MARK "vPIS" TYPE "" TAG str( vCSTPIS,9,2 ) AUTOCLOSE OF oEDX vTTCSTPIS := vTTCSTPIS + vCSTPIS endif /* PISNT 04|05|06|07|08|09 */ if alltrim(cCSTPIS) $ "04|05|06|07|08|09" endif /* PISOutr 49|50|51|52|53|54|55|56|60|61|62|63|64|65|66|67|70|71|72|73|74|75|98|99 */ if alltrim(cCSTPIS) $ "49|50|51|52|53|54|55|56|60|61|62|63|64|65|66|67|70|71|72|73|74|75|98|99" EDX OPEN MARK "vBC" TYPE "" TAG str( vBCPIS,9,2 ) AUTOCLOSE OF oEDX EDX OPEN MARK "pPIS" TYPE "" TAG str( pPIS,6,4 ) AUTOCLOSE OF oEDX // ERRO: Estava dividindo por 100 EDX OPEN MARK "vPIS" TYPE "" TAG str( vCSTPIS,9,2 ) AUTOCLOSE OF oEDX vTTCSTPIS := vTTCSTPIS + vCSTPIS endif EDX CLOSE MARK OF oEDX // pisnt EDX CLOSE MARK OF oEDX // pis endif if cCOFINSNat = "S" //.and. empty(ClInscrMun) EDX OPEN MARK "COFINS" OF oEDX cTAGCOFINS := "COFINSAliq" /* COFINSAliq 01 Basica */ if alltrim(cCSTCOFINS) $ "01" ; cTAGCOFINS := "COFINSAliq"; endif /* COFINSAliq 02 Diferenciada */ if alltrim(cCSTCOFINS) $ "02" ; cTAGCOFINS := "COFINSAliq"; endif /* COFINSQtde 03 */ if alltrim(cCSTCOFINS) $ "03" ; cTAGCOFINS := "COFINSQtde"; endif /* COFINSNT 04...09 */ if alltrim(cCSTCOFINS) $ "04|05|06|07|08|09"; cTAGCOFINS := "COFINSNT" ; pCOFINS := 0; endif /* Somente para emitentes Simples Nacional */ /* COFINSOutr 49...99 */ if alltrim(cCSTCOFINS) $ "49|50|51|52|53|54|55|56|60|61|62|63|64|65|66|67|70|71|72|73|74|75|98|99"; cTAGCOFINS := "COFINSOutr"; endif EDX OPEN MARK cTAGCOFINS OF oEDX EDX OPEN MARK "CST" TYPE "" TAG cCSTCOFINS AUTOCLOSE OF oEDX /* COFINSAliq 01|02" */ if alltrim(cCSTCOFINS) $ "01|02" EDX OPEN MARK "vBC" TYPE "" TAG str( vBCCOFINS,9,2 ) AUTOCLOSE OF oEDX EDX OPEN MARK "pCOFINS" TYPE "" TAG str( pCOFINS,7,4 ) AUTOCLOSE OF oEDX // ERRO: Estava dividindo por 100 EDX OPEN MARK "vCOFINS" TYPE "" TAG str( vCSTCOFINS,9,2 ) AUTOCLOSE OF oEDX vTTCSTCOFINS := vTTCSTCOFINS + vCSTCOFINS endif /* COFINSQtde 03 */ if alltrim(cCSTCOFINS) $ "03" EDX OPEN MARK "qBCProd" TYPE "" TAG str( IIF(ES->IDOP>0,ES->PRODUZIDAS,ES->QUANTIDADE),12,4 ) AUTOCLOSE OF oEDX EDX OPEN MARK "vAliqProd" TYPE "" TAG str( IIF(ES->IDOP>0,ES->PRODUZIDAS,ES->QUANTIDADE)*(pCOFINS),12,4 ) AUTOCLOSE OF oEDX EDX OPEN MARK "vCOFINS" TYPE "" TAG str( vCSTCOFINS,9,2 ) AUTOCLOSE OF oEDX vTTCSTCOFINS := vTTCSTCOFINS + vCSTCOFINS endif /* COFINSNT 04|05|06|07|08|09 */ if alltrim(cCSTCOFINS) $ "04|05|06|07|08|09" endif /* COFINSOutr 49|50|51|52|53|54|55|56|60|61|62|63|64|65|66|67|70|71|72|73|74|75|98|99 */ if alltrim(cCSTCOFINS) $ "49|50|51|52|53|54|55|56|60|61|62|63|64|65|66|67|70|71|72|73|74|75|98|99" EDX OPEN MARK "vBC" TYPE "" TAG str( vBCCOFINS,9,2 ) AUTOCLOSE OF oEDX EDX OPEN MARK "pCOFINS" TYPE "" TAG str( pCOFINS,7,4 ) AUTOCLOSE OF oEDX // ERRO: Estava dividindo por 100 EDX OPEN MARK "vCOFINS" TYPE "" TAG str( vCSTCOFINS,9,2 ) AUTOCLOSE OF oEDX vTTCSTCOFINS := vTTCSTCOFINS + vCSTCOFINS endif EDX CLOSE MARK OF oEDX // COFINSnt EDX CLOSE MARK OF oEDX // COFINS endif Bons cálculos
  8. Amiguinhos, Em relaão a Exclusão do ICMS da base de cálculo do PIS e da COFINS Vocês estão informando os recálculos somente no SPED? Tem alguma previsão en Nota Técnica referente à estes lançamentos em XML da NF-e?
  9. Amiguinhos, Uma pergunta não me cala. Toda semana teríamos ofertas portanto várias impressões. Este tablóide é para ser enviado via midias ou apresentado em telão LCD? Supondo que coloquemos uma antiga LCD no alto da parede de um mercado, na horizontal, pára apresentar slides de ofertas recuperadas de um pendrive conectado em um cabo USB-macho/fêmea de dois metros creio que ficaria legal.
  10. rochinha

    Pelles C

    Amiguinhos, CISCO Bom se você está usando fivewin com RCs de Pelles sugiro dar uma olhada na classe que manipula o clipBoard, porque fora da aplicação quando você faz um CTRL-V e CTRL-C o conteúdo basicamente não tem limites, mas dentro de uma aplicação Fivewin, wla assume o controle portanto, pode ser analisada e melhorada. Os RC trabalham com coordenadas não interferindo em valores das variáveis que usam os controles mas verifique os controles, pois o Pelles pode guardar algum parametro que possibilite manipular o tamanho do conteúdo. O que voce pode fazer é acionar nos controles TEXT o deslocamento horizontal ou vertical(nunca lembro qual é o para esquerda/direita) pois ele permite escrever além da casa do controle e portanto permite ter mais dados no controle.
  11. rochinha

    Pelles C

    Amiguinhos, CISCO ao abrir a tela em branco para inserir algum conteúdo por colagem, dobre o espaço de caracteres que você definiu na inicialização da variável do campo descricao Se voce define o campo com 30 caracteres de espaço vazio, defina com 60. Faça o teste da colagem após.
  12. Amiguinhos, Maravilha dorneles. Quais os nomes das fontes que você uspu. @braços.
  13. Amiguinhos, Andre Meneghetti O codigo abaixo é somente um trecho que filtra alguns dados e campos para minimizar o peso de uso das tabelas. Nada impede de colocar suas filtragens som SET FILTER etc. @ tableXLS SELECT descricao,valorvenda ; FROM estoque TO (DBF_TEMP) USE (DBF_TEMP) ALIAS tableXLS NEW INDEX ON descricao TO (NTX_TEMP) SET INDEX TO (NTX_TEMP) // Formatando o titulo O resto é código normal.
  14. Amigunhos, informax Veja se meu código te dá alguma luz. Function XLSTabela() LOCAL oExcel, oHoja LOCAL nRow := 1, nCol M->NUM_TEMP := STRZERO(RANDOM(9999),4) M->DBF_TEMP := cPathDados+"\PN"+M->NUM_TEMP+".DB$" M->NTX_TEMP := cPathDados+"\PN"+M->NUM_TEMP+".CD$" CursorWait() oExcel := TOleAuto():New( "Excel.Application" ) oExcel:WorkBooks:Add() oHoja := oExcel:Get( "ActiveSheet" ) nRows := oHoja:UsedRange:Rows:Count() nCols := oHoja:UsedRange:Columns:Count() oHoja:PageSetup:Orientation := 2 oHoja:PageSetup:PrintGridlines := .t. // Margens oHoja:PageSetup:LeftMargin := 0.25 oHoja:PageSetup:RightMargin := 0.25 oHoja:PageSetup:TopMargin := 0.25 oHoja:PageSetup:BottomMargin := 0.25 oHoja:PageSetup:HeaderMargin := 0.25 oHoja:PageSetup:FooterMargin := 0.25 // oExcel:WorkBooks:Add() // oSheet = oExcel:ActiveSheet // oSheet:Cells( 1, 1 ):Value = "This is the first page" // oSheet:Rows( 2 ):PageBreak = xlPageBreakManual // oSheet:Cells( 2, 1 ):Value = "This is the second page" // oExcel:Visible = .T. // Area de Impressao oHoja:PageSetup:PrintArea = "$A$1:$O$60" // Area de Impressao //oRange := oExcel:Range("A10:A10"):Select() //oHoja:HPageBreaks := oRange //oRange := oHoja:Cells(60,15):Select() //oHoja:HPageBreaks:Add( oHoja:Range("A60:o60") ) //oPageBreak:Add( oRange ) //oHoja:HPageBreaks:Add( oHoja:Cells( 60, 14 ):Select() ) //oHoja:VPageBreaks:Add( "" ) //oHoja:HPageBreaks:Add( "A60" ) //oHoja:VPageBreaks:Add( "O60" ) // Define nome para planilha //oHoja:= oExcel:sheets:item(1) oHoja:name:='Tabela de Precos' //oSheet:Range("A:A"):Set("ColumnWidth",32) // AJUSTA TAMAÑO UN RANGO A UN VALOR // Toda planilha oHoja:Cells:Font:Name := "Arial" oHoja:Cells:Font:Size := 8 dbSelectArea( "ESTOQUE" ) @ tableXLS SELECT descricao,valorvenda ; FROM estoque TO (DBF_TEMP) USE (DBF_TEMP) ALIAS tableXLS NEW INDEX ON descricao TO (NTX_TEMP) SET INDEX TO (NTX_TEMP) // Formatando o titulo oHoja:Cells( 1, 1 ):Value := CL_NOME oHoja:Cells( 1, 1 ):Font:Size := 24 oHoja:Cells( 1, 1 ):Font:Name := "Arial" oHoja:Range( "A1:O1" ):HorizontalAlignment := 7 oHoja:Cells( 1, 1 ):Select() nRow := 2 nCol := 1 DO WHILE .T. // EOF() if nRow = 2 //oSheet:Range("A:A"):Set("ColumnWidth",32) // AJUSTA TAMAÑO UN RANGO A UN VALOR // Colocando nomes nas colunas oHoja:Cells( nRow, nCol+0 ):Value := "DESCRICAO" oHoja:Cells( nRow, nCol+1 ):Value := "PRECO" oHoja:Cells( nRow, nCol+2 ):Value := "QT" // Formatando estilo oHoja:Cells( nRow, nCol+0 ):Font:Bold := .T. // :Font:Size / :Font:Color oHoja:Cells( nRow, nCol+1 ):Font:Bold := .T. oHoja:Cells( nRow, nCol+2 ):Font:Bold := .T. // Formatando tamanho oHoja:Cells( nRow, nCol+0 ):ColumnWidth := 22 oHoja:Cells( nRow, nCol+1 ):ColumnWidth := 6 oHoja:Cells( nRow, nCol+2 ):ColumnWidth := 5 oHoja:Cells( nRow, nCol+3 ):ColumnWidth := 0.25 // Formatando tamanho oHoja:Cells( nRow, nCol+0 ):Interior:ColorIndex := 6 oHoja:Cells( nRow, nCol+1 ):Interior:ColorIndex := 6 oHoja:Cells( nRow, nCol+2 ):Interior:ColorIndex := 6 // nRow := 3 endif // Formatando um campo oHoja:Cells( nRow, nCol+0 ):Value := descricao oHoja:Cells( nRow, nCol+1 ):NumberFormat := "##.##0,00" oHoja:Cells( nRow, nCol+1 ):Value := valorvenda // Calcula quantidade * valorvenda oHoja:Cells( nRow, nCol+3 ):NumberFormat := "##.##0,00" oHoja:Cells( nRow, nCol+3 ):Value := "="+chr(64+nCol+1)+alltrim(str(nRow))+"*"+chr(64+nCol+2)+alltrim(str(nRow)) // Somatoria dos subtotais //oHoja:Cells( nRow, nCol+1 ):NumberFormat := "##.##0,00" //oHoja:Cells( nRow, nCol+1 ):Value := "=soma("+chr(64+nCol+2)+"3:"+chr(64+nCol+2)+"57)" // oHoja:Cells( nRow, nCol+0 ):Font:Bold := .T. oHoja:Cells( nRow, nCol+1 ):Font:Bold := .T. // oHoja:Cells( nRow, nCol+2 ):Interior:ColorIndex := 6 // nRow := nRow + 1 if eof() exit endif SKIP ENDDO // oHoja:Cells( 59, 1 ):Value := "SUBTOTAL" oHoja:Cells( 59, 1 ):Font:Bold := .T. oHoja:Cells( 59, 1 ):Font:Size := 10 oHoja:Cells( 60, 1 ):NumberFormat := "####.##0,00" oHoja:Cells( 60, 1 ):Value := "=B58+F58+J58+N58" oHoja:Cells( 60, 1 ):Font:Italic := .T. oHoja:Cells( 60, 1 ):Font:Bold := .T. // oHoja:Cells( 59, 5 ):Value := "DESCONTO" oHoja:Cells( 59, 5 ):Font:Bold := .T. oHoja:Cells( 59, 5 ):Font:Size := 10 oHoja:Cells( 60, 5 ):NumberFormat := "####.##0,00" //oHoja:Cells( 60, 5 ):Value := "=B58+F58+J58+N58" oHoja:Cells( 60, 5 ):Font:Italic := .T. oHoja:Cells( 60, 5 ):Font:Bold := .T. // oHoja:Cells( 59, 9 ):Value := "TOTAL GERAL" oHoja:Cells( 59, 9 ):Font:Bold := .T. oHoja:Cells( 59, 9 ):Font:Size := 10 oHoja:Cells( 60, 9 ):NumberFormat := "####.##0,00" oHoja:Cells( 60, 9 ):Value := "=A60-(A60*(E60*0,01))" oHoja:Cells( 60, 9 ):Font:Italic := .T. oHoja:Cells( 60, 9 ):Font:Bold := .T. // dbSelectArea( "ESTOQUE" ) // oExcel:Visible := .T. //oHoja:PrintOut() // Funciona OK //oExcel:WorkBooks:SaveAs(cFilePath(GetModuleFileName(GetInstance()))+"\FABRICA.xls") oHoja:End() oExcel:End() // CursorArrow() RETURN
  15. Amiguinhos, Veja também: CURL: Previsualizar etiquetas ZPL sem impressora Zebra Visualizador Online ZPL Editor Manual ZPL
  16. Amiguinhos, Seu bunda-mole você entendeu que foi erro de digitação né, kkkkkkkk. ERRATA ...caso esteja na maquina de desenvolvimento...
  17. Amiguinhos, Tinha um aplicativo com código 16 para Fivewin que permitia estas visualizações. Era de uma empresa boliviana Quark. Talvez esteja no github ou bitblablabla do Fivewin. É alguma coisa DWG. Quanto a esta DLL ela é encontrável na internet? CAD Tools
  18. Amiguinhos, Eu uso o blat assim: cErrorFile := "NFWHErr.log" REDEFINE BUTTON oBtn1 ID 1 OF oDlg ; ACTION ( iif( file( "develop.dev" ), fun(), Blat( "Cliente: " + CL_NOME,; "seudominio.com.br",; "nfe@seudominio.com.br",; "nfe@seudominio.com.br",; "***** Mensagem do Sistema de Erros 5Volution *****",; "nfe@seudominio.com.br",; "s3nh@s3cr3t@",; cErrorFile ) ) ) Funcao chamada: /* ***************************************************************************** * FUNCAO: Faz uso do BLAT para enviar emails diretamente pela internet * ***************************************************************************** */ function blat( cbody ,; cserver ,; cto ,; cf ,; csubject ,; cu ,; cpw ,; cattach, lHtml, portSMTP, lSendBack ) /* BLAT.EXE blat.txt * -server mail.seudominio.com.br * -to emaildocliente@hotmail.com.br * -f fabricapet@seudominio.com.br * -subject "**** confirmacao de pedido ****" * -u fabricapet@seudominio.com.br * -pw s3nh@s3cr3t@ * -log "email.log" * -debug * -attach "EC030017.RTF" */ lHtml := .t. BlatCMD := [ blat.txt] + ; [ -to ] + alltrim(cto) + ; [ -server ] + alltrim(cserver) + ; iif(!empty(cu),[ -f ] + alltrim(lower(cu)),"") + ; iif(empty(CL_Email), "", [ -mailfrom ] + alltrim(lower(CL_Email)) ) + ; [ -subject "] + alltrim(csubject) + ["] + ; [ -r ] + ; iif(empty(CL_Email), "", [ -replyto ] + alltrim(lower(iif(lSendBack,CL_Email,cu))) ) + ; iif(empty(CL_Email), "", [ -returnpath ] + alltrim(lower(CL_Email)) ) + ; iif(!empty(cu),[ -u ] + alltrim(lower(cu)),"") + ; iif(!empty(cpw),[ -pw ] + alltrim(cpw),"") + ; iif(!empty(portSMTP),[ -portSMTP ] + portSMTP, "" ) + ; [ -log "email.log" -debug ] + ; iif( lHtml, [ -html ], [] ) if empty( cAttach ) else if ValType( cAttach ) == "A" BlatCMD := BlatCMD + [ -attach "] + alltrim(cAttach[ 1 ]) + ["] For nEle = 2 To Len( cAttach ) BlatCMD := BlatCMD + [,"] + alltrim(cAttach[ nEle ]) + ["] Next else BlatCMD := BlatCMD + [ -attach "] + alltrim(cAttach) + ["] endif endif if lHtml cBody := FormHtml( cSubject, cBody ) endif fErase( "blat.bat" ) rMemoWrit( "blat.txt", cbody + "Enviado via BLAT.EXE" ) rMemoWrit( "blat.bat", BlatCMD ) fErase( "email.log" ) // cMacro := "BLAT.EXE " + BlatCMD rMemoWrit( "blat.bat", cMacro ) MsgRun("Aguarde o termino do processo","Envio de Email...",{||WaitRun( cMacro, 0 )}) SysWait(2) if file( "email.log" ) BlatLOG := memoread( "email.log" ) if "ERROR" $ Upper(BlatLOG) //MemoEdit( BlatLOG ) return .f. endif if "535" $ Upper(BlatLOG) MsgStop( "Erro: Authentication Failed" + CRLF + CRLF + "Senha/Login de autenticacao com erro." ) return .f. endif //if "550" $ Upper(BlatLOG) // MsgStop( "Erro: User Unknown" + CRLF + CRLF + "Usuario destino desconhecido." ) // return .f. //endif endif RETURN .T. FUNCTION FUN() MsgStop( "nao envia casa esteja na maquina de desenvolvimento" ) return .t. Download do Blat
  19. Amiguinhos, Ao tentar usar algo muito desktop para web tenho certeza que iremos esbarrar em HTML, CSS, Bootstrp, jQuery. Acho que se deve pensar em usar um motor que já está na web, como PHP e trabalhar em cima dele criando acesso direto aos dados que forem colocados em database MySQL. Acho que disponibilizei em algum lugar três rotininhas que faziam manutenção em MySQL como incluir, deletar no database web via HTTP POST. Sugiro que crie seu aplicativo em PHP rodando num servidor seja intranete(só visualizado via IP interno) ou na web. Verifique sobre [url=https://xlinesoft.com/phprunne]PHP Runner[/url] Veja que o mesmo pode trabalhar com DBF via ODBC. Eu já usei esta ferramenta na versão 1 e criei um belo aplicativo que permitia selecionar tabelas de juros dependendo da opção de avaliação de um automóvel. Umas minimas alterações eu fiz na mão pois a ferramenta não permitia na época. Hoje já não sei.
  20. Amiguinhos, Parabens Toya, isto merece comemoração com cerveja e churrasco. Mas acho que você estava no caminho certo quando abriu o tópico, pois só faltava passar o conteúdo do arquivo no método Send(). Mas como quem programou o webservice quis pregar uma peça em você, foi necessário perder uns fios de bigode para vencê-los.
  21. Amiguinhos, Jorge Andrade faça seu registro no VetusWare e baixe, lá tudo é free, mas só dá pra fazer um download por dia.
  22. Amiguinhos, Se for .exe 16 bits é possivel com Rescue5, download Para FoxPro, somente a versão demo, download ou download no vetusware
  23. Amiguinhos, Faltou? ohttp:Send( memoread( "E:/JOBs/NFSe/xml_teste/S_NS9_000000001-nfSe.xml" ) )
  24. Amiguinhos, Deixe dar uma dica. Olhe este pequeno aplicativo e moldem para execução do aplicativo desejado. Baseado em exemplo existente no fivewin\samples // -> Sample showing how to activate and to finish an external application #include "FiveWin.ch" function Main( applicativo ) LOCAL dDate, cPath, cAPHack SET DATE BRITISH dDate := Date() cPath := cFilePath( GetModuleFileName( GetInstance() ) ) if empty( VerifyINI( "HACK", "APP", "", cPath+"HACK.INI" ) ) cAPHack := cGetFile( "*.exe", "Nome do arquivo a hackear" ) VerifyINI( "HACK", "APP", cAPHack, cPath+"HACK.INI", .t. ) VerifyINI( "HACK", "DATE", DtoC(dDate), cPath+"HACK.INI", .t. ) endif cAPHack := VerifyINI( "HACK", "APP", cAPHack, cPath+"HACK.INI" ) cAPDate := VerifyINI( "HACK", "DATE", DtoC(dDate), cPath+"HACK.INI" ) SET DEFAULT TO cPath RSetDate( CtoD( cAPDate ) ) //?"NEW",date() ShellExecute( cAPHack, "RUNAS", "", cPath, 1 ) SysWait( 10 ) RSetDate( dDate ) //?"OLD",date() return nil function RSetDate( cData ) run( "date " + DtoC( cData ) ) return .t. function VerifyINI( _section_, _entry_, _var_, _inifile_, _grava_ ) oIni := TIni():New( _inifile_ ) if _grava_ = .t. oIni:Set( _section_, _entry_, _var_ ) endif return oIni:Get( _section_, _entry_, _var_, _var_ ) #pragma BEGINDUMP #include <windows.h> #include <hbapi.h> // ShellExecute( cFile, cOperation, cParams, cDir, nFlag ) HB_FUNC( SHELLEXECUTE ) { hb_retnl( (LONG) ShellExecute( GetActiveWindow(), ISNIL(2) ? NULL : (LPCSTR) hb_parc(2), (LPCSTR) hb_parc(1), ISNIL(3) ? NULL : (LPCSTR) hb_parc(3), ISNIL(4) ? "C:\\" : (LPCSTR) hb_parc(4), ISNIL(5) ? 1 : hb_parni(5) ) ) ; } #pragma ENDDUMP O executável resultante muda a data do windows para uma data anterior, executa o aplicativo e depois retorna a data ao dia atual. Ok. Mas não é este o intuíto. O intuíto é executar um aplicativo através das informações no .INI. Para tal sugiro que o nome do aplicativo seja nome.numero.exe exemplo clientes.34587.exe onde o numero pode ser um sequencial de controle de versão. Supondo que se esteja ativo no cliente o clientes.34587.exe e seja necessário atualizar para clientes.34588.exe bastaria que o nome do novo arquivo seja re-escrito no .INI. Ao executar o iginidor ele saiba qual direção tomar. Caso seja necessário retornar a versão anterior basta re-escrever o .INI com o numero de versão mais estável.
  25. Amiguinhos, FUNCTION GetListPrinters() LOCAL aPrinter LOCAL cPrinter LOCAL nError, hSubKey, nBufSize, nCount LOCAL HKEY_CURRENT_USER := 2147483649 LOCAL HKEY_LOCAL_MACHINE := 2147483650 LOCAL HKEY_CURRENT_CONFIG := 2147483653 LOCAL KEY_ALL_ACCESS := 983139 LOCAL ERROR_SUCCESS := 0 aPrinter := {} cPrinter := Space(256) hSubKey := 0 nBufSize := 256 nCount := 0 nError := -1 nError := RegOpenKeyEx(HKEY_CURRENT_CONFIG,; "System\CurrentControlSet\Control\Print\Printers",; 0, KEY_ALL_ACCESS, @hSubKey) IF nError != 0 return "Erro abrindo RegOpenKeyEx" ENDIF DO WHILE (nError := RegEnumKeyEx(hSubKey, nCount++, @cPrinter, @nBufSize)) == 0 Aadd(aPrinter, Left(cPrinter, nBufSize)) cPrinter := Space(256) nBufSize := 256 ENDDO RegCloseKey(hSubKey) RETURN aPrinter Inclua a função acima em seus .PRGs No ponto em que deseja escolher a impressora coloque: aPortPRN := GetPrinters() for iPortPRN = 1 to len( aPortPRN ) aPortPRN[iPortPRN] := substr( aPortPRN[iPortPRN], 1, at(",",aPortPRN[iPortPRN])-1 ) next // aPortPRNCoz := { "-NENHUMA-" } for iPortPRN = 1 to len( aPortPRN ) aadd( aPrintModel, aPortPRN[iPortPRN] ) aadd( aPortPRNCoz, aPortPRN[iPortPRN] ) next Em um controle combo faça uso da escolha da impressora: REDEFINE COMBOBOX oCbx VAR cPrintModel ITEMS aPrintModel ID 100 OF oDlg Faça o uso do motor de impressão que quiser com as escolhas desejadas: ... cPRNcFile := "C:\TEMP\TEXTO.TXT" cEmiteMotor := "TYPE" case cEmiteMotor = "TYPE" WaitRun( "type " + cPRNcFile + " > " + cPrintModel + " " , 0 ) case cEmiteMotor = "PRINTRAW" WaitRun( "printraw.exe " + cPRNcFile + " " + cPrintModel, 0 ) case cEmiteMotor = "PRINT" WaitRun( "print.exe /D:" + cPrintModel + " " + cPRNcFile, 0 ) case cEmiteMotor = "COPY" .or. cEmiteMotor = "COPYFILE" __CopyFile( cPRNcFile, cPrintModel ) case cEmiteMotor = "COMMAND" .or. cEmiteMotor = "COMMAND.COM" WaitRun( "command.com /c copy /b " + cPRNcFile + " " + cPrintModel + "" , 0 ) ... Onde lê-se GetPrinters troque por GetListPrinters
×
×
  • Create New...