Merge with 699e9de54991827074750db548032db4889e533c
This commit is contained in:
commit
f9e6970119
|
@ -0,0 +1,26 @@
|
|||
-- Aug 29, 2012 6:44:34 PM COT
|
||||
-- IDEMPIERE-63 Document number is updated again when document completed after reactivation
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','Document type cannot be changed when overwrite document number on complete is set and the document was already processed',200025,'D','1bc9f344-4855-473d-a058-424dfd6d9a1e','CannotChangeProcessedDocType','Y',TO_DATE('2012-08-29 18:44:33','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-08-29 18:44:33','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Aug 29, 2012 6:44:34 PM COT
|
||||
-- IDEMPIERE-63 Document number is updated again when document completed after reactivation
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200025 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Aug 29, 2012 6:44:57 PM COT
|
||||
-- IDEMPIERE-63 Document number is updated again when document completed after reactivation
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','Date cannot be changed when overwrite date on complete is set and the document was already processed',200026,'D','81bf5a40-ae47-4dcf-9be3-9d04d0c9116f','CannotChangeProcessedDate','Y',TO_DATE('2012-08-29 18:44:56','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-08-29 18:44:56','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Aug 29, 2012 6:44:57 PM COT
|
||||
-- IDEMPIERE-63 Document number is updated again when document completed after reactivation
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200026 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
UPDATE AD_System
|
||||
SET LastMigrationScriptApplied='897_IDEMPIERE-63.sql'
|
||||
WHERE LastMigrationScriptApplied<'897_IDEMPIERE-63.sql'
|
||||
OR LastMigrationScriptApplied IS NULL
|
||||
;
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
-- Aug 29, 2012 6:44:34 PM COT
|
||||
-- IDEMPIERE-63 Document number is updated again when document completed after reactivation
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','Document type cannot be changed when overwrite document number on complete is set and the document was already processed',200025,'D','1bc9f344-4855-473d-a058-424dfd6d9a1e','CannotChangeProcessedDocType','Y',TO_TIMESTAMP('2012-08-29 18:44:33','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-08-29 18:44:33','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Aug 29, 2012 6:44:34 PM COT
|
||||
-- IDEMPIERE-63 Document number is updated again when document completed after reactivation
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200025 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Aug 29, 2012 6:44:57 PM COT
|
||||
-- IDEMPIERE-63 Document number is updated again when document completed after reactivation
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','Date cannot be changed when overwrite date on complete is set and the document was already processed',200026,'D','81bf5a40-ae47-4dcf-9be3-9d04d0c9116f','CannotChangeProcessedDate','Y',TO_TIMESTAMP('2012-08-29 18:44:56','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-08-29 18:44:56','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Aug 29, 2012 6:44:57 PM COT
|
||||
-- IDEMPIERE-63 Document number is updated again when document completed after reactivation
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200026 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
UPDATE AD_System
|
||||
SET LastMigrationScriptApplied='897_IDEMPIERE-63.sql'
|
||||
WHERE LastMigrationScriptApplied<'897_IDEMPIERE-63.sql'
|
||||
OR LastMigrationScriptApplied IS NULL
|
||||
;
|
||||
|
|
@ -254,7 +254,8 @@ implements ImportProcess
|
|||
+ " AND (i.City=l.City OR (i.City IS NULL AND l.City IS NULL))"
|
||||
+ " AND (i.Postal=l.Postal OR (i.Postal IS NULL AND l.Postal IS NULL))"
|
||||
+ " AND (i.Postal_Add=l.Postal_Add OR (l.Postal_Add IS NULL AND l.Postal_Add IS NULL))"
|
||||
+ " AND i.C_Region_ID=l.C_Region_ID AND i.C_Country_ID=l.C_Country_ID) "
|
||||
+ " AND (i.C_Region_ID=l.C_Region_ID OR (l.C_Region_ID IS NULL AND i.C_Region_ID IS NULL))"
|
||||
+ " AND i.C_Country_ID=l.C_Country_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
|
|
|
@ -332,6 +332,11 @@ public class GridFieldVO implements Serializable
|
|||
// Genied: For a range parameter the second field
|
||||
// lookup behaviour should match the first one.
|
||||
voT.AD_Reference_Value_ID = voF.AD_Reference_Value_ID;
|
||||
// IDEMPIERE-229 Bug with Process parameter range
|
||||
voT.ValidationCode = voF.ValidationCode;
|
||||
voT.IsEncryptedField = voF.IsEncryptedField;
|
||||
voT.ReadOnlyLogic = voF.ReadOnlyLogic;
|
||||
voT.DisplayLogic = voF.DisplayLogic;
|
||||
voT.initFinish();
|
||||
|
||||
return voT;
|
||||
|
|
|
@ -304,6 +304,28 @@ public class MJournal extends X_GL_Journal implements DocAction
|
|||
}
|
||||
if (getDateAcct() == null)
|
||||
setDateAcct(getDateDoc());
|
||||
|
||||
// IDEMPIERE-63
|
||||
// for documents that can be reactivated we cannot allow changing
|
||||
// C_DocTypeTarget_ID or C_DocType_ID if they were already processed and isOverwriteSeqOnComplete
|
||||
// neither change the Date if isOverwriteDateOnComplete
|
||||
BigDecimal previousProcessedOn = (BigDecimal) get_ValueOld(COLUMNNAME_ProcessedOn);
|
||||
if (! newRecord && previousProcessedOn != null && previousProcessedOn.signum() > 0) {
|
||||
int previousDocTypeID = (Integer) get_ValueOld(COLUMNNAME_C_DocType_ID);
|
||||
MDocType previousdt = MDocType.get(getCtx(), previousDocTypeID);
|
||||
if (is_ValueChanged(COLUMNNAME_C_DocType_ID)) {
|
||||
if (previousdt.isOverwriteSeqOnComplete()) {
|
||||
log.saveError("Error", Msg.getMsg(getCtx(), "CannotChangeProcessedDocType"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (is_ValueChanged(COLUMNNAME_DateDoc)) {
|
||||
if (previousdt.isOverwriteDateOnComplete()) {
|
||||
log.saveError("Error", Msg.getMsg(getCtx(), "CannotChangeProcessedDate"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update DateAcct on lines - teo_sarca BF [ 1775358 ]
|
||||
if (is_ValueChanged(COLUMNNAME_DateAcct)) {
|
||||
|
@ -601,12 +623,16 @@ public class MJournal extends X_GL_Journal implements DocAction
|
|||
private void setDefiniteDocumentNo() {
|
||||
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
|
||||
if (dt.isOverwriteDateOnComplete()) {
|
||||
setDateDoc(new Timestamp (System.currentTimeMillis()));
|
||||
if (this.getProcessedOn().signum() == 0) {
|
||||
setDateDoc(new Timestamp (System.currentTimeMillis()));
|
||||
}
|
||||
}
|
||||
if (dt.isOverwriteSeqOnComplete()) {
|
||||
String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this);
|
||||
if (value != null)
|
||||
setDocumentNo(value);
|
||||
if (this.getProcessedOn().signum() == 0) {
|
||||
String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this);
|
||||
if (value != null)
|
||||
setDocumentNo(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ import java.util.Properties;
|
|||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.exceptions.DBException;
|
||||
import org.adempiere.process.UUIDGenerator;
|
||||
import org.compiere.Adempiere;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
|
@ -433,6 +434,12 @@ public class MLanguage extends X_AD_Language
|
|||
// + " WHERE (" + keyColumn + ",'" + getAD_Language()+ "') NOT IN (SELECT "
|
||||
// + keyColumn + ",AD_Language FROM " + tableName + ")";
|
||||
int no = DB.executeUpdateEx(insert, null, get_TrxName());
|
||||
// IDEMPIERE-99 Language Maintenance does not create UUIDs
|
||||
MTable table = MTable.get(getCtx(), tableName);
|
||||
MColumn column = table.getColumn(PO.getUUIDColumnName(tableName));
|
||||
if (column != null)
|
||||
UUIDGenerator.updateUUID(column, get_TrxName());
|
||||
//
|
||||
log.fine(tableName + " #" + no);
|
||||
return no;
|
||||
} // addTable
|
||||
|
|
|
@ -1043,6 +1043,28 @@ public class MOrder extends X_C_Order implements DocAction
|
|||
setC_PaymentTerm_ID (ii);
|
||||
}
|
||||
}
|
||||
|
||||
// IDEMPIERE-63
|
||||
// for documents that can be reactivated we cannot allow changing
|
||||
// C_DocTypeTarget_ID or C_DocType_ID if they were already processed and isOverwriteSeqOnComplete
|
||||
// neither change the Date if isOverwriteDateOnComplete
|
||||
BigDecimal previousProcessedOn = (BigDecimal) get_ValueOld(COLUMNNAME_ProcessedOn);
|
||||
if (! newRecord && previousProcessedOn != null && previousProcessedOn.signum() > 0) {
|
||||
int previousDocTypeID = (Integer) get_ValueOld(COLUMNNAME_C_DocTypeTarget_ID);
|
||||
MDocType previousdt = MDocType.get(getCtx(), previousDocTypeID);
|
||||
if (is_ValueChanged(COLUMNNAME_C_DocType_ID) || is_ValueChanged(COLUMNNAME_C_DocTypeTarget_ID)) {
|
||||
if (previousdt.isOverwriteSeqOnComplete()) {
|
||||
log.saveError("Error", Msg.getMsg(getCtx(), "CannotChangeProcessedDocType"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (is_ValueChanged(COLUMNNAME_DateOrdered)) {
|
||||
if (previousdt.isOverwriteDateOnComplete()) {
|
||||
log.saveError("Error", Msg.getMsg(getCtx(), "CannotChangeProcessedDate"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} // beforeSave
|
||||
|
@ -1857,13 +1879,13 @@ public class MOrder extends X_C_Order implements DocAction
|
|||
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
|
||||
if (dt.isOverwriteDateOnComplete()) {
|
||||
/* a42niem - BF IDEMPIERE-63 - check if document has been completed before */
|
||||
if (this.getProcessedOn().compareTo(Env.ZERO) == 0) {
|
||||
if (this.getProcessedOn().signum() == 0) {
|
||||
setDateOrdered(new Timestamp (System.currentTimeMillis()));
|
||||
}
|
||||
}
|
||||
if (dt.isOverwriteSeqOnComplete()) {
|
||||
/* a42niem - BF IDEMPIERE-63 - check if document has been completed before */
|
||||
if (this.getProcessedOn().compareTo(Env.ZERO) == 0) {
|
||||
if (this.getProcessedOn().signum() == 0) {
|
||||
String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this);
|
||||
if (value != null)
|
||||
setDocumentNo(value);
|
||||
|
|
|
@ -170,7 +170,7 @@ public class MRMALine extends X_M_RMALine
|
|||
{
|
||||
int invoiceLine_ID = new Query(getCtx(), I_C_InvoiceLine.Table_Name, "M_InOutLine_ID=?", get_TrxName())
|
||||
.setParameters(getM_InOutLine_ID())
|
||||
.firstIdOnly();
|
||||
.firstId();
|
||||
return invoiceLine_ID <= 0 ? 0 : invoiceLine_ID;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ public class MTax extends X_C_Tax
|
|||
//FR: [ 2214883 ] Remove SQL code and Replace for Query - red1
|
||||
List<MTax> list = new Query(ctx, I_C_Tax.Table_Name, null, null)
|
||||
.setClient_ID()
|
||||
.setOrderBy("C_Country_ID, C_Region_ID, To_Country_ID, To_Region_ID")
|
||||
.setOrderBy("C_Country_ID, C_Region_ID, To_Country_ID, To_Region_ID, ValidFrom DESC")
|
||||
.setOnlyActiveRecords(true)
|
||||
.list();
|
||||
for (MTax tax : list)
|
||||
|
|
|
@ -195,19 +195,35 @@ public class MTree extends MTree_Base
|
|||
private void loadNodes (int AD_User_ID)
|
||||
{
|
||||
// SQL for TreeNodes
|
||||
StringBuffer sql = new StringBuffer("SELECT "
|
||||
+ "tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive "
|
||||
+ "FROM ").append(getNodeTableName()).append(" tn"
|
||||
+ " LEFT OUTER JOIN AD_TreeBar tb ON (tn.AD_Tree_ID=tb.AD_Tree_ID"
|
||||
+ " AND tn.Node_ID=tb.Node_ID "
|
||||
+ (AD_User_ID != -1 ? " AND tb.AD_User_ID=? ": "") // #1 (conditional)
|
||||
+ ") "
|
||||
+ "WHERE tn.AD_Tree_ID=?"); // #2
|
||||
if (!m_editable)
|
||||
sql.append(" AND tn.IsActive='Y'");
|
||||
sql.append(" ORDER BY COALESCE(tn.Parent_ID, -1), tn.SeqNo");
|
||||
StringBuffer sql = new StringBuffer();
|
||||
if (getTreeType().equals(TREETYPE_Menu)) // specific sql, need to load TreeBar IDEMPIERE 329 - nmicoud
|
||||
{
|
||||
sql = new StringBuffer("SELECT "
|
||||
+ "tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive "
|
||||
+ "FROM ").append(getNodeTableName()).append(" tn"
|
||||
+ " LEFT OUTER JOIN AD_TreeBar tb ON (tn.AD_Tree_ID=tb.AD_Tree_ID"
|
||||
+ " AND tn.Node_ID=tb.Node_ID "
|
||||
+ (AD_User_ID != -1 ? " AND tb.AD_User_ID=? ": "") // #1 (conditional)
|
||||
+ ") "
|
||||
+ "WHERE tn.AD_Tree_ID=?"); // #2
|
||||
if (!m_editable)
|
||||
sql.append(" AND tn.IsActive='Y'");
|
||||
sql.append(" ORDER BY COALESCE(tn.Parent_ID, -1), tn.SeqNo");
|
||||
}
|
||||
else // IDEMPIERE 329 - nmicoud
|
||||
{
|
||||
String sourceTableName = getSourceTableName(getTreeType());
|
||||
sql = new StringBuffer("SELECT "
|
||||
+ "tn.Node_ID,tn.Parent_ID,tn.SeqNo,st.IsActive "
|
||||
+ "FROM ").append(sourceTableName).append(" st "
|
||||
+ "LEFT OUTER JOIN ").append(getNodeTableName()).append(" tn ON (tn.Node_ID=st."+sourceTableName+"_ID) "
|
||||
+ "WHERE tn.AD_Tree_ID=?"); // #2
|
||||
if (!m_editable)
|
||||
sql.append(" AND tn.IsActive='Y'");
|
||||
sql.append(" ORDER BY COALESCE(tn.Parent_ID, -1), tn.SeqNo");
|
||||
sql = new StringBuffer(MRole.getDefault().addAccessSQL(sql.toString(), "st", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO)); // SQL_RO for Org_ID = 0
|
||||
}
|
||||
log.finest(sql.toString());
|
||||
|
||||
// The Node Loop
|
||||
try
|
||||
{
|
||||
|
@ -216,7 +232,7 @@ public class MTree extends MTree_Base
|
|||
//
|
||||
PreparedStatement pstmt = DB.prepareStatement(sql.toString(), get_TrxName());
|
||||
int idx = 1;
|
||||
if (AD_User_ID != -1)
|
||||
if (AD_User_ID != -1 && getTreeType().equals(TREETYPE_Menu)) // IDEMPIERE 329 - nmicoud
|
||||
pstmt.setInt(idx++, AD_User_ID);
|
||||
pstmt.setInt(idx++, getAD_Tree_ID());
|
||||
// Get Tree & Bar
|
||||
|
|
|
@ -1267,8 +1267,9 @@ public abstract class PO
|
|||
log.finest("ID=" + ID);
|
||||
if (ID > 0)
|
||||
{
|
||||
setKeyInfo();
|
||||
m_IDs = new Object[] {new Integer(ID)};
|
||||
m_KeyColumns = new String[] {p_info.getTableName() + "_ID"};
|
||||
//m_KeyColumns = new String[] {p_info.getTableName() + "_ID"};
|
||||
load(trxName);
|
||||
}
|
||||
else // new
|
||||
|
@ -3044,7 +3045,8 @@ public abstract class PO
|
|||
|
||||
// Carlos Ruiz - globalqss - IDEMPIERE-111
|
||||
// Check if the role has access to this client
|
||||
if (!MRole.getDefault().isClientAccess(getAD_Client_ID(), true))
|
||||
// Don't check role System as webstore works with this role - see IDEMPIERE-401
|
||||
if ((Env.getAD_Role_ID(getCtx()) != 0) && !MRole.getDefault().isClientAccess(getAD_Client_ID(), true))
|
||||
{
|
||||
log.warning("You cannot delete this record, role doesn't have access");
|
||||
log.saveError("AccessCannotDelete", "", false);
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
*****************************************************************************/
|
||||
package org.compiere.report;
|
||||
|
||||
import static org.compiere.model.SystemIDs.TABLE_T_REPORT;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
|
@ -25,7 +27,6 @@ import java.util.logging.Level;
|
|||
|
||||
import org.compiere.model.MAcctSchemaElement;
|
||||
import org.compiere.model.MReportCube;
|
||||
import static org.compiere.model.SystemIDs.*;
|
||||
import org.compiere.print.MPrintFormat;
|
||||
import org.compiere.print.MPrintFormatItem;
|
||||
import org.compiere.process.ProcessInfoParameter;
|
||||
|
@ -1093,6 +1094,7 @@ public class FinReport extends SvrProcess
|
|||
String s = m_report.getWhereClause();
|
||||
if (s != null && s.length() > 0)
|
||||
insert.append(" AND ").append(s);
|
||||
insert.append(m_parameterWhere); // IDEMPIERE-130
|
||||
// Period restriction
|
||||
FinReportPeriod frp = getPeriod (0);
|
||||
insert.append(" AND TRUNC(DateAcct) ")
|
||||
|
|
|
@ -23,6 +23,8 @@ import java.io.FileReader;
|
|||
import java.io.FileWriter;
|
||||
import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
|
||||
import org.compiere.util.Util;
|
||||
|
||||
|
@ -418,4 +420,15 @@ public class FileUtil
|
|||
new FileUtil(directory, filter, action, from, to);
|
||||
} // main
|
||||
|
||||
public static String getTempMailName(String subject, String extension) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String dt = sdf.format(cal.getTime());
|
||||
String cleanName = subject.replaceAll("[ &/]", "");
|
||||
String localFile = System.getProperty("java.io.tmpdir")
|
||||
+ System.getProperty("file.separator") + cleanName + "_" + dt
|
||||
+ extension;
|
||||
return localFile;
|
||||
}
|
||||
|
||||
} // FileUtil
|
||||
|
|
|
@ -1328,9 +1328,22 @@ public final class Env
|
|||
|
||||
token = inStr.substring(0, j);
|
||||
|
||||
// IDEMPIERE-194 Handling null context variable
|
||||
String defaultV = null;
|
||||
int idx = token.indexOf(":"); // or clause
|
||||
if (idx >= 0)
|
||||
{
|
||||
defaultV = token.substring(idx+1, token.length());
|
||||
token = token.substring(0, idx);
|
||||
}
|
||||
|
||||
String ctxInfo = getContext(ctx, WindowNo, token, onlyWindow); // get context
|
||||
if (ctxInfo.length() == 0 && (token.startsWith("#") || token.startsWith("$")) )
|
||||
ctxInfo = getContext(ctx, token); // get global context
|
||||
|
||||
if (ctxInfo.length() == 0 && defaultV != null)
|
||||
ctxInfo = defaultV;
|
||||
|
||||
if (ctxInfo.length() == 0)
|
||||
{
|
||||
getLogger().config("No Context Win=" + WindowNo + " for: " + token);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<stringAttribute key="location" value="${workspace_loc}/../runtime-install.app"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}/org.adempiere.server-feature"/>
|
||||
<stringAttribute key="pde.version" value="3.3"/>
|
||||
<stringAttribute key="product" value="org.adempiere.server.server_product"/>
|
||||
<stringAttribute key="selected_target_plugins" value="com.springsource.javax.activation@default:default,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.xml.rpc@default:default,com.springsource.javax.xml.soap@default:default,com.springsource.net.sf.cglib@default:default,com.springsource.org.apache.activemq@default:default,com.springsource.org.apache.commons.logging@default:default,com.springsource.org.apache.kahadb@default:default,javax.el@default:default,javax.servlet.jsp@default:default,javax.servlet@default:default,javax.xml@default:default,org.apache.ant@default:default,org.apache.commons.collections@default:default,org.apache.commons.logging@default:default,org.apache.commons.net@default:default,org.apache.poi@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.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.junit@default:default,org.restlet@default:default"/>
|
||||
|
|
|
@ -24,6 +24,7 @@ import net.sf.jasperreports.view.JRViewer;
|
|||
|
||||
import org.compiere.apps.EMailDialog;
|
||||
import org.compiere.model.MUser;
|
||||
import org.compiere.tools.FileUtil;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Msg;
|
||||
|
@ -136,7 +137,7 @@ class SendByEmailListener implements ActionListener {
|
|||
|
||||
try
|
||||
{
|
||||
attachment = File.createTempFile("mail", ".pdf");
|
||||
attachment = new File(FileUtil.getTempMailName(subject, ".pdf"));
|
||||
JasperExportManager.exportReportToPdfFile(viewer.getJasperPrint(), attachment.getAbsolutePath());
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -14,13 +14,10 @@
|
|||
package org.compiere.grid;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Insets;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.KeyStroke;
|
||||
import javax.swing.event.TableModelEvent;
|
||||
import javax.swing.event.TableModelListener;
|
||||
import javax.swing.table.TableModel;
|
||||
|
@ -31,9 +28,11 @@ import org.compiere.apps.AppsAction;
|
|||
import org.compiere.apps.ConfirmPanel;
|
||||
import org.compiere.apps.StatusBar;
|
||||
import org.compiere.minigrid.MiniTable;
|
||||
import org.compiere.swing.CButton;
|
||||
import org.compiere.swing.CDialog;
|
||||
import org.compiere.swing.CPanel;
|
||||
import org.compiere.swing.CToggleButton;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Msg;
|
||||
import org.compiere.util.Trx;
|
||||
import org.compiere.util.TrxRunnable;
|
||||
|
||||
|
@ -49,7 +48,8 @@ public class VCreateFromDialog extends CDialog implements ActionListener, TableM
|
|||
private StatusBar statusBar = new StatusBar();
|
||||
private MiniTable dataTable = new MiniTable();
|
||||
|
||||
private static final String SELECT_ALL = "SelectAll";
|
||||
private static final String SELECT_DESELECT_ALL = "SelectAll";
|
||||
protected AppsAction selectDeselectAllAction = new AppsAction (SELECT_DESELECT_ALL, null, Msg.getMsg(Env.getCtx(), SELECT_DESELECT_ALL), true);
|
||||
|
||||
public VCreateFromDialog(CreateFrom createFrom, int windowNo, boolean modal)
|
||||
{
|
||||
|
@ -80,13 +80,11 @@ public class VCreateFromDialog extends CDialog implements ActionListener, TableM
|
|||
JScrollPane dataPane = new JScrollPane();
|
||||
getContentPane().add(dataPane, BorderLayout.CENTER);
|
||||
dataPane.getViewport().add(dataTable, null);
|
||||
|
||||
AppsAction selectAllAction = new AppsAction (SELECT_ALL, KeyStroke.getKeyStroke(KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK), null);
|
||||
CButton selectAllButton = (CButton)selectAllAction.getButton();
|
||||
selectAllButton.setMargin(new Insets (0, 10, 0, 10));
|
||||
selectAllButton.setDefaultCapable(true);
|
||||
selectAllButton.addActionListener(this);
|
||||
confirmPanel.addButton(selectAllButton);
|
||||
|
||||
CToggleButton selectAllButton = (CToggleButton)selectDeselectAllAction.getButton();
|
||||
selectAllButton.setMargin(ConfirmPanel.s_insets);
|
||||
selectAllButton.addActionListener(this);
|
||||
confirmPanel.addComponent(selectAllButton);
|
||||
|
||||
CPanel southPanel = new CPanel();
|
||||
getContentPane().add(southPanel, BorderLayout.SOUTH);
|
||||
|
@ -125,14 +123,19 @@ public class VCreateFromDialog extends CDialog implements ActionListener, TableM
|
|||
}
|
||||
// Select All
|
||||
// Trifon
|
||||
else if (e.getActionCommand().equals(SELECT_ALL))
|
||||
else if (e.getActionCommand().equals(SELECT_DESELECT_ALL))
|
||||
{
|
||||
TableModel model = dataTable.getModel();
|
||||
model.removeTableModelListener(this);
|
||||
|
||||
// select or deselect all as required
|
||||
int rows = model.getRowCount();
|
||||
Boolean selectAll = selectDeselectAllAction.isPressed() ? Boolean.FALSE : Boolean.TRUE;
|
||||
for (int i = 0; i < rows; i++)
|
||||
{
|
||||
model.setValueAt(new Boolean(true), i, 0);
|
||||
}
|
||||
model.setValueAt(selectAll, i, 0);
|
||||
|
||||
model.addTableModelListener(this);
|
||||
|
||||
info();
|
||||
}
|
||||
}
|
||||
|
@ -157,6 +160,22 @@ public class VCreateFromDialog extends CDialog implements ActionListener, TableM
|
|||
type = e.getType();
|
||||
if (type != TableModelEvent.UPDATE)
|
||||
return;
|
||||
|
||||
if (e.getColumn() == 0)
|
||||
{
|
||||
TableModel model = dataTable.getModel();
|
||||
Boolean isPressed = (Boolean)model.getValueAt(0, 0);
|
||||
int rows = model.getRowCount();
|
||||
boolean equals = true;
|
||||
for (int i = 1; equals && i < rows; i++)
|
||||
{
|
||||
equals = isPressed.equals(model.getValueAt(i, 0));
|
||||
}
|
||||
|
||||
if (equals) {
|
||||
selectDeselectAllAction.setPressed(isPressed);
|
||||
}
|
||||
}
|
||||
}
|
||||
info();
|
||||
dataTable.repaint();
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
*****************************************************************************/
|
||||
package org.compiere.print;
|
||||
|
||||
import static org.compiere.model.SystemIDs.WINDOW_PRINTFORMAT;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Component;
|
||||
import java.awt.Cursor;
|
||||
|
@ -39,6 +41,7 @@ import java.sql.PreparedStatement;
|
|||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.Level;
|
||||
|
||||
|
@ -80,7 +83,6 @@ import org.compiere.model.MQuery;
|
|||
import org.compiere.model.MRole;
|
||||
import org.compiere.model.MUser;
|
||||
import org.compiere.model.PrintInfo;
|
||||
import static org.compiere.model.SystemIDs.*;
|
||||
import org.compiere.model.X_C_Invoice;
|
||||
import org.compiere.swing.CButton;
|
||||
import org.compiere.swing.CCheckBox;
|
||||
|
@ -89,6 +91,7 @@ import org.compiere.swing.CFrame;
|
|||
import org.compiere.swing.CLabel;
|
||||
import org.compiere.swing.CMenuItem;
|
||||
import org.compiere.swing.CPanel;
|
||||
import org.compiere.tools.FileUtil;
|
||||
import org.compiere.util.CLogMgt;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
|
@ -99,6 +102,7 @@ import org.compiere.util.Language;
|
|||
import org.compiere.util.Login;
|
||||
import org.compiere.util.Msg;
|
||||
import org.compiere.util.NamePair;
|
||||
import org.compiere.util.TimeUtil;
|
||||
import org.compiere.util.ValueNamePair;
|
||||
|
||||
/**
|
||||
|
@ -911,7 +915,7 @@ public class Viewer extends CFrame
|
|||
|
||||
try
|
||||
{
|
||||
attachment = File.createTempFile("mail", ".pdf");
|
||||
attachment = new File(FileUtil.getTempMailName(subject, ".pdf"));
|
||||
m_reportEngine.getPDF(attachment);
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -46,6 +46,7 @@ import org.compiere.process.ProcessInfo;
|
|||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Msg;
|
||||
import org.zkoss.zul.Div;
|
||||
import org.zkoss.zul.Hbox;
|
||||
import org.zkoss.zul.Label;
|
||||
|
@ -359,21 +360,24 @@ public class ProcessParameterPanel extends Panel implements
|
|||
if (sb.length() > 0)
|
||||
sb.append(", ");
|
||||
sb.append(field.getHeader());
|
||||
if (m_wEditors2.get(i) != null) // is a range
|
||||
sb.append(" (").append(Msg.getMsg(Env.getCtx(), "From")).append(")");
|
||||
} else
|
||||
field.setError(false);
|
||||
// Check for Range
|
||||
WEditor wEditor2 = (WEditor) m_wEditors2.get(i);
|
||||
if (wEditor2 != null) {
|
||||
Object data2 = wEditor.getValue();
|
||||
Object data2 = wEditor2.getValue();
|
||||
GridField field2 = (GridField) m_mFields2.get(i);
|
||||
if (data2 == null || data2.toString().length() == 0) {
|
||||
field.setInserting(true); // set editable (i.e.
|
||||
field2.setInserting(true); // set editable (i.e.
|
||||
// updateable) otherwise
|
||||
// deadlock
|
||||
field2.setError(true);
|
||||
if (sb.length() > 0)
|
||||
sb.append(", ");
|
||||
sb.append(field.getHeader());
|
||||
sb.append(field2.getHeader());
|
||||
sb.append(" (").append(Msg.getMsg(Env.getCtx(), "To")).append(")");
|
||||
} else
|
||||
field2.setError(false);
|
||||
} // range field
|
||||
|
|
|
@ -115,7 +115,9 @@ public class WNumberEditor extends WEditor implements ContextMenuListener
|
|||
getComponent().getDecimalbox().setCols(displayLength);
|
||||
}
|
||||
|
||||
if (!DisplayType.isNumeric(displayType))
|
||||
if (DisplayType.isID(displayType))
|
||||
displayType = DisplayType.Integer;
|
||||
else if (!DisplayType.isNumeric(displayType))
|
||||
displayType = DisplayType.Number;
|
||||
DecimalFormat format = DisplayType.getNumberFormat(displayType, AEnv.getLanguage(Env.getCtx()));
|
||||
getComponent().getDecimalbox().setFormat(format.toPattern());
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
*****************************************************************************/
|
||||
package org.adempiere.webui.window;
|
||||
|
||||
import static org.compiere.model.SystemIDs.WINDOW_PRINTFORMAT;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.StringWriter;
|
||||
|
@ -57,10 +59,10 @@ import org.compiere.model.MRole;
|
|||
import org.compiere.model.MSysConfig;
|
||||
import org.compiere.model.MTable;
|
||||
import org.compiere.model.MUser;
|
||||
import static org.compiere.model.SystemIDs.*;
|
||||
import org.compiere.print.ArchiveEngine;
|
||||
import org.compiere.print.MPrintFormat;
|
||||
import org.compiere.print.ReportEngine;
|
||||
import org.compiere.tools.FileUtil;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
|
@ -723,7 +725,7 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
|
|||
|
||||
try
|
||||
{
|
||||
attachment = File.createTempFile("mail", ".pdf");
|
||||
attachment = new File(FileUtil.getTempMailName(subject, ".pdf"));
|
||||
m_reportEngine.getPDF(attachment);
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -313,6 +313,9 @@ public class ReportCtl
|
|||
if(format.getJasperProcess_ID() > 0)
|
||||
{
|
||||
ServerReportCtl.runJasperProcess(Record_ID, re, IsDirectPrint, printerName);
|
||||
if (IsDirectPrint) {
|
||||
ReportEngine.printConfirm(type, Record_ID);
|
||||
}
|
||||
}
|
||||
else
|
||||
// Standard Print Format (Non-Jasper)
|
||||
|
|
|
@ -382,12 +382,17 @@ public class ConfigOracle implements IDatabaseConfig
|
|||
data.setProperty(ConfigurationData.ADEMPIERE_DB_USER, databaseUser);
|
||||
data.setProperty(ConfigurationData.ADEMPIERE_DB_PASSWORD, databasePassword);
|
||||
|
||||
String ospath;
|
||||
if (System.getProperty("os.name").startsWith("Windows"))
|
||||
ospath = "windows";
|
||||
else
|
||||
ospath = "unix";
|
||||
// TNS Name Info via sqlplus
|
||||
String sqlplus = "sqlplus system/" + systemPassword + "@"
|
||||
+ "//" + databaseServer.getHostName()
|
||||
+ ":" + databasePort
|
||||
+ "/" + databaseName
|
||||
+ " @utils/oracle/Test.sql";
|
||||
+ " @utils." + ospath + "/oracle/Test.sql";
|
||||
log.config(sqlplus);
|
||||
pass = testSQL(sqlplus);
|
||||
error = "Error connecting via: " + sqlplus;
|
||||
|
|
Loading…
Reference in New Issue