DO source\load_def.prg

*IF oApp.registrar()
 
*' Using the embedded SQL database engine.cBddName
*' You use the SQLite COM object to work with it:
	LOCAL db   as "newObjectsPack1.sqlite.dbutf8"
	LOCAL oObj as "adodb.recordset"
	
	db = CreateObject("newObjects.sqlite3.dbutf8")
	db.NoErrorMode = .T.
	LOCAL M.cDB
	
	*DELETE FILE (oJson._cBddName)
	M.cDB = addbs(curdir())+oJson._cBddName 
	
	IF db.Open(M.cDB) THEN
	
		oApp.openDb()
		
		IF oJs.ltest
			*oJson.subir(db,tk_customer)	
			*oJson.subir(db,tk_item)
			*oJson.subir(db,tk_cxc,'cxc')
			oJson.subir(db,tk_stock_bod, 'stock_bod','item',.T.) &&UPDATE
			db.Close()
			RETURN
		ENDIF
				

		oJson.subir(db,tk_item)
		
		*oJson.subir(db,tk_cxc,'cxc')
		
		oJson.subir(db,tk_stock_bod, 'stock_bod','item',.T.) &&UPDATE
*!*			IF oApp.lbodegas
*!*				*oJson.control_stock_bod()
*!*				*oJson.subir(db,tk_stock)
*!*			ELSE
*!*				oJson.subir(db,tk_stock)
*!*			ENDIF
		oJson.subir(db,tk_grupo)
		oJson.subir(db,tk_brand)
		oJson.subir(db,tk_customer)	
		oJson.subir(db,tk_supplier)
		oJson.subir(db,tk_salesman)
		oJson.subir(db,tk_zonas)
		oJson.subir(db,tk_bodega)
		oJson.subir(db,tk_centercost)

		oJson.subir(db,tk_contprod)
		oJson.subir(db,tk_usuario,,'usuario')
		oJson.subir(db,tk_plan)
		oJson.subir(db,tk_bank)
		oJson.subir(db,tk_tipoventa)
			
		IF oApp.lBoletos 
			oJson.subir(db,tk_itinerario)
			oJson.subir(db,tk_usergrupo)
		ENDIF
		
		oJson.subir(db,tk_cxc,'cxc')

		*oApp.closeDb()
		
	ENDIF
	
	db.Close()

	RELEASE db, oObj
	
*ENDIF



*oApp.registrar('U')