IDEMPIERE-1693 In InfoProductWindow, tab "Available to Promise" can change by change level of log. Should make a checkbox for it. / based on patch from hieplq

This commit is contained in:
Carlos Ruiz 2014-01-19 14:47:23 -05:00
parent 8ef1250754
commit 17e085641c
4 changed files with 54 additions and 11 deletions

View File

@ -0,0 +1,11 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Jan 16, 2014 11:33:27 AM ICT
-- IDEMPIERE-1693 In InfoProductWindow, tab "Available to Promise" can change by change level of log. Should make a checkbox for it.
INSERT INTO AD_Message (MsgType,MsgText,MsgTip,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,Created,AD_Client_ID,AD_Org_ID) VALUES ('I','Show detail','Show detail locator info in "Available to promise" tab',200252,'D','693d3147-e09b-4e69-9ada-23ff6c1289fc','showDetailAtp','Y',TO_DATE('2014-01-16 11:33:27','YYYY-MM-DD HH24:MI:SS'),100,100,TO_DATE('2014-01-16 11:33:27','YYYY-MM-DD HH24:MI:SS'),0,0)
;
SELECT register_migration_script('201401161604_IDEMPIERE-1693.sql') FROM dual
;

View File

@ -0,0 +1,8 @@
-- Jan 16, 2014 11:33:27 AM ICT
-- IDEMPIERE-1693 In InfoProductWindow, tab "Available to Promise" can change by change level of log. Should make a checkbox for it.
INSERT INTO AD_Message (MsgType,MsgText,MsgTip,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,Created,AD_Client_ID,AD_Org_ID) VALUES ('I','Show detail','Show detail locator info in "Available to promise" tab',200252,'D','693d3147-e09b-4e69-9ada-23ff6c1289fc','showDetailAtp','Y',TO_TIMESTAMP('2014-01-16 11:33:27','YYYY-MM-DD HH24:MI:SS'),100,100,TO_TIMESTAMP('2014-01-16 11:33:27','YYYY-MM-DD HH24:MI:SS'),0,0)
;
SELECT register_migration_script('201401161604_IDEMPIERE-1693.sql') FROM dual
;

View File

