hg merge release-2.0 (merge release2 into development)

This commit is contained in:
Carlos Ruiz 2013-12-30 21:42:36 -05:00
commit 01b4dd7c6d
5 changed files with 35 additions and 8 deletions

View File

@ -62,6 +62,8 @@ public final class ValueNamePair extends NamePair
*/ */
public String getID() public String getID()
{ {
if("".equals(m_value))
return null;
return m_value; return m_value;
} // getID } // getID

View File

@ -47,6 +47,7 @@ import org.compiere.model.MJournalGenerator;
import org.compiere.model.MJournalGeneratorLine; import org.compiere.model.MJournalGeneratorLine;
import org.compiere.model.MJournalGeneratorSource; import org.compiere.model.MJournalGeneratorSource;
import org.compiere.model.MJournalLine; import org.compiere.model.MJournalLine;
import org.compiere.model.MPeriod;
import org.compiere.model.MProduct; import org.compiere.model.MProduct;
import org.compiere.model.MTable; import org.compiere.model.MTable;
import org.compiere.model.PO; import org.compiere.model.PO;
@ -419,6 +420,9 @@ public class GLJournalGenerate extends SvrProcess
j.setC_DocType_ID(journalGenerator.getC_DocType_ID()); j.setC_DocType_ID(journalGenerator.getC_DocType_ID());
j.setControlAmt(Env.ZERO); j.setControlAmt(Env.ZERO);
j.setDateAcct(p_DateAcct); j.setDateAcct(p_DateAcct);
int C_Period_ID = MPeriod.getC_Period_ID(getCtx(), p_DateAcct, j.getAD_Org_ID());
if (C_Period_ID > 0)
j.setC_Period_ID(C_Period_ID);
j.setDateDoc(p_DateAcct); j.setDateDoc(p_DateAcct);
j.setDescription(journalGenerator.getDescription()); j.setDescription(journalGenerator.getDescription());
j.setDocumentNo(p_DocumentNo); j.setDocumentNo(p_DocumentNo);

View File

@ -1088,7 +1088,7 @@ public final class AEnv
*/ */
public static void removeWindow (int WindowNo) public static void removeWindow (int WindowNo)
{ {
if (WindowNo < s_windows.size()) if (WindowNo>=0 && WindowNo < s_windows.size())
s_windows.set(WindowNo, null); s_windows.set(WindowNo, null);
} // removeWindow } // removeWindow

View File

@ -913,25 +913,46 @@ public final class VTreePanel extends CPanel
*/ */
private void barRemove() private void barRemove()
{ {
//the button in on a JToolBar which is on a CPanel /*
* Sidebar Hierachie:
* JXTaskPaneContainer (instance variable: bar)
* --JXTaskPane (parentPanel)
* ----JXCollapsiblePane
* ------JXCollapsiblePane$WrapperContainer
* --------JXPanel
* ----------JToolBar (parentBar)
*/
//The button in on a JToolBar
JToolBar parentBar = (JToolBar) m_buttonSelected.getParent(); JToolBar parentBar = (JToolBar) m_buttonSelected.getParent();
//Get JXTaskPane for JToolBar (we want to remove this one from the "bar" if there are no more nodes)
Container parentPanel = null; Container parentPanel = null;
if(parentBar!=null){ if(parentBar!=null){
parentPanel = parentBar.getParent(); parentPanel = parentBar.getParent().getParent().getParent().getParent();
} }
//Remove the entry from the JToolBar
for (JToolBar jt : toolbar) { for (JToolBar jt : toolbar) {
jt.remove(m_buttonSelected); jt.remove(m_buttonSelected);
} }
if(parentPanel != null && parentBar.getComponentCount()==1){ //If we found the JXTaskPane for our toolbar and the toolbar is now empty, we want to remove the whole JXTaskPane
//only label left if(parentPanel != null && parentBar.getComponentCount()==0){
//Remove JXTaskPane from JXTaskPaneContainer
bar.remove(parentPanel); bar.remove(parentPanel);
//remove from toolBarMap..
//Remove JToolBar from the toolBarMap..
toolbarMap.values().remove(parentBar); toolbarMap.values().remove(parentBar);
} }
//Recreate the Sidebar
bar.validate(); bar.validate();
bar.repaint(); bar.repaint();
//Persist the changes
barDBupdate(false, Integer.parseInt(m_buttonSelected.getActionCommand())); barDBupdate(false, Integer.parseInt(m_buttonSelected.getActionCommand()));
} // barRemove } // barRemove

View File

@ -408,7 +408,7 @@ public class Allocation
// selection of payment row // selection of payment row
if (((Boolean)payment.getValueAt(row, 0)).booleanValue()) if (((Boolean)payment.getValueAt(row, 0)).booleanValue())
{ {
applied = open; // Open Amount applied = open.signum() > 0 ? open : BigDecimal.ZERO; // Open Amount
if (totalDiff.abs().compareTo(applied.abs()) < 0 // where less is available to allocate than open if (totalDiff.abs().compareTo(applied.abs()) < 0 // where less is available to allocate than open
&& totalDiff.signum() == -applied.signum() ) // and the available amount has the opposite sign && totalDiff.signum() == -applied.signum() ) // and the available amount has the opposite sign
applied = totalDiff.negate(); // reduce the amount applied to what's available applied = totalDiff.negate(); // reduce the amount applied to what's available
@ -421,7 +421,7 @@ public class Allocation
if (col == i_payment) if (col == i_payment)
{ {
if ( applied.signum() == -open.signum() ) if ( open.signum() > 0 && applied.signum() == -open.signum() )
applied = applied.negate(); applied = applied.negate();
if (! MSysConfig.getBooleanValue("ALLOW_OVER_APPLIED_PAYMENT", false, Env.getAD_Client_ID(Env.getCtx()))) if (! MSysConfig.getBooleanValue("ALLOW_OVER_APPLIED_PAYMENT", false, Env.getAD_Client_ID(Env.getCtx())))
if ( open.abs().compareTo( applied.abs() ) < 0 ) if ( open.abs().compareTo( applied.abs() ) < 0 )