LOCAL cResp, cCmd

cTabla = 'user'

cond = IIF(EMPTY(oJs.cParam), ' ', ' and id = "'+oJs.cParam+'"')


TEXT TO cCmd NOSHOW TEXTMERGE 
	SELECT 
		id+0 as id,
		name,
		login,
		TRIM(barras) as clave,
		"<<oApp.cbEnterprise>>" as nombre_empresa,
		"<<oApp.cbPhone>>" as telf_empresa,
		"<<oApp.cbWeb>>" as web_empresa,
		"<<oApp.cbDireccion>>" as direcc_empresa,
		"<<oApp.cbURLLogo>>" as url_logo,
		<<oApp.print_lin_factura>> as nro_lin_ped,
		<<IIF(oApp.ghost_lcontrol_stock,'1','0'))>> as lcontrol_stock,
		1 as stock_linea,
		1 as control_cupos,
		1 as cambia_pvp,
		1 as crea_cliente,
		0 as venta_en_linea,
		0 as sincroniza_linea,
		120 as tiempo_sincronizacion,
		"" as nota1,
		"" as nota2,
		"" as nota3,
		idsalesman+0 as idsalesman,
		idcc+0 as idcc,
		idcp+0 as idcp,
		idbodega+0 as idbodega
	FROM user WHERE !bloqueado and !borrado <<cond>>
ENDTEXT	


oApp.sqlexec(cCmd,cTabla)

SELECT &cTabla
replace clave WITH oApp.dEnc3(ALLTRIM(clave)) all
FLUSH
GO top

oJs.android_up(cTabla)