Fix * Problem saving new payment schedule on invoice

Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2904313
This commit is contained in:
Carlos Ruiz 2009-12-17 03:37:17 +00:00
parent dbd0fa1a01
commit 73b37fc7d5
2 changed files with 11 additions and 11 deletions

View File

@ -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;

View File

@ -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)