function hrbmain()

cSaveScreen := SaveScreen( 0, 0, MaxRow(), MaxCol() )
cls

set color to w/b

clear

set excl on

? "1.  Limpando as saidas..." 

use se_movnf
dele all for mfges<>"E"
dele all for mfnum=0
pack
close all

? "2.  Mantendo apenas as entradas..."

use sf_fatnf
copy to fatx
dele all for fgdev<>"E"
dele all for fMODELO="NS"
PACK
close all

? "3.  Alterando a data dos lancamentos..."
use sf_fatf
repl all pfdatache with pfdataemi+1 for pfdataemi=pfdatache
close all

? "3.  Reajustando os precos..."
use se_prod
recal all
repl all pvluven3 with pvluvenda*0.67 for pvluven3=pvluvenda
repl all pvluven3 with pvluvenda*0.67 for pvluven3>pvluvenda
repl all pvluven3 with pvluvenda*0.67 for pvluven3=0
repl all peatual with 0 for pvluven3=0
close all

? "4.  Separando as inutilizadas..."
USE FATX
COPY TO X05 FOR COD_SIT="05"
close all

USE SF_FATNF
APPEND FROM X05
close all

alert("Tecle enter para proximo passo: Corrigir Entradas")


restScreen( 0, 0, MaxRow(), MaxCol(), cSaveScreen )

return

