From 33f8fdd77c7561dea6ecfe7aeaadb30bbe7044aa Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Wed, 25 Jun 2008 09:02:42 +0000 Subject: [PATCH] BF [ 2002318 ] Context WINDOW_INFO bug --- base/src/org/compiere/model/CalloutInOut.java | 12 +++--- .../org/compiere/model/CalloutInventory.java | 4 +- .../org/compiere/model/CalloutInvoice.java | 18 ++++---- .../compiere/model/CalloutInvoiceBatch.java | 8 ++-- .../org/compiere/model/CalloutMovement.java | 6 +-- base/src/org/compiere/model/CalloutOrder.java | 28 ++++++------- .../org/compiere/model/CalloutPayment.java | 22 +++++----- .../model/CalloutPaymentAllocate.java | 8 ++-- .../org/compiere/model/CalloutProduction.java | 10 +++-- .../org/eevolution/model/CalloutProfile.java | 42 +++++++++---------- .../org/compiere/apps/search/InfoAsset.java | 2 +- .../compiere/apps/search/InfoBPartner.java | 6 +-- .../org/compiere/apps/search/InfoInvoice.java | 6 +-- .../org/compiere/apps/search/InfoProduct.java | 14 +++---- client/src/org/compiere/grid/ed/VLookup.java | 18 ++++---- .../compiere/grid/ed/VPAttributeDialog.java | 4 +- extend/src/compiere/model/CalloutUser.java | 8 ++-- .../adempiere/webui/editor/WSearchEditor.java | 12 +++--- .../adempiere/webui/panel/InfoAssetPanel.java | 2 +- .../webui/panel/InfoBPartnerPanel.java | 6 +-- .../webui/panel/InfoProductPanel.java | 14 +++---- 21 files changed, 127 insertions(+), 123 deletions(-) diff --git a/base/src/org/compiere/model/CalloutInOut.java b/base/src/org/compiere/model/CalloutInOut.java index f410ee09b8..19e6c61203 100644 --- a/base/src/org/compiere/model/CalloutInOut.java +++ b/base/src/org/compiere/model/CalloutInOut.java @@ -374,12 +374,12 @@ public class CalloutInOut extends CalloutEngine // Set Attribute & Locator int M_Locator_ID = 0; - if (Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() - && Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) + if (Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() + && Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) { mTab.setValue("M_AttributeSetInstance_ID", - new Integer(Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); - M_Locator_ID = Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_Locator_ID"); + new Integer(Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); + M_Locator_ID = Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Locator_ID"); if (M_Locator_ID != 0) mTab.setValue("M_Locator_ID", new Integer(M_Locator_ID)); } @@ -550,10 +550,10 @@ public class CalloutInOut extends CalloutEngine + " - M_Warehouse_ID=" + M_Warehouse_ID + ", M_Locator_ID=" + M_Locator_ID); // Check Selection - int M_AttributeSetInstance_ID = Env.getContextAsInt(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID"); + int M_AttributeSetInstance_ID = Env.getContextAsInt(Env.getCtx(), WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID"); if (M_ASI_ID.intValue() == M_AttributeSetInstance_ID) { - int selectedM_Locator_ID = Env.getContextAsInt(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Locator_ID"); + int selectedM_Locator_ID = Env.getContextAsInt(Env.getCtx(), WindowNo, Env.TAB_INFO, "M_Locator_ID"); if (selectedM_Locator_ID != 0) { log.fine("Selected M_Locator_ID=" + selectedM_Locator_ID); diff --git a/base/src/org/compiere/model/CalloutInventory.java b/base/src/org/compiere/model/CalloutInventory.java index 7d00eae995..eb1c8ea31d 100644 --- a/base/src/org/compiere/model/CalloutInventory.java +++ b/base/src/org/compiere/model/CalloutInventory.java @@ -69,9 +69,9 @@ public class CalloutInventory extends CalloutEngine if (ASI != null) M_AttributeSetInstance_ID = ASI.intValue(); // Product Selection - if (Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID") == M_Product_ID) + if (Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Product_ID") == M_Product_ID) { - M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID"); + M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID"); if (M_AttributeSetInstance_ID != 0) mTab.setValue("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); else diff --git a/base/src/org/compiere/model/CalloutInvoice.java b/base/src/org/compiere/model/CalloutInvoice.java index 08389171c0..67b7dff1ec 100644 --- a/base/src/org/compiere/model/CalloutInvoice.java +++ b/base/src/org/compiere/model/CalloutInvoice.java @@ -181,9 +181,9 @@ public class CalloutInvoice extends CalloutEngine int locID = rs.getInt("C_BPartner_Location_ID"); // overwritten by InfoBP selection - works only if InfoWindow // was used otherwise creates error (uses last value, may belong to differnt BP) - if (C_BPartner_ID.toString().equals(Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID"))) + if (C_BPartner_ID.toString().equals(Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_ID"))) { - String loc = Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_Location_ID"); + String loc = Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_Location_ID"); if (loc.length() > 0) locID = Integer.parseInt(loc); } @@ -194,9 +194,9 @@ public class CalloutInvoice extends CalloutEngine // Contact - overwritten by InfoBP selection int contID = rs.getInt("AD_User_ID"); - if (C_BPartner_ID.toString().equals(Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID"))) + if (C_BPartner_ID.toString().equals(Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_ID"))) { - String cont = Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "AD_User_ID"); + String cont = Env.getContext(ctx, WindowNo, Env.TAB_INFO, "AD_User_ID"); if (cont.length() > 0) contID = Integer.parseInt(cont); } @@ -300,9 +300,9 @@ public class CalloutInvoice extends CalloutEngine mTab.setValue("C_Charge_ID", null); // Set Attribute - if (Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() - && Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) - mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); + if (Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() + && Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) + mTab.setValue("M_AttributeSetInstance_ID", Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID")); else mTab.setValue("M_AttributeSetInstance_ID", null); @@ -317,7 +317,7 @@ public class CalloutInvoice extends CalloutEngine // globalqss - fix reported bug [ 1643489 ] PriceListVersion misfunctionality int M_PriceList_Version_ID; // try to get the price list version from info product tab - M_PriceList_Version_ID = Env.getContextAsInt(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_PriceList_Version_ID"); + M_PriceList_Version_ID = Env.getContextAsInt(Env.getCtx(), WindowNo, Env.TAB_INFO, "M_PriceList_Version_ID"); // if not found try to get from the context of window if (M_PriceList_Version_ID == 0) M_PriceList_Version_ID = Env.getContextAsInt(ctx, WindowNo, "M_PriceList_Version_ID"); @@ -521,7 +521,7 @@ public class CalloutInvoice extends CalloutEngine // globalqss - fix reported bug [ 1643489 ] PriceListVersion misfunctionality int M_PriceList_Version_ID; // try to get the price list version from info product tab - M_PriceList_Version_ID = Env.getContextAsInt(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_PriceList_Version_ID"); + M_PriceList_Version_ID = Env.getContextAsInt(Env.getCtx(), WindowNo, Env.TAB_INFO, "M_PriceList_Version_ID"); // if not found try to get from the context of window if (M_PriceList_Version_ID == 0) M_PriceList_Version_ID = Env.getContextAsInt(ctx, WindowNo, "M_PriceList_Version_ID"); diff --git a/base/src/org/compiere/model/CalloutInvoiceBatch.java b/base/src/org/compiere/model/CalloutInvoiceBatch.java index 9cf04a4180..d0b9a340e2 100644 --- a/base/src/org/compiere/model/CalloutInvoiceBatch.java +++ b/base/src/org/compiere/model/CalloutInvoiceBatch.java @@ -114,9 +114,9 @@ public class CalloutInvoiceBatch extends CalloutEngine int locID = rs.getInt("C_BPartner_Location_ID"); // overwritten by InfoBP selection - works only if InfoWindow // was used otherwise creates error (uses last value, may belong to differnt BP) - if (C_BPartner_ID.toString().equals(Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID"))) + if (C_BPartner_ID.toString().equals(Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_ID"))) { - String loc = Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_Location_ID"); + String loc = Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_Location_ID"); if (loc.length() > 0) locID = Integer.parseInt(loc); } @@ -127,9 +127,9 @@ public class CalloutInvoiceBatch extends CalloutEngine // Contact - overwritten by InfoBP selection int contID = rs.getInt("AD_User_ID"); - if (C_BPartner_ID.toString().equals(Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID"))) + if (C_BPartner_ID.toString().equals(Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_ID"))) { - String cont = Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "AD_User_ID"); + String cont = Env.getContext(ctx, WindowNo, Env.TAB_INFO, "AD_User_ID"); if (cont.length() > 0) contID = Integer.parseInt(cont); } diff --git a/base/src/org/compiere/model/CalloutMovement.java b/base/src/org/compiere/model/CalloutMovement.java index ceb5f6db6f..c7cbdc768c 100644 --- a/base/src/org/compiere/model/CalloutMovement.java +++ b/base/src/org/compiere/model/CalloutMovement.java @@ -49,9 +49,9 @@ public class CalloutMovement extends CalloutEngine if (M_Product_ID == null || M_Product_ID.intValue() == 0) return ""; // Set Attribute - if (Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() - && Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) - mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); + if (Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() + && Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) + mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); else mTab.setValue("M_AttributeSetInstance_ID", null); diff --git a/base/src/org/compiere/model/CalloutOrder.java b/base/src/org/compiere/model/CalloutOrder.java index c052398ddc..afe663978f 100644 --- a/base/src/org/compiere/model/CalloutOrder.java +++ b/base/src/org/compiere/model/CalloutOrder.java @@ -319,9 +319,9 @@ public class CalloutOrder extends CalloutEngine int shipTo_ID = rs.getInt("C_BPartner_Location_ID"); // overwritten by InfoBP selection - works only if InfoWindow // was used otherwise creates error (uses last value, may belong to differnt BP) - if (C_BPartner_ID.toString().equals(Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID"))) + if (C_BPartner_ID.toString().equals(Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_ID"))) { - String loc = Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_Location_ID"); + String loc = Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_Location_ID"); if (loc.length() > 0) shipTo_ID = Integer.parseInt(loc); } @@ -332,9 +332,9 @@ public class CalloutOrder extends CalloutEngine // Contact - overwritten by InfoBP selection int contID = rs.getInt("AD_User_ID"); - if (C_BPartner_ID.toString().equals(Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID"))) + if (C_BPartner_ID.toString().equals(Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_ID"))) { - String cont = Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "AD_User_ID"); + String cont = Env.getContext(ctx, WindowNo, Env.TAB_INFO, "AD_User_ID"); if (cont.length() > 0) contID = Integer.parseInt(cont); } @@ -503,9 +503,9 @@ public class CalloutOrder extends CalloutEngine int bill_Location_ID = rs.getInt("Bill_Location_ID"); // overwritten by InfoBP selection - works only if InfoWindow // was used otherwise creates error (uses last value, may belong to differnt BP) - if (bill_BPartner_ID.toString().equals(Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID"))) + if (bill_BPartner_ID.toString().equals(Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_ID"))) { - String loc = Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_Location_ID"); + String loc = Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_Location_ID"); if (loc.length() > 0) bill_Location_ID = Integer.parseInt(loc); } @@ -516,9 +516,9 @@ public class CalloutOrder extends CalloutEngine // Contact - overwritten by InfoBP selection int contID = rs.getInt("AD_User_ID"); - if (bill_BPartner_ID.toString().equals(Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID"))) + if (bill_BPartner_ID.toString().equals(Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_ID"))) { - String cont = Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "AD_User_ID"); + String cont = Env.getContext(ctx, WindowNo, Env.TAB_INFO, "AD_User_ID"); if (cont.length() > 0) contID = Integer.parseInt(cont); } @@ -692,9 +692,9 @@ public class CalloutOrder extends CalloutEngine // mTab.setValue("C_Charge_ID", null); // Set Attribute - if (Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() - && Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) - mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); + if (Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() + && Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) + mTab.setValue("M_AttributeSetInstance_ID", Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID")); else mTab.setValue("M_AttributeSetInstance_ID", null); @@ -710,7 +710,7 @@ public class CalloutOrder extends CalloutEngine // globalqss - fix reported bug [ 1643489 ] PriceListVersion misfunctionality int M_PriceList_Version_ID; // try to get the price list version from info product tab - M_PriceList_Version_ID = Env.getContextAsInt(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_PriceList_Version_ID"); + M_PriceList_Version_ID = Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_PriceList_Version_ID"); // if not found try to get from the context of window if (M_PriceList_Version_ID == 0) M_PriceList_Version_ID = Env.getContextAsInt(ctx, WindowNo, "M_PriceList_Version_ID"); @@ -731,7 +731,7 @@ public class CalloutOrder extends CalloutEngine Env.setContext(ctx, WindowNo, "DiscountSchema", pp.isDiscountSchema() ? "Y" : "N"); // Check/Update Warehouse Setting - // int M_Warehouse_ID = Env.getContextAsInt(ctx, Env.WINDOW_INFO, "M_Warehouse_ID"); + // int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID"); // Integer wh = (Integer)mTab.getValue("M_Warehouse_ID"); // if (wh.intValue() != M_Warehouse_ID) // { @@ -976,7 +976,7 @@ public class CalloutOrder extends CalloutEngine // globalqss - fix reported bug [ 1643489 ] PriceListVersion misfunctionality int M_PriceList_Version_ID; // try to get the price list version from info product tab - M_PriceList_Version_ID = Env.getContextAsInt(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_PriceList_Version_ID"); + M_PriceList_Version_ID = Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_PriceList_Version_ID"); // if not found try to get from the context of window if (M_PriceList_Version_ID == 0) M_PriceList_Version_ID = Env.getContextAsInt(ctx, WindowNo, "M_PriceList_Version_ID"); diff --git a/base/src/org/compiere/model/CalloutPayment.java b/base/src/org/compiere/model/CalloutPayment.java index af7d3bdb91..3e33632284 100644 --- a/base/src/org/compiere/model/CalloutPayment.java +++ b/base/src/org/compiere/model/CalloutPayment.java @@ -58,12 +58,11 @@ public class CalloutPayment extends CalloutEngine mTab.setValue ("IsOverUnderPayment", Boolean.FALSE); mTab.setValue ("OverUnderAmt", Env.ZERO); int C_InvoicePaySchedule_ID = 0; - if (Env.getContextAsInt (ctx, Env.WINDOW_INFO, Env.TAB_INFO, - "C_Invoice_ID") == C_Invoice_ID.intValue () - && Env.getContextAsInt (ctx, Env.WINDOW_INFO, Env.TAB_INFO, - "C_InvoicePaySchedule_ID") != 0) - C_InvoicePaySchedule_ID = Env.getContextAsInt (ctx, - Env.WINDOW_INFO, Env.TAB_INFO, "C_InvoicePaySchedule_ID"); + if (Env.getContextAsInt (ctx, WindowNo, Env.TAB_INFO, "C_Invoice_ID") == C_Invoice_ID.intValue () + && Env.getContextAsInt (ctx, WindowNo, Env.TAB_INFO, "C_InvoicePaySchedule_ID") != 0) + { + C_InvoicePaySchedule_ID = Env.getContextAsInt (ctx, WindowNo, Env.TAB_INFO, "C_InvoicePaySchedule_ID"); + } // Payment Date Timestamp ts = (Timestamp)mTab.getValue ("DateTrx"); if (ts == null) @@ -319,12 +318,11 @@ public class CalloutPayment extends CalloutEngine .getContext (ctx, WindowNo, "IsOverUnderPayment"))) mTab.setValue ("OverUnderAmt", Env.ZERO); int C_InvoicePaySchedule_ID = 0; - if (Env.getContextAsInt (ctx, Env.WINDOW_INFO, Env.TAB_INFO, - "C_Invoice_ID") == C_Invoice_ID - && Env.getContextAsInt (ctx, Env.WINDOW_INFO, Env.TAB_INFO, - "C_InvoicePaySchedule_ID") != 0) - C_InvoicePaySchedule_ID = Env.getContextAsInt (ctx, - Env.WINDOW_INFO, Env.TAB_INFO, "C_InvoicePaySchedule_ID"); + if (Env.getContextAsInt (ctx, WindowNo, Env.TAB_INFO, "C_Invoice_ID") == C_Invoice_ID + && Env.getContextAsInt (ctx, WindowNo, Env.TAB_INFO, "C_InvoicePaySchedule_ID") != 0) + { + C_InvoicePaySchedule_ID = Env.getContextAsInt (ctx, WindowNo, Env.TAB_INFO, "C_InvoicePaySchedule_ID"); + } // Get Open Amount & Invoice Currency BigDecimal InvoiceOpenAmt = Env.ZERO; int C_Currency_Invoice_ID = 0; diff --git a/base/src/org/compiere/model/CalloutPaymentAllocate.java b/base/src/org/compiere/model/CalloutPaymentAllocate.java index 28e01c86b0..7c4f8d43ff 100644 --- a/base/src/org/compiere/model/CalloutPaymentAllocate.java +++ b/base/src/org/compiere/model/CalloutPaymentAllocate.java @@ -64,9 +64,11 @@ public class CalloutPaymentAllocate extends CalloutEngine mTab.setValue("OverUnderAmt", Env.ZERO); int C_InvoicePaySchedule_ID = 0; - if (Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_Invoice_ID") == C_Invoice_ID.intValue() - && Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_InvoicePaySchedule_ID") != 0) - C_InvoicePaySchedule_ID = Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_InvoicePaySchedule_ID"); + if (Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "C_Invoice_ID") == C_Invoice_ID.intValue() + && Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "C_InvoicePaySchedule_ID") != 0) + { + C_InvoicePaySchedule_ID = Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "C_InvoicePaySchedule_ID"); + } // Payment Date Timestamp ts = Env.getContextAsDate(ctx, WindowNo, "DateTrx"); diff --git a/base/src/org/compiere/model/CalloutProduction.java b/base/src/org/compiere/model/CalloutProduction.java index 90cd1b70cd..4830586c60 100644 --- a/base/src/org/compiere/model/CalloutProduction.java +++ b/base/src/org/compiere/model/CalloutProduction.java @@ -44,11 +44,15 @@ public class CalloutProduction extends CalloutEngine if (M_Product_ID == null || M_Product_ID.intValue() == 0) return ""; // Set Attribute - if (Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() - && Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) - mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); + if (Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() + && Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) + { + mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); + } else + { mTab.setValue("M_AttributeSetInstance_ID", null); + } return ""; } // product diff --git a/base/src/org/eevolution/model/CalloutProfile.java b/base/src/org/eevolution/model/CalloutProfile.java index db02e2d4d3..8d8ed7ec71 100644 --- a/base/src/org/eevolution/model/CalloutProfile.java +++ b/base/src/org/eevolution/model/CalloutProfile.java @@ -282,9 +282,9 @@ public class CalloutProfile extends CalloutEngine int shipTo_ID = rs.getInt("C_BPartner_Location_ID"); // overwritten by InfoBP selection - works only if InfoWindow // was used otherwise creates error (uses last value, may belong to differnt BP) - if (C_BPartner_ID.toString().equals(Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID"))) + if (C_BPartner_ID.toString().equals(Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_ID"))) { - String loc = Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_Location_ID"); + String loc = Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_Location_ID"); if (loc.length() > 0) shipTo_ID = Integer.parseInt(loc); } @@ -295,9 +295,9 @@ public class CalloutProfile extends CalloutEngine // Contact - overwritten by InfoBP selection int contID = rs.getInt("AD_User_ID"); - if (C_BPartner_ID.toString().equals(Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID"))) + if (C_BPartner_ID.toString().equals(Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_ID"))) { - String cont = Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "AD_User_ID"); + String cont = Env.getContext(ctx, WindowNo, Env.TAB_INFO, "AD_User_ID"); if (cont.length() > 0) contID = Integer.parseInt(cont); } @@ -460,9 +460,9 @@ public class CalloutProfile extends CalloutEngine int bill_Location_ID = rs.getInt("Bill_Location_ID"); // overwritten by InfoBP selection - works only if InfoWindow // was used otherwise creates error (uses last value, may belong to differnt BP) - if (bill_BPartner_ID.toString().equals(Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID"))) + if (bill_BPartner_ID.toString().equals(Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_ID"))) { - String loc = Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_Location_ID"); + String loc = Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_Location_ID"); if (loc.length() > 0) bill_Location_ID = Integer.parseInt(loc); } @@ -473,9 +473,9 @@ public class CalloutProfile extends CalloutEngine // Contact - overwritten by InfoBP selection int contID = rs.getInt("AD_User_ID"); - if (bill_BPartner_ID.toString().equals(Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID"))) + if (bill_BPartner_ID.toString().equals(Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_ID"))) { - String cont = Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "AD_User_ID"); + String cont = Env.getContext(ctx, WindowNo, Env.TAB_INFO, "AD_User_ID"); if (cont.length() > 0) contID = Integer.parseInt(cont); } @@ -644,9 +644,9 @@ public class CalloutProfile extends CalloutEngine // // // mTab.setValue("C_Charge_ID", null); // // Set Attribute -// if (Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() -// && Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) -// mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); +// if (Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() +// && Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) +// mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); // else // mTab.setValue("M_AttributeSetInstance_ID", null); // @@ -674,7 +674,7 @@ public class CalloutProfile extends CalloutEngine // Env.setContext(ctx, WindowNo, "DiscountSchema", pp.isDiscountSchema() ? "Y" : "N"); // // // Check/Update Warehouse Setting -// // int M_Warehouse_ID = Env.getContextAsInt(ctx, Env.WINDOW_INFO, "M_Warehouse_ID"); +// // int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID"); // // Integer wh = (Integer)mTab.getValue("M_Warehouse_ID"); // // if (wh.intValue() != M_Warehouse_ID) // // { @@ -1165,9 +1165,9 @@ System.out.println("costo de la formula --------------" +PriceList); // //mTab.setValue("C_Charge_ID", null); // Set Attribute -// if (Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() -// && Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) -// mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); +// if (Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() +// && Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) +// mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); // else // mTab.setValue("M_AttributeSetInstance_ID", null); @@ -1237,9 +1237,9 @@ catch (SQLException e) // //mTab.setValue("C_Charge_ID", null); // Set Attribute -// if (Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() -// && Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) -// mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); +// if (Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() +// && Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) +// mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); // else // mTab.setValue("M_AttributeSetInstance_ID", null); @@ -1304,9 +1304,9 @@ catch (SQLException e) // //mTab.setValue("C_Charge_ID", null); // Set Attribute -// if (Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() -// && Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) -// mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); +// if (Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() +// && Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) +// mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); // else // mTab.setValue("M_AttributeSetInstance_ID", null); diff --git a/client/src/org/compiere/apps/search/InfoAsset.java b/client/src/org/compiere/apps/search/InfoAsset.java index 9930328c28..5eca0f3a4a 100644 --- a/client/src/org/compiere/apps/search/InfoAsset.java +++ b/client/src/org/compiere/apps/search/InfoAsset.java @@ -233,7 +233,7 @@ public class InfoAsset extends Info // publish for Callout to read Integer ID = getSelectedRowKey(); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "A_Asset_ID", ID == null ? "0" : ID.toString()); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "A_Asset_ID", ID == null ? "0" : ID.toString()); } // saveSelectionDetail diff --git a/client/src/org/compiere/apps/search/InfoBPartner.java b/client/src/org/compiere/apps/search/InfoBPartner.java index 949b8e99b6..ca1f4b839a 100644 --- a/client/src/org/compiere/apps/search/InfoBPartner.java +++ b/client/src/org/compiere/apps/search/InfoBPartner.java @@ -399,9 +399,9 @@ public class InfoBPartner extends Info } // publish for Callout to read Integer ID = getSelectedRowKey(); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID", ID == null ? "0" : ID.toString()); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "AD_User_ID", String.valueOf(AD_User_ID)); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_Location_ID", String.valueOf(C_BPartner_Location_ID)); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_BPartner_ID", ID == null ? "0" : ID.toString()); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "AD_User_ID", String.valueOf(AD_User_ID)); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_BPartner_Location_ID", String.valueOf(C_BPartner_Location_ID)); } // saveSelectionDetail diff --git a/client/src/org/compiere/apps/search/InfoInvoice.java b/client/src/org/compiere/apps/search/InfoInvoice.java index 669c194a1c..186b257ef5 100644 --- a/client/src/org/compiere/apps/search/InfoInvoice.java +++ b/client/src/org/compiere/apps/search/InfoInvoice.java @@ -398,7 +398,7 @@ public class InfoInvoice extends Info { // publish for Callout to read Integer ID = getSelectedRowKey(); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "C_Invoice_ID", ID == null ? "0" : ID.toString()); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_Invoice_ID", ID == null ? "0" : ID.toString()); // int C_InvoicePaySchedule_ID = 0; int row = p_table.getSelectedRow(); @@ -409,9 +409,9 @@ public class InfoInvoice extends Info C_InvoicePaySchedule_ID = ((KeyNamePair)value).getKey(); } if (C_InvoicePaySchedule_ID <= 0) // not selected - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "C_InvoicePaySchedule_ID", "0"); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_InvoicePaySchedule_ID", "0"); else - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "C_InvoicePaySchedule_ID", String.valueOf(C_InvoicePaySchedule_ID)); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_InvoicePaySchedule_ID", String.valueOf(C_InvoicePaySchedule_ID)); } // saveSelectionDetail diff --git a/client/src/org/compiere/apps/search/InfoProduct.java b/client/src/org/compiere/apps/search/InfoProduct.java index 7dae44996d..7e0f394d7a 100644 --- a/client/src/org/compiere/apps/search/InfoProduct.java +++ b/client/src/org/compiere/apps/search/InfoProduct.java @@ -936,22 +936,22 @@ public final class InfoProduct extends Info implements ActionListener { // publish for Callout to read Integer ID = getSelectedRowKey(); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID", ID == null ? "0" : ID.toString()); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Product_ID", ID == null ? "0" : ID.toString()); KeyNamePair kn = (KeyNamePair)pickPriceList.getSelectedItem(); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_PriceList_Version_ID", kn.getID()); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_PriceList_Version_ID", kn.getID()); kn = (KeyNamePair)pickWarehouse.getSelectedItem(); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Warehouse_ID", kn.getID()); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Warehouse_ID", kn.getID()); // if (m_M_AttributeSetInstance_ID == -1) // not selected { - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Locator_ID", "0"); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Locator_ID", "0"); } else { - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID", + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID", String.valueOf(m_M_AttributeSetInstance_ID)); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Locator_ID", + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Locator_ID", String.valueOf(m_M_Locator_ID)); } } // saveSelectionDetail diff --git a/client/src/org/compiere/grid/ed/VLookup.java b/client/src/org/compiere/grid/ed/VLookup.java index dfb6ebdba0..0e6d09fbe3 100644 --- a/client/src/org/compiere/grid/ed/VLookup.java +++ b/client/src/org/compiere/grid/ed/VLookup.java @@ -807,9 +807,9 @@ public class VLookup extends JComponent else if (col.equals("M_Product_ID")) { // Reset - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID", "0"); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Lookup_ID", "0"); + Env.setContext(Env.getCtx(), m_lookup.getWindowNo(), Env.TAB_INFO, "M_Product_ID", "0"); + Env.setContext(Env.getCtx(), m_lookup.getWindowNo(), Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); + Env.setContext(Env.getCtx(), m_lookup.getWindowNo(), Env.TAB_INFO, "M_Lookup_ID", "0"); // Replace Value with name if no value exists if (queryValue.length() == 0 && m_text.getText().length() > 0) queryValue = "@" + m_text.getText() + "@"; // Name indicator - otherwise Value @@ -933,9 +933,9 @@ public class VLookup extends JComponent if (m_columnName.equals("M_Product_ID")) { // Reset - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID", "0"); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Locator_ID", "0"); + Env.setContext(Env.getCtx(), m_lookup.getWindowNo(), Env.TAB_INFO, "M_Product_ID", "0"); + Env.setContext(Env.getCtx(), m_lookup.getWindowNo(), Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); + Env.setContext(Env.getCtx(), m_lookup.getWindowNo(), Env.TAB_INFO, "M_Locator_ID", "0"); // sql.append(" AND (UPPER(p.Value) LIKE ") .append(DB.TO_STRING(text)) @@ -1067,9 +1067,9 @@ public class VLookup extends JComponent if (m_columnName.equals("M_Product_ID")) { // Reset - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID", "0"); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Locator_ID", "0"); + Env.setContext(Env.getCtx(), m_lookup.getWindowNo(), Env.TAB_INFO, "M_Product_ID", "0"); + Env.setContext(Env.getCtx(), m_lookup.getWindowNo(), Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); + Env.setContext(Env.getCtx(), m_lookup.getWindowNo(), Env.TAB_INFO, "M_Locator_ID", "0"); // sql.append("SELECT M_Product_ID FROM M_Product WHERE (UPPER(Value) LIKE ") .append(DB.TO_STRING(text)) diff --git a/client/src/org/compiere/grid/ed/VPAttributeDialog.java b/client/src/org/compiere/grid/ed/VPAttributeDialog.java index f01c694869..769a8ecb3a 100644 --- a/client/src/org/compiere/grid/ed/VPAttributeDialog.java +++ b/client/src/org/compiere/grid/ed/VPAttributeDialog.java @@ -455,9 +455,9 @@ public class VPAttributeDialog extends CDialog removeAll(); Env.clearWinContext(m_WindowNo); // - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID", + Env.setContext(Env.getCtx(), m_WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID", String.valueOf(m_M_AttributeSetInstance_ID)); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Locator_ID", + Env.setContext(Env.getCtx(), m_WindowNo, Env.TAB_INFO, "M_Locator_ID", String.valueOf(m_M_Locator_ID)); // super.dispose(); diff --git a/extend/src/compiere/model/CalloutUser.java b/extend/src/compiere/model/CalloutUser.java index fea436c456..ed9459c986 100644 --- a/extend/src/compiere/model/CalloutUser.java +++ b/extend/src/compiere/model/CalloutUser.java @@ -95,9 +95,9 @@ public class CalloutUser extends CalloutEngine int locID = rs.getInt("C_BPartner_Location_ID"); // overwritten by InfoBP selection - works only if InfoWindow // was used otherwise creates error (uses last value, may belong to differnt BP) - if (C_BPartner_ID.toString().equals(Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID"))) + if (C_BPartner_ID.toString().equals(Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_ID"))) { - String loc = Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_Location_ID"); + String loc = Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_Location_ID"); if (loc.length() > 0) locID = Integer.parseInt(loc); } @@ -108,9 +108,9 @@ public class CalloutUser extends CalloutEngine // Contact - overwritten by InfoBP selection int contID = rs.getInt("AD_User_ID"); - if (C_BPartner_ID.toString().equals(Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID"))) + if (C_BPartner_ID.toString().equals(Env.getContext(ctx, WindowNo, Env.TAB_INFO, "C_BPartner_ID"))) { - String cont = Env.getContext(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "AD_User_ID"); + String cont = Env.getContext(ctx, WindowNo, Env.TAB_INFO, "AD_User_ID"); if (cont.length() > 0) contID = Integer.parseInt(cont); } diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java index 01f4438225..274c83c53b 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java @@ -453,9 +453,9 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Prope if (col.equals("M_Product_ID")) { // Reset - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID", "0"); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Lookup_ID", "0"); + Env.setContext(Env.getCtx(), lookup.getWindowNo(), Env.TAB_INFO, "M_Product_ID", "0"); + Env.setContext(Env.getCtx(), lookup.getWindowNo(), Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); + Env.setContext(Env.getCtx(), lookup.getWindowNo(), Env.TAB_INFO, "M_Lookup_ID", "0"); // Replace Value with name if no value exists if (queryValue.length() == 0 && searchbox.getText().length() > 0) @@ -573,9 +573,9 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Prope if (m_columnName.equals("M_Product_ID")) { // Reset - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID", "0"); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Locator_ID", "0"); + Env.setContext(Env.getCtx(), lookup.getWindowNo(), Env.TAB_INFO, "M_Product_ID", "0"); + Env.setContext(Env.getCtx(), lookup.getWindowNo(), Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); + Env.setContext(Env.getCtx(), lookup.getWindowNo(), Env.TAB_INFO, "M_Locator_ID", "0"); sql.append("SELECT M_Product_ID FROM M_Product WHERE (UPPER(Value) LIKE ") .append(DB.TO_STRING(text)) diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java index b0953e385f..9bab8e4a9f 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java @@ -329,7 +329,7 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev // publish for Callout to read Integer ID = getSelectedRowKey(); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "A_Asset_ID", ID == null ? "0" : ID.toString()); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "A_Asset_ID", ID == null ? "0" : ID.toString()); } // saveSelectionDetail /*************************************************************************/ diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java index 3eaf0a0d3f..c61387df8b 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java @@ -492,9 +492,9 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener, WTabl } // publish for Callout to read Integer ID = getSelectedRowKey(); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_ID", ID == null ? "0" : ID.toString()); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "AD_User_ID", String.valueOf(AD_User_ID)); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "C_BPartner_Location_ID", String.valueOf(C_BPartner_Location_ID)); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_BPartner_ID", ID == null ? "0" : ID.toString()); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "AD_User_ID", String.valueOf(AD_User_ID)); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_BPartner_Location_ID", String.valueOf(C_BPartner_Location_ID)); } // saveSelectionDetail diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java index ac5b57327c..6898d47d0f 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java @@ -713,28 +713,28 @@ public final class InfoProductPanel extends InfoPanel implements EventListener { // publish for Callout to read Integer ID = getSelectedRowKey(); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID", ID == null ? "0" : ID.toString()); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Product_ID", ID == null ? "0" : ID.toString()); ListItem pickPL = (ListItem)pickPriceList.getSelectedItem(); if (pickPL!=null) { - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_PriceList_Version_ID",pickPL.getValue().toString()); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_PriceList_Version_ID",pickPL.getValue().toString()); } ListItem pickWH = (ListItem)pickWarehouse.getSelectedItem(); if (pickWH != null) { - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Warehouse_ID",pickWH.getValue().toString()); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Warehouse_ID",pickWH.getValue().toString()); } // if (m_M_AttributeSetInstance_ID == -1) // not selected { - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Locator_ID", "0"); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Locator_ID", "0"); } else { - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID", + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID", String.valueOf(m_M_AttributeSetInstance_ID)); - Env.setContext(Env.getCtx(), Env.WINDOW_INFO, Env.TAB_INFO, "M_Locator_ID", + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Locator_ID", String.valueOf(m_M_Locator_ID)); } } // saveSelectionDetail