*  #>
*  smaze pozustale a duplicitni karty v databazi SKLAD.DBF
*  po ukonceni je potreba pustit prepocet skladu !! <#
*
*  2015-11-03   zrusen browse, pridano upozorneni na nezbytnost spusteni prepoctu
*


USE (m.fn_sklad)
REPLACE FOR EMPT(zustatek) .and. EMPTY(vycisleni) .and. EMPTY(min_zaso) c_karty WITH 0, c_stredisk WITH 0
DELETE  FOR EMPT(zustatek) .and. EMPTY(vycisleni) .and. EMPTY(min_zaso)

REPLACE FOR min_zaso < 0 min_zaso WITH 0
INDEX on STR(c_stredisk, 9) + STR(c_karty,9) + IIF(EMPTY(min_zaso), "B", "A") TO qwe

STORE -8475302857 TO o_c_karty, o_c_str
SCAN
   IF (o_c_str = c_stredisk) .and. (o_c_karty = c_karty)
       REPLACE min_zaso WITH -99999
   ELSE
       o_c_str   = c_stredisk
       o_c_karty = c_karty
   ENDIF 
   WAIT REPLICATE("*", RECNO()%77+3) WINDOW AT 22,22 NOWAIT 
ENDSCAN
WAIT CLEAR 
*SET FILTER TO min_zaso < 0 
*BROWSE NODELETE NOAPPEND NOEDIT TIMEOUT 3
DELETE FOR min_zaso < 0 

MESSAGEBOX("Spustte operaci PREPOCET VSECH SKLADU!" + CHR(13) + "v Ostatni - Reindexace",1+48, "")
