hg merge release-5.1 (merge release5.1 into default)

This commit is contained in:
Carlos Ruiz 2018-01-19 15:44:08 +01:00
commit af32053a03
29 changed files with 391 additions and 80 deletions

View File

@ -0,0 +1,10 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3589 Add a 'Warning' Message
-- Dec 29, 2017 9:22:30 AM CET
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Warning',0,0,'Y',TO_DATE('2017-12-29 09:22:30','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2017-12-29 09:22:30','YYYY-MM-DD HH24:MI:SS'),0,200442,'Warning','D','ef025d76-6391-4a0c-88c0-64d12196b53e')
;
SELECT register_migration_script('201712290930_IDEMPIERE-3589.sql') FROM dual
;

View File

@ -0,0 +1,22 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3529 Add parameters to InvoicePrint process
-- Jan 11, 2018 7:02:29 PM CET
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200222,0,0,'Y',TO_DATE('2018-01-11 19:02:28','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2018-01-11 19:02:28','YYYY-MM-DD HH24:MI:SS'),100,'Printed','Indicates if this document / line is printed','The Printed checkbox indicates if this document or line will included when printing.',200,80,17,319,'N',0,'N','IsPrinted','Y','D',399,'24d72545-9015-4b87-921d-7de97eaa5079','N')
;
-- Jan 11, 2018 7:03:51 PM CET
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,IsRange,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200223,0,0,'Y',TO_DATE('2018-01-11 19:03:50','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2018-01-11 19:03:50','YYYY-MM-DD HH24:MI:SS'),100,'Payment Rule','How you pay the invoice','The Payment Rule indicates the method of invoice payment.',200,90,200012,'N',1,'N','PaymentRule','Y','D',1143,'d7b2cef8-86cc-4a2d-91c2-ea452a71ffa3','N')
;
-- Jan 11, 2018 7:05:08 PM CET
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,IsRange,AD_Val_Rule_ID,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200224,0,0,'Y',TO_DATE('2018-01-11 19:05:07','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2018-01-11 19:05:07','YYYY-MM-DD HH24:MI:SS'),100,'Payment Term','The terms of Payment (timing, discount)','Payment Terms identify the method and timing of payment.',200,100,19,'N',52098,22,'N','C_PaymentTerm_ID','Y','D',204,'77ec6576-ac60-48b8-a072-63af04afd7b5','N')
;
-- Jan 11, 2018 7:06:08 PM CET
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200225,0,0,'Y',TO_DATE('2018-01-11 19:06:07','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2018-01-11 19:06:07','YYYY-MM-DD HH24:MI:SS'),100,'Document Status','The current status of the document','The Document Status indicates the status of a document at this time. If you want to change the document status, use the Document Action field',200,110,17,131,'N',0,'N','DocStatus','Y','D',289,'409de69f-31b2-4742-8339-7a0a30272480','N')
;
SELECT register_migration_script('201801111909_IDEMPIERE-3529.sql') FROM dual
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-3589 Add a 'Warning' Message
-- Dec 29, 2017 9:22:30 AM CET
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Warning',0,0,'Y',TO_TIMESTAMP('2017-12-29 09:22:30','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2017-12-29 09:22:30','YYYY-MM-DD HH24:MI:SS'),0,200442,'Warning','D','ef025d76-6391-4a0c-88c0-64d12196b53e')
;
SELECT register_migration_script('201712290930_IDEMPIERE-3589.sql') FROM dual
;

View File

@ -0,0 +1,19 @@
-- IDEMPIERE-3529 Add parameters to InvoicePrint process
-- Jan 11, 2018 7:02:29 PM CET
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200222,0,0,'Y',TO_TIMESTAMP('2018-01-11 19:02:28','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-01-11 19:02:28','YYYY-MM-DD HH24:MI:SS'),100,'Printed','Indicates if this document / line is printed','The Printed checkbox indicates if this document or line will included when printing.',200,80,17,319,'N',0,'N','IsPrinted','Y','D',399,'24d72545-9015-4b87-921d-7de97eaa5079','N')
;
-- Jan 11, 2018 7:03:51 PM CET
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,IsRange,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200223,0,0,'Y',TO_TIMESTAMP('2018-01-11 19:03:50','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-01-11 19:03:50','YYYY-MM-DD HH24:MI:SS'),100,'Payment Rule','How you pay the invoice','The Payment Rule indicates the method of invoice payment.',200,90,200012,'N',1,'N','PaymentRule','Y','D',1143,'d7b2cef8-86cc-4a2d-91c2-ea452a71ffa3','N')
;
-- Jan 11, 2018 7:05:08 PM CET
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,IsRange,AD_Val_Rule_ID,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200224,0,0,'Y',TO_TIMESTAMP('2018-01-11 19:05:07','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-01-11 19:05:07','YYYY-MM-DD HH24:MI:SS'),100,'Payment Term','The terms of Payment (timing, discount)','Payment Terms identify the method and timing of payment.',200,100,19,'N',52098,22,'N','C_PaymentTerm_ID','Y','D',204,'77ec6576-ac60-48b8-a072-63af04afd7b5','N')
;
-- Jan 11, 2018 7:06:08 PM CET
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200225,0,0,'Y',TO_TIMESTAMP('2018-01-11 19:06:07','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-01-11 19:06:07','YYYY-MM-DD HH24:MI:SS'),100,'Document Status','The current status of the document','The Document Status indicates the status of a document at this time. If you want to change the document status, use the Document Action field',200,110,17,131,'N',0,'N','DocStatus','Y','D',289,'409de69f-31b2-4742-8339-7a0a30272480','N')
;
SELECT register_migration_script('201801111909_IDEMPIERE-3529.sql') FROM dual
;

View File

