Srs,
Bom dia,
Creio que como todos, tambem estou enfretando dificultades em gerar o arquivo sintegra, com os seus respectivos registros.
Esta precisando de um arquivo sintegra(São Paulo), para que eu possar dar uma olhadinha como fica a cara do mesmo depois de pronto.
estou desenvolvendo a rotina para um cliente do comercio, optante do simples paulista.
espero ter sido claro, quanto a minha necessidade....
Modelo de Arquivo Sintegra.txt
Moderador: Moderadores
-
Adriano Ramos
- Usuário Nível 1

- Mensagens: 2
- Registrado em: 18 Jan 2006 00:20
- Localização: Guarulhos
Amigo , osei se vai te ajudar mas vai um exempo de uma rotina para gerar o txt em Minas Gerais
* DATA : 04/07/2003
* PROGRAMA : GERAARQ.PRG
* COMENTARIO : Gera arquivo PED
////////////////////////////////////////////////////////////////////////////
#INCLUDE "INKEY.CH"
set dele on
MENSAGEM("Tecle <ESC> para retornar")
COR("MENU")
@ LIN_MENU,00
@ LIN_MENU,01 SAY "Gera arquivo ³ Processamento Eletronico de Dados"
tela=savescreen(02,00,23,79)
midias:=0
wdatai:=wdataf:=ctod("")
JANELA(05,08,22,72,"Gera arquivo eletronico")
sombra(05,08,22,72)
COR("MENU")
BOTAO(20,25,"Enter")
botao(20,45,"ESC")
SETCOLOR("W+/B")
@06,15 TO 18,60
@07,17 say "Informe a data inicial e a data final para"
@08,17 say "que seja gerado o arquivo eletronico "
@13,17 SAY "Data Inicio :"
@14,17 say "Data Final :"
@13,35 get wdatai
@14,35 get wdataf
read
arqgera := substr(dtoc(wdatai),1,2)+substr(dtoc(wdatai),4,2)+ ;
substr(dtoc(wdataf),1,2)+substr(dtoc(wdataf),4,2)+".TXT"
if lastkey()==K_ENTER
@ 18,24 say "Nome arquivo: "+arqgera
BOTAO(20,25,"Enter",-2)
if pergunta("Gerar arquivo?")="S"
gera()
endi
elseif lastkey()==K_ESC
BOTAO(20,45,"ESC",-2)
endi
restscreen(02,00,23,79,tela)
return
///////////////////////////////////////////////////////////
func gera
*
* Nome Arq...: Gera.PRG
* Data.......: 04/07/2003
* Descricao..: Rotina de Gera‡ao de TXT ( verificação com SINTEGRA )
////////////////////
ARQ="TIPO50"
CRIATIPO50(ARQ)
SELE 50
USE TIPO50
////////////////////
ARQ="TIPO54"
CRIATIPO54(ARQ)
SELE 54
USE TIPO54
///////////////////
ARQ="TIPO61"
CRIATIPO61(ARQ)
SELE 61
USE TIPO61
///////////////////
ARQ="TIPO75"
CRIATIPO75(ARQ)
SELE 75
USE TIPO75
///////////////////
SELE 88
USE TIPO88
///////////////////
abredbf(1,"remet","remet001")
dbgotop()
abredbf(4,"notafis","notaf001","notaf002")
sele 4
set order to 2
set filter to data >= wdatai .and. data <= wdataf
dbgotop()
sele 4
whil(!eof())
sele 50
if .not. adireg(0)
beep()
alert("InclusÆo nÆo foi bem sucedida",3)
loop
else
repl tipo with 50 ///Campo 01
if 4->cgc <> space(14)
repl cnpj with val(4->cgc) ///Campo 02
else
repl cnpj with val(4->cpf) ///Campo 02
endi
if 4->ie = space(14) ///Campo 03
repl ie with "ISENTO"
else
repl ie with 4->ie ///Campo 03
endi
repl datae with 4->data ///Campo 04
repl uf with 4->uf ///Campo 05
repl modelo with 04 ///Campo 06
repl serie with " " ///Campo 07
repl nf with val(4->numnf) ///Campo 08
repl cfop with val(4->cfop) ///Campo 09
repl emitente with "P" ///Campo 10
repl vlrnf with 4->valortotno ///Campo 11
repl vlrbc with 4->bcalcicms ///Campo 12
repl vlricmS with 4->valoricms ///Campo 13
repl vlrisento with 4->reducao ///Campo 14
if 4->diferido="DIFERIDO " ///Campo 15
repl vlroutros with 4->valortotno
else
repl vlroutros with 0 ///Campo 15
endi
ALIQQ=4->ICMS1+"00" ///Campo 16
repl aliq with ALIQQ
repl sit with "N" ///Campo 17
//////////////////////////////////////////////////////////////////////////////
//// Gera registro 54 //// Note que estamos dentro do whil do registro 50 ////
//////////////////////////////////////////////////////////////////////////////
sele 54
for a=1 to 9
var_1="4->desc"+ltrim(str(a))
var_2="4->qtd"+ltrim(str(a))
var_3="4->subto"+ltrim(str(a))
var_4="4->bcalit"+ltrim(str(a))
var_5="4->icms"+ltrim(str(a))
if &var_1 <> space(41)
if .not. adireg(0)
beep()
alert("InclusÆo nÆo foi bem sucedida",3)
loop
else
repl tipo with 54 /// campo 01
if 4->cgc <> space(14)
repl cnpj with val(4->cgc) /// campo 02
else
repl cnpj with val(4->cpf) /// campo 02
endi
repl modelo with 4 /// campo 03
repl serie with space(03) /// campo 04
repl nf with val(4->numnf) /// campo 05
repl cfop with val(4->cfop) /// campo 06
if 4->diferido="DIFERIDO " /// campo 07
repl cst with 51
if left(&var_1,4) ="SEME" .or. left(&var_1,4)="SOJA"
repl codprod with "120151"+4->icms1 /// campo 09
elseif left(&var_1,4)="MILH"
repl codprod with "100551"+4->icms1
endi
elseif 4->uf ="MG" .and. 4->diferido=space(10)
repl cst with 40
if left(&var_1,4) ="SEME" .or. left(&var_1,4)="SOJA"
repl codprod with "120140"+4->icms1 /// campo 09
elseif left(&var_1,4)="MILH"
repl codprod with "100540"+4->icms1
endi
elseif 4->uf <> "MG" .and. 4->diferido=space(10)
repl cst with 20
if left(&var_1,4) ="SEME" .or. left(&var_1,4)="SOJA"
repl codprod with "120120"+4->icms1 /// campo 09
elseif left(&var_1,4)="MILH"
repl codprod with "100520"+4->icms1
endi
endi
repl nitem with a /// campo 08
// if left(&var_1,4) ="SEME" .or. left(&var_1,4)="SOJA"
// repl codprod with "1201000000" /// campo 09
// elseif left(&var_1,4)="MILH"
// repl codprod with "1005900200"
// endi
repl qtde with &var_2 /// campo 10
repl vlrprod with &var_3 /// campo 11
repl vlrdesc with 0 /// campo 12
repl vlrbc with &var_4 /// campo 13
repl vlrdcst with 0 /// campo 14
repl vlripi with 0 /// campo 15
repl aliq with strtran(&var_5," ","0")+"00" /// campo 16
endi
endi
next
/////////////////////////////////////////////////////////////////////////////
//// Gera registro 54 para o frete /// Ainda estamos do while do registro 50/
/////////////////////////////////////////////////////////////////////////////
if 4->valorfrete <> 0
if .not. adireg(0)
beep()
alert("InclusÆo nÆo foi bem sucedida",3)
loop
else
repl tipo with 54 /// campo 01
if 4->cgc <> space(14)
repl cnpj with val(4->cgc) /// campo 02
else
repl cnpj with val(4->cpf) /// campo 02
endi
repl modelo with 4 /// campo 03
repl serie with space(03) /// campo 04
repl nf with val(4->numnf) /// campo 05
repl cfop with val(4->cfop) /// campo 06
repl cst with 70 /// campo 07
// if 4->diferido="DIFERIDO " /// campo 07
// repl cst with 51
// elseif 4->uf ="MG" .and. 4->diferido=space(10)
// repl cst with 40
// elseif 4->uf <> "MG" .and. 4->diferido=space(10)
// repl cst with 20
// endi
repl nitem with 991 /// campo 08
repl codprod with space(14) /// campo 09
repl qtde with 0 /// campo 10
repl vlrprod with 0 /// campo 11
repl vlrdesc with 0 /// campo 12
repl vlrbc with 4->baicmfre /// campo 13
repl vlrdcst with 0 /// campo 14
repl vlripi with 0 /// campo 15
repl aliq with strzero(4->alicmfre)+"00" /// campo 16
endi
endi
endif
sele 4
skip
endd
////////////////////////////////////////////////////////////////////
///// Gera registro tipo 61 ////////////////////////////////////////
////////////////////////////////////////////////////////////////////
sele 4
set date brit
index on dtos(data)+icms1 to dataaliq for data >= wdatai .and. data <=wdataf
//pdata="01/01/2003"
dbgotop()
//pesquiza(4,"data","icms1","Data","Aliq","pdata","Escolher Plano",4,11,73,"data","w+/b")
m->data=data
m->icms1=space(02)
m->icms1=icms1
m->Numinic=numnf
Vl_Tot:=Base_Calc:=Vl_Icms:=Vl_Isento:=Vl_Outras:=0
whil(!eof())
if m->data=data .and. m->icms1=icms1
Vl_Tot=Vl_Tot+valortotno
Base_Calc=Base_Calc+bcalcicms
Vl_Icms=Vl_Icms+valoricms
//////////////////////////////////////////////////////////////////
if valoricms=0 //// Campo 13 ////
Vl_ISento=Vl_Isento+totprod
elseif reducao <> 0
Vl_ISento=Vl_ISento+reducao
endi
/////////////////////////////////////////////////////////////////
If diferido ="DIFERIDO "
Vl_outras=Vl_outras+totprod
endi
m->numfinal=numnf
endi
skip+1
if m->data=data .and. m->icms1=icms1
loop
else
sele 61
if .not. adireg(0)
beep()
alert("InclusÆo nÆo foi bem sucedida",3)
loop
else
repl tipo with 61 /// campo 01
repl branco1 with space(14) /// campo 02
repl branco2 with space(14) /// campo 03
repl dtemissao with m->data /// campo 04
repl modelo with 04 /// campo 05
repl serie with " " /// campo 06
repl subserie with " " /// campo 07
repl numinic with val(m->numinic) /// campo 08
repl numfinal with Val(m->numfinal) /// campo 09
repl vltotal with vl_tot /// campo 10
repl basecalc with Base_calc /// campo 11
repl vlicms with Vl_Icms /// campo 12
repl isenta with Vl_Isento /// campo 13
repl outras with Vl_Outras /// campo 14
// repl aliq with strtran(&var_5," ","0")+"00" /// campo 16
// ALIQQQ=4->ICMS1+"00"
// repl aliquota with ALIQQQ //val(m->icms1) /// campo 15
repl aliquota with strtran(m->icms1," ","0")+"00"
repl branco3 with space(01) /// campo 16
Vl_Tot:=Base_Calc:=Vl_Icms:=Vl_Isento:=Vl_Outras:=0
m->Numinic=4->numnf
sele 4
m->data=data
m->icms1=icms1
endi
endi
endd
////////////////////////////////////////////////////////////////////////////
//// Alimenta o arquivo Tipo 75 ////
////////////////////////////////////////////////////////////////////////////
sele 4
dbgotop()
whil(!eof())
sele 75
if .not. adireg(0)
beep()
alert("InclusÆo nÆo foi bem sucedida",3)
loop
else
repl tipo with 75
repl dtini with wdatai
repl dtfim with wdataf
if 4->diferido="DIFERIDO " /// campo 07
repl strib with 51
repl aliqipi with 0
repl aliqicms with val(4->icms1)
if left(4->desc1,4) ="SEME" .or. left(4->desc1,4)="SOJA"
repl codprod with "120151"+4->icms1 /// campo 09
repl codnbm with "1201000000"
repl desc with "SOJA, MESMO TRITURADA"
if left(4->desc1,4) = "SEME"
repl unit with "SC"
elseif left(4->desc1,4) = "SOJA"
repl unit with "KG"
endi
elseif left(4->desc1,4)="MILH"
repl codprod with "100551"+4->icms1
repl desc with "MILHO EM GRAO COM CASCAS"
repl unit with "KG"
repl codnbm with "1005900200"
endi
elseif 4->uf ="MG" .and. 4->diferido=space(10)
repl strib with 40
repl aliqipi with 0
repl aliqicms with val(4->icms1)
if left(4->desc1,4) ="SEME" .or. left(4->desc1,4)="SOJA"
repl codprod with "120140"+4->icms1 /// campo 09
repl desc with "SOJA, MESMO TRITURADA"
repl codnbm with "1201000000"
if left(4->desc1,4) = "SEME"
repl unit with "SC"
elseif left(4->desc1,4) = "SOJA"
repl unit with "KG"
endi
elseif left(4->desc1,4)="MILH"
repl codprod with "100540"+4->icms1
repl desc with "MILHO EM GRAO COM CASCAS"
repl unit with "KG"
repl codnbm with "1005900200"
endi
elseif 4->uf <> "MG" .and. 4->diferido=space(10)
repl strib with 20
repl aliqipi with 0
repl aliqicms with val(4->icms1)
repl reducao with 60
if left(4->desc1,4) ="SEME" .or. left(4->desc1,4)="SOJA"
repl codprod with "120120"+4->icms1 /// campo 09
repl codnbm with "1201000000"
repl desc with "SOJA, MESMO TRITURADA"
repl codnbm with "1201000000"
if left(4->desc1,4) = "SEME"
repl unit with "SC"
elseif left(4->desc1,4) = "SOJA"
repl unit with "KG"
endi
elseif left(4->desc1,4)="MILH"
repl codprod with "100520"+4->icms1
repl codnbm with "1005900200"
repl desc with "MILHO EM GRAO COM CASCAS"
repl unit with "KG"
endi
endi
endi
sele 4
dbskip()
endd
sele 75
index on codprod to codprod
m->codprod=codprod
whil(!eof())
skip
if codprod=m->codprod
if .not. reglock(5)
beep()
mensagem("ExclusÆo mal sucedida",3)
else
dele
endif
endi
endd
set printer on
set device to print
set printer to &arqgera
//////////////////////////////////////////////////////////////////////
/////////////// Gera Registro Tipo 10 ////////////////////////////////
//////////////////////////////////////////////////////////////////////
if 1->reg10="S"
sele 1
dbgotop()
// data inicial em yy/mm/dd
ddy := year(wdatai)
ddm := month(wdatai)
ddd := day(wdatai)
// data final em yy/mm/dd
ddfy := year(wdataf)
ddfm := month(wdataf)
ddfd := day(wdataf)
setprc(0,0)
@ 0 ,0 say "10"
@ prow(),pcol() say strzero(cnpj)
@ prow(),pcol() say ie
@ prow(),pcol() say razao
@ prow(),pcol() say cidade
@ prow(),pcol() say uf
@ prow(),pcol() say strzero(fax)
@ prow(),pcol() say strzero(ddy,4,0)
@ prow(),pcol() say strzero(ddm,2,0)
@ prow(),pcol() say strzero(ddd,2,0)
@ prow(),pcol() say strzero(ddfy,4,0)
@ prow(),pcol() say strzero(ddfm,2,0)
@ prow(),pcol() say strzero(ddfd,2,0)
@ prow(),pcol() say "3"
@ prow(),pcol() say "3"
@ prow(),pcol() say "1"
endi
//////////////////////////////////////////////////////////////////////
/////////////// Gera Registro Tipo 11 ////////////////////////////////
//////////////////////////////////////////////////////////////////////
if 1->reg11="S"
@ prow()+1,0 say "11"
@ prow() ,pcol() say end
@ prow() ,pcol() say strzero(num)
@ prow() ,pcol() say compl
@ prow() ,pcol() say bairro
@ prow() ,pcol() say strzero(cep)
@ prow() ,pcol() say contato
@ prow() ,pcol() say strzero(tel)
endi
//////////////////////////////////////////////////////////////////////
tt50:=tt54:=tt61:=tt75:=0
//////////////////////////////////////////////////////////////////////
/////////////// Gera Registro Tipo 50 ////////////////////////////////
//////////////////////////////////////////////////////////////////////
if 1->reg50="S"
sele 50
//data de emissao em yy/mm/dd
ddey := year(datae)
ddem := month(datae)
dded := day(datae)
count to tt50
Dbgotop()
Whil(!EOF())
@ prow()+1,0 say "50" /// campo 1
@ prow() ,pcol() say strzero(cnpj) /// campo 2
@ prow() ,pcol() say ie /// campo 3
@ prow() ,pcol() say strzero(ddey,4,0) /// campo 4
@ prow() ,pcol() say strzero(ddem,2,0) /// campo 4
@ prow() ,pcol() say strzero(dded,2,0) /// campo 4
@ prow() ,pcol() say uf /// campo 5
@ prow() ,pcol() say "04" //strzero(modelo) /// campo 6
@ prow() ,pcol() say serie /// campo 7
// @ prow() ,pcol() say subserie /// campo 8
@ prow() ,pcol() say strzero(nf) /// campo 8
@ prow() ,pcol() say strzero(cfop) /// campo 9
@ prow() ,pcol() say emitente /// campo 10
@ prow() ,pcol() say "0"+substr(strzero(vlrnf),1,10)+; // campo11
substr(strzero(vlrnf),12,2)
@ prow() ,pcol() say "0"+substr(strzero(vlrbc),1,10)+; // campo12
substr(strzero(vlrbc),12,2)
@ prow() ,pcol() say "0"+substr(strzero(vlricms),1,10)+; // campo13
substr(strzero(vlricms),12,2)
@ prow() ,pcol() say "0"+substr(strzero(vlrisento),1,10)+; // campo14
substr(strzero(vlrisento),12,2)
@ prow() ,pcol() say "0"+substr(strzero(vlroutros),1,10)+; // campo15
substr(strzero(vlroutros),12,2)
@ prow() ,pcol() say aliq
@ prow() ,pcol() say sit
Dbskip(1)
Enddo
endi
//////////////////////////////////////////////////////////////////////
/////////////// Gera Registro Tipo 54 ////////////////////////////////
//////////////////////////////////////////////////////////////////////
if 1->reg54="S"
sele 54
count to tt54
dbgotop()
While !EOF()
@ prow()+1,0 say "54"
@ prow() ,pcol() say strzero(cnpj)
@ prow() ,pcol() say strzero(modelo)
@ prow() ,pcol() say serie
@ prow() ,pcol() say strzero(nf)
@ prow() ,pcol() say strzero(cfop)
@ prow() ,pcol() say strzero(cst)
@ prow() ,pcol() say strzero(nitem)
@ prow() ,pcol() say codprod
@ prow() ,pcol() say "0"+substr(strzero(qtde),1,7) +;
substr(strzero(qtde),9,3)
@ prow() ,pcol() say "0"+substr(strzero(vlrprod),1,9)+;
substr(strzero(vlrprod),11,2)
@ prow() ,pcol() say "0"+substr(strzero(vlrdesc),1,9)+;
substr(strzero(vlrdesc),11,2)
@ prow() ,pcol() say "0"+substr(strzero(vlrbc),1,9)+;
substr(strzero(vlrbc),11,2)
@ prow() ,pcol() say "0"+substr(strzero(vlrdcst),1,9)+;
substr(strzero(vlrdcst),11,2)
@ prow() ,pcol() say "0"+substr(strzero(vlripi),1,9)+;
substr(strzero(vlripi),11,2)
@ prow() ,pcol() say aliq
Dbskip(1)
Enddo
endi
//////////////////////////////////////////////////////////////////////
/////////////// Gera Registro Tipo 61 ////////////////////////////////
//////////////////////////////////////////////////////////////////////
if 1->reg61="S"
sele 61
count to tt61
dbgotop()
whil(!eof())
ddey := year(dtemissao)
ddem := month(dtemissao)
dded := day(dtemissao)
@ prow()+1,0 say "61"
@ prow() ,pcol() say branco1
@ prow() ,pcol() say branco2
@ prow() ,pcol() say strzero(ddey,4,0) /// campo 4
@ prow() ,pcol() say strzero(ddem,2,0) /// campo 4
@ prow() ,pcol() say strzero(dded,2,0) /// campo 4
// @ prow() ,pcol() say dtemissao
@ prow() ,pcol() say strzero(modelo)
@ prow() ,pcol() say serie
@ prow() ,pcol() say subserie
@ prow() ,pcol() say strzero(numinic)
@ prow() ,pcol() say strzero(numfinal)
// @ prow() ,pcol() say strzero(vltotal)
@ prow() ,pcol() say "0"+substr(strzero(vltotal),1,10)+;
substr(strzero(vltotal),12,2)
@ prow() ,pcol() say "0"+substr(strzero(basecalc),1,10)+;
substr(strzero(basecalc),12,2)
@ prow() ,pcol() say "0"+substr(strzero(vlicms),1,9)+;
substr(strzero(vlicms),11,2)
@ prow() ,pcol() say "0"+substr(strzero(isenta),1,10)+;
substr(strzero(isenta),12,2)
@ prow() ,pcol() say "0"+substr(strzero(outras),1,10)+;
substr(strzero(outras),12,2)
@ prow() , pcol() say aliquota
@ prow() , pcol() say branco3
Dbskip(1)
Enddo
endi
//////////////////////////////////////////////////////////////////////
/////////////// Gera Registro Tipo 75 ////////////////////////////////
//////////////////////////////////////////////////////////////////////
if 1->reg75="S"
sele 75
// data inicial em yy/mm/dd
ddy := year(wdatai)
ddm := month(wdatai)
ddd := day(wdatai)
// data final em yy/mm/dd
ddfy := year(wdataf)
ddfm := month(wdataf)
ddfd := day(wdataf)
dbgotop()
count to tt75
Dbgotop()
Whil(!EOF())
@prow()+1,0 say "75"
@prow(),pcol() say strzero(ddy,4,0)
@prow(),pcol() say strzero(ddm,2,0)
@prow(),pcol() say strzero(ddd,2,0)
@prow(),pcol() say strzero(ddfy,4,0)
@prow(),pcol() say strzero(ddfm,2,0)
@prow(),pcol() say strzero(ddfd,2,0)
@prow(),pcol() say codprod
@prow(),pcol() say codnbm
@prow(),pcol() say desc
@prow(),pcol() say unit
@prow(),pcol() say strzero(strib)
@prow(),pcol() say strzero(aliqipi)
@prow(),pcol() say strzero(reducao)
@prow(),pcol() say strzero(bcalcst)
dbskip()
endd
endi
tt88=0
if tt50+tt54+tt61+tt75=0
tt88=1
sele 88
@ prow()+01,0 say "88"
@ prow() ,pcol() say subtipo
@ prow() ,pcol() say strzero(cnpj)
@ prow() ,pcol() say mensagem
@ prow() ,pcol() say brancos
endi
if 1->reg90="S"
//////////////////////////////////////////////////////////////////////
/////////////// Gera Registro Tipo 90 ////////////////////////////////
//////////////////////////////////////////////////////////////////////
sele 1
Dbgotop()
//tt50:=tt54:=tt61:=0
wtot := (tt54+tt61+tt75+tt88) + 3
@ prow()+1,0 say "90"
@ prow() ,pcol() say strzero(cnpj)
@ prow() ,pcol() say ie
@ prow() ,pcol() say "50"
@ prow() ,pcol() say strzero(tt50,8,0)
@ prow() ,pcol() say "54"
@ prow() ,pcol() say strzero(tt54,8,0)
@ prow() ,pcol() say "61"
@ prow() ,pcol() say strzero(tt61,8,0)
@ prow() ,pcol() say "75"
@ prow() ,pcol() say strzero(tt75,8,0)
@ prow() ,pcol() say "88"
@ prow() ,pcol() say strzero(tt88,8,0)
@ prow() ,pcol() say "99"
@ prow() ,pcol() say strzero(wtot,8,0)
@ prow() ,pcol()+35 say "1"
endi
set printer off
set device to screen
tone(1000,2)
tone(1000,2)
set devi to screen
retu .t.
/////////////////////////////////////////////////////////////////////////
FUNCTION CRIATIPO50( )
PARA PAR1
PRIVATE aStru
aStru := {;
{"TIPO","N",02,00},;
{"CNPJ","N",14,00},;
{"IE","C",14,00},;
{"DATAE","D",08,00},;
{"UF","C",02,00},;
{"MODELO","N",02,00},;
{"SERIE","C",03,00},;
{"NF","N",06,00},;
{"CFOP","N",04,00},;
{"EMITENTE","C",01,00},;
{"VLRNF","N",13,02},;
{"VLRBC","N",13,02},;
{"VLRICMS","N",13,02},;
{"VLRISENTO","N",13,02},;
{"VLROUTROS","N",13,02},;
{"ALIQ","C",04,00},;
{"SIT","C",01,00}}
DBCREATE(PAR1,aStru)
RETURN NIL
/////////////////////////////////////////////////////////
FUNCTION CRIATIPO54( )
PARA PAR1
PRIVATE aStru
aStru := {;
{"TIPO","N",02,00},;
{"CNPJ","N",14,00},;
{"MODELO","N",02,00},;
{"SERIE","C",03,00},;
{"NF","N",06,00},;
{"CFOP","N",04,00},;
{"CST","N",03,00},;
{"NITEM","N",03,00},;
{"CODPROD","C",14,00},;
{"QTDE","N",11,03},;
{"VLRPROD","N",12,02},;
{"VLRDESC","N",12,02},;
{"VLRBC","N",12,02},;
{"VLRDCST","N",12,02},;
{"VLRIPI","N",12,02},;
{"ALIQ","C",04,00}}
DBCREATE(PAR1,aStru)
RETURN NIL
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
FUNCTION CRIATIPO61( )
PARA PAR1
PRIVATE aStru
aStru := {;
{"TIPO","N",02,00},;
{"BRANCO1","C",14,00},;
{"BRANCO2","C",14,00},;
{"DTEMISSAO","D",08,00},;
{"MODELO","N",02,00},;
{"SERIE","C",03,00},;
{"SUBSERIE","C",02,00},;
{"NUMINIC","N",06,00},;
{"NUMFINAL","N",06,00},;
{"VLTOTAL","N",13,02},;
{"BASECALC","N",13,02},;
{"VLICMS","N",12,02},;
{"ISENTA","N",13,02},;
{"OUTRAS","N",13,02},;
{"ALIQUOTA","C",04,00},;
{"BRANCO3","C",01,00}}
DBCREATE(PAR1,aStru)
RETURN NIL
/////////////////////////////////////////////////////////
FUNCTION CRIATIPO75( )
PARA PAR1
PRIVATE aStru
aStru := {;
{"TIPO","N",02,00},;
{"DTINI","D",08,00},;
{"DTFIM","D",08,00},;
{"CODPROD","C",14,00},;
{"CODNBM","C",08,00},;
{"DESC","C",53,00},;
{"UNIT","C",06,00},;
{"STRIB","N",03,00},;
{"ALIQIPI","N",04,00},;
{"ALIQICMS","N",04,00},;
{"REDUCAO","N",04,00},;
{"BCALCST","N",12,02}}
DBCREATE(PAR1,aStru)
RETURN NIL
/////////////////////////////////////////////////////////
-
Adriano Ramos
- Usuário Nível 1

