hg merge development (merge development into zk7)

This commit is contained in:
Carlos Ruiz 2014-12-17 20:11:47 -05:00
commit f0a8c83af3
24 changed files with 266 additions and 36 deletions

View File

@ -0,0 +1,15 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Dec 17, 2014 7:50:03 PM COT
-- IDEMPIERE-1996 InventoryLine inherits bad default
UPDATE AD_Column SET Callout='org.idempiere.model.CalloutFillLocator.fillLocator',Updated=TO_DATE('2014-12-17 19:50:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3537
;
-- Dec 17, 2014 7:51:10 PM COT
UPDATE AD_Column SET Callout='org.idempiere.model.CalloutFillLocator.fillLocator;org.compiere.model.CalloutInventory.product',Updated=TO_DATE('2014-12-17 19:51:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3564
;
SELECT register_migration_script('201412171953_IDEMPIERE-1996.sql') FROM dual
;

View File

@ -0,0 +1,12 @@
-- Dec 17, 2014 7:50:03 PM COT
-- IDEMPIERE-1996 InventoryLine inherits bad default
UPDATE AD_Column SET Callout='org.idempiere.model.CalloutFillLocator.fillLocator',Updated=TO_TIMESTAMP('2014-12-17 19:50:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3537
;
-- Dec 17, 2014 7:51:10 PM COT
UPDATE AD_Column SET Callout='org.idempiere.model.CalloutFillLocator.fillLocator;org.compiere.model.CalloutInventory.product',Updated=TO_TIMESTAMP('2014-12-17 19:51:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3564
;
SELECT register_migration_script('201412171953_IDEMPIERE-1996.sql') FROM dual
;

View File

@ -271,6 +271,7 @@ Export-Package: bsh,
org.eevolution.model, org.eevolution.model,
org.idempiere.broadcast, org.idempiere.broadcast,
org.idempiere.distributed, org.idempiere.distributed,
org.idempiere.model,
org.jfree, org.jfree,
org.jfree.base, org.jfree.base,
org.jfree.base.config, org.jfree.base.config,

View File

@ -1752,6 +1752,10 @@ public class MInOut extends X_M_InOut implements DocAction
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
if (dt.isOverwriteDateOnComplete()) { if (dt.isOverwriteDateOnComplete()) {
setMovementDate(new Timestamp (System.currentTimeMillis())); setMovementDate(new Timestamp (System.currentTimeMillis()));
if (getDateAcct().before(getMovementDate())) {
setDateAcct(getMovementDate());
MPeriod.testPeriodOpen(getCtx(), getDateAcct(), getC_DocType_ID(), getAD_Org_ID());
}
} }
if (dt.isOverwriteSeqOnComplete()) { if (dt.isOverwriteSeqOnComplete()) {
String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this); String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this);

View File

@ -595,6 +595,7 @@ public class MInventory extends X_M_Inventory implements DocAction
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
if (dt.isOverwriteDateOnComplete()) { if (dt.isOverwriteDateOnComplete()) {
setMovementDate(new Timestamp (System.currentTimeMillis())); setMovementDate(new Timestamp (System.currentTimeMillis()));
MPeriod.testPeriodOpen(getCtx(), getMovementDate(), MDocType.DOCBASETYPE_MaterialPhysicalInventory, getAD_Org_ID());
} }
if (dt.isOverwriteSeqOnComplete()) { if (dt.isOverwriteSeqOnComplete()) {
String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this); String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this);

View File

@ -2118,6 +2118,10 @@ public class MInvoice extends X_C_Invoice implements DocAction
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
if (dt.isOverwriteDateOnComplete()) { if (dt.isOverwriteDateOnComplete()) {
setDateInvoiced(new Timestamp (System.currentTimeMillis())); setDateInvoiced(new Timestamp (System.currentTimeMillis()));
if (getDateAcct().before(getDateInvoiced())) {
setDateAcct(getDateInvoiced());
MPeriod.testPeriodOpen(getCtx(), getDateAcct(), getC_DocTypeTarget_ID(), getAD_Org_ID());
}
} }
if (dt.isOverwriteSeqOnComplete()) { if (dt.isOverwriteSeqOnComplete()) {
String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this); String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this);

View File

@ -627,6 +627,10 @@ public class MJournal extends X_GL_Journal implements DocAction
if (dt.isOverwriteDateOnComplete()) { if (dt.isOverwriteDateOnComplete()) {
if (this.getProcessedOn().signum() == 0) { if (this.getProcessedOn().signum() == 0) {
setDateDoc(new Timestamp (System.currentTimeMillis())); setDateDoc(new Timestamp (System.currentTimeMillis()));
if (getDateAcct().before(getDateDoc())) {
setDateAcct(getDateDoc());
MPeriod.testPeriodOpen(getCtx(), getDateAcct(), getC_DocType_ID(), getAD_Org_ID());
}
} }
} }
if (dt.isOverwriteSeqOnComplete()) { if (dt.isOverwriteSeqOnComplete()) {

View File

@ -510,6 +510,10 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
if (dt.isOverwriteDateOnComplete()) { if (dt.isOverwriteDateOnComplete()) {
setDateDoc(new Timestamp (System.currentTimeMillis())); setDateDoc(new Timestamp (System.currentTimeMillis()));
if (getDateAcct().before(getDateDoc())) {
setDateAcct(getDateDoc());
MPeriod.testPeriodOpen(getCtx(), getDateAcct(), getC_DocType_ID(), getAD_Org_ID());
}
} }
if (dt.isOverwriteSeqOnComplete()) { if (dt.isOverwriteSeqOnComplete()) {
String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this); String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this);

View File

@ -548,6 +548,7 @@ public class MMovement extends X_M_Movement implements DocAction
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
if (dt.isOverwriteDateOnComplete()) { if (dt.isOverwriteDateOnComplete()) {
setMovementDate(new Timestamp (System.currentTimeMillis())); setMovementDate(new Timestamp (System.currentTimeMillis()));
MPeriod.testPeriodOpen(getCtx(), getMovementDate(), getC_DocType_ID(), getAD_Org_ID());
} }
if (dt.isOverwriteSeqOnComplete()) { if (dt.isOverwriteSeqOnComplete()) {
String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this); String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this);

View File

@ -2128,6 +2128,10 @@ public class MOrder extends X_C_Order implements DocAction
/* a42niem - BF IDEMPIERE-63 - check if document has been completed before */ /* a42niem - BF IDEMPIERE-63 - check if document has been completed before */
if (this.getProcessedOn().signum() == 0) { if (this.getProcessedOn().signum() == 0) {
setDateOrdered(new Timestamp (System.currentTimeMillis())); setDateOrdered(new Timestamp (System.currentTimeMillis()));
if (getDateAcct().before(getDateOrdered())) {
setDateAcct(getDateOrdered());
MPeriod.testPeriodOpen(getCtx(), getDateAcct(), getC_DocTypeTarget_ID(), getAD_Org_ID());
}
} }
} }
if (dt.isOverwriteSeqOnComplete()) { if (dt.isOverwriteSeqOnComplete()) {

View File

@ -655,6 +655,7 @@ public class MPayment extends X_C_Payment
protected boolean beforeSave (boolean newRecord) protected boolean beforeSave (boolean newRecord)
{ {
if (isComplete() && if (isComplete() &&
! is_ValueChanged(COLUMNNAME_Processed) &&
( is_ValueChanged(COLUMNNAME_C_BankAccount_ID) ( is_ValueChanged(COLUMNNAME_C_BankAccount_ID)
|| is_ValueChanged(COLUMNNAME_C_BPartner_ID) || is_ValueChanged(COLUMNNAME_C_BPartner_ID)
|| is_ValueChanged(COLUMNNAME_C_Charge_ID) || is_ValueChanged(COLUMNNAME_C_Charge_ID)
@ -2094,6 +2095,10 @@ public class MPayment extends X_C_Payment
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
if (dt.isOverwriteDateOnComplete()) { if (dt.isOverwriteDateOnComplete()) {
setDateTrx(new Timestamp (System.currentTimeMillis())); setDateTrx(new Timestamp (System.currentTimeMillis()));
if (getDateAcct().before(getDateTrx())) {
setDateAcct(getDateTrx());
MPeriod.testPeriodOpen(getCtx(), getDateAcct(), getC_DocType_ID(), getAD_Org_ID());
}
} }
if (dt.isOverwriteSeqOnComplete()) { if (dt.isOverwriteSeqOnComplete()) {
String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this); String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this);

View File

@ -364,6 +364,7 @@ public class MRequisition extends X_M_Requisition implements DocAction
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
if (dt.isOverwriteDateOnComplete()) { if (dt.isOverwriteDateOnComplete()) {
setDateDoc(new Timestamp (System.currentTimeMillis())); setDateDoc(new Timestamp (System.currentTimeMillis()));
MPeriod.testPeriodOpen(getCtx(), getDateDoc(), MDocType.DOCBASETYPE_PurchaseRequisition, getAD_Org_ID());
} }
if (dt.isOverwriteSeqOnComplete()) { if (dt.isOverwriteSeqOnComplete()) {
String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this); String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this);

View File

@ -42,7 +42,7 @@ public class MSysConfig extends X_AD_SysConfig
/** /**
* *
*/ */
private static final long serialVersionUID = 2907227045981641758L; private static final long serialVersionUID = -1248226696518701944L;
public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION"; public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION";
public static final String ALERT_SEND_ATTACHMENT_AS_XLS = "ALERT_SEND_ATTACHMENT_AS_XLS"; public static final String ALERT_SEND_ATTACHMENT_AS_XLS = "ALERT_SEND_ATTACHMENT_AS_XLS";
@ -80,6 +80,7 @@ public class MSysConfig extends X_AD_SysConfig
public static final String DPVIEWS_SHOWINFOSCHEDULE = "DPViews_ShowInfoSchedule"; public static final String DPVIEWS_SHOWINFOSCHEDULE = "DPViews_ShowInfoSchedule";
public static final String ENABLE_PAYMENTBOX_BUTTON = "ENABLE_PAYMENTBOX_BUTTON"; public static final String ENABLE_PAYMENTBOX_BUTTON = "ENABLE_PAYMENTBOX_BUTTON";
public static final String GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS = "GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS"; public static final String GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS = "GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS";
public static final String HTML_REPORT_THEME = "HTML_REPORT_THEME";
public static final String Invoice_ReverseUseNewNumber = "Invoice_ReverseUseNewNumber"; public static final String Invoice_ReverseUseNewNumber = "Invoice_ReverseUseNewNumber";
public static final String JASPER_SWAP_MAX_PAGES = "JASPER_SWAP_MAX_PAGES"; public static final String JASPER_SWAP_MAX_PAGES = "JASPER_SWAP_MAX_PAGES";
public static final String LASTRUN_RECORD_COUNT = "LASTRUN_RECORD_COUNT"; public static final String LASTRUN_RECORD_COUNT = "LASTRUN_RECORD_COUNT";

View File

@ -1171,22 +1171,23 @@ public class MPrintFormat extends X_AD_PrintFormat
*/ */
public static List<KeyNamePair> getAccessiblePrintFormats (int AD_Table_ID, int AD_Window_ID, String trxName, boolean makeNewWhenEmpty) public static List<KeyNamePair> getAccessiblePrintFormats (int AD_Table_ID, int AD_Window_ID, String trxName, boolean makeNewWhenEmpty)
{ {
// append WHERE to can use MRole.getDefault().addAccessSQL String constantForRoleAccess = "SELECT * FROM AD_PrintFormat WHERE ";
String sqlWhere = " WHERE AD_Table_ID=? AND IsTableBased='Y' "; StringBuilder sqlWhereB = new StringBuilder(constantForRoleAccess)
.append("AD_Table_ID=? AND IsTableBased='Y' ");
if (AD_Window_ID > 0) if (AD_Window_ID > 0)
sqlWhere += "AND (AD_Window_ID=? OR AD_Window_ID IS NULL) "; sqlWhereB.append("AND (AD_Window_ID=? OR AD_Window_ID IS NULL)");
// //
sqlWhere = MRole.getDefault().addAccessSQL ( String sqlWhere = MRole.getDefault().addAccessSQL (
sqlWhere, "AD_PrintFormat", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); sqlWhereB.toString(), "AD_PrintFormat", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
// remove " WHERE " to use in Query // remove " WHERE " to use in Query
sqlWhere = sqlWhere.substring(6); sqlWhere = sqlWhere.substring(constantForRoleAccess.length());
// add sql parameter // add sql parameter
List<Object> lsParameter = new ArrayList<Object>(); List<Object> lsParameter = new ArrayList<Object>();
lsParameter.add(new Integer(AD_Table_ID)); lsParameter.add(new Integer(AD_Table_ID));
if (AD_Window_ID > 0) if (AD_Window_ID > 0)
lsParameter.add(new Integer(AD_Window_ID)); lsParameter.add(new Integer(AD_Window_ID));
// init query // init query

View File

@ -57,8 +57,10 @@ import org.apache.ecs.xhtml.a;
import org.apache.ecs.xhtml.link; import org.apache.ecs.xhtml.link;
import org.apache.ecs.xhtml.script; import org.apache.ecs.xhtml.script;
import org.apache.ecs.xhtml.table; import org.apache.ecs.xhtml.table;
import org.apache.ecs.xhtml.tbody;
import org.apache.ecs.xhtml.td; import org.apache.ecs.xhtml.td;
import org.apache.ecs.xhtml.th; import org.apache.ecs.xhtml.th;
import org.apache.ecs.xhtml.thead;
import org.apache.ecs.xhtml.tr; import org.apache.ecs.xhtml.tr;
import org.compiere.model.MClient; import org.compiere.model.MClient;
import org.compiere.model.MColumn; import org.compiere.model.MColumn;
@ -71,7 +73,9 @@ import org.compiere.model.MProject;
import org.compiere.model.MQuery; import org.compiere.model.MQuery;
import org.compiere.model.MRfQResponse; import org.compiere.model.MRfQResponse;
import org.compiere.model.PrintInfo; import org.compiere.model.PrintInfo;
import static org.compiere.model.SystemIDs.*; import static org.compiere.model.SystemIDs.*;
import org.compiere.print.layout.LayoutEngine; import org.compiere.print.layout.LayoutEngine;
import org.compiere.process.ProcessInfo; import org.compiere.process.ProcessInfo;
import org.compiere.process.ServerProcessCtl; import org.compiere.process.ServerProcessCtl;
@ -587,6 +591,8 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
} }
doc.output(w); doc.output(w);
} }
thead thead = new thead();
tbody tbody = new tbody();
// for all rows (-1 = header row) // for all rows (-1 = header row)
for (int row = -1; row < m_printData.getRowCount(); row++) for (int row = -1; row < m_printData.getRowCount(); row++)
{ {
@ -598,6 +604,16 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
{ {
extension.extendRowElement(tr, m_printData); extension.extendRowElement(tr, m_printData);
} }
if (m_printData.isFunctionRow()) {
tr.setClass(cssPrefix + "-functionrow");
} else if ( row < m_printData.getRowCount() && m_printData.isFunctionRow(row+1)) {
tr.setClass(cssPrefix + "-lastgrouprow");
}
// add row to table body
tbody.addElement(tr);
} else {
// add row to table header
thead.addElement(tr);
} }
// for all columns // for all columns
for (int col = 0; col < m_printFormat.getItemCount(); col++) for (int col = 0; col < m_printFormat.getItemCount(); col++)
@ -719,9 +735,11 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
} }
} // printed } // printed
} // for all columns } // for all columns
tr.output(w);
} // for all rows } // for all rows
thead.output(w);
tbody.output(w);
w.println(); w.println();
w.println("</table>"); w.println("</table>");
if (!onlyTable) if (!onlyTable)

View File

@ -0,0 +1,65 @@
/**********************************************************************
* This file is part of iDempiere ERP Open Source *
* http://www.idempiere.org *
* *
* Copyright (C) Contributors *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
* MA 02110-1301, USA. *
* *
* Contributors: *
* - Carlos Ruiz - globalqss *
**********************************************************************/
package org.idempiere.model;
import java.util.Properties;
import org.compiere.model.CalloutEngine;
import org.compiere.model.GridField;
import org.compiere.model.GridTab;
import org.compiere.model.MLocator;
import org.compiere.model.MWarehouse;
import org.compiere.util.Env;
public class CalloutFillLocator extends CalloutEngine {
/**
* fillLocator - fill default Locator based on actual warehouse
*
* @param ctx
* @param WindowNo
* @param mTab
* @param mField
* @param value
* @return error message or ""
*/
public String fillLocator(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
{
Integer locatorID = (Integer) value;
if (locatorID == null || locatorID.intValue() == 0) {
int warehouseID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID", true);
if (warehouseID > 0) {
MWarehouse wh = MWarehouse.get(ctx, warehouseID);
MLocator defaultLocator = wh.getDefaultLocator();
if (defaultLocator != null) {
mTab.setValue(mField, defaultLocator.getM_Locator_ID());
}
}
}
return "";
}
}

View File

@ -34,7 +34,9 @@ import java.util.logging.Level;
import org.adempiere.server.rpl.IImportProcessor; import org.adempiere.server.rpl.IImportProcessor;
import org.compiere.model.AdempiereProcessor; import org.compiere.model.AdempiereProcessor;
import org.compiere.model.MClient; import org.compiere.model.MClient;
import org.compiere.model.MOrgInfo;
import org.compiere.model.X_IMP_Processor_Type; import org.compiere.model.X_IMP_Processor_Type;
import org.compiere.util.Env;
import org.compiere.util.TimeUtil; import org.compiere.util.TimeUtil;
import org.compiere.server.AdempiereServer; import org.compiere.server.AdempiereServer;
import org.compiere.model.MIMPProcessor; import org.compiere.model.MIMPProcessor;
@ -96,6 +98,16 @@ public class ReplicationProcessor extends AdempiereServer {
{ {
// process is not started! // process is not started!
// Prepare a ctx
Env.setContext(mImportProcessor.getCtx(), "#AD_Client_ID", mImportProcessor.getAD_Client_ID());
Env.setContext(mImportProcessor.getCtx(), "#AD_Org_ID", mImportProcessor.getAD_Org_ID());
if (mImportProcessor.getAD_Org_ID() != 0) {
MOrgInfo schedorg = MOrgInfo.get(getCtx(), mImportProcessor.getAD_Org_ID(), null);
if (schedorg.getM_Warehouse_ID() > 0)
Env.setContext(mImportProcessor.getCtx(), "#M_Warehouse_ID", schedorg.getM_Warehouse_ID());
}
Env.setContext(mImportProcessor.getCtx(), "#AD_User_ID", getAD_User_ID());
m_summary = new StringBuffer(); m_summary = new StringBuffer();
String trxName = mImportProcessor.get_TrxName(); String trxName = mImportProcessor.get_TrxName();
if ( trxName == null || "".equals(trxName) ) if ( trxName == null || "".equals(trxName) )
@ -148,6 +160,18 @@ public class ReplicationProcessor extends AdempiereServer {
} }
} }
protected int getAD_User_ID() {
int AD_User_ID;
if (mImportProcessor.getCreatedBy() > 0)
AD_User_ID = mImportProcessor.getCreatedBy();
else if (mImportProcessor.getUpdatedBy() > 0)
AD_User_ID = mImportProcessor.getUpdatedBy();
else
AD_User_ID = 100; //fall back to SuperUser
return AD_User_ID;
}
@Override @Override
public String getServerInfo() public String getServerInfo()
{ {

View File

@ -41,6 +41,7 @@ import org.compiere.util.CLogger;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
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.compiere.util.TimeUtil; import org.compiere.util.TimeUtil;
import org.compiere.util.Trx; import org.compiere.util.Trx;
@ -93,7 +94,13 @@ public class AlertProcessor extends AdempiereServer
MAlert[] alerts = m_model.getAlerts(false); MAlert[] alerts = m_model.getAlerts(false);
for (int i = 0; i < alerts.length; i++) for (int i = 0; i < alerts.length; i++)
{ {
if (!processAlert(alerts[i])) Language language = Env.getLanguage(getCtx());
// Try to get the language of the client's alert
MClient client = MClient.get(getCtx(), alerts[i].getAD_Client_ID());
if (client.getLanguage() != null)
language = client.getLanguage();
if (!processAlert(alerts[i], language))
countError++; countError++;
count++; count++;
} }
@ -119,7 +126,7 @@ public class AlertProcessor extends AdempiereServer
* @param alert alert * @param alert alert
* @return true if processed * @return true if processed
*/ */
protected boolean processAlert (MAlert alert) protected boolean processAlert (MAlert alert, Language language)
{ {
if (!alert.isValid()) if (!alert.isValid())
return false; return false;
@ -164,8 +171,8 @@ public class AlertProcessor extends AdempiereServer
try try
{ {
String text = null; String text = null;
if (MSysConfig.getBooleanValue(MSysConfig.ALERT_SEND_ATTACHMENT_AS_XLS, true, Env.getAD_Client_ID(getCtx()))) if (MSysConfig.getBooleanValue(MSysConfig.ALERT_SEND_ATTACHMENT_AS_XLS, true, alert.getAD_Client_ID()))
text = getExcelReport(rule, sql, null, attachments); text = getExcelReport(rule, sql, language, null, attachments);
else else
text = getPlainTextReport(rule, sql, null, attachments); text = getPlainTextReport(rule, sql, null, attachments);
if (text != null && text.length() > 0) if (text != null && text.length() > 0)
@ -220,9 +227,9 @@ public class AlertProcessor extends AdempiereServer
// //
// Report footer - Date Generated // Report footer - Date Generated
DateFormat df = DisplayType.getDateFormat(DisplayType.DateTime); DateFormat df = DisplayType.getDateFormat(DisplayType.DateTime, language);
message.append("\n\n"); message.append("\n\n");
message.append(Msg.translate(getCtx(), "Date")).append(" : ") message.append(Msg.translate(language, "Date")).append(" : ")
.append(df.format(new Timestamp(System.currentTimeMillis()))); .append(df.format(new Timestamp(System.currentTimeMillis())));
Collection<Integer> users = alert.getRecipientUsers(); Collection<Integer> users = alert.getRecipientUsers();
@ -408,7 +415,7 @@ public class AlertProcessor extends AdempiereServer
* @return summary message to be added into mail content * @return summary message to be added into mail content
* @throws Exception * @throws Exception
*/ */
protected String getExcelReport(MAlertRule rule, String sql, String trxName, Collection<File> attachments) protected String getExcelReport(MAlertRule rule, String sql, Language language, String trxName, Collection<File> attachments)
throws Exception throws Exception
{ {
ArrayList<ArrayList<Object>> data = getData(sql, trxName); ArrayList<ArrayList<Object>> data = getData(sql, trxName);
@ -418,10 +425,10 @@ public class AlertProcessor extends AdempiereServer
File file = rule.createReportFile("xls"); File file = rule.createReportFile("xls");
// //
ArrayExcelExporter exporter = new ArrayExcelExporter(getCtx(), data); ArrayExcelExporter exporter = new ArrayExcelExporter(getCtx(), data);
exporter.export(file, null, false); exporter.export(file, language, false);
attachments.add(file); attachments.add(file);
String msg = rule.getName() + " (@SeeAttachment@ "+file.getName()+")"+Env.NL; String msg = rule.getName() + " (" + Msg.translate(language, "SeeAttachment") + " " + file.getName() + ")" + Env.NL;
return Msg.parseTranslation(Env.getCtx(), msg); return msg;
} }
/** /**

View File

@ -23,6 +23,8 @@ import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.window.WFieldRecordInfo; import org.adempiere.webui.window.WFieldRecordInfo;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.event.Events;
@ -77,8 +79,8 @@ public class WDatetimeEditor extends WEditor implements ContextMenuListener
public WDatetimeEditor() public WDatetimeEditor()
{ {
this("Datetime", "Datetime", false, false, true); this(Msg.getMsg(Env.getCtx(), "DateTime"), Msg.getMsg(Env.getCtx(), "DateTime"), false, false, true);
} // VDate } // WDatetimeEditor
/** /**
* *

View File

@ -19,6 +19,7 @@ import org.apache.ecs.ConcreteElement;
import org.apache.ecs.xhtml.a; import org.apache.ecs.xhtml.a;
import org.apache.ecs.xhtml.div; import org.apache.ecs.xhtml.div;
import org.apache.ecs.xhtml.img; import org.apache.ecs.xhtml.img;
import org.compiere.model.MSysConfig;
import org.compiere.print.IHTMLExtension; import org.compiere.print.IHTMLExtension;
import org.compiere.print.PrintData; import org.compiere.print.PrintData;
import org.compiere.print.PrintDataElement; import org.compiere.print.PrintDataElement;
@ -32,14 +33,24 @@ import org.compiere.util.Msg;
*/ */
public class HTMLExtension implements IHTMLExtension { public class HTMLExtension implements IHTMLExtension {
private String contextPath;
private String classPrefix; private String classPrefix;
private String componentId; private String componentId;
private String scriptURL;
private String styleURL;
public HTMLExtension(String contextPath, String classPrefix, String componentId) { public HTMLExtension(String contextPath, String classPrefix, String componentId) {
this.contextPath = contextPath;
String theme = MSysConfig.getValue(MSysConfig.HTML_REPORT_THEME, "/", Env.getAD_Client_ID(Env.getCtx()));
if (! theme.startsWith("/"))
theme = "/" + theme;
if (! theme.endsWith("/"))
theme = theme + "/";
this.classPrefix = classPrefix; this.classPrefix = classPrefix;
this.componentId = componentId; this.componentId = componentId;
this.scriptURL = contextPath + theme + "js/report.js";
this.styleURL = contextPath + theme + "css/report.css";
} }
public void extendIDColumn(int row, ConcreteElement columnElement, a href, public void extendIDColumn(int row, ConcreteElement columnElement, a href,
@ -106,11 +117,11 @@ public class HTMLExtension implements IHTMLExtension {
} }
public String getScriptURL() { public String getScriptURL() {
return contextPath + "/js/report.js"; return scriptURL;
} }
public String getStyleURL() { public String getStyleURL() {
return contextPath + "/css/report.css"; return styleURL;
} }
} }

View File

@ -22,7 +22,9 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@ -57,6 +59,7 @@ import org.compiere.util.CLogger;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
import org.compiere.util.EMail; import org.compiere.util.EMail;
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.compiere.util.Util; import org.compiere.util.Util;
import org.zkforge.ckez.CKeditor; import org.zkforge.ckez.CKeditor;
@ -120,6 +123,9 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
fMessage = new CKeditor(); fMessage = new CKeditor();
fMessage.setCustomConfigurationsPath("/js/ckeditor/config.js"); fMessage.setCustomConfigurationsPath("/js/ckeditor/config.js");
fMessage.setToolbar("MyToolbar"); fMessage.setToolbar("MyToolbar");
Map<String,Object> lang = new HashMap<String,Object>();
lang.put("language", Language.getLoginLanguage().getAD_Language());
fMessage.setConfig(lang);
commonInit(from, to, subject, message, attachment); commonInit(from, to, subject, message, attachment);
} // EmailDialog } // EmailDialog

View File

@ -12,6 +12,9 @@
*****************************************************************************/ *****************************************************************************/
package org.adempiere.webui.window; package org.adempiere.webui.window;
import java.util.HashMap;
import java.util.Map;
import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.Tab; import org.adempiere.webui.component.Tab;
@ -21,6 +24,8 @@ import org.adempiere.webui.component.Tabpanels;
import org.adempiere.webui.component.Tabs; import org.adempiere.webui.component.Tabs;
import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Textbox;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.compiere.util.Env;
import org.compiere.util.Language;
import org.zkforge.ckez.CKeditor; import org.zkforge.ckez.CKeditor;
import org.zkoss.zk.au.out.AuScript; import org.zkoss.zk.au.out.AuScript;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
@ -162,6 +167,9 @@ public class WTextEditorDialog extends Window implements EventListener<Event>{
editor = new CKeditor(); editor = new CKeditor();
editor.setCustomConfigurationsPath("/js/ckeditor/config.js"); editor.setCustomConfigurationsPath("/js/ckeditor/config.js");
editor.setToolbar("MyToolbar"); editor.setToolbar("MyToolbar");
Map<String,Object> lang = new HashMap<String,Object>();
lang.put("language", Language.getLoginLanguage().getAD_Language());
editor.setConfig(lang);
tabPanel.appendChild(editor); tabPanel.appendChild(editor);
editor.setVflex("1"); editor.setVflex("1");
editor.setWidth("100%"); editor.setWidth("100%");

View File

@ -8,23 +8,35 @@
border-collapse: collapse; border-collapse: collapse;
width: 90%; width: 90%;
background-color: #EBF1EF; background-color: #EBF1EF;
border-width: 0px;
} }
.rp-table th { .rp-table th {
text-align: center; text-align: center;
padding: 2px; padding: 2px;
font-weight: normal; font-weight: bold;
font-size: 13px;
background-color: #C6D1CD; background-color: #C6D1CD;
border-width: 1px; border-width: 1px;
border-color: #BBBBBB; border-color: black;
border-width: 2px 1px 2px 0px;
border-style: solid; border-style: solid;
} }
.rp-table th:last-child {
border-width: 2px 0px 2px 0px;
}
.rp-table td { .rp-table td {
border-width: 1px; border-width: 1px;
border-color: #BBBBBB; border-color: #BBBBBB;
border-style: solid; border-style: solid;
border-width: 1px 1px 1px 0px;
padding: 3px; padding: 3px;
} }
.rp-table td:last-child {
border-width: 1px 0px 1px 0px;
}
.rp-number { .rp-number {
background-color: #EBF1EF; background-color: #EBF1EF;
text-align: right !important; text-align: right !important;
@ -35,3 +47,24 @@
text-align: left; text-align: left;
padding: 3px; padding: 3px;
} }
.rp-lastgrouprow td {
border-width: 0px 1px 2px 0px;
border-color: white #BBBBBB black white;
}
.rp-lastgrouprow td:last-child {
border-width: 0px 0px 2px 0px;
border-color: white #BBBBBB black white;
}
.rp-functionrow td {
background-color: #C6D1CD;
font-weight: bold;
border-width: 0px 1px 0px 0px;
}
.rp-functionrow td:last-child {
border-width: 0px 0px 0px 0px;
}

View File

@ -372,8 +372,8 @@ public abstract class PaymentFormCash extends PaymentForm {
m_mPayment.setC_Order_ID(C_Order_ID); m_mPayment.setC_Order_ID(C_Order_ID);
m_needSave = true; m_needSave = true;
} }
m_mPayment.setDateTrx(m_DateAcct); m_mPayment.setDateTrx(newDateAcct);
m_mPayment.setDateAcct(m_DateAcct); m_mPayment.setDateAcct(newDateAcct);
m_mPayment.saveEx(); m_mPayment.saveEx();
// Save/Post // Save/Post
@ -398,8 +398,6 @@ public abstract class PaymentFormCash extends PaymentForm {
*/ */
log.config("Saving changes"); log.config("Saving changes");
// //
if (!newDateAcct.equals(m_DateAcct))
getGridTab().setValue("DateAcct", newDateAcct);
// Set Payment // Set Payment
if (m_mPayment.getC_Payment_ID() != m_C_Payment_ID) if (m_mPayment.getC_Payment_ID() != m_C_Payment_ID)
{ {