Eu uso clipper 5.3, rdd ntx,
abraços
Código: Selecionar todos
SELE 3
set filter to cod_empr=xempresa .and. me_ano=xdata
if ordem = "D"
dbsetorder(1) //index on dt_entr to I_data2
* index on dt_entr to tmp1 while cod_empr=xempresa .and. me_ano = xdata
else
dbsetorder(4) //index on n_nf to I_nf
* index on n_nf to tmp1 while cod_empr=xempresa .and. me_ano = xdata
endif
DECLARE VETOR_CAMPOS[28]
VETOR_CAMPOS[1] = 'CHAVE'
VETOR_CAMPOS[2] = 'N_NF'
VETOR_CAMPOS[3] = 'SERIE'
VETOR_CAMPOS[4] = 'DT_ENTR'
VETOR_CAMPOS[5] = 'ESPECIE'
VETOR_CAMPOS[6] = 'DT_NF'
VETOR_CAMPOS[7] = 'substr(EMITENTE,1,25)'
VETOR_CAMPOS[8] = 'COD_FISC'
VETOR_CAMPOS[9] = 'VR_CONTABI'
VETOR_CAMPOS[10]= 'BC_ICMS'
VETOR_CAMPOS[11]= 'ALI_ICMS'
VETOR_CAMPOS[12]= 'ICMS'
VETOR_CAMPOS[13]= 'ISENTOICMS'
VETOR_CAMPOS[14]= 'OUTRASICMS'
VETOR_CAMPOS[15]= 'IPI_ICMS'
vetor_campos[16]= 'Icms_ret'
VETOR_CAMPOS[17]= 'BC_IPI'
VETOR_CAMPOS[18]= 'IPI'
VETOR_CAMPOS[19]= 'ISENTOIPI'
VETOR_CAMPOS[20]= 'OUTRASIPI'
VETOR_CAMPOS[21]= 'VCONT'
VETOR_CAMPOS[22]= 'BCICMS'
* VETOR_CAMPOS[23]= 'PETRO'
VETOR_CAMPOS[23]= 'OUTRAS'
* VETOR_CAMPOS[25]= 'OUTROS'
VETOR_CAMPOS[24]= 'UFFORA'
VETOR_CAMPOS[25]= 'cod_empr'
VETOR_CAMPOS[26]= 'ME_ANO'
VETOR_CAMPOS[27]= 'COD_CONT'
VETOR_CAMPOS[28]= 'FORNECEDOR'
@1,1 clear to 24,79
@01,2 say 'Empresa: '+XNOME+space(3)+xdata+' '+'Entradas'
@2,1 to 21,77
sum vr_contabi to aaaa
sum bc_icms to bbbb
sum icms to cccc
sum isentoicms to dddd
sum outrasicms to eeee
sum ipi_icms to ffff
sum icms_ret to gggg
@22,02 say 'Vr.Cont: '+str(aaaa,12,2) color'gr+/w'
@22,25 say 'BC.ICMS: '+str(bbbb,12,2) color'gr+/w'
@22,50 say 'ICMS: '+str(cccc,12,2) color'gr+/w'
@23,02 say 'Isento: '+str(dddd,12,2) color'gr+/w'
@23,25 say 'Outras: '+str(eeee,12,2) color'gr+/w'
@23,50 say 'IPI: '+str(ffff,12,2) color'gr+/w'
@24,2 say 'ICMS Ret: '+str(gggg,12,2) color'gr+/w'
@24,50 say 'Diferenca: '+str((diferenca/100),12,2) color'r+/w*'
if diferenca > 0
wait"cuidado tem diferencas"
elseif diferenca < 0
wait"cuidado tem diferencas"
endi
go top
DBEDIT(3,2,20,76,VETOR_CAMPOS,"editabb",,,+CHR(196)+CHR(194)+CHR(196))