@ -20,8 +20,8 @@
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}"/> <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}"/>
<stringAttribute key="pde.version" value="3.3"/> <stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.adempiere.server.server_product"/> <stringAttribute key="product" value="org.adempiere.server.server_product"/>
<stringAttribute key="selected_target_plugins" value="bcpkix*1.56.0@default:default,bcprov*1.56.0@default:default,com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.ibm.icu*58.2.0@default:default,com.itextpdf@default:default,com.sun.mail.javax.mail@default:default,groovy-all*2.4.8@default:default,java_cup.runtime@default:default,javax.activation@default:default,javax.annotation-api@default:default,javax.annotation@default:default,javax.ejb@default:default,javax.inject@default:default,javax.jms@default:default,javax.management.j2ee-api@default:default,javax.transaction@default:false,javax.xml.rpc@default:default,javax.xml.soap@default:default,javax.xml@default:default,joda-time*2.9.7@default:default,net.sf.supercsv.super-csv@default:default,org.apache.activemq.activemq-core@default:default,org.apache.activemq.kahadb@default:default,org.apache.ant@default:default,org.apache.bcel@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.codec@default:default,org.apache.commons.collections@default:default,org.apache.commons.logging@default:default,org.apache.commons.net@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.poi@default:default,org.apache.servicemix.bundles.cglib@default:default,org.apache.xalan@default:default,org.apache.xerces@default:default,org.apache.xml.resolver@default:default,org.apache.xml.serializer@default:default,org.cryptacular@default:default,org.eclipse.ant.core@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.util@default:default,org.eclipse.jdt.core.compiler.batch@default:default,org.eclipse.jetty.osgi-servlet-api@default:default,org.eclipse.jetty.osgi.alpn.fragment@default:false,org.eclipse.osgi.compatibility.plugins@default:false,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.junit@default:default,org.mortbay.jasper.apache-el*8.5.9@default:default,org.mortbay.jasper.apache-jsp*8.0.27@default:default,org.passay@default:default,org.restlet@default:default,org.slf4j.api@default:default,org.slf4j.jcl@default:default"/> <stringAttribute key="selected_target_plugins" value="bcpkix@default:default,bcprov@default:default,com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.ibm.icu@default:default,com.itextpdf@default:default,com.jaspersoft.studio.bundles.barbecue@default:default,com.jaspersoft.studio.bundles.poi@default:default,com.sun.mail.javax.mail@default:default,groovy-all@default:default,java_cup.runtime@default:default,javax.activation@default:default,javax.annotation-api@default:default,javax.ejb@default:default,javax.inject@default:default,javax.jms@default:default,javax.management.j2ee-api@default:default,javax.transaction@default:false,javax.xml.rpc@default:default,javax.xml.soap@default:default,javax.xml.stream@default:default,javax.xml@default:default,joda-time@default:default,net.sf.jasperreports.engine@default:default,net.sf.supercsv.super-csv@default:default,org.apache.activemq.activemq-core@default:default,org.apache.activemq.kahadb@default:default,org.apache.ant@default:default,org.apache.bcel@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.codec@default:default,org.apache.commons.collections@default:default,org.apache.commons.logging@default:default,org.apache.commons.net@default:default,org.apache.felix.scr@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.poi@default:default,org.apache.servicemix.bundles.cglib@default:default,org.apache.servicemix.bundles.xmlbeans@default:default,org.apache.xalan@default:default,org.apache.xerces@default:default,org.apache.xml.resolver@default:default,org.apache.xml.serializer@default:default,org.cryptacular@default:default,org.dom4j@default:default,org.eclipse.ant.core@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.util@default:default,org.eclipse.jdt.core.compiler.batch@default:default,org.eclipse.jetty.osgi-servlet-api@default:default,org.eclipse.jetty.osgi.alpn.fragment@default:false,org.eclipse.osgi.compatibility.plugins@default:false,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services@default:default,org.eclipse.osgi.util@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.jfree.chart-osgi@default:default,org.jfree.jcommon-osgi@default:default,org.junit@default:default,org.krysalis.barcode4j@default:default,org.mortbay.jasper.apache-el@default:default,org.passay@default:default,org.restlet@default:default,org.slf4j.api@default:default,org.slf4j.jcl@default:default"/>
<stringAttribute key="selected_workspace_plugins" value="org.adempiere.base.callout@default:default,org.adempiere.base@default:default,org.adempiere.extend@default:false,org.adempiere.install@default:default,org.adempiere.plugin.utils@default:default,org.adempiere.report.jasper.library@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.fitrecorder@default:default,org.idempiere.webservices@default:default,org.slf4j.jdk14@default:false"/> <stringAttribute key="selected_workspace_plugins" value="de.bxservice.report.fonts@default:default,org.adempiere.base.callout@default:default,org.adempiere.base@default:default,org.adempiere.extend@default:false,org.adempiere.install@default:default,org.adempiere.plugin.utils@default:default,org.adempiere.report.jasper.fonts@default:default,org.adempiere.report.jasper.library@default:false,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.fitrecorder@default:default,org.idempiere.webservices@default:default,org.slf4j.jdk14@default:false"/>
<booleanAttribute key="show_selected_only" value="false"/> <booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/> <stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
<booleanAttribute key="tracing" value="false"/> <booleanAttribute key="tracing" value="false"/>

View File

@ -833,6 +833,8 @@ public class CalloutOrder extends CalloutEngine
if (product.isStocked() && Env.getContext(ctx, WindowNo, "IsDropShip").equals("N")) if (product.isStocked() && Env.getContext(ctx, WindowNo, "IsDropShip").equals("N"))
{ {
BigDecimal QtyOrdered = (BigDecimal)mTab.getValue("QtyOrdered"); BigDecimal QtyOrdered = (BigDecimal)mTab.getValue("QtyOrdered");
if (QtyOrdered == null)
QtyOrdered = Env.ZERO;
int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID"); int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID");
int M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_AttributeSetInstance_ID"); int M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_AttributeSetInstance_ID");
BigDecimal available = MStorageReservation.getQtyAvailable BigDecimal available = MStorageReservation.getQtyAvailable
@ -1036,7 +1038,11 @@ public class CalloutOrder extends CalloutEngine
BigDecimal QtyEntered, QtyOrdered, PriceEntered, PriceActual, PriceLimit, Discount, PriceList; BigDecimal QtyEntered, QtyOrdered, PriceEntered, PriceActual, PriceLimit, Discount, PriceList;
// get values // get values
QtyEntered = (BigDecimal)mTab.getValue("QtyEntered"); QtyEntered = (BigDecimal)mTab.getValue("QtyEntered");
if (QtyEntered == null)
QtyEntered = Env.ZERO;
QtyOrdered = (BigDecimal)mTab.getValue("QtyOrdered"); QtyOrdered = (BigDecimal)mTab.getValue("QtyOrdered");
if (QtyOrdered == null)
QtyOrdered = Env.ZERO;
if (log.isLoggable(Level.FINE)) log.fine("QtyEntered=" + QtyEntered + ", Ordered=" + QtyOrdered + ", UOM=" + C_UOM_To_ID); if (log.isLoggable(Level.FINE)) log.fine("QtyEntered=" + QtyEntered + ", Ordered=" + QtyOrdered + ", UOM=" + C_UOM_To_ID);
// //
PriceEntered = (BigDecimal)mTab.getValue("PriceEntered"); PriceEntered = (BigDecimal)mTab.getValue("PriceEntered");

View File

