diff --git a/migration/i5.1/oracle/201712290930_IDEMPIERE-3589.sql b/migration/i5.1/oracle/201712290930_IDEMPIERE-3589.sql
new file mode 100644
index 0000000000..50addd5031
--- /dev/null
+++ b/migration/i5.1/oracle/201712290930_IDEMPIERE-3589.sql
@@ -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
+;
\ No newline at end of file
diff --git a/migration/i5.1/oracle/201801111909_IDEMPIERE-3529.sql b/migration/i5.1/oracle/201801111909_IDEMPIERE-3529.sql
new file mode 100644
index 0000000000..623bdedebf
--- /dev/null
+++ b/migration/i5.1/oracle/201801111909_IDEMPIERE-3529.sql
@@ -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
+;
diff --git a/migration/i5.1/postgresql/201712290930_IDEMPIERE-3589.sql b/migration/i5.1/postgresql/201712290930_IDEMPIERE-3589.sql
new file mode 100644
index 0000000000..3919d3f0c5
--- /dev/null
+++ b/migration/i5.1/postgresql/201712290930_IDEMPIERE-3589.sql
@@ -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
+;
\ No newline at end of file
diff --git a/migration/i5.1/postgresql/201801111909_IDEMPIERE-3529.sql b/migration/i5.1/postgresql/201801111909_IDEMPIERE-3529.sql
new file mode 100644
index 0000000000..bf8a4b3077
--- /dev/null
+++ b/migration/i5.1/postgresql/201801111909_IDEMPIERE-3529.sql
@@ -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
+;
diff --git a/org.adempiere.base-feature/sign.database.build.launch b/org.adempiere.base-feature/sign.database.build.launch
index 864c5de172..87719eb972 100644
--- a/org.adempiere.base-feature/sign.database.build.launch
+++ b/org.adempiere.base-feature/sign.database.build.launch
@@ -20,8 +20,8 @@
-
-
+
+
diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java
index 36ef208b32..969e4d0a60 100644
--- a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java
+++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java
@@ -833,6 +833,8 @@ public class CalloutOrder extends CalloutEngine
if (product.isStocked() && Env.getContext(ctx, WindowNo, "IsDropShip").equals("N"))
{
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_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_AttributeSetInstance_ID");
BigDecimal available = MStorageReservation.getQtyAvailable
@@ -1036,7 +1038,11 @@ public class CalloutOrder extends CalloutEngine
BigDecimal QtyEntered, QtyOrdered, PriceEntered, PriceActual, PriceLimit, Discount, PriceList;
// get values
QtyEntered = (BigDecimal)mTab.getValue("QtyEntered");
+ if (QtyEntered == null)
+ QtyEntered = Env.ZERO;
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);
//
PriceEntered = (BigDecimal)mTab.getValue("PriceEntered");
diff --git a/org.adempiere.base.process/src/org/compiere/process/CopyRole.java b/org.adempiere.base.process/src/org/compiere/process/CopyRole.java
index 4b5ba2d7aa..12846a9f44 100755
--- a/org.adempiere.base.process/src/org/compiere/process/CopyRole.java
+++ b/org.adempiere.base.process/src/org/compiere/process/CopyRole.java
@@ -26,7 +26,6 @@ import org.compiere.model.I_AD_Role_Included;
import org.compiere.model.MRole;
import org.compiere.util.DB;
import org.compiere.util.Env;
-import org.compiere.util.Msg;
/**
@@ -76,7 +75,7 @@ public class CopyRole extends SvrProcess
protected String doIt() throws Exception
{
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)
diff --git a/org.adempiere.base.process/src/org/idempiere/process/ImportCSVProcess.java b/org.adempiere.base.process/src/org/idempiere/process/ImportCSVProcess.java
index 5e90f6a456..45fca381c8 100644
--- a/org.adempiere.base.process/src/org/idempiere/process/ImportCSVProcess.java
+++ b/org.adempiere.base.process/src/org/idempiere/process/ImportCSVProcess.java
@@ -43,6 +43,7 @@ import org.compiere.model.DataStatusEvent;
import org.compiere.model.DataStatusListener;
import org.compiere.model.GridField;
import org.compiere.model.GridTab;
+import org.compiere.model.GridTable;
import org.compiere.model.GridWindow;
import org.compiere.model.MImportTemplate;
import org.compiere.model.MLookup;
@@ -75,6 +76,7 @@ public class ImportCSVProcess extends SvrProcess implements DataStatusListener {
}
}
+ GridWindow m_gridWindow = null;
GridTab m_gridTab = null;
List 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())))
throw new AdempiereException("Template/Mode not allowed for this role");
- GridWindow gWin = GridWindow.get(getCtx(), -1, l_AD_Window_ID);
- Env.setContext(getCtx(), -1, "IsSOTrx", gWin.isSOTrx());
+ m_gridWindow = GridWindow.get(getCtx(), -1, l_AD_Window_ID);
+ Env.setContext(getCtx(), -1, "IsSOTrx", m_gridWindow.isSOTrx());
m_Childs = new ArrayList();
- for (int i = 0; i < gWin.getTabCount(); i++) {
- GridTab gridtab = gWin.getTab(i);
+ for (int i = 0; i < m_gridWindow.getTabCount(); i++) {
+ GridTab gridtab = m_gridWindow.getTab(i);
if (!gridtab.isLoadComplete())
- gWin.initTab(i);
- if (gWin.getTab(i).getAD_Tab_ID() == l_AD_Tab_ID) {
- m_gridTab = gWin.getTab(i);
+ m_gridWindow.initTab(i);
+ if (m_gridWindow.getTab(i).getAD_Tab_ID() == l_AD_Tab_ID) {
+ m_gridTab = m_gridWindow.getTab(i);
} else {
if (m_gridTab != null && gridtab.getTabLevel() > m_gridTab.getTabLevel())
m_Childs.add(gridtab);
@@ -119,6 +121,8 @@ public class ImportCSVProcess extends SvrProcess implements DataStatusListener {
if (m_gridTab == null)
throw new Exception("No Active Tab");
m_gridTab.addDataStatusListener(this);
+ for (GridTab childTab : m_Childs)
+ childTab.addDataStatusListener(this);
}
protected IGridTabImporter initImporter() throws Exception {
@@ -161,23 +165,33 @@ public class ImportCSVProcess extends SvrProcess implements DataStatusListener {
public void dataStatusChanged(DataStatusEvent e)
{
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
- GridField mField = m_gridTab.getField(col);
+ GridField mField = l_gridTab.getField(col);
if (mField != null
&& (mField.getCallout().length() > 0
- || (Core.findCallout(m_gridTab.getTableName(), mField.getColumnName())).size()>0
- || m_gridTab.hasDependants(mField.getColumnName())))
+ || (Core.findCallout(l_gridTab.getTableName(), mField.getColumnName())).size()>0
+ || 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)
{
log.warning(msg);
}
// 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 (dependentField != null && dependentField.getLookup() instanceof MLookup)
diff --git a/org.adempiere.base/build.properties b/org.adempiere.base/build.properties
index 1c58047ed2..495b62c82b 100644
--- a/org.adempiere.base/build.properties
+++ b/org.adempiere.base/build.properties
@@ -22,7 +22,7 @@ bin.includes = META-INF/,\
OSGI-INF/defaultaddressvalidationfactory.xml,\
OSGI-INF/defaulttaxproviderfactory.xml,\
OSGI-INF/addressvalidationeventhandler.xml,\
- OSGI-INF/defaultproductpricingfactory.xml\
+ OSGI-INF/defaultproductpricingfactory.xml,\
schema/,\
bsh-2.0b6.jar,\
commons-validator-1.6.jar
diff --git a/org.adempiere.base/src/org/adempiere/base/event/IEventTopics.java b/org.adempiere.base/src/org/adempiere/base/event/IEventTopics.java
index 990590cead..7a2287c8f2 100644
--- a/org.adempiere.base/src/org/adempiere/base/event/IEventTopics.java
+++ b/org.adempiere.base/src/org/adempiere/base/event/IEventTopics.java
@@ -91,6 +91,9 @@ public interface IEventTopics {
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 REQUEST_SEND_EMAIL = "idempiere/requestSendEMail";
diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java
index 97ce82f7d0..240bcdeea9 100644
--- a/org.adempiere.base/src/org/compiere/model/GridTable.java
+++ b/org.adempiere.base/src/org/compiere/model/GridTable.java
@@ -99,12 +99,11 @@ import org.compiere.util.ValueNamePair;
public class GridTable extends AbstractTableModel
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_UPDATE_COPIED_MESSAGE = "UpdateCopied";
public static final String DATA_INSERTED_MESSAGE = "Inserted";
@@ -3878,6 +3877,15 @@ public class GridTable extends AbstractTableModel
}
return tabNo;
}
+
+ /**
+ * get Tab No
+ * @return Tab No
+ */
+ public int getTabNo()
+ {
+ return m_TabNo;
+ }
private boolean isNotNullAndIsEmpty (Object value) {
if (value != null
diff --git a/org.adempiere.base/src/org/compiere/model/MInventory.java b/org.adempiere.base/src/org/compiere/model/MInventory.java
index 4cd75b68e0..86d192bd33 100644
--- a/org.adempiere.base/src/org/compiere/model/MInventory.java
+++ b/org.adempiere.base/src/org/compiere/model/MInventory.java
@@ -574,7 +574,7 @@ public class MInventory extends X_M_Inventory implements DocAction
Timestamp dateMPolicy= qtyDiff.signum() > 0 ? getMovementDate() : null;
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)
dateMPolicy = t;
}
diff --git a/org.adempiere.base/src/org/compiere/model/MLocation.java b/org.adempiere.base/src/org/compiere/model/MLocation.java
index af41006793..cdffcd292a 100644
--- a/org.adempiere.base/src/org/compiere/model/MLocation.java
+++ b/org.adempiere.base/src/org/compiere/model/MLocation.java
@@ -536,7 +536,7 @@ public class MLocation extends X_C_Location implements Comparator