Merge with 351f2f8327904e8f0b154d200c77b99b141bc785

This commit is contained in:
Heng Sin Low 2012-11-27 16:56:04 +08:00
commit 9573837df2
7 changed files with 67 additions and 12 deletions

View File

@ -0,0 +1,13 @@
-- Nov 26, 2012 1:55:57 PM COT
-- IDEMPIERE-509 Problem in create new record in the window Production
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-11-26 13:55:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=228
;
-- Nov 26, 2012 1:56:13 PM COT
-- IDEMPIERE-509 Problem in create new record in the window Production
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-11-26 13:56:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=191
;
SELECT register_migration_script('201211261356_IDEMPIERE-509.sql') FROM dual
;

View File

@ -0,0 +1,13 @@
-- Nov 26, 2012 1:55:57 PM COT
-- IDEMPIERE-509 Problem in create new record in the window Production
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-11-26 13:55:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=228
;
-- Nov 26, 2012 1:56:13 PM COT
-- IDEMPIERE-509 Problem in create new record in the window Production
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-11-26 13:56:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=191
;
SELECT register_migration_script('201211261356_IDEMPIERE-509.sql') FROM dual
;

View File

@ -4,8 +4,10 @@ import java.math.BigDecimal;
import java.util.logging.Level;
import org.compiere.model.MProduction;
import org.compiere.model.MSysConfig;
import org.compiere.util.AdempiereUserError;
import org.compiere.util.DB;
import org.compiere.util.Env;
/**
@ -62,6 +64,7 @@ public class ProductionCreate extends SvrProcess {
String sql = "SELECT ABS(((cc.currentcostprice-(SELECT SUM(c.currentcostprice*bom.bomqty)"
+ " FROM m_cost c"
+ " INNER JOIN m_product_bom bom ON (c.m_product_id=bom.m_productbom_id)"
+ " INNER JOIN m_costelement ce ON (c.m_costelement_id = ce.m_costelement_id AND ce.costingmethod = 'S')"
+ " WHERE bom.m_product_id = pp.m_product_id)"
+ " )/cc.currentcostprice))"
+ " FROM m_product pp"
@ -74,7 +77,13 @@ public class ProductionCreate extends SvrProcess {
if (costPercentageDiff == null)
{
throw new AdempiereUserError("Could not retrieve costs");
costPercentageDiff = Env.ZERO;
String msg = "Could not retrieve costs";
if (MSysConfig.getBooleanValue("MFG_ValidateCostsOnCreate", false, getAD_Client_ID())) {
throw new AdempiereUserError(msg);
} else {
log.warning(msg);
}
}
if ( (costPercentageDiff.compareTo(new BigDecimal("0.005")))< 0 )
@ -88,10 +97,16 @@ public class ProductionCreate extends SvrProcess {
int created = 0;
isBom(m_production.getM_Product_ID());
if (!costsOK(m_production.getM_Product_ID()))
if (!costsOK(m_production.getM_Product_ID())) {
String msg = "Excessive difference in standard costs";
if (MSysConfig.getBooleanValue("MFG_ValidateCostsDifferenceOnCreate", false, getAD_Client_ID())) {
throw new AdempiereUserError("Excessive difference in standard costs");
} else {
log.warning(msg);
}
}
if (!recreate && "true".equalsIgnoreCase(m_production.get_ValueAsString("IsCreated")))
if (!recreate && "Y".equalsIgnoreCase(m_production.getIsCreated()))
throw new AdempiereUserError("Production already created.");
if (newQty != null )

View File

@ -926,7 +926,8 @@ public class CConnection implements Serializable, Cloneable
if (!retest && m_ds != null && m_okDB)
return null;
getDatabase().close();
if (getDatabase() != null)
getDatabase().close();
m_ds = null;
setDataSource();
// the actual test

View File

@ -21,8 +21,8 @@
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.adempiere.ui.swing.client_product"/>
<stringAttribute key="productFile" value="/org.adempiere.ui.swing-feature/swingclient.product"/>
<stringAttribute key="selected_target_plugins" value="com.springsource.javax.ejb@default:default,com.springsource.javax.jms@default:default,com.springsource.javax.mail@default:default,com.springsource.javax.management.j2ee@default:default,com.springsource.javax.transaction@default:default,com.springsource.javax.xml.rpc@default:default,com.springsource.javax.xml.soap@default:default,com.springsource.net.sf.cglib@default:default,com.springsource.org.aopalliance@default:default,com.springsource.org.apache.activemq@default:default,com.springsource.org.apache.commons.logging@default:default,com.springsource.org.apache.kahadb@default:default,com.springsource.org.apache.xmlcommons@default:default,com.springsource.slf4j.api@default:default,com.springsource.slf4j.jcl@default:false,javax.servlet@default:default,javax.xml@default:default,org.apache.ant@default:default,org.apache.commons.codec@default:default,org.apache.commons.collections@default:default,org.apache.commons.httpclient@default:default,org.apache.commons.logging@default:default,org.apache.commons.net@default:default,org.apache.poi@default:default,org.apache.xerces@default:default,org.apache.xml.resolver@default:default,org.apache.xml.serializer@default:default,org.eclipse.ant.core@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.filetransfer.httpclient.ssl@default:false,org.eclipse.ecf.provider.filetransfer.httpclient@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.ds@3:true,org.eclipse.equinox.event@3:true,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.launcher.gtk.linux.x86_64@default:false,org.eclipse.equinox.launcher@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.console@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.equinox.p2.ql@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.equinox.util@default:default,org.eclipse.osgi.services@3:true,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.junit@default:default,org.restlet.ext.net@default:true,org.restlet@default:true,org.sat4j.core@default:default,org.sat4j.pb@default:default,org.springframework.aop@default:default,org.springframework.beans@default:default,org.springframework.context@default:default,org.springframework.core@default:default"/>
<stringAttribute key="selected_workspace_plugins" value="org.adempiere.base.callout@default:default,org.adempiere.base.process@default:default,org.adempiere.base@4:true,org.adempiere.extend@default:false,org.adempiere.install@default:default,org.adempiere.payment.processor@default:default,org.adempiere.pipo.handlers@default:default,org.adempiere.pipo@default:default,org.adempiere.plugin.utils@default:default,org.adempiere.replication@default:default,org.adempiere.report.jasper.library@default:default,org.adempiere.report.jasper.swing@default:default,org.adempiere.report.jasper@default:default,org.adempiere.ui.swing@default:default,org.adempiere.ui@default:default,org.apache.ecs@default:default,org.compiere.db.oracle.provider@default:default,org.compiere.db.postgresql.provider@default:default,org.idempiere.hazelcast.service@default:true"/>
<stringAttribute key="selected_target_plugins" value="com.springsource.javax.ejb@default:default,com.springsource.javax.jms@default:default,com.springsource.javax.mail*1.4.0@default:default,com.springsource.javax.mail*1.4.5@default:default,com.springsource.javax.management.j2ee@default:default,com.springsource.javax.persistence@default:default,com.springsource.javax.transaction@default:default,com.springsource.javax.xml.rpc@default:default,com.springsource.javax.xml.soap@default:default,com.springsource.net.sf.cglib@default:default,com.springsource.org.aopalliance@default:default,com.springsource.org.apache.activemq@default:default,com.springsource.org.apache.commons.logging@default:default,com.springsource.org.apache.kahadb@default:default,com.springsource.org.apache.xmlcommons@default:default,com.springsource.slf4j.api@default:default,com.springsource.slf4j.jcl@default:false,com.springsource.slf4j.nop@default:default,javax.el@default:default,javax.servlet@default:default,javax.xml@default:default,org.apache.ant@default:default,org.apache.commons.codec@default:default,org.apache.commons.collections@default:default,org.apache.commons.httpclient@default:default,org.apache.commons.logging@default:default,org.apache.commons.net@default:default,org.apache.poi@default:default,org.apache.xerces@default:default,org.apache.xml.resolver@default:default,org.apache.xml.serializer@default:default,org.eclipse.ant.core@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.net@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.filetransfer.httpclient.ssl@default:false,org.eclipse.ecf.provider.filetransfer.httpclient@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.ds@3:true,org.eclipse.equinox.event@3:true,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.launcher.gtk.linux.x86_64@default:false,org.eclipse.equinox.launcher@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.console@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.equinox.p2.ql@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.equinox.util@default:default,org.eclipse.osgi.services@3:true,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.junit@default:default,org.restlet.ext.net@default:true,org.restlet@default:true,org.sat4j.core@default:default,org.sat4j.pb@default:default,org.springframework.aop@default:default,org.springframework.beans@default:default,org.springframework.context@default:default,org.springframework.core@default:default"/>
<stringAttribute key="selected_workspace_plugins" value="org.adempiere.base.callout@default:default,org.adempiere.base.process@default:default,org.adempiere.base@4:true,org.adempiere.extend@default:false,org.adempiere.install@default:default,org.adempiere.payment.processor@default:default,org.adempiere.pipo.handlers@default:default,org.adempiere.pipo@default:default,org.adempiere.plugin.utils@default:default,org.adempiere.replication@default:default,org.adempiere.report.jasper.font.demo@default:default,org.adempiere.report.jasper.library@default:default,org.adempiere.report.jasper.swing@default:default,org.adempiere.report.jasper@default:default,org.adempiere.ui.swing@default:default,org.adempiere.ui@default:default,org.apache.ecs@default:default,org.compiere.db.oracle.provider@default:default,org.compiere.db.postgresql.provider@default:default,org.idempiere.hazelcast.service@default:true"/>
<booleanAttribute key="show_selected_only" value="false"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>

View File

@ -17,6 +17,7 @@ import org.adempiere.webui.apps.graph.WPAPanel;
import org.adempiere.webui.util.ServerPushTemplate;
import org.zkoss.zk.au.out.AuScript;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.Page;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.util.Clients;
@ -46,14 +47,16 @@ public class DPPerformance extends DashboardPanel {
public void refresh(ServerPushTemplate template) {
super.refresh(template);
Events.echoEvent("onPostRender", this, null);
if (Executions.getCurrent() != null)
Events.echoEvent("onPostRender", this, null);
}
@Override
public void onPageAttached(Page newpage, Page oldpage) {
super.onPageAttached(newpage, oldpage);
if (newpage != null) {
Events.echoEvent("onPostRender", this, null);
if (Executions.getCurrent() != null)
Events.echoEvent("onPostRender", this, null);
}
}
@ -63,6 +66,7 @@ public class DPPerformance extends DashboardPanel {
Component grid = this.getFirstChild().getFirstChild();
String script = "setTimeout(function() { var grid = jq('#" + grid.getUuid() + "');";
script = script + "grid.parent().height(grid.css('height'));}, 500);";
Clients.response(new AuScript(script));
if (Executions.getCurrent() != null)
Clients.response(new AuScript(script));
}
}

View File

@ -36,17 +36,26 @@ public class CacheServiceImpl implements ICacheService {
*/
@Override
public <K, V> Map<K, V> getMap(String name) {
return Activator.hazelcastInstance.getMap(name);
if (Activator.hazelcastInstance != null)
return Activator.hazelcastInstance.getMap(name);
else
return null;
}
@Override
public <K> List<K> getList(String name) {
return Activator.hazelcastInstance.getList(name);
if (Activator.hazelcastInstance != null)
return Activator.hazelcastInstance.getList(name);
else
return null;
}
@Override
public <K> Set<K> getSet(String name) {
return Activator.hazelcastInstance.getSet(name);
if (Activator.hazelcastInstance != null)
return Activator.hazelcastInstance.getSet(name);
else
return null;
}
}