From 73b37fc7d59604694236daf23b0188651bf59df7 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 17 Dec 2009 03:37:17 +0000 Subject: [PATCH] Fix * Problem saving new payment schedule on invoice Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2904313 --- base/src/org/compiere/model/GridTab.java | 13 +++++-------- base/src/org/compiere/model/MPaymentTerm.java | 9 ++++++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/base/src/org/compiere/model/GridTab.java b/base/src/org/compiere/model/GridTab.java index 998db567ba..4045c8464a 100644 --- a/base/src/org/compiere/model/GridTab.java +++ b/base/src/org/compiere/model/GridTab.java @@ -99,11 +99,10 @@ import org.compiere.util.ValueNamePair; */ public class GridTab implements DataStatusListener, Evaluatee, Serializable { - /** * */ - private static final long serialVersionUID = 7198494041906579986L; + private static final long serialVersionUID = -8762357519103152929L; public static final String DEFAULT_STATUS_MESSAGE = "NavigateOrUpdate"; @@ -947,8 +946,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable fireStateChangeEvent(new StateChangeEvent(this, StateChangeEvent.DATA_SAVE)); if (retValue) { - // refresh parent tabs with the same table - refreshParentsSameTable(); + // refresh parent tabs + refreshParents(); } return retValue; @@ -999,7 +998,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return false; } - private void refreshParentsSameTable() { + private void refreshParents() { if (isDetail()) { // get parent tab // the parent tab is the first tab above with level = this_tab_level-1 @@ -1007,9 +1006,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable for (int i = m_window.getTabIndex(this) - 1; i >= 0; i--) { GridTab parentTab = m_window.getTab(i); if (parentTab.m_vo.TabLevel == level-1) { - if (parentTab.getAD_Table_ID() == getAD_Table_ID()) { - parentTab.dataRefresh(); - } + parentTab.dataRefresh(); // search for the next parent if (parentTab.isDetail()) { level = parentTab.m_vo.TabLevel; diff --git a/base/src/org/compiere/model/MPaymentTerm.java b/base/src/org/compiere/model/MPaymentTerm.java index e01b837762..035888b216 100644 --- a/base/src/org/compiere/model/MPaymentTerm.java +++ b/base/src/org/compiere/model/MPaymentTerm.java @@ -141,12 +141,14 @@ public class MPaymentTerm extends X_C_PaymentTerm getSchedule(true); if (m_schedule.length == 0) { - setIsValid(true); + if (! isValid()) + setIsValid(true); return "@OK@"; } if (m_schedule.length == 1) { - setIsValid(false); + if (isValid()) + setIsValid(false); if (m_schedule[0].isValid()) { m_schedule[0].setIsValid(false); @@ -164,7 +166,8 @@ public class MPaymentTerm extends X_C_PaymentTerm total = total.add(percent); } boolean valid = total.compareTo(HUNDRED) == 0; - setIsValid (valid); + if (isValid() != valid) + setIsValid (valid); for (int i = 0; i < m_schedule.length; i++) { if (m_schedule[i].isValid() != valid)