Página 1 de 1

Sintegra

Enviado: 19 Jan 2005 02:53
por vagucs
Amigos,

Preciso fazer o sintegra de um cliente aqui que é Distribuidora (Produtos de mercarias), não usam ECF.

Alguém sabe quais os tipos de registro devo apresenta ou mesmo se tiver alguma rotina, preciso disto urgente, socorram-me.

Se tiverem alguma coisa enviem para meu e-mail
vagucs@vagucs.com.br

Enviado: 19 Jan 2005 14:18
por Paulao
Vagucs como diz o mineiro cada caso um causo, dependendo do estado os registros gerados são diferentes, mas de uma olhada em

http://www.sef.mg.gov.br/servicos/ped/index.html


E de uma olhada numa rotina para gerar o arquivo PED

* 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
/////////////////////////////////////////////////////////
editado by admin Evolver - quando colocar códigos muito grandes use a tag quote pra não aparecer tanta coisa . você vê o botão da tag quote no espaço para edição do post. Obrigado