diff --git a/migration/i6.2/oracle/201905071815_IDEMPIERE-3961.sql b/migration/i6.2/oracle/201905071815_IDEMPIERE-3961.sql new file mode 100644 index 0000000000..9ce0960be6 --- /dev/null +++ b/migration/i6.2/oracle/201905071815_IDEMPIERE-3961.sql @@ -0,0 +1,10 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-3961 GL Journal - Switching accounting schema removes PERIOD +-- May 7, 2019, 5:20:41 PM SGT +UPDATE AD_Column SET Callout='org.compiere.model.CalloutGLJournal.acctSchema',Updated=TO_DATE('2019-05-07 17:20:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1632 +; + +SELECT register_migration_script('201905071815_IDEMPIERE-3961.sql') FROM dual +; diff --git a/migration/i6.2/oracle/201905091233_IDEMPIERE-3958.sql b/migration/i6.2/oracle/201905091233_IDEMPIERE-3958.sql new file mode 100644 index 0000000000..556bd86788 --- /dev/null +++ b/migration/i6.2/oracle/201905091233_IDEMPIERE-3958.sql @@ -0,0 +1,15 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- CPH::ERP Comments: +-- 28. apr. 2019 00.04.12 CEST +UPDATE AD_Process_Para SET AD_Reference_Value_ID=141,Updated=TO_DATE('2019-04-28 00:04:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=363 +; + +-- 1. maj 2019 17.22.57 CEST +UPDATE AD_Column SET AD_Reference_Value_ID=141,Updated=TO_DATE('2019-05-01 17:22:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14091 +; + +SELECT register_migration_script('201905091233_IDEMPIERE-3958.sql') FROM dual +; + diff --git a/migration/i6.2/postgresql/201905071815_IDEMPIERE-3961.sql b/migration/i6.2/postgresql/201905071815_IDEMPIERE-3961.sql new file mode 100644 index 0000000000..fdf7b73f9f --- /dev/null +++ b/migration/i6.2/postgresql/201905071815_IDEMPIERE-3961.sql @@ -0,0 +1,7 @@ +-- IDEMPIERE-3961 GL Journal - Switching accounting schema removes PERIOD +-- May 7, 2019, 5:20:41 PM SGT +UPDATE AD_Column SET Callout='org.compiere.model.CalloutGLJournal.acctSchema',Updated=TO_TIMESTAMP('2019-05-07 17:20:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1632 +; + +SELECT register_migration_script('201905071815_IDEMPIERE-3961.sql') FROM dual +; \ No newline at end of file diff --git a/migration/i6.2/postgresql/201905091233_IDEMPIERE-3958.sql b/migration/i6.2/postgresql/201905091233_IDEMPIERE-3958.sql new file mode 100644 index 0000000000..6719f17234 --- /dev/null +++ b/migration/i6.2/postgresql/201905091233_IDEMPIERE-3958.sql @@ -0,0 +1,12 @@ +-- CPH::ERP Comments: +-- 28. apr. 2019 00.04.12 CEST +UPDATE AD_Process_Para SET AD_Reference_Value_ID=141,Updated=TO_TIMESTAMP('2019-04-28 00:04:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=363 +; + +-- 1. maj 2019 17.22.57 CEST +UPDATE AD_Column SET AD_Reference_Value_ID=141,Updated=TO_TIMESTAMP('2019-05-01 17:22:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14091 +; + +SELECT register_migration_script('201905091233_IDEMPIERE-3958.sql') FROM dual +; + diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutGLJournal.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutGLJournal.java index 2f122a184f..479e53d29d 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutGLJournal.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutGLJournal.java @@ -294,4 +294,26 @@ public class CalloutGLJournal extends CalloutEngine } return ""; } + + /** + * Journal - Acct Schema + * Set Currency from C_AcctSchema_ID + * @param ctx context + * @param WindowNo window no + * @param mTab tab + * @param mField field + * @param value value + * @return null or error message + */ + public String acctSchema(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) + { + if (value == null) + return ""; + + int C_AcctSchema_ID = Env.getContextAsInt(ctx, WindowNo, "C_AcctSchema_ID"); + MAcctSchema as = MAcctSchema.get (ctx, C_AcctSchema_ID); + mTab.setValue("C_Currency_ID", as.getC_Currency_ID()); + + return ""; + } } // CalloutGLJournal diff --git a/org.adempiere.base.process/src/org/compiere/process/RequisitionPOCreate.java b/org.adempiere.base.process/src/org/compiere/process/RequisitionPOCreate.java index 0337437a95..3f4fec2b82 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RequisitionPOCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/RequisitionPOCreate.java @@ -26,6 +26,7 @@ import org.adempiere.exceptions.NoVendorForProductException; import org.apache.commons.collections.keyvalue.MultiKey; import org.compiere.model.MBPartner; import org.compiere.model.MCharge; +import org.compiere.model.MConversionType; import org.compiere.model.MOrder; import org.compiere.model.MOrderLine; import org.compiere.model.MProduct; @@ -352,6 +353,8 @@ public class RequisitionPOCreate extends SvrProcess m_order.setC_DocTypeTarget_ID(); m_order.setBPartner(m_bpartner); m_order.setM_PriceList_ID(M_PriceList_ID); + if (MConversionType.getDefault(getAD_Client_ID()) > 0) + m_order.setC_ConversionType_ID(MConversionType.getDefault(getAD_Client_ID())); // default po document type if (!p_ConsolidateDocument) { diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index 83826a7c9b..ca57300f76 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -2783,8 +2783,13 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable { if (log.isLoggable(Level.FINE)) log.fine(columnName + " changed - " + dependentField.getColumnName() + " set to null"); + Object currentValue = dependentField.getValue(); + // invalidate current selection setValue(dependentField, null); + + if (currentValue != null && mLookup.containsKey(currentValue)) + setValue(dependentField, currentValue); } } // if the field is a Virtual UI Column diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index 90d7166b56..941a5a8d83 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -1681,6 +1681,8 @@ public class MInOut extends X_M_InOut implements DocAction MInOut dropShipment = createDropShipment(); if (dropShipment != null) info.append(" - @DropShipment@: @M_InOut_ID@=").append(dropShipment.getDocumentNo()); + if (dropShipment != null) + addDocsPostProcess(dropShipment); // User Validation String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) diff --git a/org.adempiere.base/src/org/compiere/model/MPayment.java b/org.adempiere.base/src/org/compiere/model/MPayment.java index a9a84d8edd..9ab8374dc3 100644 --- a/org.adempiere.base/src/org/compiere/model/MPayment.java +++ b/org.adempiere.base/src/org/compiere/model/MPayment.java @@ -22,6 +22,7 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Properties; @@ -83,8 +84,10 @@ import org.compiere.util.ValueNamePair; public class MPayment extends X_C_Payment implements DocAction, ProcessCall, PaymentInterface { - - private static final long serialVersionUID = -7179638016937305380L; + /** + * + */ + private static final long serialVersionUID = -6268462097642919346L; /** * Get Payments Of BPartner @@ -2111,6 +2114,16 @@ public class MPayment extends X_C_Payment return DocAction.STATUS_Completed; } // completeIt + /* Save array of documents to process AFTER completing this one */ + ArrayList docsPostProcess = new ArrayList(); + + protected void addDocsPostProcess(PO doc) { + docsPostProcess.add(doc); + } + + public ArrayList getDocsPostProcess() { + return docsPostProcess; + } /** * Set the definite document number after completed @@ -2289,6 +2302,7 @@ public class MPayment extends X_C_Payment // added AdempiereException by zuhri if (!alloc.processIt(DocAction.ACTION_Complete)) throw new AdempiereException(Msg.getMsg(getCtx(), "FailedProcessingDocument") + " - " + alloc.getProcessMsg()); + addDocsPostProcess(alloc); // end added m_processMsg = "@C_AllocationHdr_ID@: " + alloc.getDocumentNo(); return alloc.save(get_TrxName()); @@ -2324,6 +2338,7 @@ public class MPayment extends X_C_Payment // added AdempiereException by zuhri if (!alloc.processIt(DocAction.ACTION_Complete)) throw new AdempiereException(Msg.getMsg(getCtx(), "FailedProcessingDocument") + " - " + alloc.getProcessMsg()); + addDocsPostProcess(alloc); // end added alloc.saveEx(get_TrxName()); m_justCreatedAllocInv = alloc; @@ -2418,10 +2433,12 @@ public class MPayment extends X_C_Payment else { // added Adempiere Exception by zuhri - if(alloc.processIt(DocAction.ACTION_Complete)) + if (alloc.processIt(DocAction.ACTION_Complete)) { + addDocsPostProcess(alloc); ok = alloc.save(get_TrxName()); - else + } else { throw new AdempiereException(Msg.getMsg(getCtx(), "FailedProcessingDocument") + " - " + alloc.getProcessMsg()); + } // end added by zuhri m_processMsg = "@C_AllocationHdr_ID@: " + alloc.getDocumentNo(); } @@ -2709,6 +2726,7 @@ public class MPayment extends X_C_Payment // added AdempiereException by zuhri if (!alloc.processIt(DocAction.ACTION_Complete)) throw new AdempiereException(Msg.getMsg(getCtx(), "FailedProcessingDocument") + " - " + alloc.getProcessMsg()); + addDocsPostProcess(alloc); // end added alloc.saveEx(get_TrxName()); // diff --git a/org.adempiere.base/src/org/compiere/model/MSysConfig.java b/org.adempiere.base/src/org/compiere/model/MSysConfig.java index 1b140ad148..044c0ff628 100644 --- a/org.adempiere.base/src/org/compiere/model/MSysConfig.java +++ b/org.adempiere.base/src/org/compiere/model/MSysConfig.java @@ -420,12 +420,15 @@ public class MSysConfig extends X_AD_SysConfig public static String getValue(String Name, String defaultValue, int AD_Client_ID, int AD_Org_ID) { String key = ""+AD_Client_ID+"_"+AD_Org_ID+"_"+Name; - String str = s_cache.get(key); - if (str != null) - return str; - if (str == null && s_cache.containsKey(key)) // found null key - return defaultValue; - + String str = null; + if (! Name.endsWith("_NOCACHE")) { + str = s_cache.get(key); + if (str != null) + return str; + if (str == null && s_cache.containsKey(key)) // found null key + return defaultValue; + } + // String sql = "SELECT Value FROM AD_SysConfig" + " WHERE Name=? AND AD_Client_ID IN (0, ?) AND AD_Org_ID IN (0, ?) AND IsActive='Y'" @@ -452,13 +455,15 @@ public class MSysConfig extends X_AD_SysConfig rs = null; pstmt = null; } // + if (str != null) { - s_cache.put(key, str); + if (! Name.endsWith("_NOCACHE")) + s_cache.put(key, str); return str; - } - else { + } else { // anyways, put the not found key as null - s_cache.put(key, null); + if (! Name.endsWith("_NOCACHE")) + s_cache.put(key, null); return defaultValue; } } diff --git a/org.adempiere.base/src/org/compiere/process/DocumentEngine.java b/org.adempiere.base/src/org/compiere/process/DocumentEngine.java index 4c26ef0a70..ce9c400abb 100644 --- a/org.adempiere.base/src/org/compiere/process/DocumentEngine.java +++ b/org.adempiere.base/src/org/compiere/process/DocumentEngine.java @@ -324,12 +324,13 @@ public class DocumentEngine implements DocAction { // PostProcess documents when invoice or inout (this is to postprocess the generated MatchPO and MatchInv if any) ArrayList docsPostProcess = new ArrayList(); - if (m_document instanceof MInvoice || m_document instanceof MInOut) { + if (m_document instanceof MInvoice || m_document instanceof MInOut || m_document instanceof MPayment) { if (m_document instanceof MInvoice) { docsPostProcess = ((MInvoice) m_document).getDocsPostProcess(); - } - if (m_document instanceof MInOut) { + } else if (m_document instanceof MInOut) { docsPostProcess = ((MInOut) m_document).getDocsPostProcess(); + } else if (m_document instanceof MPayment) { + docsPostProcess = ((MPayment) m_document).getDocsPostProcess(); } } if (m_document instanceof PO && docsPostProcess.size() > 0) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index 7fcf504f31..d174f99bcc 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -757,7 +757,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements private void setupEmbeddedFindwindow() { findWindow.setTitle(null); findWindow.setBorder("none"); - findWindow.setStyle("position: absolute; border-bottom: 2px solid #484848; padding: 2px; background-color: #fff;"); + findWindow.setStyle("position: absolute;background-color: #fff;"); ZKUpdateUtil.setWidth(findWindow, "100%"); if (ClientInfo.maxHeight(ClientInfo.MEDIUM_HEIGHT-1)) ZKUpdateUtil.setHeight(findWindow, "100%"); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index 7ab999807c..6800b3ce09 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -626,7 +626,7 @@ public class FindWindow extends Window implements EventListener, ValueCha div.appendChild(labelHistory); div.appendChild(historyCombo); historyCombo.setStyle("margin-left: 3px; margin-right: 3px; position: relative; vertical-align: middle;"); - + div.setClass("toolbar"); winMain = new MultiTabPart(); winMain.createPart(layout); winMain.getComponent().setStyle("position: relative; margin-left: auto; margin-right: auto; margin-top: 3px; margin-bottom: 3px;"); @@ -647,6 +647,7 @@ public class FindWindow extends Window implements EventListener, ValueCha initSimple(); initAdvanced(); /** START DEVCOFFEE **/ + statusBar.setClass("statusbar"); layout.appendChild(statusBar); /** START DEVCOFFEE **/