From ee91d259f6a1ec329dd9b0142b3df36a154e787d Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 25 Feb 2015 08:32:03 -0500 Subject: [PATCH 01/14] IDEMPIERE-2462 In table view, when using tab , it skip number box / thanks to Deepak Pansheriya --- .../WEB-INF/src/org/adempiere/webui/component/NumberBox.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java index 269f59d9e5..9d407ad7a8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java @@ -466,7 +466,7 @@ public class NumberBox extends Div */ public boolean isEnabled() { - return decimalBox.isReadonly(); + return !decimalBox.isReadonly(); } @Override From ac0845314c091c296954286d0ce235ef70dfd7c8 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 25 Feb 2015 09:55:49 -0500 Subject: [PATCH 02/14] IDEMPIERE-2450 Enable Zoom for Record_ID on HTML Reports / thanks to Deepak Pansheriya and Adaxa for seed patch --- .../org/compiere/print/PrintDataElement.java | 9 +++++++- .../src/org/compiere/print/ReportEngine.java | 23 +++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/print/PrintDataElement.java b/org.adempiere.base/src/org/compiere/print/PrintDataElement.java index bbbc78d75c..ea2ef64e9a 100644 --- a/org.adempiere.base/src/org/compiere/print/PrintDataElement.java +++ b/org.adempiere.base/src/org/compiere/print/PrintDataElement.java @@ -39,7 +39,7 @@ public class PrintDataElement implements Serializable /** * */ - private static final long serialVersionUID = 2177482817458457236L; + private static final long serialVersionUID = -2121125127301364735L; /** * Print Data Element Constructor @@ -129,6 +129,13 @@ public class PrintDataElement implements Serializable return m_foreignColumnName; } + /** + * Set ForeignName + * @return name + */ + public void setForeignColumnName(String foreignColumnName) { + m_foreignColumnName = foreignColumnName; + } /** * Get Node Value diff --git a/org.adempiere.base/src/org/compiere/print/ReportEngine.java b/org.adempiere.base/src/org/compiere/print/ReportEngine.java index ca3f98851f..e3936059da 100644 --- a/org.adempiere.base/src/org/compiere/print/ReportEngine.java +++ b/org.adempiere.base/src/org/compiere/print/ReportEngine.java @@ -72,6 +72,7 @@ import org.compiere.model.MPaySelectionCheck; import org.compiere.model.MProject; import org.compiere.model.MQuery; import org.compiere.model.MRfQResponse; +import org.compiere.model.MTable; import org.compiere.model.PrintInfo; import static org.compiere.model.SystemIDs.*; @@ -660,8 +661,26 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount) if (cssPrefix != null) href.setClass(cssPrefix + "-href"); - extension.extendIDColumn(row, td, href, pde); - + if (item.getColumnName().equals("Record_ID")) { + Object tablePDE = m_printData.getNode("AD_Table_ID"); + if (tablePDE != null && tablePDE instanceof PrintDataElement) { + int tableID = -1; + try { + tableID = Integer.parseInt(((PrintDataElement)tablePDE).getValueAsString()); + } catch (Exception e) { + tableID = -1; + } + if (tableID > 0) { + MTable mTable = MTable.get(getCtx(), tableID); + String foreignColumnName = mTable.getTableName() + "_ID"; + pde.setForeignColumnName(foreignColumnName); + extension.extendIDColumn(row, td, href, pde); + } + } + } else { + extension.extendIDColumn(row, td, href, pde); + } + } else { From be325f3b229f4bd5063d3e477c56d387f1fe7dfc Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 25 Feb 2015 10:24:42 -0500 Subject: [PATCH 03/14] IDEMPIERE-2483 Users can report on windows where they don't have access --- .../src/org/compiere/print/ReportEngine.java | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/print/ReportEngine.java b/org.adempiere.base/src/org/compiere/print/ReportEngine.java index e3936059da..1d79805410 100644 --- a/org.adempiere.base/src/org/compiere/print/ReportEngine.java +++ b/org.adempiere.base/src/org/compiere/print/ReportEngine.java @@ -72,6 +72,7 @@ import org.compiere.model.MPaySelectionCheck; import org.compiere.model.MProject; import org.compiere.model.MQuery; import org.compiere.model.MRfQResponse; +import org.compiere.model.MRole; import org.compiere.model.MTable; import org.compiere.model.PrintInfo; @@ -653,14 +654,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount) String value = pde.getValueDisplay(language); // formatted if (pde.getColumnName().endsWith("_ID") && extension != null) { - //link for column - a href = new a("javascript:void(0)"); - href.setID(pde.getColumnName() + "_" + row + "_a"); - td.addElement(href); - href.addElement(Util.maskHTML(value)); - if (cssPrefix != null) - href.setClass(cssPrefix + "-href"); - + boolean isZoom = false; if (item.getColumnName().equals("Record_ID")) { Object tablePDE = m_printData.getNode("AD_Table_ID"); if (tablePDE != null && tablePDE instanceof PrintDataElement) { @@ -674,11 +668,33 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount) MTable mTable = MTable.get(getCtx(), tableID); String foreignColumnName = mTable.getTableName() + "_ID"; pde.setForeignColumnName(foreignColumnName); - extension.extendIDColumn(row, td, href, pde); + isZoom = true; } } } else { + isZoom = true; + } + if (isZoom) { + // check permission on the zoomed window + MTable mTable = MTable.get(getCtx(), pde.getForeignColumnName().substring(0, pde.getForeignColumnName().length()-3)); + int Record_ID = Integer.parseInt(pde.getValueAsString()); + int AD_Window_ID = Env.getZoomWindowID(mTable.get_ID(), Record_ID); + Boolean canAccess = MRole.getDefault().getWindowAccess(AD_Window_ID); + if (canAccess == null) { + isZoom = false; + } + } + if (isZoom) { + //link for column + a href = new a("javascript:void(0)"); + href.setID(pde.getColumnName() + "_" + row + "_a"); + td.addElement(href); + href.addElement(Util.maskHTML(value)); + if (cssPrefix != null) + href.setClass(cssPrefix + "-href"); extension.extendIDColumn(row, td, href, pde); + } else { + td.addElement(Util.maskHTML(value)); } } From 639d830e1fc75ab5b71af7405cdcab3dd42e4cf8 Mon Sep 17 00:00:00 2001 From: hieplq Date: Wed, 25 Feb 2015 13:37:59 +0700 Subject: [PATCH 04/14] IDEMPIERE-2478:process parameter dialog need auto size to show button --- .../webui/apps/ProcessModalDialog.java | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java index 12c7b27dfb..ee98e28070 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java @@ -21,10 +21,10 @@ import java.util.logging.Level; import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.component.Button; import org.adempiere.webui.component.ConfirmPanel; -import org.adempiere.webui.component.VerticalBox; import org.adempiere.webui.component.Window; import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.factory.ButtonFactory; +import org.adempiere.webui.session.SessionManager; import org.compiere.process.ProcessInfo; import org.compiere.util.CLogger; import org.compiere.util.Env; @@ -33,7 +33,8 @@ import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zul.Div; -import org.zkoss.zul.Hbox; +import org.zkoss.zul.Hlayout; +import org.zkoss.zul.Layout; import org.zkoss.zul.Vlayout; /** @@ -54,8 +55,6 @@ public class ProcessModalDialog extends AbstractProcessDialog implements EventLi */ private static final long serialVersionUID = -3260639688339379279L; - private VerticalBox dialogBody; - /** Logger */ private static CLogger log = CLogger.getCLogger(ProcessModalDialog.class); // @@ -138,23 +137,32 @@ public class ProcessModalDialog extends AbstractProcessDialog implements EventLi private void initComponents() { this.setBorder("normal"); - dialogBody = new VerticalBox(); + Layout dialogBody = new Vlayout(); dialogBody.setHflex("1"); + dialogBody.setStyle(dialogBody.getStyle() + ";max-height:" + (SessionManager.getAppDesktop().getClientInfo().desktopHeight - 100) + "px"); + + Vlayout dialogContent = new Vlayout(); dialogContent.setHflex("1"); dialogContent.setVflex("1"); dialogContent.setSclass("dialog-content"); dialogContent.setStyle("overflow-y: auto;"); dialogBody.appendChild(dialogContent); + // description Div div = new Div(); div.setId("message"); div.appendChild(getMessage()); div.setStyle("max-height: 150pt; overflow: auto;"); dialogContent.appendChild(div); + dialogContent.appendChild(getCenterPanel()); - Hbox hbox = new Hbox(); + // button panel + Layout hbox = new Hlayout(); + hbox.setStyle("bottom:0;text-align:right"); + dialogBody.appendChild(hbox); hbox.setWidth("100%"); hbox.setSclass("dialog-footer"); + Button btn = ButtonFactory.createNamedButton(ConfirmPanel.A_OK); btn.setId("Ok"); btn.addEventListener(Events.ON_CLICK, this); @@ -163,11 +171,10 @@ public class ProcessModalDialog extends AbstractProcessDialog implements EventLi btn = ButtonFactory.createNamedButton(ConfirmPanel.A_CANCEL); btn.setId("Cancel"); btn.addEventListener(Events.ON_CLICK, this); - hbox.appendChild(btn); - hbox.setPack("end"); dialogBody.appendChild(hbox); this.appendChild(dialogBody); + this.setSclass("popup-dialog"); } @@ -201,13 +208,13 @@ public class ProcessModalDialog extends AbstractProcessDialog implements EventLi @Override public void showBusyDialog() { - this.setBorder("none"); - this.setTitle(null); - dialogBody.setVisible(false); - BusyDialog progressWindow = createBusyDialog(); - if (this.getParent() != null) + if (this.getParent() != null){ + this.getParent().appendChild(progressWindow); LayoutUtils.openOverlappedWindow(this.getParent(), progressWindow, "middle_center"); + } + + this.setVisible(false); } @Override From 0cea1c7fe15eb93836f3ddc26dd41e07201981f4 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 25 Feb 2015 13:44:42 -0500 Subject: [PATCH 05/14] IDEMPIERE-2477 Generate boolean in 2Pack as Y/N instead of true/false --- .../pipo2/handler/CommonTranslationHandler.java | 4 ++-- .../adempiere/pipo2/handler/MenuElementHandler.java | 13 ++----------- .../src/org/adempiere/pipo2/PoExporter.java | 4 ++-- .../src/org/adempiere/pipo2/PoFiller.java | 2 +- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/CommonTranslationHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/CommonTranslationHandler.java index 40901fc17f..f347c29475 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/CommonTranslationHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/CommonTranslationHandler.java @@ -121,7 +121,7 @@ public class CommonTranslationHandler extends AbstractElementHandler implements if(columnName.equalsIgnoreCase("IsActive") || columnName.equalsIgnoreCase("IsTranslated")){ - value = "true".equals(value) ? "Y" : "N"; + value = "true".equals(value) || "Y".equals(value) ? "Y" : "N"; } pstm.setString(i, value); } @@ -161,7 +161,7 @@ public class CommonTranslationHandler extends AbstractElementHandler implements if(columnName.equalsIgnoreCase("IsActive") || columnName.equalsIgnoreCase("IsTranslated")){ - value = "true".equals(value) ? "Y" : "N"; + value = "true".equals(value) || "Y".equals(value) ? "Y" : "N"; } pstm.setString(i, value); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MenuElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MenuElementHandler.java index fa4cb8d8cb..edbbff4eab 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MenuElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MenuElementHandler.java @@ -133,17 +133,8 @@ public class MenuElementHandler extends AbstractElementHandler { int columnID = DB.getSQLValue(getTrxName(ctx), sql, colName, tableID); sql = "SELECT AD_Reference_ID FROM AD_COLUMN WHERE AD_Column_ID = ?"; int referenceID = DB.getSQLValue(getTrxName(ctx), sql, columnID); - if (referenceID == 20 || referenceID == 28) - if (rs.getObject(q).equals("Y")) - colValue = "true"; - else - colValue = "false"; - else - { - Object obj = rs.getObject(q); - colValue = obj == null ? "" : obj.toString(); - } - + Object obj = rs.getObject(q); + colValue = obj == null ? "" : obj.toString(); X_AD_Package_Imp_Backup backup = new X_AD_Package_Imp_Backup(ctx.ctx, 0, getTrxName(ctx)); backup.setAD_Package_Imp_Detail_ID(impDetail.getAD_Package_Imp_Detail_ID()); backup.setAD_Package_Imp_ID(getPackageImpId(ctx.ctx)); diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java index 6cd744c5fd..3325d8118c 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java @@ -90,7 +90,7 @@ public class PoExporter { * @param boolValue */ public void addBoolean(String name, boolean boolValue, AttributesImpl atts){ - addTextElement(name, boolValue == true ? "true" : "false", atts); + addTextElement(name, boolValue == true ? "Y" : "N", atts); } @@ -120,7 +120,7 @@ public class PoExporter { if(value instanceof String){ addTextElement(columnName, (String)value, atts); } else if(value instanceof Boolean) { - addTextElement(columnName, (Boolean)value == true ? "true" : "false", atts); + addTextElement(columnName, (Boolean)value == true ? "Y" : "N", atts); } else if(value instanceof Integer) { addTextElement(columnName, value.toString(), atts); } else if(value instanceof BigDecimal) { diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PoFiller.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PoFiller.java index 39f4d16b35..1f7136d27a 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PoFiller.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PoFiller.java @@ -70,7 +70,7 @@ public class PoFiller{ Element e = element.properties.get(columnName); String value = e != null ? e.contents.toString() : null; - boolean bool = "true".equals(value) ? true : false; + boolean bool = "true".equals(value) || "Y".equals(value) ? true : false; if (po.get_Value(columnName) != null && po.get_ValueAsBoolean(columnName) == bool) return; From f7d2c70f5de2da7a5bd3a1c772a1b1e279edba43 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 25 Feb 2015 13:46:20 -0500 Subject: [PATCH 06/14] IDEMPIERE-2472 CallOutOrder make a mistake of calculating LineNetAmt,When updata enterQty at detail panel using UOM conversion. --- .../src/org/compiere/model/CalloutOrder.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java index 1afce71542..0ff22e3ca8 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java @@ -841,7 +841,7 @@ public class CalloutOrder extends CalloutEngine { BigDecimal QtyOrdered = (BigDecimal)mTab.getValue("QtyOrdered"); int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID"); - int M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, "M_AttributeSetInstance_ID"); + int M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_AttributeSetInstance_ID"); BigDecimal available = MStorageReservation.getQtyAvailable (M_Warehouse_ID, M_Product_ID.intValue(), M_AttributeSetInstance_ID, null); if (available == null) @@ -961,12 +961,12 @@ public class CalloutOrder extends CalloutEngine if (column.equals("M_Product_ID")) M_Product_ID = ((Integer)value).intValue(); else - M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID"); + M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID"); int C_Charge_ID = 0; if (column.equals("C_Charge_ID")) C_Charge_ID = ((Integer)value).intValue(); else - C_Charge_ID = Env.getContextAsInt(ctx, WindowNo, "C_Charge_ID"); + C_Charge_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_Charge_ID"); if (log.isLoggable(Level.FINE)) log.fine("Product=" + M_Product_ID + ", C_Charge_ID=" + C_Charge_ID); if (M_Product_ID == 0 && C_Charge_ID == 0) return amt(ctx, WindowNo, mTab, mField, value); // @@ -1034,9 +1034,9 @@ public class CalloutOrder extends CalloutEngine return ""; if (steps) log.warning("init"); - int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, "C_UOM_ID"); - int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID"); - int M_PriceList_ID = Env.getContextAsInt(ctx, WindowNo, "M_PriceList_ID"); + int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); + int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID"); + int M_PriceList_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_PriceList_ID"); int StdPrecision = MPriceList.getStandardPrecision(ctx, M_PriceList_ID); MPriceList pl = new MPriceList(ctx, M_PriceList_ID, null); boolean isEnforcePriceLimit = pl.isEnforcePriceLimit(); @@ -1211,7 +1211,7 @@ public class CalloutOrder extends CalloutEngine { if (isCalloutActive() || value == null) return ""; - int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID"); + int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID"); if (steps) log.warning("init - M_Product_ID=" + M_Product_ID + " - " ); BigDecimal QtyOrdered = Env.ZERO; BigDecimal QtyEntered, PriceActual, PriceEntered; @@ -1257,7 +1257,7 @@ public class CalloutOrder extends CalloutEngine // QtyEntered changed - calculate QtyOrdered else if (mField.getColumnName().equals("QtyEntered")) { - int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, "C_UOM_ID"); + int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); QtyEntered = (BigDecimal)value; BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); if (QtyEntered.compareTo(QtyEntered1) != 0) @@ -1282,7 +1282,7 @@ public class CalloutOrder extends CalloutEngine // QtyOrdered changed - calculate QtyEntered (should not happen) else if (mField.getColumnName().equals("QtyOrdered")) { - int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, "C_UOM_ID"); + int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); QtyOrdered = (BigDecimal)value; int precision = MProduct.get(ctx, M_Product_ID).getUOMPrecision(); BigDecimal QtyOrdered1 = QtyOrdered.setScale(precision, BigDecimal.ROUND_HALF_UP); @@ -1320,7 +1320,7 @@ public class CalloutOrder extends CalloutEngine if (product.isStocked()) { int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID"); - int M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, "M_AttributeSetInstance_ID"); + int M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_AttributeSetInstance_ID"); BigDecimal available = MStorageReservation.getQtyAvailable (M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID, null); if (available == null) From 8af991da51e4128a7bef61f2a0e3f1c0dff177f0 Mon Sep 17 00:00:00 2001 From: Hideaki Hagiwara Date: Thu, 19 Feb 2015 10:30:22 +0900 Subject: [PATCH 07/14] IDEMPIERE-2472 CalloutInvoice --- .../src/org/compiere/model/CalloutInvoice.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java index 771bb308fd..1a93a8c3d0 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java @@ -319,7 +319,7 @@ public class CalloutInvoice extends CalloutEngine /***** Price Calculation see also qty ****/ boolean IsSOTrx = Env.getContext(ctx, WindowNo, "IsSOTrx").equals("Y"); - int C_BPartner_ID = Env.getContextAsInt(ctx, WindowNo, WindowNo, "C_BPartner_ID"); + int C_BPartner_ID = Env.getContextAsInt(ctx, WindowNo, "C_BPartner_ID"); BigDecimal Qty = (BigDecimal)mTab.getValue("QtyInvoiced"); MProductPricing pp = new MProductPricing (M_Product_ID.intValue(), C_BPartner_ID, Qty, IsSOTrx); // @@ -444,12 +444,12 @@ public class CalloutInvoice extends CalloutEngine if (column.equals("M_Product_ID")) M_Product_ID = ((Integer)value).intValue(); else - M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID"); + M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID"); int C_Charge_ID = 0; if (column.equals("C_Charge_ID")) C_Charge_ID = ((Integer)value).intValue(); else - C_Charge_ID = Env.getContextAsInt(ctx, WindowNo, "C_Charge_ID"); + C_Charge_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_Charge_ID"); if (log.isLoggable(Level.FINE)) log.fine("Product=" + M_Product_ID + ", C_Charge_ID=" + C_Charge_ID); if (M_Product_ID == 0 && C_Charge_ID == 0) return amt (ctx, WindowNo, mTab, mField, value); // @@ -506,8 +506,8 @@ public class CalloutInvoice extends CalloutEngine return ""; // log.log(Level.WARNING,"amt - init"); - int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, "C_UOM_ID"); - int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID"); + int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); + int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID"); int M_PriceList_ID = Env.getContextAsInt(ctx, WindowNo, "M_PriceList_ID"); int StdPrecision = MPriceList.getStandardPrecision(ctx, M_PriceList_ID); MPriceList pl = new MPriceList(ctx, M_PriceList_ID, null); @@ -732,7 +732,7 @@ public class CalloutInvoice extends CalloutEngine if (isCalloutActive() || value == null) return ""; - int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID"); + int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID"); // log.log(Level.WARNING,"qty - init - M_Product_ID=" + M_Product_ID); BigDecimal QtyInvoiced, QtyEntered, PriceActual, PriceEntered; @@ -776,7 +776,7 @@ public class CalloutInvoice extends CalloutEngine // QtyEntered changed - calculate QtyInvoiced else if (mField.getColumnName().equals("QtyEntered")) { - int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, "C_UOM_ID"); + int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); QtyEntered = (BigDecimal)value; BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); if (QtyEntered.compareTo(QtyEntered1) != 0) @@ -801,7 +801,7 @@ public class CalloutInvoice extends CalloutEngine // QtyInvoiced changed - calculate QtyEntered (should not happen) else if (mField.getColumnName().equals("QtyInvoiced")) { - int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, "C_UOM_ID"); + int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); QtyInvoiced = (BigDecimal)value; int precision = MProduct.get(ctx, M_Product_ID).getUOMPrecision(); BigDecimal QtyInvoiced1 = QtyInvoiced.setScale(precision, BigDecimal.ROUND_HALF_UP); From be17f8a145701676c951312bd597f5b50e473ea4 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 25 Feb 2015 14:41:58 -0500 Subject: [PATCH 08/14] IDEMPIERE-2472 CalloutInOut/CalloutMovement --- .../src/org/compiere/model/CalloutInOut.java | 12 ++++++------ .../src/org/compiere/model/CalloutMovement.java | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java index 8f70134894..dba843e84c 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java @@ -570,7 +570,7 @@ public class CalloutInOut extends CalloutEngine if (isCalloutActive() || value == null) return ""; - int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID"); + int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID"); // log.log(Level.WARNING,"qty - init - M_Product_ID=" + M_Product_ID); BigDecimal MovementQty, QtyEntered; @@ -606,7 +606,7 @@ public class CalloutInOut extends CalloutEngine mTab.setValue("MovementQty", MovementQty); } // No UOM defined - else if (Env.getContextAsInt(ctx, WindowNo, "C_UOM_ID") == 0) + else if (Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID") == 0) { QtyEntered = (BigDecimal)mTab.getValue("QtyEntered"); mTab.setValue("MovementQty", QtyEntered); @@ -614,7 +614,7 @@ public class CalloutInOut extends CalloutEngine // QtyEntered changed - calculate MovementQty else if (mField.getColumnName().equals("QtyEntered")) { - int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, "C_UOM_ID"); + int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); QtyEntered = (BigDecimal)value; BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); if (QtyEntered.compareTo(QtyEntered1) != 0) @@ -639,7 +639,7 @@ public class CalloutInOut extends CalloutEngine // MovementQty changed - calculate QtyEntered (should not happen) else if (mField.getColumnName().equals("MovementQty")) { - int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, "C_UOM_ID"); + int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); MovementQty = (BigDecimal)value; int precision = MProduct.get(ctx, M_Product_ID).getUOMPrecision(); BigDecimal MovementQty1 = MovementQty.setScale(precision, BigDecimal.ROUND_HALF_UP); @@ -683,9 +683,9 @@ public class CalloutInOut extends CalloutEngine if (M_ASI_ID == null || M_ASI_ID.intValue() == 0) return ""; // - int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID"); + int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID"); int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID"); - int M_Locator_ID = Env.getContextAsInt(ctx, WindowNo, "M_Locator_ID"); + int M_Locator_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Locator_ID"); if (log.isLoggable(Level.FINE)) log.fine("M_Product_ID=" + M_Product_ID + ", M_ASI_ID=" + M_ASI_ID + " - M_Warehouse_ID=" + M_Warehouse_ID diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutMovement.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutMovement.java index a0bec96ca6..19d8ee70bc 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutMovement.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutMovement.java @@ -76,7 +76,7 @@ public class CalloutMovement extends CalloutEngine if (isCalloutActive() || value == null) return ""; - int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID"); + int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID"); checkQtyAvailable(ctx, mTab, WindowNo, M_Product_ID, (BigDecimal)value); // return ""; @@ -95,7 +95,7 @@ public class CalloutMovement extends CalloutEngine public String locator(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) { if (value == null) return ""; - int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID"); + int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID"); checkQtyAvailable(ctx, mTab, WindowNo, M_Product_ID, null); return ""; } @@ -116,11 +116,11 @@ public class CalloutMovement extends CalloutEngine if (product.isStocked()) { if (MovementQty == null) MovementQty = (BigDecimal) mTab.getValue("MovementQty"); - int M_Locator_ID = Env.getContextAsInt(ctx, WindowNo, "M_Locator_ID"); + int M_Locator_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Locator_ID"); // If no locator, don't check anything and assume is ok if (M_Locator_ID <= 0) return; - int M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, "M_AttributeSetInstance_ID"); + int M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_AttributeSetInstance_ID"); BigDecimal available = MStorageOnHand.getQtyOnHandForLocator(M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID, null); if (available == null) From 997f145013e289abac558e93b3251cfbb115ac65 Mon Sep 17 00:00:00 2001 From: hieplq Date: Fri, 6 Feb 2015 19:59:01 +0700 Subject: [PATCH 09/14] IDEMPIERE-2427:ZK7 / Grid Customisation Available Choices not sorted by login language --- .../webui/component/SimpleListModel.java | 31 ++++++++++++++++++- .../webui/panel/CustomizeGridViewPanel.java | 26 +++++++++++----- 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/SimpleListModel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/SimpleListModel.java index 6b5dc51c4f..ffc36915cb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/SimpleListModel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/SimpleListModel.java @@ -15,8 +15,11 @@ package org.adempiere.webui.component; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; import java.util.List; +import org.zkoss.lang.Objects; import org.zkoss.zul.AbstractListModel; import org.zkoss.zul.Listbox; import org.zkoss.zul.Listcell; @@ -24,13 +27,14 @@ import org.zkoss.zul.Listitem; import org.zkoss.zul.ListitemRenderer; import org.zkoss.zul.ListitemRendererExt; import org.zkoss.zul.event.ListDataEvent; +import org.zkoss.zul.ext.Sortable; /** * * @author Low Heng Sin * */ -public class SimpleListModel extends AbstractListModel implements ListitemRenderer, ListitemRendererExt { +public class SimpleListModel extends AbstractListModel implements ListitemRenderer, ListitemRendererExt, Sortable { /** * @@ -39,6 +43,10 @@ public class SimpleListModel extends AbstractListModel implements Listit protected List list; + private Comparator _sorting; + + private boolean _sortDir; + private int[] maxLength; public SimpleListModel() { @@ -50,6 +58,7 @@ public class SimpleListModel extends AbstractListModel implements Listit this.list = (List)list; } + @Override public Object getElementAt(int index) { if (index >= 0 && index < list.size()) return list.get(index); @@ -57,6 +66,7 @@ public class SimpleListModel extends AbstractListModel implements Listit return null; } + @Override public int getSize() { return list.size(); } @@ -111,14 +121,17 @@ public class SimpleListModel extends AbstractListModel implements Listit } } + @Override public int getControls() { return DETACH_ON_RENDER; } + @Override public Listcell newListcell(Listitem item) { return null; } + @Override public Listitem newListitem(Listbox listbox) { ListItem item = new ListItem(); item.applyProperties(); @@ -159,4 +172,20 @@ public class SimpleListModel extends AbstractListModel implements Listit public int indexOf(Object value) { return list.indexOf(value); } + + @Override + public void sort(Comparator cmpr, boolean ascending) { + _sorting = cmpr; + _sortDir = ascending; + Collections.sort(list, cmpr); + fireEvent(ListDataEvent.STRUCTURE_CHANGED, -1, -1); + } + + @Override + public String getSortDirection(Comparator cmpr) { + if (Objects.equals(_sorting, cmpr)) + return _sortDir ? + "ascending" : "descending"; + return "natural"; + } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java index 0517c72fa8..ccce815ef1 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java @@ -18,6 +18,7 @@ package org.adempiere.webui.panel; import java.util.ArrayList; import java.util.Arrays; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -41,11 +42,13 @@ import org.adempiere.webui.component.SimpleListModel; import org.adempiere.webui.factory.ButtonFactory; import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.window.FDialog; +import org.compiere.model.I_AD_Field; import org.compiere.model.MField; import org.compiere.model.MRefList; import org.compiere.model.MRole; import org.compiere.model.MTab; import org.compiere.model.Query; +import org.compiere.model.X_AD_Tab_Customization; import org.compiere.util.CLogger; import org.compiere.util.Env; import org.compiere.util.Msg; @@ -144,10 +147,11 @@ public class CustomizeGridViewPanel extends Panel yesList.setVflex(true); noList.setVflex(true); - + EventListener mouseListener = new EventListener() { + @Override public void onEvent(Event event) throws Exception { if (Events.ON_DOUBLE_CLICK.equals(event.getName())) @@ -161,6 +165,7 @@ public class CustomizeGridViewPanel extends Panel // EventListener actionListener = new EventListener() { + @Override public void onEvent(Event event) throws Exception { migrateValueAcrossLists(event); } @@ -184,6 +189,7 @@ public class CustomizeGridViewPanel extends Panel actionListener = new EventListener() { + @Override public void onEvent(Event event) throws Exception { migrateValueWithinYesList(event); } @@ -214,7 +220,10 @@ public class CustomizeGridViewPanel extends Panel listHead.setParent(noList); listHeader = new ListHeader(); listHeader.appendChild(noLabel); - + listHeader.setSort("auto"); + listHeader.setSortDirection("ascending"); + //http://books.zkoss.org/wiki/ZK%20Configuration%20Reference/zk.xml/The%20Library%20Properties/org.zkoss.zul.listbox.autoSort + noList.setAttribute("org.zkoss.zul.listbox.autoSort", "true"); Hlayout noButtonLayout = new Hlayout(); noButtonLayout.appendChild(bRemove); @@ -268,6 +277,7 @@ public class CustomizeGridViewPanel extends Panel LayoutUtils.addSclass("dialog-footer", confirmPanel); EventListener onClickListener = new EventListener() { + @Override public void onEvent(Event event) throws Exception { if (event.getTarget().equals( confirmPanel.getButton(ConfirmPanel.A_OK))) { @@ -298,7 +308,7 @@ public class CustomizeGridViewPanel extends Panel boolean baseLanguage = Env.isBaseLanguage(Env.getCtx(), "AD_Field"); Query query = null; - query = new Query(Env.getCtx(), MField.Table_Name, "AD_Tab_ID=? AND (IsDisplayed='Y' OR IsDisplayedGrid='Y') AND IsActive='Y'", null); + query = new Query(Env.getCtx(), I_AD_Field.Table_Name, "AD_Tab_ID=? AND (IsDisplayed='Y' OR IsDisplayedGrid='Y') AND IsActive='Y'", null); query.setOrderBy("SeqNoGrid, Name, SeqNo"); query.setParameters(new Object [] {m_AD_Tab_ID}); query.setApplyAccessFilter(true); @@ -319,7 +329,7 @@ public class CustomizeGridViewPanel extends Panel if (baseLanguage) name = field.getName(); else - name = field.get_Translation(MField.COLUMNNAME_Name); + name = field.get_Translation(I_AD_Field.COLUMNNAME_Name); ListElement pp = new ListElement(key, name); if (tableSeqs != null && tableSeqs.size() > 0 ) { @@ -359,7 +369,7 @@ public class CustomizeGridViewPanel extends Panel ValueNamePair pp = new ValueNamePair(null, null); lstGridMode.addItem(pp); - ValueNamePair[] list = MRefList.getList(Env.getCtx(), MTabCustomization.ISDISPLAYEDGRID_AD_Reference_ID, false); + ValueNamePair[] list = MRefList.getList(Env.getCtx(), X_AD_Tab_Customization.ISDISPLAYEDGRID_AD_Reference_ID, false); for (int i = 0;i < list.length; i++ ) { lstGridMode.addItem(list[i]); if (m_tabcust != null && list[i].getValue().equals(m_tabcust.getIsDisplayedGrid())) @@ -637,8 +647,7 @@ public class CustomizeGridViewPanel extends Panel return s; } } - - /** + /** * @author eslatis * */ @@ -652,6 +661,7 @@ public class CustomizeGridViewPanel extends Panel { } + @Override public void onEvent(Event event) throws Exception { if (event instanceof DropEvent) { @@ -669,7 +679,6 @@ public class CustomizeGridViewPanel extends Panel Listbox listTo = (Listbox)endItem.getListbox(); endIndex = yesList.getIndexOfItem(endItem); migrateLists (listFrom,listTo,endIndex); - }else if (startItem.getListbox() == endItem.getListbox() && startItem.getListbox() == yesList) { List selObjects = new ArrayList(); @@ -718,3 +727,4 @@ public class CustomizeGridViewPanel extends Panel } } //CustomizeGridViewPanel + From 2e8a31d4d87a6ce16e46dd8382ca4dacf616c6de Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 25 Feb 2015 15:38:30 -0500 Subject: [PATCH 10/14] IDEMPIERE-2427 minor remove unused import --- .../src/org/adempiere/webui/panel/CustomizeGridViewPanel.java | 1 - 1 file changed, 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java index ccce815ef1..b1377db76e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java @@ -18,7 +18,6 @@ package org.adempiere.webui.panel; import java.util.ArrayList; import java.util.Arrays; -import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; From 79b5854a22a245368b93bc0248163c1fc5342ef6 Mon Sep 17 00:00:00 2001 From: tsvikruha Date: Wed, 25 Feb 2015 15:59:17 -0500 Subject: [PATCH 11/14] IDEMPIERE-2453 Deleting nodes from tree has strange behviour --- org.adempiere.base/src/org/compiere/model/PO.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/model/PO.java b/org.adempiere.base/src/org/compiere/model/PO.java index 93e76913d2..7eb44df8b9 100644 --- a/org.adempiere.base/src/org/compiere/model/PO.java +++ b/org.adempiere.base/src/org/compiere/model/PO.java @@ -3938,6 +3938,14 @@ public abstract class PO int id = get_ID(); if (id == 0) id = get_IDOld(); + + // IDEMPIERE-2453 + StringBuilder countSql = new StringBuilder("SELECT COUNT(*) FROM ") + .append(MTree_Base.getNodeTableName(treeType)) + .append(" WHERE Parent_ID=?"); + if(DB.getSQLValue( get_TrxName(), countSql.toString(), id) > 0) + throw new AdempiereException("CannotDeleteParent"); + StringBuilder sb = new StringBuilder ("DELETE FROM ") .append(MTree_Base.getNodeTableName(treeType)) .append(" n WHERE Node_ID=").append(id) From f8d7e6bc2665216ca56271dbbf876f36435d5cd7 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 25 Feb 2015 16:02:10 -0500 Subject: [PATCH 12/14] IDEMPIERE-2453 peer review --- org.adempiere.base/src/org/compiere/model/PO.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/PO.java b/org.adempiere.base/src/org/compiere/model/PO.java index 7eb44df8b9..0a0487b330 100644 --- a/org.adempiere.base/src/org/compiere/model/PO.java +++ b/org.adempiere.base/src/org/compiere/model/PO.java @@ -3943,8 +3943,9 @@ public abstract class PO StringBuilder countSql = new StringBuilder("SELECT COUNT(*) FROM ") .append(MTree_Base.getNodeTableName(treeType)) .append(" WHERE Parent_ID=?"); - if(DB.getSQLValue( get_TrxName(), countSql.toString(), id) > 0) - throw new AdempiereException("CannotDeleteParent"); + int cnt = DB.getSQLValue( get_TrxName(), countSql.toString(), id); + if (cnt > 0) + throw new AdempiereException(Msg.getMsg(Env.getCtx(),"NoParentDelete", new Object[] {cnt})); StringBuilder sb = new StringBuilder ("DELETE FROM ") .append(MTree_Base.getNodeTableName(treeType)) From 12dd7d7aa202ec926c054c5f94e7c32eef0e3751 Mon Sep 17 00:00:00 2001 From: dantam Date: Sun, 15 Dec 2013 16:55:45 +0100 Subject: [PATCH 13/14] IDEMPIERE-1633 - Missing pieces for replication setup --- org.adempiere.replication/build.properties | 3 ++- org.adempiere.replication/plugin.xml | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 org.adempiere.replication/plugin.xml diff --git a/org.adempiere.replication/build.properties b/org.adempiere.replication/build.properties index 34d2e4d2da..e9863e281e 100644 --- a/org.adempiere.replication/build.properties +++ b/org.adempiere.replication/build.properties @@ -1,4 +1,5 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ - . + .,\ + plugin.xml diff --git a/org.adempiere.replication/plugin.xml b/org.adempiere.replication/plugin.xml new file mode 100644 index 0000000000..13774d1ee0 --- /dev/null +++ b/org.adempiere.replication/plugin.xml @@ -0,0 +1,14 @@ + + + + + + + + + + From 30e89568b7e67aa722adf6b9865d0e4d22517126 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 25 Feb 2015 17:26:21 -0500 Subject: [PATCH 14/14] IDEMPIERE-2161 DiscountSchema works with every CumulativeLevel value / fix broken when AccumulationLevel is Line --- org.adempiere.base/src/org/compiere/model/MProductPricing.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MProductPricing.java b/org.adempiere.base/src/org/compiere/model/MProductPricing.java index 71ad2c4998..d309ff80ae 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductPricing.java +++ b/org.adempiere.base/src/org/compiere/model/MProductPricing.java @@ -781,7 +781,7 @@ public class MProductPricing return; MDiscountSchema sd = MDiscountSchema.get(Env.getCtx(), M_DiscountSchema_ID); // not correct - if (sd.get_ID() == 0 || (MDiscountSchema.DISCOUNTTYPE_Breaks.equals(sd.getDiscountType()) && MDiscountSchema.CUMULATIVELEVEL_Line.equals(sd.getCumulativeLevel()))) + if (sd.get_ID() == 0 || (MDiscountSchema.DISCOUNTTYPE_Breaks.equals(sd.getDiscountType()) && !MDiscountSchema.CUMULATIVELEVEL_Line.equals(sd.getCumulativeLevel()))) return; // m_discountSchema = true;