@ -26,7 +26,6 @@ import org.compiere.model.I_AD_Role_Included;
import org.compiere.model.MRole; import org.compiere.model.MRole;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg;
/** /**
@ -76,7 +75,7 @@ public class CopyRole extends SvrProcess
protected String doIt() throws Exception protected String doIt() throws Exception
{ {
if (! MRole.getDefault().isAccessAdvanced()) { if (! MRole.getDefault().isAccessAdvanced()) {
throw new AdempiereException(Msg.getMsg(getCtx(), "CannotAccessProcess", new Object[] {getProcessInfo().getAD_Process_ID(), MRole.getDefault().getName()})); return "@Error@ @Advanced@ @Process@";
} }
if (m_AD_Role_ID_From == m_AD_Role_ID_To) if (m_AD_Role_ID_From == m_AD_Role_ID_To)

View File

@ -43,6 +43,7 @@ import org.compiere.model.DataStatusEvent;
import org.compiere.model.DataStatusListener; import org.compiere.model.DataStatusListener;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.model.GridTab; import org.compiere.model.GridTab;
import org.compiere.model.GridTable;
import org.compiere.model.GridWindow; import org.compiere.model.GridWindow;
import org.compiere.model.MImportTemplate; import org.compiere.model.MImportTemplate;
import org.compiere.model.MLookup; import org.compiere.model.MLookup;
@ -75,6 +76,7 @@ public class ImportCSVProcess extends SvrProcess implements DataStatusListener {
} }
} }
GridWindow m_gridWindow = null;
GridTab m_gridTab = null; GridTab m_gridTab = null;
List<GridTab> m_Childs = null; List<GridTab> m_Childs = null;
@ -101,15 +103,15 @@ public class ImportCSVProcess extends SvrProcess implements DataStatusListener {
if (!m_importTemplate.isAllowed(p_ImportMode, Env.getAD_Role_ID(Env.getCtx()))) if (!m_importTemplate.isAllowed(p_ImportMode, Env.getAD_Role_ID(Env.getCtx())))
throw new AdempiereException("Template/Mode not allowed for this role"); throw new AdempiereException("Template/Mode not allowed for this role");
GridWindow gWin = GridWindow.get(getCtx(), -1, l_AD_Window_ID); m_gridWindow = GridWindow.get(getCtx(), -1, l_AD_Window_ID);
Env.setContext(getCtx(), -1, "IsSOTrx", gWin.isSOTrx()); Env.setContext(getCtx(), -1, "IsSOTrx", m_gridWindow.isSOTrx());
m_Childs = new ArrayList<GridTab>(); m_Childs = new ArrayList<GridTab>();
for (int i = 0; i < gWin.getTabCount(); i++) { for (int i = 0; i < m_gridWindow.getTabCount(); i++) {
GridTab gridtab = gWin.getTab(i); GridTab gridtab = m_gridWindow.getTab(i);
if (!gridtab.isLoadComplete()) if (!gridtab.isLoadComplete())
gWin.initTab(i); m_gridWindow.initTab(i);
if (gWin.getTab(i).getAD_Tab_ID() == l_AD_Tab_ID) { if (m_gridWindow.getTab(i).getAD_Tab_ID() == l_AD_Tab_ID) {
m_gridTab = gWin.getTab(i); m_gridTab = m_gridWindow.getTab(i);
} else { } else {
if (m_gridTab != null && gridtab.getTabLevel() > m_gridTab.getTabLevel()) if (m_gridTab != null && gridtab.getTabLevel() > m_gridTab.getTabLevel())
m_Childs.add(gridtab); m_Childs.add(gridtab);
@ -119,6 +121,8 @@ public class ImportCSVProcess extends SvrProcess implements DataStatusListener {
if (m_gridTab == null) if (m_gridTab == null)
throw new Exception("No Active Tab"); throw new Exception("No Active Tab");
m_gridTab.addDataStatusListener(this); m_gridTab.addDataStatusListener(this);
for (GridTab childTab : m_Childs)
childTab.addDataStatusListener(this);
} }
protected IGridTabImporter initImporter() throws Exception { protected IGridTabImporter initImporter() throws Exception {
@ -161,23 +165,33 @@ public class ImportCSVProcess extends SvrProcess implements DataStatusListener {
public void dataStatusChanged(DataStatusEvent e) public void dataStatusChanged(DataStatusEvent e)
{ {
int col = e.getChangedColumn(); int col = e.getChangedColumn();
if (log.isLoggable(Level.CONFIG)) log.config("(" + m_gridTab + ") Col=" + col + ": " + e.toString()); if (col < 0)
return;
GridTab l_gridTab = null;
if (e.getSource() != null && e.getSource() instanceof GridTable) {
GridTable gt = (GridTable) e.getSource();
l_gridTab = m_gridWindow.getTab(gt.getTabNo());
if (l_gridTab.getAD_Table_ID() != e.AD_Table_ID)
throw new RuntimeException("Table doesn't match with updated tab");
}
if (log.isLoggable(Level.CONFIG)) log.config("(" + l_gridTab + ") Col=" + col + ": " + e.toString());
// Process Callout // Process Callout
GridField mField = m_gridTab.getField(col); GridField mField = l_gridTab.getField(col);
if (mField != null if (mField != null
&& (mField.getCallout().length() > 0 && (mField.getCallout().length() > 0
|| (Core.findCallout(m_gridTab.getTableName(), mField.getColumnName())).size()>0 || (Core.findCallout(l_gridTab.getTableName(), mField.getColumnName())).size()>0
|| m_gridTab.hasDependants(mField.getColumnName()))) || l_gridTab.hasDependants(mField.getColumnName())))
{ {
String msg = m_gridTab.processFieldChange(mField); // Dependencies & Callout String msg = l_gridTab.processFieldChange(mField); // Dependencies & Callout
if (msg.length() > 0) if (msg.length() > 0)
{ {
log.warning(msg); log.warning(msg);
} }
// Refresh the list on dependant fields // Refresh the list on dependant fields
for (GridField dependentField : m_gridTab.getDependantFields(mField.getColumnName())) for (GridField dependentField : l_gridTab.getDependantFields(mField.getColumnName()))
{ {
// if the field has a lookup // if the field has a lookup
if (dependentField != null && dependentField.getLookup() instanceof MLookup) if (dependentField != null && dependentField.getLookup() instanceof MLookup)

View File

@ -22,7 +22,7 @@ bin.includes = META-INF/,\
OSGI-INF/defaultaddressvalidationfactory.xml,\ OSGI-INF/defaultaddressvalidationfactory.xml,\
OSGI-INF/defaulttaxproviderfactory.xml,\ OSGI-INF/defaulttaxproviderfactory.xml,\
OSGI-INF/addressvalidationeventhandler.xml,\ OSGI-INF/addressvalidationeventhandler.xml,\
OSGI-INF/defaultproductpricingfactory.xml\ OSGI-INF/defaultproductpricingfactory.xml,\
schema/,\ schema/,\
bsh-2.0b6.jar,\ bsh-2.0b6.jar,\
commons-validator-1.6.jar commons-validator-1.6.jar

View File

@ -91,6 +91,9 @@ public interface IEventTopics {
public static final String PREF_AFTER_LOAD = "adempiere/pref/afterLoad"; public static final String PREF_AFTER_LOAD = "adempiere/pref/afterLoad";
/** Called after next document actions are set */
public static final String DOCACTION = "adempiere/docAction";
public static final String BROADCAST_MESSAGE = "idempiere/broadcastMsg"; public static final String BROADCAST_MESSAGE = "idempiere/broadcastMsg";
public static final String REQUEST_SEND_EMAIL = "idempiere/requestSendEMail"; public static final String REQUEST_SEND_EMAIL = "idempiere/requestSendEMail";

View File

