LOCAL cResp, cCad, cTabla, cDet, cTablaDet

cTabla = 'basket'
TEXT TO cCab noshow
	SELECT 
		id+0 as id,
		idcustomer+0 as idcustomer,
		date,
		hora,
		idsalesman+0 as idsalesman,
		idbodega+0 as idbodega,
		pvp,
		subtotal,
		subt0,
		subtX,
		tax,
		total,
		iduser+0 as iduser,
		taxpercent,
		formapago
	FROM basket where !void
ENDTEXT

* @cond
*cCab = STRTRAN(cCab,"@cond",IIF(EMPTY(oJs.cParam), "", " and idsalesman = "+oJs.cParam))

oApp.sqlexec(cCab,cTabla)

cTablaDet = 'BasketDet'
TEXT TO cDet noshow
	SELECT 
		concat(id,line)+0 as id,
		id+0 as idCab,
		iditem+0 as iditem,
		line+0 as line,
		price,
		iva,
		pvp,
		liva,
		quantity,
		bultos,
		uc,
		unidades
	FROM basketdet 
ENDTEXT


oApp.sqlexec(cDet,cTablaDet)

oJs.android_up(cTabla, cTablaDet)

