jbinfo Posted August 19, 2015 Report Share Posted August 19, 2015 Bom dia Pessoal, Estou tentando configurar o SAT no sistema mas estou tento problema para declarar a nova função de vender item completo...esta dando erro na hora de compilar, segue abaixo como estou fazendo.... && JSON função: Bematech_FI_VendeItemCompletoJSON - SAT VENDE ITEM COMPLETO DLL32 function ITEM_SAT( Codigo AS STRING,; EAN13 As String,; descricao As String,; indiceDepartamento As String,; aliquota As String,; unidadeMedida As String,; tipoQuantidade As String,; casasDecimaisQuantidade As String,; quantidade As String,; casasDecimaisValorUnitario As String,; valorUnitario As String,; tipoAcrescimoDesconto As String,; valorAcrescimo As String,; valorDesconto As String,; tipoCalculo As String,; NCM As String,; CFOP As String,; informacoesAdicionais As String,; CST_ICMS As String,; origemProduto As String,; itemListaServico As String,; codigoISS As String,; naturezaOperacaoISS As String,; indicadorIncentivoISS As String,; codigoIBGE As String,; CSOSN As String,; baseCalculoValorRetido As String,; ICMS_ValorRetido As String,; modoBaseCalculo As String,; percentualReducaoBaseCalculo As String,; ICMS_ST_ModoBaseCalculo As String,; ICMS_ST_PercentualMargemAdicionado As String,; ICMS_ST_PercentualReducaoBaseCalculo As String,; ICMS_ST_ValorReducaoBaseCalculoAs String,; ICMS_ST_AliquotaAs String,; ICMS_ST_ValorAs String,; valorDesoneracaoICMS As String,; motivoDesoneracaoICMS As String,; aliquotaCalculoCredito As String,; creditoICMSSimples As String,; impostosIncidentes As String,; CST_PIS As String,; PIS_BaseCalculo As String,; PIS_Aliquota As String,; PIS_Valor As String,; PIS_QuantidadeVendida As String,; PIS_ValorAliquotaReais As String,; CST_COFINS As String,; COFINS_BaseCalculo As String,; COFINS_Aliquota As String,; COFINS_Valor As String,; COFINS_QuantidadeVendida As String,; COFINS_ValorAliquotaReais As String,; iRet As Integer) AS STRING PASCAL ; from "Bematech_FI_VendeItemCompletoJSON" lib xDll *iRet As Integer) AS LONG PASCAL ; Obrigado, Leandro JBI Quote Link to comment Share on other sites More sharing options...
aokisantos Posted August 19, 2015 Report Share Posted August 19, 2015 amigo, olhe esta para vc ter uma ideia: DLL32 FUNCTION AtivarSAT ( numeroSessao AS _INT ,; subComando AS _INT ,; codigoDeAtivacao AS STRING,; CNPJ AS STRING,; cUF AS _INT ) AS STRING PASCAL LIB s_hDLLSAT Quote Link to comment Share on other sites More sharing options...
jbinfo Posted August 19, 2015 Author Report Share Posted August 19, 2015 amigo, olhe esta para vc ter uma ideia: DLL32 FUNCTION AtivarSAT ( numeroSessao AS _INT ,; subComando AS _INT ,; codigoDeAtivacao AS STRING,; CNPJ AS STRING,; cUF AS _INT ) AS STRING PASCAL LIB s_hDLLSAT Obrigado pelo retorno.... Vc usa esta VENDEITEMCOMPLETO nova do SAT? Tem ela declarada pra ver a diferença? Quote Link to comment Share on other sites More sharing options...
kapiaba Posted August 19, 2015 Report Share Posted August 19, 2015 Fonte: http://www.pctoledo.com.br/forum/viewtopic.php?f=20&t=13720&start=30 http://fivewin.com.br/index.php?/topic/20760-sat-fiscal-a-mistica-foi-desvendada/ //*Using Harbour DLLs //*To build Tutor01.dll do: buildhd.bat tutor01 // #include "FiveWin.ch" // function Main() // HbDLLEntry( "MAIN" ) // MsgInfo( "ok from EXE" ) // return nil // DLL FUNCTION HBDLLENTRY( cProc AS LPSTR ) AS LONG PASCAL LIB "Tutor01.dll" #include "FiveWin.ch" #include "dll.ch" STATIC hACBrDLL function Main() //cPath := cFilePath( GetModuleFileName( GetInstance() ) ) // Pega o caminho exato onde se encontra o sistema. // A SAT.dll pode estar na pasta do seu sistema ? "SAT.dll carregada",; hACBrDLL:= LoadLibrary( "c:\SAT\SAT.DLL" ) // LoadLibrary LoadLib32 ? "ConsultarSAT",; ConsultarSAT( RandomSAT( 999999 ) ) //[3] ? "AtivarSAT",; AtivarSAT( RandomSAT( 999999 ), 1, "123456", "11111111111111", 35 ) //[3] cCFeTeste := MemoRead( cPath+"CFeTeste.xml" ) aRetorno := EnviarDadosVenda( RandomSAT( 999999 ), "123456", cCFeTeste ) ? "EnviarDadosVenda",aRetorno[1],aRetorno[2],aRetorno[3],aRetorno[4] return nil ************************** * * FUNÇÕES SAT * Function ConsultarSAT( nSessionRandom ) cString := SATConsultar( nSessionRandom ) return StringToArray( cString, "|" ) Function AtivarSAT( numeroSessao, subComando, codigoDeAtivacao, CNPJ, cUF ) cString := SATAtivar( numeroSessao, subComando, codigoDeAtivacao, CNPJ, cUF ) return StringToArray( cString, "|" ) Function DesligarSAT() cString := SATDesligar() return StringToArray( cString, "|" ) Function ConsultarNumeroSessao( nSessionRandom, codigoAtivacao, numeroSessao ) cString := SATConsultarNumeroSessao( nSessionRandom, codigoAtivacao, numeroSessao ) return StringToArray( cString, "|" ) Function TesteFimAFim() cString := SATTesteFimAFim() return StringToArray( cString, "|" ) Function EnviarDadosVenda( numeroSessao, codigoAtivacao, dados ) cString := SATEnviarDadosVenda( numeroSessao, codigoAtivacao, dados ) return StringToArray( cString, "|" ) Function CancelarUltimaVenda( numeroSessao, codigoAtivacao, chaveAcesso, dados ) cString := SATCancelarUltimaVenda( numeroSessao, codigoAtivacao, chaveAcesso, dados ) return StringToArray( cString, "|" ) DLL32 FUNCTION SATConsultar( nSessionRandom AS _INT ) AS STRING FROM "ConsultarSAT" LIB hACBrDLL DLL32 FUNCTION SATAtivar( numeroSessao AS _INT ,; subComando AS _INT ,; codigoDeAtivacao AS STRING,; CNPJ AS STRING,; cUF AS _INT ) AS STRING FROM "AtivarSAT" LIB hACBrDLL DLL32 FUNCTION SATDesligar( ) AS STRING FROM "DesligarSAT" LIB hACBrDLL DLL32 FUNCTION SATConsultarNumeroSessao(getRandom AS _INT ,; codigoAtivacao AS STRING,; numeroSessao AS STRING ) AS STRING FROM "ConsultarNumeroSessao" LIB hACBrDLL DLL32 FUNCTION SATTesteFimAFim( numeroSessao AS _INT ,; codigoAtivacao AS STRING,; dados AS STRING ) AS STRING FROM "TesteFimAFim" LIB hACBrDLL DLL32 FUNCTION SATEnviarDadosVenda( numeroSessao AS _INT ,; codigoAtivacao AS STRING,; dados AS STRING ) AS STRING FROM "EnviarDadosVenda" LIB hACBrDLL DLL32 FUNCTION SATCancelarUltimaVenda( numeroSessao AS _INT ,; codigoAtivacao AS STRING,; chaveAcesso AS STRING,; dados AS STRING ) AS STRING FROM "CancelarUltimaVenda" LIB hACBrDLL ********************************************** * * OUTRAS FUNÇÕES * Function RandomSAT( nMaximo ) static nRandom local nTemporal nMaximo = if( nMaximo == NIL, 65535, nMaximo ) if nRandom == NIL nRandom = seconds() endif nTemporal = ( nRandom * seconds() ) % ( nMaximo + 1 ) nTemporal = if( nTemporal < 1, 1, nTemporal ) nRandom = nTemporal + seconds() if nTemporal<100000 ntemporal:= ntemporal + 99999 endif RETURN int( nTemporal ) function StringToArray( cString, cSeparator ) LOCAL nPos LOCAL aString := {} cSeparator := iif(cSeparator=nil, ";", cSeparator) cString := iif(cString=nil, "", cString) cString := ALLTRIM( cString ) + cSeparator DO WHILE .T. nPos := AT( cSeparator, cString ) IF nPos = 0 EXIT ENDIF AADD( aString, SUBSTR( cString, 1, nPos-1 ) ) cString := SUBSTR( cString, nPos+1 ) ENDDO RETURN ( aString ) Return(lOk) Quote Link to comment Share on other sites More sharing options...
aokisantos Posted August 19, 2015 Report Share Posted August 19, 2015 jbinfo,Eu não uso esta função, mais percebi na sua declaração a definição "string" não esta em CAIXA ALTA: STRING. Quote Link to comment Share on other sites More sharing options...
jbinfo Posted August 19, 2015 Author Report Share Posted August 19, 2015 Testei mas não deu certo AokiSantos...rsrs..valeu Quote Link to comment Share on other sites More sharing options...
aokisantos Posted August 19, 2015 Report Share Posted August 19, 2015 JBINFO, eu uso a: ENVIARDADOSVENDA DLL32 FUNCTION EnviarDadosVenda( numeroSessao AS _INT ,; codigoAtivacao AS STRING,; dados AS STRING ) AS STRING PASCAL LIB s_hDLLSAT Referente a sua declaracao eu faria assim: DLL32 FUNCTION Bematech_FI_VendeItemCompletoJSON( CODIGO AS STRING,; EAN13 AS STRING,; DESCRICAO AS STRING,; INDICEDEPARTAMENTO AS STRING,; ALIQUOTA AS STRING,; UNIDADEMEDIDA AS STRING,; TIPOQUANTIDADE AS STRING,; CASASDECIMAISQUANTIDADE AS STRING,; QUANTIDADE AS STRING,; CASASDECIMAISVALORUNITARIO AS STRING,; VALORUNITARIO AS STRING,; TIPOACRESCIMODESCONTO AS STRING,; VALORACRESCIMO AS STRING,; VALORDESCONTO AS STRING,; TIPOCALCULO AS STRING,; NCM AS STRING,; CFOP AS STRING,; INFORMACOESADICIONAIS AS STRING,; CST_ICMS AS STRING,; ORIGEMPRODUTO AS STRING,; ITEMLISTASERVICO AS STRING,; CODIGOISS AS STRING,; NATUREZAOPERACAOISS AS STRING,; INDICADORINCENTIVOISS AS STRING,; CODIGOIBGE AS STRING,; CSOSN AS STRING,; BASECALCULOVALORRETIDO AS STRING,; ICMS_VALORRETIDO AS STRING,; MODOBASECALCULO AS STRING,; PERCENTUALREDUCAOBASECALCULO AS STRING,; ICMS_ST_MODOBASECALCULO AS STRING,; ICMS_ST_PERCENTUALMARGEMADICIONADO AS STRING,; ICMS_ST_PERCENTUALREDUCAOBASECALCULO AS STRING,; ICMS_ST_VALORREDUCAOBASECALCULOAS STRING,; ICMS_ST_ALIQUOTAAS STRING,; ICMS_ST_VALORAS STRING,; VALORDESONERACAOICMS AS STRING,; MOTIVODESONERACAOICMS AS STRING,; ALIQUOTACALCULOCREDITO AS STRING,; CREDITOICMSSIMPLES AS STRING,; IMPOSTOSINCIDENTES AS STRING,; CST_PIS AS STRING,; PIS_BASECALCULO AS STRING,; PIS_ALIQUOTA AS STRING,; PIS_VALOR AS STRING,; PIS_QUANTIDADEVENDIDA AS STRING,; PIS_VALORALIQUOTAREAIS AS STRING,; CST_COFINS AS STRING,; COFINS_BASECALCULO AS STRING,; COFINS_ALIQUOTA AS STRING,; COFINS_VALOR AS STRING,; COFINS_QUANTIDADEVENDIDA AS STRING,; COFINS_VALORALIQUOTAREAIS AS STRING,; IRET AS INTEGER) AS STRING PASCAL LIB 'coloqueaquidllbematech.dll' Quote Link to comment Share on other sites More sharing options...
jbinfo Posted August 19, 2015 Author Report Share Posted August 19, 2015 Alguem sabe como fazer a assinatura digital dos CNPJs? Preciso anexar na configuração do SAT...aff...rsrs Quote Link to comment Share on other sites More sharing options...
silvanof Posted September 15, 2015 Report Share Posted September 15, 2015 Depois de muito pesquisar achei um alternativa bem fácil com o "Gerador de Código de Vinculação" da Tanca,segue o link http://www.tanca.com.br/drivers/.php?cat=24⊂=43 AWS Sistemas Empresariais suporte@awsinformatica.com.br Quote Link to comment Share on other sites More sharing options...
Luiz Fernando Posted September 15, 2015 Report Share Posted September 15, 2015 Colegas estou na duvida sobre numeroSessao, utilizada nas chamas da DLL acima, como obter este numero. Obrigado Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.