@ -99,11 +99,10 @@ import org.compiere.util.ValueNamePair;
public class GridTable extends AbstractTableModel public class GridTable extends AbstractTableModel
implements Serializable implements Serializable
{ {
/** /**
* *
*/ */
private static final long serialVersionUID = -4982992333796276205L; private static final long serialVersionUID = -4651516342985623070L;
public static final String DATA_REFRESH_MESSAGE = "Refreshed"; public static final String DATA_REFRESH_MESSAGE = "Refreshed";
public static final String DATA_UPDATE_COPIED_MESSAGE = "UpdateCopied"; public static final String DATA_UPDATE_COPIED_MESSAGE = "UpdateCopied";
@ -3879,6 +3878,15 @@ public class GridTable extends AbstractTableModel
return tabNo; return tabNo;
} }
/**
* get Tab No
* @return Tab No
*/
public int getTabNo()
{
return m_TabNo;
}
private boolean isNotNullAndIsEmpty (Object value) { private boolean isNotNullAndIsEmpty (Object value) {
if (value != null if (value != null
&& (value instanceof String) && (value instanceof String)

View File

@ -574,7 +574,7 @@ public class MInventory extends X_M_Inventory implements DocAction
Timestamp dateMPolicy= qtyDiff.signum() > 0 ? getMovementDate() : null; Timestamp dateMPolicy= qtyDiff.signum() > 0 ? getMovementDate() : null;
if (line.getM_AttributeSetInstance_ID() > 0) if (line.getM_AttributeSetInstance_ID() > 0)
{ {
Timestamp t = MStorageOnHand.getDateMaterialPolicy(line.getM_Product_ID(), line.getM_AttributeSetInstance_ID(), line.get_TrxName()); Timestamp t = MStorageOnHand.getDateMaterialPolicy(line.getM_Product_ID(), line.getM_AttributeSetInstance_ID(), line.getM_Locator_ID(), line.get_TrxName());
if (t != null) if (t != null)
dateMPolicy = t; dateMPolicy = t;
} }

View File

@ -536,7 +536,7 @@ public class MLocation extends X_C_Location implements Comparator<Object>
if (isAddressLinesReverse()) if (isAddressLinesReverse())
{ {
// City, Region, Postal // City, Region, Postal
retStr.append(", ").append(parseCRP (getCountry())); retStr.append(parseCRP (getCountry()));
if (getAddress5() != null && getAddress5().length() > 0) if (getAddress5() != null && getAddress5().length() > 0)
retStr.append(", ").append(getAddress5()); retStr.append(", ").append(getAddress5());
if (getAddress4() != null && getAddress4().length() > 0) if (getAddress4() != null && getAddress4().length() > 0)
@ -546,7 +546,7 @@ public class MLocation extends X_C_Location implements Comparator<Object>
if (getAddress2() != null && getAddress2().length() > 0) if (getAddress2() != null && getAddress2().length() > 0)
retStr.append(", ").append(getAddress2()); retStr.append(", ").append(getAddress2());
if (getAddress1() != null) if (getAddress1() != null)
retStr.append(getAddress1()); retStr.append(", ").append(getAddress1());
} }
else else
{ {
@ -563,6 +563,7 @@ public class MLocation extends X_C_Location implements Comparator<Object>
// City, Region, Postal // City, Region, Postal
retStr.append(", ").append(parseCRP (getCountry())); retStr.append(", ").append(parseCRP (getCountry()));
// Add Country would come here // Add Country would come here
// retStr.append(", ").append(getCountry());
} }
return retStr.toString(); return retStr.toString();
} // toString } // toString

View File

@ -32,6 +32,7 @@ import org.adempiere.base.event.EventManager;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Language;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.idempiere.distributed.IMessageService; import org.idempiere.distributed.IMessageService;
import org.idempiere.distributed.ITopic; import org.idempiere.distributed.ITopic;
@ -219,8 +220,15 @@ public class MPInstance extends X_AD_PInstance
{ {
MRole role = MRole.get(getCtx(), AD_Role_ID); MRole role = MRole.get(getCtx(), AD_Role_ID);
Boolean access = role.getProcessAccess(AD_Process_ID); Boolean access = role.getProcessAccess(AD_Process_ID);
if (access == null || !access.booleanValue()) if (access == null || !access.booleanValue()) {
throw new IllegalStateException(Msg.getMsg(getCtx(), "CannotAccessProcess", new Object[] {AD_Process_ID, role.getName()})); MProcess proc = MProcess.get(getCtx(), AD_Process_ID);
StringBuilder procMsg = new StringBuilder("[");
if (! Language.isBaseLanguage (Env.getAD_Language(getCtx()))) {
procMsg.append(proc.get_Translation("Name")).append(" / ");
}
procMsg.append(proc.getName()).append("]");
throw new IllegalStateException(Msg.getMsg(getCtx(), "CannotAccessProcess", new Object[] {procMsg.toString(), role.getName()}));
}
} }
super.setAD_Process_ID (AD_Process_ID); super.setAD_Process_ID (AD_Process_ID);
} // setAD_Process_ID } // setAD_Process_ID

View File

@ -64,10 +64,12 @@ public class MRecentItem extends X_AD_RecentItem
{ {
super (ctx, AD_RecentItem_ID, trxName); super (ctx, AD_RecentItem_ID, trxName);
if (AD_RecentItem_ID > 0) { if (AD_RecentItem_ID > 0) {
synchronized (MRecentItem.class) {
Integer key = new Integer (AD_RecentItem_ID); Integer key = new Integer (AD_RecentItem_ID);
if (!s_cache.containsKey(key)) if (!s_cache.containsKey(key))
s_cache.put (key, this); s_cache.put (key, this);
} }
}
} // MRecentItem } // MRecentItem
/** /**
@ -85,8 +87,10 @@ public class MRecentItem extends X_AD_RecentItem
} catch (SQLException e) { } catch (SQLException e) {
throw new AdempiereException(e); throw new AdempiereException(e);
} }
synchronized (MRecentItem.class) {
if (key != null && !s_cache.containsKey(key)) if (key != null && !s_cache.containsKey(key))
s_cache.put (key, this); s_cache.put (key, this);
}
} // MRecentItem } // MRecentItem
/** /**
@ -95,7 +99,7 @@ public class MRecentItem extends X_AD_RecentItem
* @param AD_RecentItem_ID id * @param AD_RecentItem_ID id
* @return recent item * @return recent item
*/ */
public static MRecentItem get (Properties ctx, int AD_RecentItem_ID) public static synchronized MRecentItem get (Properties ctx, int AD_RecentItem_ID)
{ {
Integer ii = new Integer (AD_RecentItem_ID); Integer ii = new Integer (AD_RecentItem_ID);
MRecentItem ri = (MRecentItem)s_cache.get(ii); MRecentItem ri = (MRecentItem)s_cache.get(ii);
@ -111,7 +115,7 @@ public class MRecentItem extends X_AD_RecentItem
* @param Record_ID recordID * @param Record_ID recordID
* @return recent item * @return recent item
*/ */
public static MRecentItem get (Properties ctx, int AD_Table_ID, int Record_ID, int AD_User_ID) public static synchronized MRecentItem get (Properties ctx, int AD_Table_ID, int Record_ID, int AD_User_ID)
{ {
Iterator<MRecentItem> it = s_cache.values().iterator(); Iterator<MRecentItem> it = s_cache.values().iterator();
while (it.hasNext()) while (it.hasNext())
@ -262,7 +266,9 @@ public class MRecentItem extends X_AD_RecentItem
@Override @Override
public boolean delete(boolean force) { public boolean delete(boolean force) {
Integer ii = new Integer (getAD_RecentItem_ID()); Integer ii = new Integer (getAD_RecentItem_ID());
synchronized (MRecentItem.class) {
s_cache.remove(ii); s_cache.remove(ii);
}
return super.delete(force); return super.delete(force);
} }

View File

@ -3174,9 +3174,26 @@ public final class MRole extends X_AD_Role
+ "WHERE AD_Table_ID = ? " + "WHERE AD_Table_ID = ? "
+ " AND iw.IsActive = 'Y' " + " AND iw.IsActive = 'Y' "
+ " AND iwa.IsActive = 'Y' " + " AND iwa.IsActive = 'Y' "
+ " AND iwa.AD_Role_ID = ?"; + " AND (iwa.AD_Role_ID = ? OR iwa.AD_Role_ID IN"
int cnt = DB.getSQLValueEx(null, sql, I_M_Product.Table_ID, getAD_Role_ID()); + " (SELECT ri.Included_Role_ID FROM AD_Role_Included ri WHERE ri.IsActive='Y' AND ri.AD_Role_ID=?))";
int cnt = DB.getSQLValueEx(get_TrxName(), sql, I_M_Product.Table_ID, getAD_Role_ID(), getAD_Role_ID());
m_canAccess_Info_Product = new Boolean(cnt > 0); m_canAccess_Info_Product = new Boolean(cnt > 0);
// Verify if is excluded in the specific role (it can be allowed in included role and inactive in specific role)
if (m_canAccess_Info_Product) {
String sqlInactive = ""
+ "SELECT COUNT(*) "
+ "FROM AD_InfoWindow iw "
+ " JOIN AD_InfoWindow_Access iwa "
+ " ON ( iwa.AD_InfoWindow_ID = iw.AD_InfoWindow_ID ) "
+ "WHERE AD_Table_ID = ? "
+ " AND iw.IsActive = 'Y' "
+ " AND iwa.IsActive = 'N' "
+ " AND iwa.AD_Role_ID = ?";
int cntInactive = DB.getSQLValueEx(get_TrxName(), sqlInactive, I_M_Product.Table_ID, getAD_Role_ID());
if (cntInactive > 0)
m_canAccess_Info_Product = new Boolean(false);
}
} }
return m_canAccess_Info_Product.booleanValue(); return m_canAccess_Info_Product.booleanValue();
} }

View File

@ -83,6 +83,16 @@ public class Query
private int queryTimeout = 0; private int queryTimeout = 0;
private List<String> joinClauseList = new ArrayList<String>(); private List<String> joinClauseList = new ArrayList<String>();
/**
* Limit current query rows return.
*/
private int pageSize;
/**
* Number of pages will be skipped on query run.
*/
private int pagesToSkip;
/** /**
* *
* @param table * @param table
@ -753,10 +763,73 @@ public class Query
if (DB.isPostgreSQL()) if (DB.isPostgreSQL())
sql = sql + " OF " + table.getTableName(); sql = sql + " OF " + table.getTableName();
} }
if (log.isLoggable(Level.FINEST)) log.finest("TableName = "+table.getTableName()+"... SQL = " +sql); //red1 - to assist in debugging SQL
// If have pagination
if (pageSize > 0) {
sql = appendPagination(sql);
}
if (log.isLoggable(Level.FINEST))
log.finest("TableName = " + table.getTableName() + "... SQL = " + sql); // red1 - to assist in debugging SQL
return sql; return sql;
} }
/**
* Set the pagination of the query.
*
* @param pPageSize
* Limit current query rows return.
*
* @return current Query
*/
public Query setPageSize(int pPageSize) {
this.pageSize = pPageSize;
return this;
}
/**
* Set the pagination of the query.
*
* @param pPageSize
* Limit current query rows return.
*
* @param pPagesToSkip
* Number of pages will be skipped on query run. ZERO for first page
*
* @return current Query
*/
public Query setPage(int pPageSize, int pPagesToSkip) {
this.pageSize = pPageSize;
this.pagesToSkip = pPagesToSkip;
return this;
}
/**
* If top is bigger than 0 set the pagination on query
*
* @param query
* SQL String
* @param pageSize
* number
* @param skip
* number
*/
private String appendPagination(String pQuery) {
String query = pQuery;
if (pageSize > 0) {
if (DB.getDatabase().isPagingSupported()) {
query = DB.getDatabase().addPagingSQL(query, (pageSize*pagesToSkip) + 1, pageSize * (pagesToSkip+1));
} else {
throw new IllegalArgumentException("Pagination not supported by database");
}
}
return query;
}
private final ResultSet createResultSet (PreparedStatement pstmt) throws SQLException private final ResultSet createResultSet (PreparedStatement pstmt) throws SQLException
{ {
DB.setParameters(pstmt, parameters); DB.setParameters(pstmt, parameters);

View File

@ -0,0 +1,33 @@
package org.compiere.process;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicInteger;
import org.compiere.model.PO;
public class DocActionEventData {
public String docStatus;
public Object processing;
public String orderType;
public String isSOTrx;
public int AD_Table_ID;
public ArrayList<String> docAction;
public ArrayList<String> options;
public AtomicInteger indexObj;
public PO po;
public DocActionEventData(String docStatus, Object processing, String orderType, String isSOTrx,
int AD_Table_ID, ArrayList<String> docAction, ArrayList<String> options, AtomicInteger indexObj, PO po) {
this.docStatus = docStatus;
this.processing = processing;
this.orderType = orderType;
this.isSOTrx = isSOTrx;
this.AD_Table_ID = AD_Table_ID;
this.docAction = docAction;
this.options = options;
this.indexObj = indexObj;
this.po = po;
}
}

View File

@ -22,9 +22,14 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Properties; import java.util.Properties;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.base.event.EventManager;
import org.adempiere.base.event.EventProperty;
import org.adempiere.base.event.IEventTopics;
import org.adempiere.exceptions.AdempiereException; import org.adempiere.exceptions.AdempiereException;
import org.compiere.acct.Doc; import org.compiere.acct.Doc;
import org.compiere.model.MAcctSchema; import org.compiere.model.MAcctSchema;
@ -55,6 +60,7 @@ import org.eevolution.model.I_DD_Order;
import org.eevolution.model.I_HR_Process; import org.eevolution.model.I_HR_Process;
import org.eevolution.model.I_PP_Cost_Collector; import org.eevolution.model.I_PP_Cost_Collector;
import org.eevolution.model.I_PP_Order; import org.eevolution.model.I_PP_Order;
import org.osgi.service.event.Event;
/** /**
* Document Action Engine * Document Action Engine
@ -907,7 +913,7 @@ public class DocumentEngine implements DocAction
* @return Number of valid options * @return Number of valid options
*/ */
public static int getValidActions(String docStatus, Object processing, public static int getValidActions(String docStatus, Object processing,
String orderType, String isSOTrx, int AD_Table_ID, String[] docAction, String[] options, boolean periodOpen) String orderType, String isSOTrx, int AD_Table_ID, String[] docAction, String[] options, boolean periodOpen, PO po)
{ {
if (options == null) if (options == null)
throw new IllegalArgumentException("Option array parameter is null"); throw new IllegalArgumentException("Option array parameter is null");
@ -1214,6 +1220,25 @@ public class DocumentEngine implements DocAction
options[index++] = DocumentEngine.ACTION_Void; options[index++] = DocumentEngine.ACTION_Void;
} }
} }
if (po instanceof DocOptions)
index = ((DocOptions) po).customizeValidActions(docStatus, processing, orderType, isSOTrx,
AD_Table_ID, docAction, options, index);
AtomicInteger indexObj = new AtomicInteger(index);
ArrayList<String> docActionsArray = new ArrayList<String>(Arrays.asList(docAction));
ArrayList<String> optionsArray = new ArrayList<String>(Arrays.asList(options));
DocActionEventData eventData = new DocActionEventData(docStatus, processing, orderType, isSOTrx, AD_Table_ID, docActionsArray, optionsArray, indexObj, po);
Event event = EventManager.newEvent(IEventTopics.DOCACTION,
new EventProperty(EventManager.EVENT_DATA, eventData),
new EventProperty("tableName", po.get_TableName()));
EventManager.getInstance().sendEvent(event);
index = indexObj.get();
for (int i = 0; i < optionsArray.size(); i++)
options[i] = optionsArray.get(i);
for (int i = 0; i < docActionsArray.size(); i++)
docAction[i] = docActionsArray.get(i);
return index; return index;
} }

View File

@ -14,21 +14,21 @@ url.maven2.lib=http://central.maven.org
url.maven.zkoss=http://mavensync.zkoss.org url.maven.zkoss=http://mavensync.zkoss.org
url.maven.zkoss.lib=http://mavensync.zkoss.org url.maven.zkoss.lib=http://mavensync.zkoss.org
url.zkoss.osgi=${local.repository.root}/jarfile/zk-p2/zk-8.5.0/ url.zkoss.osgi=http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/zk-p2/zk-8.5.0/
url.equinox=http://download.eclipse.org/eclipse/updates/4.7 url.equinox=http://download.eclipse.org/eclipse/updates/4.7
url.jetty=http://download.eclipse.org/jetty/updates/jetty-bundles-9.x url.jetty=http://download.eclipse.org/jetty/updates/jetty-bundles-9.x
url.orbit=http://download.eclipse.org/tools/orbit/downloads/drops/R20170919201930/repository/ url.orbit=http://download.eclipse.org/tools/orbit/downloads/drops/R20170919201930/repository/
url.file.srv=${local.repository.root} url.file.srv=http://downloads.sourceforge.net/project/idempiere/binary.file
url.restlet.p2=http://p2.restlet.com/2.3 url.restlet.p2=http://p2.restlet.com/2.3
url.modify.bundle=${local.repository.root}/jarfile/modifyBundle-1.0.0 url.modify.bundle=http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/modifyBundle-1.0.0
url.file.jp.lib=${local.repository.root}/jarfile/jp-6.3.1 url.file.jp.lib=http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/jp-6.3.1
url.jp.p2=${local.repository.root}/jarfile/jp-p2/jp-6.3.1 url.jp.p2=http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/jp-p2/jp-6.3.1
url.alpn.boot=http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar url.alpn.boot=http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar

View File

@ -42,7 +42,6 @@ import org.compiere.model.MProduction;
import org.compiere.model.MTable; import org.compiere.model.MTable;
import org.compiere.model.PO; import org.compiere.model.PO;
import org.compiere.process.DocAction; import org.compiere.process.DocAction;
import org.compiere.process.DocOptions;
import org.compiere.process.DocumentEngine; import org.compiere.process.DocumentEngine;
import org.compiere.swing.CComboBox; import org.compiere.swing.CComboBox;
import org.compiere.swing.CDialog; import org.compiere.swing.CDialog;
@ -245,11 +244,7 @@ public class VDocAction extends CDialog
String[] docActionHolder = new String[] {DocAction}; String[] docActionHolder = new String[] {DocAction};
index = DocumentEngine.getValidActions(DocStatus, Processing, OrderType, IsSOTrx, m_AD_Table_ID, index = DocumentEngine.getValidActions(DocStatus, Processing, OrderType, IsSOTrx, m_AD_Table_ID,
docActionHolder, options, periodOpen); docActionHolder, options, periodOpen, po);
if (po instanceof DocOptions)
index = ((DocOptions) po).customizeValidActions(DocStatus, Processing, OrderType, IsSOTrx,
m_AD_Table_ID, docActionHolder, options, index);
Integer doctypeId = (Integer)m_mTab.getValue("C_DocType_ID"); Integer doctypeId = (Integer)m_mTab.getValue("C_DocType_ID");
if(doctypeId==null || doctypeId.intValue()==0){ if(doctypeId==null || doctypeId.intValue()==0){

View File

@ -1118,6 +1118,7 @@ public class WAcctViewer extends Window implements EventListener<Event>
table.setItemRenderer(new WListItemRenderer()); table.setItemRenderer(new WListItemRenderer());
table.setModel(listmodeltable); table.setModel(listmodeltable);
table.setSizedByContent(true);
resultPanel.invalidate(); resultPanel.invalidate();

View File

@ -484,9 +484,13 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
decimalFormat.setRoundingMode(RoundingMode.DOWN); decimalFormat.setRoundingMode(RoundingMode.DOWN);
String columnWidth = decimalFormat.format(equalWidth); String columnWidth = decimalFormat.format(equalWidth);
for (int h=0;h<numCols;h++){ for (int h=0;h<numCols+1;h++){
Column col = new Column(); Column col = new Column();
if (h == numCols) {
ZKUpdateUtil.setWidth(col, "5%");
} else {
ZKUpdateUtil.setWidth(col, columnWidth + "%"); ZKUpdateUtil.setWidth(col, columnWidth + "%");
}
columns.appendChild(col); columns.appendChild(col);
} }
@ -587,8 +591,10 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
actualxpos = 0; actualxpos = 0;
} }
// get the column span for field
int columnSpan = field.getColumnSpan();
int xpos = field.getXPosition(); int xpos = field.getXPosition();
if (xpos > numCols && diff > 0) if (xpos + columnSpan > numCols && diff > 0)
{ {
xpos = xpos - diff; xpos = xpos - diff;
if (xpos <= 0) if (xpos <= 0)
@ -613,10 +619,16 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
if (xpos-1 - actualxpos > 0) if (xpos-1 - actualxpos > 0)
row.appendCellChild(createSpacer(), xpos-1 - actualxpos); row.appendCellChild(createSpacer(), xpos-1 - actualxpos);
boolean paintLabel = ! (field.getDisplayType() == DisplayType.Button || field.getDisplayType() == DisplayType.YesNo || field.isFieldOnly()); boolean paintLabel = ! (field.getDisplayType() == DisplayType.Button || field.getDisplayType() == DisplayType.YesNo || field.isFieldOnly());
// Adjust column spam to the remain columns size
int remainCols = numCols - actualxpos;
if (columnSpan > remainCols)
columnSpan = remainCols-1 > 0 ? remainCols-1 : 1;
if (field.isHeading()) if (field.isHeading())
actualxpos = xpos; actualxpos = xpos;
else else
actualxpos = xpos + field.getColumnSpan()-1 + (paintLabel ? 1 : 0); actualxpos = xpos + columnSpan-1 + (paintLabel ? 1 : 0);
if (! field.isHeading()) { if (! field.isHeading()) {
@ -645,7 +657,8 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
div.appendChild(label.getDecorator()); div.appendChild(label.getDecorator());
row.appendCellChild(div,1); row.appendCellChild(div,1);
} }
row.appendCellChild(editor.getComponent(), field.getColumnSpan());
row.appendCellChild(editor.getComponent(), columnSpan );
//to support float/absolute editor //to support float/absolute editor
row.getLastCell().setStyle("position: relative; overflow: visible;"); row.getLastCell().setStyle("position: relative; overflow: visible;");

View File

@ -559,12 +559,17 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
} }
} }
public void updateStyle() { public void updateStyle(boolean applyDictionaryStyle) {
applyLabelStyles(); applyLabelStyles(applyDictionaryStyle);
applyFieldStyles(); applyFieldStyles(applyDictionaryStyle);
} }
protected void applyLabelStyles() { public void updateStyle() {
applyLabelStyles(true);
applyFieldStyles(true);
}
protected void applyLabelStyles(boolean applyDictionaryStyle) {
if (label != null) { if (label != null) {
boolean zoomable = isZoomable(); boolean zoomable = isZoomable();
String style = (zoomable ? STYLE_ZOOMABLE_LABEL : "") + (isMandatoryStyle() ? STYLE_EMPTY_MANDATORY_LABEL : STYLE_NORMAL_LABEL); String style = (zoomable ? STYLE_ZOOMABLE_LABEL : "") + (isMandatoryStyle() ? STYLE_EMPTY_MANDATORY_LABEL : STYLE_NORMAL_LABEL);
@ -573,7 +578,7 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
style = style + STYLE_MOBILE_ZOOMABLE; style = style + STYLE_MOBILE_ZOOMABLE;
} }
} }
if (gridField.getAD_LabelStyle_ID() > 0) if (applyDictionaryStyle && gridField.getAD_LabelStyle_ID() > 0)
{ {
String s = buildStyle(gridField.getAD_LabelStyle_ID()); String s = buildStyle(gridField.getAD_LabelStyle_ID());
if (!Util.isEmpty(s)) { if (!Util.isEmpty(s)) {
@ -593,12 +598,13 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
label.setStyle(style); label.setStyle(style);
} }
protected void applyFieldStyles() { protected void applyFieldStyles(boolean applyDictionaryStyle) {
if (gridField.getAD_FieldStyle_ID() > 0) String style = null;
if (applyDictionaryStyle && gridField.getAD_FieldStyle_ID() > 0)
{ {
String style = buildStyle(gridField.getAD_FieldStyle_ID()); style = buildStyle(gridField.getAD_FieldStyle_ID());
setFieldStyle(style);
} }
setFieldStyle(style);
} }
protected void setFieldStyle(String style) { protected void setFieldStyle(String style) {

View File

@ -2164,7 +2164,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
vqe.loadRecord (0); vqe.loadRecord (0);
final ISupportMask parent = LayoutUtils.showWindowWithMask(vqe, this, LayoutUtils.OVERLAP_TAB_PANEL); final ISupportMask parent = LayoutUtils.showWindowWithMask(vqe, this, LayoutUtils.OVERLAP_SELF);
vqe.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() { vqe.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
@Override @Override

View File

@ -46,7 +46,6 @@ import org.compiere.model.MProduction;
import org.compiere.model.MTable; import org.compiere.model.MTable;
import org.compiere.model.PO; import org.compiere.model.PO;
import org.compiere.process.DocAction; import org.compiere.process.DocAction;
import org.compiere.process.DocOptions;
import org.compiere.process.DocumentEngine; import org.compiere.process.DocumentEngine;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DB; import org.compiere.util.DB;
@ -172,15 +171,11 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
String[] docActionHolder = new String[]{DocAction}; String[] docActionHolder = new String[]{DocAction};
index = DocumentEngine.getValidActions(DocStatus, Processing, OrderType, IsSOTrx, index = DocumentEngine.getValidActions(DocStatus, Processing, OrderType, IsSOTrx,
m_AD_Table_ID, docActionHolder, options, periodOpen); m_AD_Table_ID, docActionHolder, options, periodOpen, po);
if (po instanceof DocOptions) Integer doctypeId = (Integer)gridTab.getValue("C_DocTypeTarget_ID");
index = ((DocOptions) po).customizeValidActions(DocStatus, Processing, OrderType, IsSOTrx,
m_AD_Table_ID, docActionHolder, options, index);
Integer doctypeId = (Integer)gridTab.getValue("C_DocType_ID");
if(doctypeId==null || doctypeId.intValue()==0){ if(doctypeId==null || doctypeId.intValue()==0){
doctypeId = (Integer)gridTab.getValue("C_DocTypeTarget_ID"); doctypeId = (Integer)gridTab.getValue("C_DocType_ID");
} }
if (doctypeId == null && MAllocationHdr.Table_ID == m_AD_Table_ID) { if (doctypeId == null && MAllocationHdr.Table_ID == m_AD_Table_ID) {
doctypeId = MDocType.getDocType(MDocType.DOCBASETYPE_PaymentAllocation); doctypeId = MDocType.getDocType(MDocType.DOCBASETYPE_PaymentAllocation);

View File

@ -70,6 +70,10 @@ public class InvoicePrint extends SvrProcess
protected String m_DocumentNo_To = null; protected String m_DocumentNo_To = null;
private String p_IsPaid = null; private String p_IsPaid = null;
private int m_C_DocType_ID = 0; private int m_C_DocType_ID = 0;
private String p_IsPrinted = null;
private String m_PaymentRule = null;
private int m_C_PaymentTerm_ID = 0;
private String m_DocStatus = null;
protected volatile StringBuffer sql = new StringBuffer(); protected volatile StringBuffer sql = new StringBuffer();
protected volatile List<Object> params = new ArrayList<Object>(); protected volatile List<Object> params = new ArrayList<Object>();
@ -107,6 +111,14 @@ public class InvoicePrint extends SvrProcess
p_IsPaid = (String)para[i].getParameter(); p_IsPaid = (String)para[i].getParameter();
else if (name.equals("C_DocType_ID")) else if (name.equals("C_DocType_ID"))
m_C_DocType_ID = para[i].getParameterAsInt(); m_C_DocType_ID = para[i].getParameterAsInt();
else if (name.equals("IsPrinted"))
p_IsPrinted = (String)para[i].getParameter();
else if (name.equals("PaymentRule"))
m_PaymentRule = (String)para[i].getParameter();
else if (name.equals("C_PaymentTerm_ID"))
m_C_PaymentTerm_ID = para[i].getParameterAsInt();
else if (name.equals("DocStatus"))
m_DocStatus = (String)para[i].getParameter();
else else
log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name); log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name);
} }
@ -132,7 +144,11 @@ public class InvoicePrint extends SvrProcess
+ ", DateInvoiced=" + m_dateInvoiced_From + "-" + m_dateInvoiced_To + ", DateInvoiced=" + m_dateInvoiced_From + "-" + m_dateInvoiced_To
+ ", DocumentNo=" + m_DocumentNo_From + "-" + m_DocumentNo_To + ", DocumentNo=" + m_DocumentNo_From + "-" + m_DocumentNo_To
+ ", IsPaid=" + p_IsPaid + ", IsPaid=" + p_IsPaid
+ ", C_DocType_ID=" + m_C_DocType_ID); + ", C_DocType_ID=" + m_C_DocType_ID
+ ", IsPrinted=" + p_IsPrinted
+ ", PaymentRule=" + m_PaymentRule
+ ", C_PaymentTerm_ID=" + m_C_PaymentTerm_ID
+ ", DocStatus=" + m_DocStatus);
MMailText mText = null; MMailText mText = null;
if (p_R_MailText_ID != 0) if (p_R_MailText_ID != 0)
@ -144,7 +160,8 @@ public class InvoicePrint extends SvrProcess
// Too broad selection // Too broad selection
if (m_C_BPartner_ID == 0 && m_C_Invoice_ID == 0 && m_dateInvoiced_From == null && m_dateInvoiced_To == null if (m_C_BPartner_ID == 0 && m_C_Invoice_ID == 0 && m_dateInvoiced_From == null && m_dateInvoiced_To == null
&& m_DocumentNo_From == null && m_DocumentNo_To == null) && m_DocumentNo_From == null && m_DocumentNo_To == null && m_PaymentRule == null && m_C_PaymentTerm_ID == 0
&& m_DocStatus == null)
throw new AdempiereUserError ("@RestrictSelection@"); throw new AdempiereUserError ("@RestrictSelection@");
MClient client = MClient.get(getCtx()); MClient client = MClient.get(getCtx());
@ -395,6 +412,26 @@ public class InvoicePrint extends SvrProcess
sql.append (" AND i.C_DocTypeTarget_ID=?"); sql.append (" AND i.C_DocTypeTarget_ID=?");
params.add(m_C_DocType_ID); params.add(m_C_DocType_ID);
} }
if (p_IsPrinted != null && p_IsPrinted.length() == 1)
{
sql.append (" AND i.IsPrinted=?");
params.add(p_IsPrinted);
}
if (m_PaymentRule != null)
{
sql.append (" AND i.PaymentRule=?");
params.add(m_PaymentRule);
}
if (m_C_PaymentTerm_ID != 0)
{
sql.append (" AND i.C_PaymentTerm_ID=?");
params.add(m_C_PaymentTerm_ID);
}
if (m_DocStatus != null)
{
sql.append (" AND i.DocStatus=?");
params.add(m_DocStatus);
}
} }
String orgWhere = MRole.getDefault(getCtx(), false).getOrgWhere(MRole.SQL_RO); String orgWhere = MRole.getDefault(getCtx(), false).getOrgWhere(MRole.SQL_RO);
if (!Util.isEmpty(orgWhere, true)) { if (!Util.isEmpty(orgWhere, true)) {

View File

@ -1104,6 +1104,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
editor.setMandatory(false); editor.setMandatory(false);
editor.setReadWrite(true); editor.setReadWrite(true);
editor.dynamicDisplay(); editor.dynamicDisplay();
editor.updateStyle(false);
editor.addValueChangeListener(this); editor.addValueChangeListener(this);
Label label = editor.getLabel(); Label label = editor.getLabel();
Component fieldEditor = editor.getComponent(); Component fieldEditor = editor.getComponent();
@ -1122,6 +1123,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
editorTo.setMandatory(false); editorTo.setMandatory(false);
editorTo.setReadWrite(true); editorTo.setReadWrite(true);
editorTo.dynamicDisplay(); editorTo.dynamicDisplay();
editorTo.updateStyle(false);
editorTo.addValueChangeListener(this); editorTo.addValueChangeListener(this);
// //
if (displayLength > 0) // set it back if (displayLength > 0) // set it back
@ -1157,6 +1159,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
m_sEditorsFlag.add(null); m_sEditorsFlag.add(null);
m_sEditorsTo.add(null); m_sEditorsTo.add(null);
editor.fillHorizontal(); editor.fillHorizontal();
editor.updateStyle(false);
} }
panel.appendChild(new Space()); panel.appendChild(new Space());
if (group != null) if (group != null)
@ -2021,6 +2024,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
editor.setReadWrite(enabled); editor.setReadWrite(enabled);
editor.setVisible(enabled); editor.setVisible(enabled);
editor.dynamicDisplay(); editor.dynamicDisplay();
editor.updateStyle(false);
if (editor instanceof WPaymentEditor) { if (editor instanceof WPaymentEditor) {
((WPaymentEditor)editor).getComponent().setEnabled(true, false); ((WPaymentEditor)editor).getComponent().setEnabled(true, false);
} }

