LOCAL cResp, cCmd, cIdUser,cIdS
DECLARE aParam [1]

oApp.explode(oJs.cParam,@aParam,'|')

cCode  = aParam[1]
cFecha = aParam[2]

cIdS = 'xx'
IF oApp.sqlexec('SELECT id FROM salesman WHERE code="'+cCode+'"')>0
	cIdS=sqlresult.id
ENDIF


cResp = ''	

cCmd = 'SELECT a.noteprint as nota FROM invoice_noteprint as a inner join invoice as i on a.id=i.id WHERE i.due= "'+cFecha+'" and i.idsalesman = "'+cIdS+'"'

IF oApp.sqlexec(cCmd,'curListPax')>0
	SELECT curListPax
	GO TOP 
	SCAN all
		IF !EMPTY(cResp)
			cResp = cResp + '~'
		ENDIF
		cResp = cResp +  ALLTRIM(curListPax.nota)
	ENDSCAN
	
ENDIF

cCmd = 'json/set_respuesta.php?id='+oJs.cIdCmd+'&resp='+cResp

oApp.runLink(cCmd)
