SET DATE GERMAN
SET CENTURY on	

OPEN DATABASE C:\belcar\baze\belcar EXCLUSIVE
USE C:\belcar\baze\zalihe ALIAS zalihe EXCLUSIVE IN 0
USE C:\belcar\baze\kalkstav ALIAS kalkstav EXCLUSIVE IN 0
*USE zagkalk ALIAS zagkalk EXCLUSIVE IN 0
SELECT zalihe
GOTO top
DO WHILE !EOF()
a=sifra	
u=ukol
i=ikol
IF u-i<>0
	SELECT kalkstav
	APPEND BLANK
	replace brdok WITH "SRAVNI1"
	replace sifrob WITH a
	replace magacin WITH "01"
	replace datum WITH CTOD("17.01.2004")
	replace kolicina WITH 0-(u-i)	
ENDIF
SELECT zalihe
SKIP
ENDDO
RETURN