View File

@ -663,6 +663,7 @@ public class DB_Oracle implements AdempiereDatabase
boolean testConnectionOnCheckout = getBooleanProperty(poolProperties, "TestConnectionOnCheckout", false); boolean testConnectionOnCheckout = getBooleanProperty(poolProperties, "TestConnectionOnCheckout", false);
String mlogClass = getStringProperty(poolProperties, "com.mchange.v2.log.MLog", "com.mchange.v2.log.FallbackMLog"); String mlogClass = getStringProperty(poolProperties, "com.mchange.v2.log.MLog", "com.mchange.v2.log.FallbackMLog");
int checkoutTimeout = getIntProperty(poolProperties, "CheckoutTimeout", 0); int checkoutTimeout = getIntProperty(poolProperties, "CheckoutTimeout", 0);
int statementCacheNumDeferredCloseThreads = getIntProperty(poolProperties, "StatementCacheNumDeferredCloseThreads", 1);
try try
{ {
System.setProperty("com.mchange.v2.log.MLog", mlogClass); System.setProperty("com.mchange.v2.log.MLog", mlogClass);
@ -681,7 +682,7 @@ public class DB_Oracle implements AdempiereDatabase
cpds.setTestConnectionOnCheckout(testConnectionOnCheckout); cpds.setTestConnectionOnCheckout(testConnectionOnCheckout);
if (checkoutTimeout > 0) if (checkoutTimeout > 0)
cpds.setCheckoutTimeout(checkoutTimeout); cpds.setCheckoutTimeout(checkoutTimeout);
cpds.setStatementCacheNumDeferredCloseThreads(statementCacheNumDeferredCloseThreads);
cpds.setMaxIdleTimeExcessConnections(maxIdleTimeExcessConnections); cpds.setMaxIdleTimeExcessConnections(maxIdleTimeExcessConnections);
cpds.setMaxIdleTime(maxIdleTime); cpds.setMaxIdleTime(maxIdleTime);
if (Ini.isClient()) if (Ini.isClient())
@ -1287,12 +1288,20 @@ public class DB_Oracle implements AdempiereDatabase
} }
public String addPagingSQL(String sql, int start, int end) { public String addPagingSQL(String sql, int start, int end) {
//not supported, too many corner case that doesn't work using rownum. to investigate later StringBuilder newSql = new StringBuilder("select * from (")
return sql; .append(" select tb.*, ROWNUM oracle_native_rownum_ from (")
.append(sql)
.append(") tb) where oracle_native_rownum_ >= ")
.append(start)
.append(" AND oracle_native_rownum_ <= ")
.append(end)
.append(" order by oracle_native_rownum_");
return newSql.toString();
} }
public boolean isPagingSupported() { public boolean isPagingSupported() {
return false; return true;
} }
private int getIntProperty(Properties properties, String key, int defaultValue) private int getIntProperty(Properties properties, String key, int defaultValue)