- Mensagens: 2
- Registrado em: 18 Jan 2006 00:20
- Localização: Guarulhos
Este arquivo é de Minas é só pra vc ter uma idéia.
Cada estado tem sua própria lei e cada ramo de atividade gera arquivos diferentes, minha sujestao é que gere o arquivo e tente valida-lo com o sintegra, e depois veja nos resumos do programa sintegra se os valores batem, amigo foi brabo fazer isto funcionar, acho que demorei uns tres meses trabalhando meio periodo, vc vai ter que visitar muito o site do icms e tentar tirar suas duvidas com o que tem por la.
Boa sorte
Cada estado tem sua própria lei e cada ramo de atividade gera arquivos diferentes, minha sujestao é que gere o arquivo e tente valida-lo com o sintegra, e depois veja nos resumos do programa sintegra se os valores batem, amigo foi brabo fazer isto funcionar, acho que demorei uns tres meses trabalhando meio periodo, vc vai ter que visitar muito o site do icms e tentar tirar suas duvidas com o que tem por la.
Boa sorte
1000007400446800PR5691867 JAMIL MIGUEL SACRAMENTO MG16372114002003100120031031231
11RODOVIA FRANCA ARAXA KM 70 00000A DIREITA 9 KM P/TERRAZONA RURAL 38190000MARCOS 001637215204
61 2003100104 00145000000400000016008000000000690000000000082800000000103500000000000000001200
61 2003100204 00000500000600000053399240000002301691000000276203000000345253700000000000001200
61 2003100304 00000700001200000163709870000007056460000000846775000001058469000000000000001200
61 2003100404 00001300001300000044242600000001907009000000228841000000286051300000000000001200
61 2003100604 00001400001700000215293220000009279880000001113586000001391982000000000000001200
61 2003100704 00001900001900000049000000000000000000000000000000000000490000000000000000000000
61 2003100704 00001800001800000025807680000001112400000000133488000000166860000000000000001200
61 2003100804 00002000002100000057907200000002496000000000299520000000374400000000000000001200
61 2003100904 00002200002200000025608000000000000000000000000000000000256080000000000000000000
61 2003100904 00002300002300000026423640000001138950000000136674000000170842500000000000001200
61 2003101004 00002400002500000023896000000001030000000000123600000000154500000000000000001200
61 2003101104 00002600002600000049532000000000000000000000000000000000495320000000000000000000
61 2003101104 00002700002800000042873600000001848000000000221760000000277200000000000000001200
61 2003101304 00002900002900000029510400000001272000000000152640000000190800000000000000001200
61 2003101404 00003000003000000039780000000000000000000000000000000000397800000000000000000000
61 2003101504 00003100003800000113053800000000000000000000000000000001130538000000000000000000
61 2003101504 00003400003700000136852160000005898800000000707856000000884820000000000000001200
61 2003101604 00003900003900000042790000000000000000000000000000000000427900000000000000000000
61 2003101704 00004000004300000180876480000007796400000000935568000001169460000000000000001200
61 2003101804 00004400004400000045550000000000000000000000000000000000455500000000000000000000
61 2003101804 00004500004800000094099200000004056000000000486720000000608400000000000000001200
61 2003102004 00004900004900000043374720000001869600000000224352000000280440000000000000001200
61 2003102104 00005000005800000127490490000005495280000000659433000000824292000000000000001200
61 2003102204 00005900006000000027505920000001185600000000142272000000177840000000000000001200
61 2003102304 00006700006700000018000000000000000000000000000000000000180000000000000000000000
61 2003102304 00006200006500000075613440000003259200000000391104000000488880000000000000001200
61 2003102304 00006100006900000108177360000004516800000000316176000000677520000000000000007000
61 2003102404 00007000008100000251634160000010846300000001301556000001626945000000000000001200
61 2003102504 00008400008400000010000000000000000000000000000000000000100000000000010000000000
61 2003102504 00008200008300000090869760000003916800000000470016000000587520000000000000001200
61 2003102704 00008500008600000044080000000001900000000000228000000000285000000000000000001200
61 2003102804 00008700009100000255118570000010996490000001319579000001649473500000000000001200
61 2003102904 00009700009700000029880000000000000000000000000000000000298800000000000000000000
61 2003102904 00009200009800000144197280000006215400000000745848000000932310000000000000001200
61 2003103004 00009900011000000082591250000003559968000000427196000000533995200000000000001200
61 2003103104 00011100012100000122886000000000000000000000000000000001228860000000000000000000
61 2003103104 00011600012000000120186670000005180460000000621655000000777069000000000000001200
9000007400446800PR5691867 500000000054000000006100000037750000000088000000009900000040 1
