From 688f959441cca0a1d46140395145243e308b0b30 Mon Sep 17 00:00:00 2001 From: fer_luck Date: Tue, 29 Apr 2008 00:10:25 +0000 Subject: [PATCH] BF 1953753 - PRoblems in the warehouse stock info... --- .../org/compiere/apps/search/InfoProduct.java | 18 +++--- migration/340s-trunk/148-BF_1953753.sql | 18 ++++++ .../340s-trunk/postgresql/148-BF_1953753.sql | 56 +++++++++++++++++++ 3 files changed, 82 insertions(+), 10 deletions(-) create mode 100644 migration/340s-trunk/148-BF_1953753.sql create mode 100644 migration/340s-trunk/postgresql/148-BF_1953753.sql diff --git a/client/src/org/compiere/apps/search/InfoProduct.java b/client/src/org/compiere/apps/search/InfoProduct.java index d7c474bbab..0efa1bc1cc 100644 --- a/client/src/org/compiere/apps/search/InfoProduct.java +++ b/client/src/org/compiere/apps/search/InfoProduct.java @@ -116,7 +116,7 @@ public final class InfoProduct extends Info implements ActionListener private CTextField fieldVendor = new CTextField(10); //Begin - fer_luck @ centuryon - private CTextPane fieldDescription = new CTextPane(); + private CTextArea fieldDescription = new CTextArea(); JXTaskPane warehouseStockPanel = new JXTaskPane(); CPanel tablePanel = new CPanel(); MiniTable warehouseTbl = new MiniTable(); @@ -229,14 +229,14 @@ public final class InfoProduct extends Info implements ActionListener warehouseTbl.addMouseListener(this); warehouseTbl.getSelectionModel().addListSelectionListener(this); warehouseTbl.autoSize(); - warehouseTbl.setPreferredScrollableViewportSize(new Dimension(INFO_WIDTH - 10, 40)); - warehouseTbl.setPreferredSize(new Dimension(INFO_WIDTH - 10, 40)); ColumnInfo[] s_layoutSubstitute = new ColumnInfo[]{ + new ColumnInfo(Msg.translate(Env.getCtx(), "Warehouse"), "orgname", String.class), new ColumnInfo( Msg.translate(Env.getCtx(), "Value"), "(Select Value from M_Product p where p.M_Product_ID=M_PRODUCT_SUBSTITUTERELATED_V.Substitute_ID)", - String.class), + String.class), + new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyAvailable"), "QtyAvailable", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "QtyOnHand", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyReserved"), "QtyReserved", Double.class), @@ -249,14 +249,14 @@ public final class InfoProduct extends Info implements ActionListener substituteTbl.addMouseListener(this); substituteTbl.getSelectionModel().addListSelectionListener(this); substituteTbl.autoSize(); - substituteTbl.setPreferredScrollableViewportSize(new Dimension(INFO_WIDTH - 10, 40)); - substituteTbl.setPreferredSize(new Dimension(INFO_WIDTH - 10, 40)); ColumnInfo[] s_layoutRelated = new ColumnInfo[]{ + new ColumnInfo(Msg.translate(Env.getCtx(), "Warehouse"), "orgname", String.class), new ColumnInfo( Msg.translate(Env.getCtx(), "Value"), "(Select Value from M_Product p where p.M_Product_ID=M_PRODUCT_SUBSTITUTERELATED_V.Substitute_ID)", String.class), + new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyAvailable"), "QtyAvailable", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "QtyOnHand", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyReserved"), "QtyReserved", Double.class), @@ -269,13 +269,11 @@ public final class InfoProduct extends Info implements ActionListener relatedTbl.addMouseListener(this); relatedTbl.getSelectionModel().addListSelectionListener(this); relatedTbl.autoSize(); - relatedTbl.setPreferredScrollableViewportSize(new Dimension(INFO_WIDTH - 10, 40)); - relatedTbl.setPreferredSize(new Dimension(INFO_WIDTH - 10, 40)); CTabbedPane jTab = new CTabbedPane(); jTab.addTab(Msg.translate(Env.getCtx(), "Warehouse"), new JScrollPane(warehouseTbl)); - jTab.setPreferredSize(new Dimension(INFO_WIDTH, 110)); - jTab.addTab(Msg.translate(Env.getCtx(), "Description"), fieldDescription); + jTab.setPreferredSize(new Dimension(INFO_WIDTH, 105)); + jTab.addTab(Msg.translate(Env.getCtx(), "Description"), new JScrollPane(fieldDescription)); jTab.addTab(Msg.translate(Env.getCtx(), "Substitute_ID"), new JScrollPane(substituteTbl)); jTab.addTab(Msg.translate(Env.getCtx(), "RelatedProduct_ID"), new JScrollPane(relatedTbl)); tablePanel.setPreferredSize(new Dimension(INFO_WIDTH, 110)); diff --git a/migration/340s-trunk/148-BF_1953753.sql b/migration/340s-trunk/148-BF_1953753.sql new file mode 100644 index 0000000000..10b47a6803 --- /dev/null +++ b/migration/340s-trunk/148-BF_1953753.sql @@ -0,0 +1,18 @@ +CREATE OR REPLACE VIEW M_Product_SubstituteRelated_V AS +SELECT s.AD_Client_ID, s.AD_Org_ID, s.IsActive, s.Created, s.CreatedBy, s.Updated, s.UpdatedBy, s.m_product_id, s.substitute_id, s.description, 'S' AS ROWTYPE, (ms.qtyonhand - ms.qtyreserved) AS qtyavailable, ms.qtyonhand, ms.qtyreserved, mpr.pricestd, mpr.m_pricelist_version_id, mw.m_warehouse_id, mp.name, org.name as orgname +FROM M_SUBSTITUTE s +JOIN M_STORAGE ms ON ms.m_product_id = s.substitute_id +JOIN M_PRODUCT mp ON ms.m_product_id = mp.m_product_id +JOIN M_LOCATOR ml ON ms.m_locator_id = ml.m_locator_id +JOIN M_WAREHOUSE mw ON ml.m_warehouse_id = mw.m_warehouse_id +JOIN M_PRODUCTPRICE mpr ON ms.m_product_id = mpr.m_product_id +JOIN ad_org org ON org.ad_org_id = mw.ad_org_id +UNION +SELECT r.ad_client_id, r.ad_org_id, r.IsActive, r.Created, r.CreatedBy, r.Updated, r.UpdatedBy, r.m_product_id, r.relatedproduct_id, r.description, 'R' AS ROWTYPE, (ms.qtyonhand - ms.qtyreserved) AS qtyavailable, ms.qtyonhand, ms.qtyreserved, mpr.pricestd, mpr.m_pricelist_version_id, mw.m_warehouse_id, mp.name, org.name as orgname +FROM M_RELATEDPRODUCT r +JOIN M_STORAGE ms ON ms.m_product_id = r.relatedproduct_id +JOIN M_PRODUCT mp ON ms.m_product_id = mp.m_product_id +JOIN M_LOCATOR ml ON ms.m_locator_id = ml.m_locator_id +JOIN M_WAREHOUSE mw ON ml.m_warehouse_id = mw.m_warehouse_id +JOIN M_PRODUCTPRICE mpr ON ms.m_product_id = mpr.m_product_id +JOIN ad_org org ON org.ad_org_id = mw.ad_org_id; \ No newline at end of file diff --git a/migration/340s-trunk/postgresql/148-BF_1953753.sql b/migration/340s-trunk/postgresql/148-BF_1953753.sql new file mode 100644 index 0000000000..67012de365 --- /dev/null +++ b/migration/340s-trunk/postgresql/148-BF_1953753.sql @@ -0,0 +1,56 @@ +DROP VIEW m_product_substituterelated_v; +CREATE OR +REPLACE VIEW m_product_substituterelated_v AS +SELECT s.ad_client_id, + s.ad_org_id, + s.isactive, + s.created, + s.createdby, + s.updated, + s.updatedby, + s.m_product_id, + s.substitute_id, + s.description, + 'S' AS rowtype, + (ms.qtyonhand - ms.qtyreserved) AS qtyavailable, + mp.NAME, + ms.qtyonhand, + ms.qtyreserved, + mpr.pricestd, + mpr.m_pricelist_version_id, + mw.m_warehouse_id, + org.name as orgname +FROM m_substitute s + JOIN m_storage ms ON ms.m_product_id = s.substitute_id + JOIN m_product mp ON ms.m_product_id = mp.m_product_id + JOIN m_locator ml ON ms.m_locator_id = ml.m_locator_id + JOIN m_warehouse mw ON ml.m_warehouse_id = mw.m_warehouse_id + JOIN m_productprice mpr ON ms.m_product_id = mpr.m_product_id + JOIN ad_org org ON org.ad_org_id = mw.ad_org_id +UNION +SELECT r.ad_client_id, + r.ad_org_id, + r.isactive, + r.created, + r.createdby, + r.updated, + r.updatedby, + r.m_product_id, + r.relatedproduct_id AS substitute_id, + r.description, + 'R' AS rowtype, + (ms.qtyonhand - ms.qtyreserved) AS qtyavailable, + mp.NAME, + ms.qtyonhand, + ms.qtyreserved, + mpr.pricestd, + mpr.m_pricelist_version_id, + mw.m_warehouse_id, + org.name as orgname +FROM m_relatedproduct r + JOIN m_storage ms ON ms.m_product_id = r.relatedproduct_id + JOIN m_product mp ON ms.m_product_id = mp.m_product_id + JOIN m_locator ml ON ms.m_locator_id = ml.m_locator_id + JOIN m_warehouse mw ON ml.m_warehouse_id = mw.m_warehouse_id + JOIN m_productprice mpr ON ms.m_product_id = mpr.m_product_id + JOIN ad_org org ON org.ad_org_id = mw.ad_org_id; \ No newline at end of file