entityName, where);
obq.setFilterOnReadableClients(false);
obq.setFilterOnReadableOrganization(false);
// Get xml
final EntityXMLConverter exc = EntityXMLConverter.newInstance();
exc.setOptionEmbedChildren(true);
exc.setOptionIncludeChildren(true);
exc.setOptionIncludeReferenced(false);
exc.setOptionExportClientOrganizationReferences(true);
StringWriter sw = new StringWriter();
exc.setOutput(sw);
exc.process(obq.list());
final String xml = sw.toString();
doc = DocumentHelper.parseText(xml);
// PRODUCTS
if (entityName.equals("ExternalPOS") && erp_pos != null) {
final Map<String, String> lData = processExternalPOS(doc,
erp_pos);
String whereClauseProduct = lData.get("whereProduct");
if (whereClauseProduct == null) {
whereClauseProduct = "client.id=" + erp_id
+ " and organization.id in ('0', " + erp_org + ")";
}
final OBQuery<BaseOBObject> obq2 = OBDal.getInstance()
.createQuery("Product", whereClauseProduct);
obq2.setFilterOnReadableClients(false);
obq2.setFilterOnReadableOrganization(false);
sw = new StringWriter();
exc.setOutput(sw);
exc.process(obq2.list());
final String xml2 = sw.toString();
doc = DocumentHelper.parseText(xml2);
final Map<String, String> pBuy = priceBuyProductByPriceList(obq2);
final Map<String, String> pSell = priceSellProductByPriceList(