hg merge release-2.0 (merge release2 into development)
This commit is contained in:
commit
dd784a0dad
|
@ -129,7 +129,7 @@ public abstract class Doc
|
||||||
* M_Requisition POR
|
* M_Requisition POR
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
private static final String DOC_TYPE_BY_DOC_BASE_TYPE_SQL = "SELECT C_DocType_ID FROM C_DocType WHERE AD_Client_ID=? AND DocBaseType=? AND IsActive='Y'";
|
private static final String DOC_TYPE_BY_DOC_BASE_TYPE_SQL = "SELECT C_DocType_ID FROM C_DocType WHERE AD_Client_ID=? AND DocBaseType=? AND IsActive='Y' ORDER BY IsDefault DESC, C_DocType_ID";
|
||||||
|
|
||||||
/** AR Invoices - ARI */
|
/** AR Invoices - ARI */
|
||||||
public static final String DOCTYPE_ARInvoice = MDocType.DOCBASETYPE_ARInvoice;
|
public static final String DOCTYPE_ARInvoice = MDocType.DOCBASETYPE_ARInvoice;
|
||||||
|
|
|
@ -1722,15 +1722,23 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
BigDecimal difference = target
|
BigDecimal difference = target
|
||||||
.subtract(line.getQtyReserved())
|
.subtract(line.getQtyReserved())
|
||||||
.subtract(line.getQtyDelivered());
|
.subtract(line.getQtyDelivered());
|
||||||
if (difference.signum() <= 0)
|
|
||||||
|
if (difference.signum() == 0 || line.getQtyOrdered().signum() < 0)
|
||||||
{
|
{
|
||||||
MProduct product = line.getProduct();
|
if (difference.signum() == 0 || line.getQtyReserved().signum() == 0)
|
||||||
if (product != null)
|
|
||||||
{
|
{
|
||||||
Volume = Volume.add(product.getVolume().multiply(line.getQtyOrdered()));
|
MProduct product = line.getProduct();
|
||||||
Weight = Weight.add(product.getWeight().multiply(line.getQtyOrdered()));
|
if (product != null)
|
||||||
|
{
|
||||||
|
Volume = Volume.add(product.getVolume().multiply(line.getQtyOrdered()));
|
||||||
|
Weight = Weight.add(product.getWeight().multiply(line.getQtyOrdered()));
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (line.getQtyOrdered().signum() < 0 && line.getQtyReserved().signum() > 0)
|
||||||
|
{
|
||||||
|
difference = line.getQtyReserved().negate();
|
||||||
}
|
}
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Line=" + line.getLine()
|
if (log.isLoggable(Level.FINE)) log.fine("Line=" + line.getLine()
|
||||||
|
|
|
@ -2368,9 +2368,10 @@ public final class MRole extends X_AD_Role
|
||||||
// NOT IN (x)
|
// NOT IN (x)
|
||||||
if (m_recordAccess[i].isExclude())
|
if (m_recordAccess[i].isExclude())
|
||||||
{
|
{
|
||||||
if (sbExclude.length() == 0)
|
if (sbExclude.length() == 0){
|
||||||
sbExclude.append(keyColumnName)
|
sbExclude.append("(").append(keyColumnName).append(" IS NULL OR ");
|
||||||
.append(" NOT IN (");
|
sbExclude.append(keyColumnName).append(" NOT IN (");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
sbExclude.append(",");
|
sbExclude.append(",");
|
||||||
sbExclude.append(m_recordAccess[i].getRecord_ID());
|
sbExclude.append(m_recordAccess[i].getRecord_ID());
|
||||||
|
@ -2390,7 +2391,7 @@ public final class MRole extends X_AD_Role
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
if (sbExclude.length() > 0)
|
if (sbExclude.length() > 0)
|
||||||
sb.append(sbExclude).append(")");
|
sb.append(sbExclude).append("))");
|
||||||
if (sbInclude.length() > 0)
|
if (sbInclude.length() > 0)
|
||||||
{
|
{
|
||||||
if (sb.length() > 0)
|
if (sb.length() > 0)
|
||||||
|
|
|
@ -292,27 +292,40 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
|
||||||
|
|
||||||
if (Account_ID != 0)
|
if (Account_ID != 0)
|
||||||
m_Account_ID = Account_ID;
|
m_Account_ID = Account_ID;
|
||||||
|
else
|
||||||
|
m_Account_ID = 0;
|
||||||
|
|
||||||
if(fieldOrg.getValue()!=null)
|
if(fieldOrg.getValue()!=null)
|
||||||
m_AD_Org_ID = (Integer)fieldOrg.getValue();
|
m_AD_Org_ID = (Integer)fieldOrg.getValue();
|
||||||
|
else
|
||||||
|
m_AD_Org_ID = 0;
|
||||||
|
|
||||||
if(fieldAcctSchema.getValue()!=null)
|
if(fieldAcctSchema.getValue()!=null)
|
||||||
m_C_AcctSchema_ID = (Integer)fieldAcctSchema.getValue();
|
m_C_AcctSchema_ID = (Integer)fieldAcctSchema.getValue();
|
||||||
|
else
|
||||||
|
m_C_AcctSchema_ID = 0;
|
||||||
|
|
||||||
m_isReconciled = isReconciled.isChecked();
|
m_isReconciled = isReconciled.isChecked();
|
||||||
|
|
||||||
if(fieldBPartner.getValue()!=null)
|
if(fieldBPartner.getValue()!=null)
|
||||||
m_C_BPartner_ID = (Integer)fieldBPartner.getValue();
|
m_C_BPartner_ID = (Integer)fieldBPartner.getValue();
|
||||||
|
else
|
||||||
|
m_C_BPartner_ID = 0;
|
||||||
|
|
||||||
if((Integer)fieldProduct.getValue()!=null)
|
if((Integer)fieldProduct.getValue()!=null)
|
||||||
m_M_Product_ID = (Integer)fieldProduct.getValue();
|
m_M_Product_ID = (Integer)fieldProduct.getValue();
|
||||||
|
else
|
||||||
|
m_M_Product_ID = 0;
|
||||||
|
|
||||||
if(fieldDateAcct.getValue()!=null)
|
if(fieldDateAcct.getValue()!=null)
|
||||||
m_DateAcct = (Timestamp)fieldDateAcct.getValue();
|
m_DateAcct = (Timestamp)fieldDateAcct.getValue();
|
||||||
|
else
|
||||||
|
m_DateAcct = null;
|
||||||
|
|
||||||
if(fieldDateAcct2.getValue()!=null)
|
if(fieldDateAcct2.getValue()!=null)
|
||||||
m_DateAcct2 = (Timestamp)fieldDateAcct2.getValue();
|
m_DateAcct2 = (Timestamp)fieldDateAcct2.getValue();
|
||||||
|
else
|
||||||
|
m_DateAcct2 = null;
|
||||||
// Set Model
|
// Set Model
|
||||||
Vector<Vector<Object>> data = getData();
|
Vector<Vector<Object>> data = getData();
|
||||||
Vector<String> columnNames = getColumnNames();
|
Vector<String> columnNames = getColumnNames();
|
||||||
|
|
|
@ -483,7 +483,7 @@ public class WGraph extends Div implements IdSpace {
|
||||||
Br br = new Br();
|
Br br = new Br();
|
||||||
td.appendChild(br);
|
td.appendChild(br);
|
||||||
text = new Text(stripHtml(m_goal.getColorSchema()
|
text = new Text(stripHtml(m_goal.getColorSchema()
|
||||||
.getDescription(), true));
|
.getDescription(), false));
|
||||||
td.appendChild(text);
|
td.appendChild(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,7 @@ import org.zkoss.zk.ui.Page;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zk.ui.event.EventListener;
|
import org.zkoss.zk.ui.event.EventListener;
|
||||||
import org.zkoss.zk.ui.event.Events;
|
import org.zkoss.zk.ui.event.Events;
|
||||||
|
import org.zkoss.zk.ui.event.MouseEvent;
|
||||||
import org.zkoss.zk.ui.event.SelectEvent;
|
import org.zkoss.zk.ui.event.SelectEvent;
|
||||||
import org.zkoss.zk.ui.util.Clients;
|
import org.zkoss.zk.ui.util.Clients;
|
||||||
import org.zkoss.zul.Comboitem;
|
import org.zkoss.zul.Comboitem;
|
||||||
|
@ -1250,6 +1251,9 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
||||||
}
|
}
|
||||||
else if (event.getTarget() == contentPanel && event.getName().equals(Events.ON_DOUBLE_CLICK))
|
else if (event.getTarget() == contentPanel && event.getName().equals(Events.ON_DOUBLE_CLICK))
|
||||||
{
|
{
|
||||||
|
if (event.getClass().equals(MouseEvent.class)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (contentPanel.isMultiple()) {
|
if (contentPanel.isMultiple()) {
|
||||||
if (m_lastOnSelectItem != null)
|
if (m_lastOnSelectItem != null)
|
||||||
contentPanel.setSelectedItem(m_lastOnSelectItem);
|
contentPanel.setSelectedItem(m_lastOnSelectItem);
|
||||||
|
|
|
@ -15,7 +15,6 @@ import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.text.DecimalFormat;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
@ -38,8 +37,6 @@ import org.compiere.util.Login;
|
||||||
public class CompiereService {
|
public class CompiereService {
|
||||||
|
|
||||||
private static CLogger log = CLogger.getCLogger(CompiereService.class);
|
private static CLogger log = CLogger.getCLogger(CompiereService.class);
|
||||||
|
|
||||||
public final static String datePattern = "dd-MM-yyyy";
|
|
||||||
|
|
||||||
private Properties m_ctx;
|
private Properties m_ctx;
|
||||||
|
|
||||||
|
@ -56,32 +53,17 @@ public class CompiereService {
|
||||||
|
|
||||||
/** Localized Date format */
|
/** Localized Date format */
|
||||||
public SimpleDateFormat dateFormat = null;
|
public SimpleDateFormat dateFormat = null;
|
||||||
|
/** JDBC Date format */
|
||||||
|
public SimpleDateFormat dateFormatJDBC = null;
|
||||||
/** Localized Timestamp format */
|
/** Localized Timestamp format */
|
||||||
public SimpleDateFormat dateTimeFormat = null;
|
public SimpleDateFormat dateTimeFormat = null;
|
||||||
|
/** JDBC Timestamp format */
|
||||||
|
public SimpleDateFormat dateTimeFormatJDBC = null;
|
||||||
|
/** Localized Time format */
|
||||||
|
public SimpleDateFormat timeFormat = null;
|
||||||
|
/** JDBC Time format */
|
||||||
|
public SimpleDateFormat timeFormatJDBC = null;
|
||||||
|
|
||||||
/** Localized Amount format */
|
|
||||||
public DecimalFormat amountFormat = null;
|
|
||||||
/** Localized Integer format */
|
|
||||||
public DecimalFormat integerFormat = null;
|
|
||||||
/** Localized Number format */
|
|
||||||
public DecimalFormat numberFormat = null;
|
|
||||||
/** Localized Quantity format */
|
|
||||||
public DecimalFormat quantityFormat = null;
|
|
||||||
|
|
||||||
/** Localized Date format */
|
|
||||||
public SimpleDateFormat modelDateFormat = null;
|
|
||||||
/** Localized Timestamp format */
|
|
||||||
public SimpleDateFormat modelDateTimeFormat = null;
|
|
||||||
|
|
||||||
/** Localized Amount format */
|
|
||||||
public DecimalFormat modelAmountFormat = null;
|
|
||||||
/** Localized Integer format */
|
|
||||||
public DecimalFormat modelIntegerFormat = null;
|
|
||||||
/** Localized Number format */
|
|
||||||
public DecimalFormat modelNumberFormat = null;
|
|
||||||
/** Localized Quantity format */
|
|
||||||
public DecimalFormat modelQuantityFormat = null;
|
|
||||||
|
|
||||||
private Language m_language;
|
private Language m_language;
|
||||||
|
|
||||||
public final String dateFormatOnlyForCtx = "yyyy-MM-dd";
|
public final String dateFormatOnlyForCtx = "yyyy-MM-dd";
|
||||||
|
@ -137,17 +119,12 @@ public class CompiereService {
|
||||||
Env.setContext( m_ctx, "#AD_Language", "en_US" );
|
Env.setContext( m_ctx, "#AD_Language", "en_US" );
|
||||||
m_language = Language.getLanguage("en_US");
|
m_language = Language.getLanguage("en_US");
|
||||||
|
|
||||||
// These variables are needed for ADClient.exe
|
dateFormat = DisplayType.getDateFormat(DisplayType.Date, m_language);
|
||||||
Language m_lang2 = Language.getLanguage("pl_PL");
|
dateTimeFormat = DisplayType.getDateFormat(DisplayType.DateTime, m_language);
|
||||||
|
timeFormat = DisplayType.getDateFormat(DisplayType.Time, m_language);
|
||||||
|
dateFormatJDBC = DisplayType.getDateFormat_JDBC();
|
||||||
dateFormat = new SimpleDateFormat( datePattern );
|
dateTimeFormatJDBC = DisplayType.getTimestampFormat_Default();
|
||||||
dateTimeFormat = new SimpleDateFormat( datePattern );
|
timeFormatJDBC = DisplayType.getTimeFormat_Default();
|
||||||
|
|
||||||
amountFormat = DisplayType.getNumberFormat(DisplayType.Amount, m_lang2);
|
|
||||||
integerFormat = DisplayType.getNumberFormat(DisplayType.Integer, m_lang2);
|
|
||||||
numberFormat = DisplayType.getNumberFormat(DisplayType.Number, m_lang2);
|
|
||||||
quantityFormat = DisplayType.getNumberFormat(DisplayType.Quantity, m_lang2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,14 +256,13 @@ public class CompiereService {
|
||||||
Env.setContext( m_ctx, "#AD_Language", Lang);
|
Env.setContext( m_ctx, "#AD_Language", Lang);
|
||||||
m_language = Language.getLanguage(Lang);
|
m_language = Language.getLanguage(Lang);
|
||||||
Env.verifyLanguage( getCtx(), m_language );
|
Env.verifyLanguage( getCtx(), m_language );
|
||||||
|
|
||||||
modelDateFormat = new SimpleDateFormat( datePattern );
|
dateFormat = DisplayType.getDateFormat(DisplayType.Date, m_language);
|
||||||
modelDateTimeFormat = new SimpleDateFormat( datePattern );
|
dateTimeFormat = DisplayType.getDateFormat(DisplayType.DateTime, m_language);
|
||||||
|
timeFormat = DisplayType.getDateFormat(DisplayType.Time, m_language);
|
||||||
modelAmountFormat = DisplayType.getNumberFormat(DisplayType.Amount, m_language);
|
dateFormatJDBC = DisplayType.getDateFormat_JDBC();
|
||||||
modelIntegerFormat = DisplayType.getNumberFormat(DisplayType.Integer, m_language);
|
dateTimeFormatJDBC = DisplayType.getTimestampFormat_Default();
|
||||||
modelNumberFormat = DisplayType.getNumberFormat(DisplayType.Number, m_language);
|
timeFormatJDBC = DisplayType.getTimeFormat_Default();
|
||||||
modelQuantityFormat = DisplayType.getNumberFormat(DisplayType.Quantity, m_language);
|
|
||||||
|
|
||||||
// Set Date
|
// Set Date
|
||||||
Timestamp ts = new Timestamp(System.currentTimeMillis());
|
Timestamp ts = new Timestamp(System.currentTimeMillis());
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream;
|
||||||
import java.io.CharArrayWriter;
|
import java.io.CharArrayWriter;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
import java.text.ParseException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
@ -545,35 +546,50 @@ public class Process {
|
||||||
else if (DisplayType.isDate(displayType))
|
else if (DisplayType.isDate(displayType))
|
||||||
{
|
{
|
||||||
java.util.Date d;
|
java.util.Date d;
|
||||||
if (displayType == DisplayType.DateTime)
|
if (value.toString().length() > 0) {
|
||||||
d = m_cs.dateTimeFormat.parse(value.toString());
|
if (displayType == DisplayType.DateTime) {
|
||||||
|
try {
|
||||||
else
|
d = m_cs.dateTimeFormatJDBC.parse(value.toString());
|
||||||
d = m_cs.dateFormat.parse(value.toString());
|
} catch (ParseException e) {
|
||||||
|
d = m_cs.dateTimeFormat.parse(value.toString());
|
||||||
Timestamp ts = null;
|
}
|
||||||
ts = new Timestamp(d.getTime());
|
} else if (displayType == DisplayType.Time) {
|
||||||
iPara.setP_Date(ts);
|
try {
|
||||||
|
d = m_cs.timeFormatJDBC.parse(value.toString());
|
||||||
if (pPara.isRange())
|
} catch (ParseException e) {
|
||||||
{
|
d = m_cs.timeFormat.parse(value.toString());
|
||||||
if (displayType == DisplayType.DateTime)
|
}
|
||||||
d = m_cs.dateTimeFormat.parse(valueString2);
|
} else {
|
||||||
else
|
try {
|
||||||
{
|
d = m_cs.dateFormatJDBC.parse(value.toString());
|
||||||
if (valueString2 == null || valueString2.length() == 0)
|
} catch (ParseException e) {
|
||||||
d = new java.util.Date();
|
d = m_cs.dateFormat.parse(value.toString());
|
||||||
else
|
}
|
||||||
d = m_cs.dateFormat.parse(valueString2);
|
}
|
||||||
|
|
||||||
|
Timestamp ts = new Timestamp(d.getTime());
|
||||||
|
iPara.setP_Date(ts);
|
||||||
|
if (log.isLoggable(Level.FINE)) log.fine("fillParameter - " + key
|
||||||
|
+ " = " + valueString + " (=" + ts + "=)");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pPara.isRange())
|
||||||
|
{
|
||||||
|
if (valueString2 != null && valueString2.length() > 0) {
|
||||||
|
if (displayType == DisplayType.DateTime)
|
||||||
|
d = m_cs.dateTimeFormat.parse(valueString2.toString());
|
||||||
|
else if (displayType == DisplayType.Time)
|
||||||
|
d = m_cs.timeFormat.parse(valueString2.toString());
|
||||||
|
else
|
||||||
|
d = m_cs.dateFormat.parse(valueString2.toString());
|
||||||
|
|
||||||
|
Timestamp ts = new Timestamp(d.getTime());
|
||||||
|
iPara.setP_Date_To(ts);
|
||||||
|
if (log.isLoggable(Level.FINE)) log.fine("fillParameterTo - " + key
|
||||||
|
+ " = " + valueString + " (=" + ts + "=)");
|
||||||
}
|
}
|
||||||
|
|
||||||
ts = new Timestamp(d.getTime());
|
|
||||||
iPara.setP_Date_To(ts );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("fillParameter - " + key
|
|
||||||
+ " = " + valueString + " (=" + ts + "=)");
|
|
||||||
}
|
}
|
||||||
else if (DisplayType.YesNo == pPara.getAD_Reference_ID())
|
else if (DisplayType.YesNo == pPara.getAD_Reference_ID())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue