cialdoco|B1|SELECT b.cod_barras FROM cialdocobul AS b WHERE b.fase=5 AND b.cod_almacen='ATC' AND b.id_cocabe_pv IN (SELECT l.id_cocabe_ori FROM cialdocolin AS l WHERE l.id_cocabe=cialdoco.id_cocabe AND l.id_tenant=cialdoco.id_tenant AND l.soporte_ori='PV' GROUP BY l.id_cocabe_ori) AND (b.soporte_ori='AV' AND b.id_cocabe_ori=cialdoco.id_cocabe OR b.id_cocabe_ori=0) AND b.id_tenant=cialdoco.id_tenant ORDER BY b.id_cialdocobul LIMIT 0,1|A
cialdoco|BT|SELECT GROUP_CONCAT(b.cod_barras ORDER BY b.id_cialdocobul SEPARATOR '$') FROM cialdocobul AS b WHERE b.fase=5 AND b.cod_almacen='ATC' AND b.id_cocabe_pv IN (SELECT l.id_cocabe_ori FROM cialdocolin AS l WHERE l.id_cocabe=cialdoco.id_cocabe AND l.id_tenant=cialdoco.id_tenant AND l.soporte_ori='PV' GROUP BY l.id_cocabe_ori) AND (b.soporte_ori='AV' AND b.id_cocabe_ori=cialdoco.id_cocabe OR b.id_cocabe_ori=0) AND b.id_tenant=cialdoco.id_tenant ORDER BY b.id_cialdocobul|A