@ -13,6 +13,7 @@ import java.util.logging.Level;
import org.adempiere.webui.component.Borderlayout;
import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.Checkbox;
import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.ListModelTable;
import org.adempiere.webui.component.ListboxFactory;
@ -31,7 +32,6 @@ import org.adempiere.webui.session.SessionManager;
import org.compiere.minigrid.ColumnInfo;
import org.compiere.model.MDocType;
import org.compiere.model.MRole;
import org.compiere.util.CLogMgt;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
@ -48,11 +48,10 @@ import org.zkoss.zul.South;
*
*/
public class InfoProductWindow extends InfoWindow {
/**
*
*/
private static final long serialVersionUID = 4939032152860189380L;
private static final long serialVersionUID = 4817648658129732541L;
private Tabbox tabbedPane;
private WListbox warehouseTbl;
@ -64,6 +63,9 @@ public class InfoProductWindow extends InfoWindow {
//Available to Promise Tab
private WListbox m_tableAtp;
// Group atp by warehouse or non
private Checkbox chbShowDetailAtp;
//IDEMPIERE-337
private WListbox productpriceTbl;
private String m_sqlProductprice;
@ -275,6 +277,21 @@ public class InfoProductWindow extends InfoWindow {
desktopTabPanel = new Tabpanel();
desktopTabPanel.setHeight("100%");
desktopTabPanel.appendChild(m_tableAtp);
// IDEMPIERE-1692
chbShowDetailAtp = new Checkbox();
chbShowDetailAtp.setLabel(Msg.getMsg(Env.getCtx(), "showDetailAtp", true));
chbShowDetailAtp.setTooltiptext(Msg.getMsg(Env.getCtx(), "showDetailAtp", false));
chbShowDetailAtp.addActionListener(new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
if (contentPanel.getLayout() != null) {
int M_Warehouse_ID = getSelectedWarehouseId();
int m_M_Product_ID = getSelectedRowKey();
initAtpTab(M_Warehouse_ID, m_M_Product_ID);
}
}
});
desktopTabPanel.appendChild(chbShowDetailAtp);
tabPanels.appendChild(desktopTabPanel);
tab = new Tab(Msg.translate(Env.getCtx(), "Price"));
@ -631,7 +648,7 @@ public class InfoProductWindow extends InfoWindow {
columnNames.add(Msg.translate(Env.getCtx(), "M_Warehouse_ID"));
// Fill Storage Data
boolean showDetail = CLogMgt.isLevelFine();
boolean showDetail = isShowDetailATP();
String sql = "SELECT s.QtyOnHand, s.QtyReserved, s.QtyOrdered,"
+ " productAttribute(s.M_AttributeSetInstance_ID), s.M_AttributeSetInstance_ID,";
if (!showDetail)
@ -777,6 +794,10 @@ public class InfoProductWindow extends InfoWindow {
m_tableAtp.autoSize();
} // initAtpTab
public boolean isShowDetailATP() {
return chbShowDetailAtp.isChecked();
}
@Override
protected void showHistory() {
log.info("");

View File

@ -34,9 +34,9 @@ import org.adempiere.webui.component.Tabpanels;
import org.adempiere.webui.component.Tabs;
import org.adempiere.webui.component.WListbox;
import org.adempiere.webui.component.Window;
import org.adempiere.webui.info.InfoProductWindow;
import org.compiere.model.MDocType;
import org.compiere.model.MPriceList;
import org.compiere.util.CLogMgt;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -60,7 +60,9 @@ public class InvoiceHistory extends Window implements EventListener<Event>
/**
*
*/
private static final long serialVersionUID = -7426909865199278220L;
private static final long serialVersionUID = 8742214467478030802L;
boolean showDetailATP = false;
/**
* Show History
@ -94,6 +96,8 @@ public class InvoiceHistory extends Window implements EventListener<Event>
this.setSclass("popup-dialog");
AEnv.showCenterWindow(parent, this);
if (parent instanceof InfoProductWindow)
showDetailATP = ((InfoProductWindow)parent).isShowDetailATP();
} // InvoiceHistory
private int m_C_BPartner_ID;
@ -598,10 +602,9 @@ public class InvoiceHistory extends Window implements EventListener<Event>
columnNames.add(Msg.translate(Env.getCtx(), "M_Warehouse_ID"));
// Fill Storage Data
boolean showDetail = CLogMgt.isLevelFine();
String sql = "SELECT s.QtyOnHand, s.QtyReserved, s.QtyOrdered,"
+ " productAttribute(s.M_AttributeSetInstance_ID), s.M_AttributeSetInstance_ID,";
if (!showDetail)
if (!showDetailATP)
sql = "SELECT SUM(s.QtyOnHand), SUM(s.QtyReserved), SUM(s.QtyOrdered),"
+ " productAttribute(s.M_AttributeSetInstance_ID), 0,";
sql += " w.Name, l.Value "
@ -614,7 +617,7 @@ public class InvoiceHistory extends Window implements EventListener<Event>
if (m_M_AttributeSetInstance_ID > 0)
sql += " AND s.M_AttributeSetInstance_ID=?";
sql += " AND (s.QtyOnHand<>0 OR s.QtyReserved<>0 OR s.QtyOrdered<>0)";
if (!showDetail)
if (!showDetailATP)
sql += " GROUP BY productAttribute(s.M_AttributeSetInstance_ID), w.Name, l.Value";
sql += " ORDER BY l.Value";
@ -643,7 +646,7 @@ public class InvoiceHistory extends Window implements EventListener<Event>
line.add(new Double(rs.getDouble(2))); // QtyReserved
line.add(rs.getString(7)); // Locator
String asi = rs.getString(4);
if (showDetail && (asi == null || asi.length() == 0))
if (showDetailATP && (asi == null || asi.length() == 0))
asi = "{" + rs.getInt(5) + "}";
line.add(asi); // ASI
line.add(null); // DocumentNo
@ -710,7 +713,7 @@ public class InvoiceHistory extends Window implements EventListener<Event>
line.add(qtyReserved); // QtyReserved
line.add(null); // Locator
String asi = rs.getString(3);
if (showDetail && (asi == null || asi.length() == 0))
if (showDetailATP && (asi == null || asi.length() == 0))
asi = "{" + rs.getInt(4) + "}";
line.add(asi); // ASI
line.add(rs.getString(7)); // DocumentNo