IDEMPIERE-337 zkwebui - Improve Info Product window - Display only single row per product

This commit is contained in:
Elaine Tan 2013-12-02 17:08:29 +08:00
parent 4ff74bfef3
commit 953abf870c
1 changed files with 19 additions and 1 deletions

View File

@ -71,7 +71,7 @@ public class InfoProductWindow extends InfoWindow {
private Textbox fieldDescription; private Textbox fieldDescription;
/** ASI */ /** ASI */
private int m_M_AttributeSetInstance_ID; protected int m_M_AttributeSetInstance_ID;
private Borderlayout contentBorderLayout; private Borderlayout contentBorderLayout;
@ -121,6 +121,24 @@ public class InfoProductWindow extends InfoWindow {
} }
where.append("p.IsSummary='N' "); where.append("p.IsSummary='N' ");
} }
for(WEditor editor : editors) {
if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("C_BPartner_ID")) {
Number value = (Number) editor.getValue();
if (value == null || value.intValue() == 0)
{
if (where.length() > 0) {
where.append(" AND ");
}
where.append("CASE WHEN ppo.m_product_id > 0 THEN ppo.C_BPartner_ID IN (");
where.append("SELECT MAX(ppo.C_BPartner_ID) FROM M_Product_PO ppo ");
where.append("WHERE p.M_Product_ID=ppo.M_Product_ID AND ppo.IsCurrentVendor='Y' AND ppo.IsActive='Y') ");
where.append("ELSE 1 = 1 END ");
}
break;
}
}
return where.toString(); return where.toString();
} }