SET DELETED ON
CLOSE DATABASES
CLOSE TABLE

SET DEFAULT TO C:\2009\ROBNO\BAZE

OPEN DATABASE BELCAR
USE ROBA ALIAS ROBA IN 0
USE C:\B\STANJE ALIAS STANJE IN 0

USE C:\2009\ROBNO\baze\roba ALIAS roba
SELECT roba
ZAP

SELECT STANJE
GOTO top
DO WHILE !EOF()
MSIF2=STANJE.SIFRA
MSIF =STANJE.BARKOD
MNAZ =STANJE.NAZIV
MJM  =STANJE.JM
MTAR =STANJE.TARIFA
SELECT ROBA
	APPEND BLANK
	REPLACE ROBA.SIFROB 		WITH MSIF
	REPLACE ROBA.SIFRA2 	WITH MSIF2
	REPLACE ROBA.NAZIV		WITH MNAZ
	REPLACE ROBA.JM			WITH MJM
	IF ALLTRIM(MTAR)="1"
		REPLACE ROBA.TARIFA		WITH "18"
	ENDIF
	IF ALLTRIM(MTAR)="2"
		REPLACE ROBA.TARIFA		WITH "8"
	ENDIF
	IF ALLTRIM(MTAR)="0"
		REPLACE ROBA.TARIFA		WITH "18"
	ENDIF
SELECT STANJE
SKIP
ENDDO
RETURN
	
	