CLOSE ALL

OPEN DATABASE d:\2010\fin\baze\fin

USE d:\2010\fin\baze\gknjiga ALIAS gknjiga IN 0
SELECT gknjiga
ZAP

USE d:\a\uplate ALIAS uplate IN 0

SELECT uplate
GOTO top
DO WHILE !EOF()
mkup=uplate.kupdob
mdug=ABS(uplate.potrazuje)
mpot=ABS(uplate.duguje)

SELECT gknjiga

IF mdug<>0
APPEND blank
replace gknjiga.nalog	WITH "00"
replace gknjiga.dokument WITH "PS"
replace gknjiga.datum	WITH CTOD("01.01.2010")
replace gknjiga.dpo		WITH CTOD("01.01.2010")
replace gknjiga.valuta	WITH CTOD("01.01.2010")
replace gknjiga.datknji	WITH CTOD("01.01.2010")
replace gknjiga.konto	WITH "2020"
replace gknjiga.analitika	WITH mkup
replace gknjiga.duguje	WITH mdug
replace gknjiga.opis	WITH "PS"
ENDIF

IF mpot<>0
APPEND blank
replace gknjiga.nalog	WITH "00"
replace gknjiga.dokument WITH "PS"
replace gknjiga.datum	WITH CTOD("01.01.2010")
replace gknjiga.dpo		WITH CTOD("01.01.2010")
replace gknjiga.valuta	WITH CTOD("01.01.2010")
replace gknjiga.datknji	WITH CTOD("01.01.2010")
replace gknjiga.konto	WITH "4330"
replace gknjiga.analitika	WITH mkup
replace gknjiga.potrazuje	WITH mpot
replace gknjiga.opis	WITH "PS"
ENDIF


SELECT uplate
SKIP
ENDDO
RETURN
