hg merge release-1.0c (merge release1 into release2)
This commit is contained in:
commit
dc63e9ce78
|
@ -1344,13 +1344,16 @@ public class MInOut extends X_M_InOut implements DocAction
|
|||
{
|
||||
if (!isReversal())
|
||||
{
|
||||
BigDecimal toDelivered = oLine.getQtyOrdered().subtract(oLine.getQtyDelivered());
|
||||
if (sLine.getMovementQty().compareTo(toDelivered) > 0)
|
||||
overReceipt = sLine.getMovementQty().subtract(toDelivered);
|
||||
if (overReceipt.signum() != 0)
|
||||
if (oLine != null)
|
||||
{
|
||||
sLine.setQtyOverReceipt(overReceipt);
|
||||
sLine.saveEx();
|
||||
BigDecimal toDelivered = oLine.getQtyOrdered().subtract(oLine.getQtyDelivered());
|
||||
if (sLine.getMovementQty().compareTo(toDelivered) > 0)
|
||||
overReceipt = sLine.getMovementQty().subtract(toDelivered);
|
||||
if (overReceipt.signum() != 0)
|
||||
{
|
||||
sLine.setQtyOverReceipt(overReceipt);
|
||||
sLine.saveEx();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.compiere.util.DisplayType;
|
|||
import org.compiere.util.Env;
|
||||
import org.compiere.util.KeyNamePair;
|
||||
import org.compiere.util.Language;
|
||||
import org.compiere.util.Msg;
|
||||
import org.compiere.util.NamePair;
|
||||
|
||||
/**
|
||||
|
@ -191,9 +192,15 @@ public class PrintDataElement implements Serializable
|
|||
{
|
||||
if (DisplayType.isNumeric(m_displayType)) {
|
||||
retValue = DisplayType.getNumberFormat(m_displayType, language, m_formatPattern).format(m_value);
|
||||
}
|
||||
else if (DisplayType.isDate(m_displayType))
|
||||
} else if (DisplayType.isDate(m_displayType)) {
|
||||
retValue = DisplayType.getDateFormat(m_displayType, language, m_formatPattern).format(m_value);
|
||||
} else if (m_value instanceof Boolean) {
|
||||
if (m_value.toString().equals("true")) {
|
||||
retValue = Msg.getMsg(Env.getCtx(), "Yes");
|
||||
} else if (m_value.toString().equals("false")) {
|
||||
retValue = Msg.getMsg(Env.getCtx(), "No");
|
||||
}
|
||||
}
|
||||
}
|
||||
return retValue;
|
||||
} // getValueDisplay
|
||||
|
|
|
@ -65,6 +65,19 @@ public class SessionContextListener implements ExecutionInit,
|
|||
Session session = exec.getDesktop().getSession();
|
||||
Properties ctx = (Properties)session.getAttribute(SESSION_CTX);
|
||||
HttpSession httpSession = (HttpSession)session.getNativeSession();
|
||||
//create empty context if there's no valid native session
|
||||
if (httpSession == null)
|
||||
{
|
||||
ctx = new Properties();
|
||||
ctx.put(ServerContextURLHandler.SERVER_CONTEXT_URL_HANDLER, new ServerContextURLHandler() {
|
||||
public void showURL(String url) {
|
||||
SessionManager.getAppDesktop().showURL(url, true);
|
||||
}
|
||||
});
|
||||
ServerContext.setCurrentInstance(ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx != null)
|
||||
{
|
||||
//verify ctx
|
||||
|
@ -283,7 +296,7 @@ public class SessionContextListener implements ExecutionInit,
|
|||
HttpSession httpSession = (HttpSession)session.getNativeSession();
|
||||
//verify ctx
|
||||
String cacheId = ctx.getProperty(SERVLET_SESSION_ID);
|
||||
if (cacheId == null || !cacheId.equals(httpSession.getId()) )
|
||||
if (cacheId == null || httpSession == null || !cacheId.equals(httpSession.getId()) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue