hg merge release-2.0 (merge release2 into development)

This commit is contained in:
Carlos Ruiz 2014-04-02 22:24:15 -05:00
commit 156bde8b07
22 changed files with 458 additions and 148 deletions

View File

@ -0,0 +1,14 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Mar 21, 2014 10:20:57 PM CET
-- IDEMPIERE-1845
UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_DATE('2014-03-21 22:20:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9448
;
-- Mar 21, 2014 10:20:59 PM CET
UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_DATE('2014-03-21 22:20:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202528
;
SELECT register_migration_script('201303212222_IDEMPIERE-1845.sql') FROM dual
;

View File

@ -0,0 +1,11 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Mar 30, 2014 6:50:49 PM COT
-- IDEMPIERE-1864 Allow negative tax rate
UPDATE AD_Column SET ValueMin=NULL,Updated=TO_DATE('2014-03-30 18:50:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3693
;
SELECT register_migration_script('201403301851_IDEMPIERE-1864.sql') FROM dual
;

View File

@ -0,0 +1,14 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Apr 2, 2014 8:22:49 AM COT
-- IDEMPIERE-1834
UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_DATE('2014-04-02 08:22:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10900
;
UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_DATE('2014-04-02 08:22:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=53438
;
SELECT register_migration_script('201404020823_IDEMPIERE-1834.sql') FROM dual
;

View File

@ -0,0 +1,15 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Apr 2, 2014 10:27:03 AM COT
-- IDEMPIERE-1717 Maintenance mode
INSERT INTO AD_SysConfig (AD_SysConfig_ID,ConfigurationLevel,Value,Description,AD_SysConfig_UU,Updated,Created,AD_Org_ID,CreatedBy,IsActive,UpdatedBy,Name,AD_Client_ID,EntityType) VALUES (200052,'C','N','Define if the system is in manteinance mode. Y = just advanced roles can log in / N = normal operation mode','636b9278-5633-4f92-9180-a2eb4f0674b1',TO_DATE('2014-04-02 10:27:02','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2014-04-02 10:27:02','YYYY-MM-DD HH24:MI:SS'),0,100,'Y',100,'SYSTEM_IN_MAINTENANCE_MODE',0,'D')
;
-- Apr 2, 2014 10:39:33 AM COT
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,Created,AD_Client_ID,AD_Org_ID) VALUES ('E','System is in maintenance mode, please wait until the access is restored.',200268,'D','bc45a082-4784-46a8-b5a5-14874ed5ee69','SystemInMaintenance','Y',TO_DATE('2014-04-02 10:39:32','YYYY-MM-DD HH24:MI:SS'),100,100,TO_DATE('2014-04-02 10:39:32','YYYY-MM-DD HH24:MI:SS'),0,0)
;
SELECT register_migration_script('201404021038_IDEMPIERE-1717.sql') FROM dual
;

View File

@ -0,0 +1,15 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Apr 2, 2014 2:46:52 PM COT
-- fix wrong length of PA_DashboardContent_Trl.Name
UPDATE AD_Column SET FieldLength=120,Updated=TO_DATE('2014-04-02 14:46:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=60126
;
-- Apr 2, 2014 2:46:54 PM COT
ALTER TABLE PA_DashboardContent_Trl MODIFY Name VARCHAR2(120)
;
SELECT register_migration_script('201404021448_IDEMPIERE-1216.sql') FROM dual
;

View File

@ -0,0 +1,11 @@
-- Mar 21, 2014 10:20:57 PM CET
-- IDEMPIERE-1845
UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2014-03-21 22:20:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9448
;
-- Mar 21, 2014 10:20:59 PM CET
UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2014-03-21 22:20:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202528
;
SELECT register_migration_script('201303212222_IDEMPIERE-1845.sql') FROM dual
;

View File

@ -0,0 +1,8 @@
-- Mar 30, 2014 6:50:49 PM COT
-- IDEMPIERE-1864 Allow negative tax rate
UPDATE AD_Column SET ValueMin=NULL,Updated=TO_TIMESTAMP('2014-03-30 18:50:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3693
;
SELECT register_migration_script('201403301851_IDEMPIERE-1864.sql') FROM dual
;

View File

@ -0,0 +1,11 @@
-- Apr 2, 2014 8:22:49 AM COT
-- IDEMPIERE-1834
UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2014-04-02 08:22:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10900
;
UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2014-04-02 08:22:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=53438
;
SELECT register_migration_script('201404020823_IDEMPIERE-1834.sql') FROM dual
;

View File

@ -0,0 +1,12 @@
-- Apr 2, 2014 10:27:03 AM COT
-- IDEMPIERE-1717 Maintenance mode
INSERT INTO AD_SysConfig (AD_SysConfig_ID,ConfigurationLevel,Value,Description,AD_SysConfig_UU,Updated,Created,AD_Org_ID,CreatedBy,IsActive,UpdatedBy,Name,AD_Client_ID,EntityType) VALUES (200052,'C','N','Define if the system is in manteinance mode. Y = just advanced roles can log in / N = normal operation mode','636b9278-5633-4f92-9180-a2eb4f0674b1',TO_TIMESTAMP('2014-04-02 10:27:02','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2014-04-02 10:27:02','YYYY-MM-DD HH24:MI:SS'),0,100,'Y',100,'SYSTEM_IN_MAINTENANCE_MODE',0,'D')
;
-- Apr 2, 2014 10:39:33 AM COT
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,Created,AD_Client_ID,AD_Org_ID) VALUES ('E','System is in maintenance mode, please wait until the access is restored.',200268,'D','bc45a082-4784-46a8-b5a5-14874ed5ee69','SystemInMaintenance','Y',TO_TIMESTAMP('2014-04-02 10:39:32','YYYY-MM-DD HH24:MI:SS'),100,100,TO_TIMESTAMP('2014-04-02 10:39:32','YYYY-MM-DD HH24:MI:SS'),0,0)
;
SELECT register_migration_script('201404021038_IDEMPIERE-1717.sql') FROM dual
;

View File

@ -0,0 +1,12 @@
-- Apr 2, 2014 2:46:52 PM COT
-- fix wrong length of PA_DashboardContent_Trl.Name
UPDATE AD_Column SET FieldLength=120,Updated=TO_TIMESTAMP('2014-04-02 14:46:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=60126
;
-- Apr 2, 2014 2:46:54 PM COT
INSERT INTO t_alter_column values('pa_dashboardcontent_trl','Name','VARCHAR(120)',null,null)
;
SELECT register_migration_script('201404021448_IDEMPIERE-1216.sql') FROM dual
;

View File

@ -8,4 +8,5 @@ Require-Bundle: org.adempiere.base;bundle-version="2.0.0"
Eclipse-RegisterBuddy: org.adempiere.base
Service-Component: OSGI-INF/costadjustmentcalloutfactory.xml
Bundle-ActivationPolicy: lazy
Export-Package: org.compiere.model

View File

@ -769,8 +769,17 @@ public class GridField
{
// try timestamp format - then date format -- [ 1950305 ]
java.util.Date date = null;
SimpleDateFormat dateTimeFormat = DisplayType.getTimestampFormat_Default();
SimpleDateFormat dateFormat = DisplayType.getDateFormat_JDBC();
SimpleDateFormat timeFormat = DisplayType.getTimeFormat_Default();
try {
date = DisplayType.getTimestampFormat_Default().parse (value);
if (m_vo.displayType == DisplayType.Date) {
date = dateFormat.parse (value);
} else if (m_vo.displayType == DisplayType.Time) {
date = timeFormat.parse (value);
} else {
date = dateTimeFormat.parse (value);
}
} catch (java.text.ParseException e) {
date = DisplayType.getDateFormat_JDBC().parse (value);
}

View File

@ -189,26 +189,23 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck
return psc;
} // createForPayment
/**************************************************************************
* Get Checks of Payment Selection
* Get Checks of Payment Selection without check no assignment
*
* @param C_PaySelection_ID Payment Selection
* @param PaymentRule Payment Rule
* @param startDocumentNo start document no
* @param trxName transaction
* @return array of checks
*/
static public MPaySelectionCheck[] get (int C_PaySelection_ID,
String PaymentRule, int startDocumentNo, String trxName)
public static MPaySelectionCheck[] get (int C_PaySelection_ID, String PaymentRule, String trxName)
{
if (s_log.isLoggable(Level.FINE)) s_log.fine("C_PaySelection_ID=" + C_PaySelection_ID
+ ", PaymentRule=" + PaymentRule + ", startDocumentNo=" + startDocumentNo);
+ ", PaymentRule=" + PaymentRule);
ArrayList<MPaySelectionCheck> list = new ArrayList<MPaySelectionCheck>();
int docNo = startDocumentNo;
String sql = "SELECT * FROM C_PaySelectionCheck "
+ "WHERE C_PaySelection_ID=? AND PaymentRule=?";
+ "WHERE C_PaySelection_ID=? AND PaymentRule=? "
+ "ORDER BY C_PaySelectionCheck_ID"; // order by the C_PaySelectionCheck_ID
PreparedStatement pstmt = null;
ResultSet rs = null;
try
@ -220,9 +217,6 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck
while (rs.next())
{
MPaySelectionCheck check = new MPaySelectionCheck (Env.getCtx(), rs, trxName);
// Set new Check Document No
check.setDocumentNo(String.valueOf(docNo++));
check.saveEx();
list.add(check);
}
}
@ -244,18 +238,36 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck
/**************************************************************************
* Confirm Print.
* Create Payments the first time
* @param checks checks
* @param batch batch
* @return last Document number or 0 if nothing printed
* Get Checks of Payment Selection
*
* @param C_PaySelection_ID Payment Selection
* @param PaymentRule Payment Rule
* @param startDocumentNo start document no
* @param trxName transaction
* @return array of checks
*/
public static int confirmPrint (MPaySelectionCheck[] checks, MPaymentBatch batch)
static public MPaySelectionCheck[] get (int C_PaySelection_ID,
String PaymentRule, int startDocumentNo, String trxName)
{
int lastDocumentNo = 0;
for (int i = 0; i < checks.length; i++)
MPaySelectionCheck[] checks = get(C_PaySelection_ID, PaymentRule, trxName);
int docNo = startDocumentNo;
for (MPaySelectionCheck check : checks)
{
// Set new Check Document No
check.setDocumentNo(String.valueOf(docNo++));
check.saveEx();
}
return checks;
} // get
/**************************************************************************
* Confirm Print for a payment selection check
* Create Payment the first time
* @param check check
* @param batch batch
*/
public static void confirmPrint (MPaySelectionCheck check, MPaymentBatch batch)
{
MPaySelectionCheck check = checks[i];
MPayment payment = new MPayment(check.getCtx(), check.getC_Payment_ID(), check.get_TrxName());
// Existing Payment
if (check.getC_Payment_ID() != 0)
@ -283,7 +295,7 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck
else
{
s_log.log(Level.SEVERE, "Unsupported Payment Rule=" + check.getPaymentRule());
continue;
return;
}
payment.setTrxType(X_C_Payment.TRXTYPE_CreditPayment);
payment.setAmount(check.getParent().getC_Currency_ID(), check.getPayAmt());
@ -335,6 +347,27 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck
}
} // new Payment
check.setIsPrinted(true);
check.setProcessed(true);
if (!check.save ())
s_log.log(Level.SEVERE, "Check not saved: " + check);
} // confirmPrint
/**************************************************************************
* Confirm Print.
* Create Payments the first time
* @param checks checks
* @param batch batch
* @return last Document number or 0 if nothing printed
*/
public static int confirmPrint (MPaySelectionCheck[] checks, MPaymentBatch batch)
{
int lastDocumentNo = 0;
for (int i = 0; i < checks.length; i++)
{
MPaySelectionCheck check = checks[i];
confirmPrint(check, batch);
// Get Check Document No
try
{
@ -346,10 +379,6 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck
{
s_log.log(Level.SEVERE, "DocumentNo=" + check.getDocumentNo(), ex);
}
check.setIsPrinted(true);
check.setProcessed(true);
if (!check.save ())
s_log.log(Level.SEVERE, "Check not saved: " + check);
} // all checks
if (s_log.isLoggable(Level.FINE)) s_log.fine("Last Document No = " + lastDocumentNo);

View File

@ -21,6 +21,7 @@ import java.util.List;
import java.util.Properties;
import org.compiere.util.CLogger;
import org.compiere.util.Msg;
/**
* User Roles Model
@ -33,8 +34,7 @@ public class MUserRoles extends X_AD_User_Roles
/**
*
*/
private static final long serialVersionUID = -2659323298844769713L;
private static final long serialVersionUID = 5850010835736994376L;
/**
* Get User Roles Of Role
@ -133,4 +133,38 @@ public class MUserRoles extends X_AD_User_Roles
set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID));
} // setAD_Role_ID
@Override
protected boolean beforeSave(boolean newRecord) {
// IDEMPIERE-1410
if (! MRole.getDefault().isAccessAdvanced()) {
MRole role = new MRole(getCtx(), getAD_Role_ID(), get_TrxName());
if (role.isAccessAdvanced()) {
log.saveError("Error", Msg.getMsg(getCtx(), "ActionNotAllowedHere"));
return false;
}
if (! newRecord && is_ValueChanged(COLUMNNAME_AD_Role_ID)) {
MRole oldrole = new MRole(getCtx(), get_ValueOldAsInt(COLUMNNAME_AD_Role_ID), get_TrxName());
if (oldrole.isAccessAdvanced()) {
log.saveError("Error", Msg.getMsg(getCtx(), "ActionNotAllowedHere"));
return false;
}
}
}
return true;
}
@Override
protected boolean beforeDelete() {
// IDEMPIERE-1410
if (! MRole.getDefault().isAccessAdvanced()) {
MRole role = new MRole(getCtx(), getAD_Role_ID(), get_TrxName());
if (role.isAccessAdvanced()) {
log.saveError("Error", Msg.getMsg(getCtx(), "ActionNotAllowedHere"));
return false;
}
}
return true;
}
} // MUserRoles

View File

@ -769,6 +769,13 @@ public class Login
log.severe("Refused: " + error);
return error;
}
// IDEMPIERE-1717 Maintenance mode
if (! MRole.get(m_ctx, AD_Role_ID).isAccessAdvanced()) {
if (MSysConfig.getBooleanValue("SYSTEM_IN_MAINTENANCE_MODE", false, AD_Client_ID))
return Msg.getMsg(m_ctx, "SystemInMaintenance");
}
return null;
} // validateLogin

View File

@ -2,9 +2,9 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ADempiere - Smart Open Source ERP Software with integrated CRM Solution</title>
<meta name="author" content="ADempiere">
<meta name="copyright" content="Copyright 2010, ADempiere">
<title>iDempiere - Smart Open Source ERP Software with integrated CRM Solution</title>
<meta name="author" content="iDempiere">
<meta name="copyright" content="Copyright 2010, iDempiere">
<meta name="rating" content="GENERAL">
<link rel="stylesheet" href="images/adempiere_disc.css" type="text/css" media="screen">
<link rel="stylesheet" href="images/adempiere_print.css" type="text/css" media="print">
@ -41,8 +41,8 @@ function MM_swapImage() { //v3.0
<!-- begin masthead -->
<div id="masthead">
<div id="header">
<div id="logoHeader"><a href="http://www.adempiere.org" target="_blank"><img src="images/adempiere_5a.jpg" width="760" height="94" border="0" /></a></div>
<div id="topNav" class='noPrint'><a href="http://www.adempiere.com/index.php?option=com_contact&Itemid=3" class="alttoplink" target="_blank">Contact
<div id="logoHeader"><a href="http://www.idempiere.org" target="_blank"><img src="images/idempiere_5a.jpg" width="760" height="94" border="0" /></a></div>
<div id="topNav" class='noPrint'><a href="http://www.idempiere.com/index.php?option=com_contact&Itemid=3" class="alttoplink" target="_blank">Contact
Us</a></div>
</div>
</div>
@ -50,42 +50,41 @@ function MM_swapImage() { //v3.0
<!-- end masthead -->
<div id="fullcontent">
<div class="story">
<h1 id="pageName"><img src="images/InstallSteps.gif" alt="Install Steps" width="237" height="667" align="right" />ADempiere
<h1 id="pageName"><img src="images/InstallSteps.gif" alt="Install Steps" width="237" height="667" align="right" />iDempiere
Server Installation </h1>
<img src="images/hr.jpg" name="pageNameimg" width="350" height="2" id="pageNameimg"/>
<p>Please check the more detailed page on <a href="http://www.adempiere.com/wiki/index.php" target="i">ADempiere Wiki<br />
</a>for the latest version and help from ADempiere Partners.</p>
<p>Please check the more detailed page on <a href="http://wiki.idempiere.org" target="i">iDempiere Wiki<br />
</a>for the latest version and help from iDempiere Partners.</p>
<p><a href="license.html">License information</a></p>
<p>&nbsp;</p>
<h2 id="storyTitle2">Prerequisites</h2>
<ol>
<li>Download and install <a href="http://java.sun.com/j2se/1.5.0/download.html" target="sun">Sun Java 1.5.0 SDK</a> (not just JRE)</li>
<li><a href="http://adempiere.com/wiki/index.php/ADempiere_Installing" target="ora">Install
<li>Download and install <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" target="sun">Oracle Java 7 SDK</a> (not just JRE)</li>
<li><a href="http://wiki.idempiere.org/en/Install_Database" target="ora">Install
Database</a> (Oracle 10g free download for development, Oracle 10gXE,
PostgreSQL)</li>
<li>You downloaded ADempiere </li>
<li>You downloaded iDempiere </li>
</ol>
<h2 id="storyTitle2">Installation</h2>
<ol>
<li><a href="http://www.adempiere.com/wiki/index.php/InstallServer" target="i">Install ADempiere Server</a></li>
<li><a href="http://adempiere.com/wiki/index.php/CreateDatabase" target="i">Create ADempiere Database</a></li>
<li><a href="http://www.adempiere.com/wiki/index.php/InstallComplete" target="i">Complete ADempiere Server Install</a></li>
<li><a href="http://wiki.idempiere.org/en/Install_Server" target="i">Install iDempiere Server</a></li>
<li><a href="http://wiki.idempiere.org/en/Create_Database" target="i">Create iDempiere Database</a></li>
<li><a href="http://wiki.idempiere.org/enInstall_Complete" target="i">Complete iDempiere Server Install</a></li>
</ol>
<h2 id="storyTitle1">Client Installation</h2>
<ol>
<li>Download and install <a href="http://java.sun.com/j2se/1.5.0/download.html" target="sun">Sun Java 1.5.0 JRE</a></li>
<li>Download and install <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" target="sun">Oracle Java 7 JRE</a></li>
<li>Point your browser to your application server - options -
<ol>
<li>Start the client with WebStart</li>
<li>Download and extract the file AdempiereClient.zip </li>
<li>Download and extract the idempiere client</li>
</ol>
</li>
</ol>
<p><a href="http://www.adempiere.com/wiki/index.php/InstallClient" target="i">ADempiere Application Client Install Details</a>.</p>
<p><a href="http://wiki.idempiere.org/en/Install_Client" target="i">iDempiere Application Client Install Details</a>.</p>
<h2 id="storyTitle1">Installing Language Packs</h2>
<p>Please check the <a href="http://sourceforge.net/project/showfiles.php?group_id=176962">Download
<p>Please check the <a href="http://wiki.idempiere.org/en/Translations">Translations
Project Page</a> for the availability of Language Packs. You find the
installation details <a href="http://www.adempiere.com/wiki/index.php/Language_Pack_Installation">here</a>.<br>
installation details <a href="http://wiki.idempiere.org/en/Language_Pack_Installation">here</a>.<br>
</p>
</div>
</div>
@ -94,8 +93,8 @@ function MM_swapImage() { //v3.0
<tr>
<td height="38" align="center" valign="top">
<p class="style2"><font size="2" face="Geneva, Arial, Helvetica, sans-serif">Copyright
&copy; 2010 ADempiere, Inc. - All rights reserved<br />
ADempiere&#153; is a registered trademark of ADempiere, Inc</font>
&copy; 2010 iDempiere, Inc. - All rights reserved<br />
iDempiere&#153; is a registered trademark of iDempiere, Inc</font>
</p>
</td>
</tr>

View File

@ -2,12 +2,12 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ADempiere Server Error</title>
<title>iDempiere Server Error</title>
<link href="/standard.css" rel="stylesheet"/>
</head>
<body>
<h1>ADempiere Server Error </h1>
<p>The ADempiere Server encountered a unrecoverable error.</p>
<h1>iDempiere Server Error </h1>
<p>The iDempiere Server encountered a unrecoverable error.</p>
<h2>Please notify the administrator.</h2>
</body>
</html>

View File

@ -18,6 +18,9 @@ package org.compiere.server;
import java.io.File;
import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Properties;
@ -40,10 +43,12 @@ import org.compiere.print.ReportEngine;
import org.compiere.process.ProcessInfo;
import org.compiere.process.ProcessInfoUtil;
import org.compiere.process.ServerProcessCtl;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.TimeUtil;
import org.compiere.util.Trx;
import org.compiere.util.Util;
/**
@ -402,6 +407,39 @@ public class Scheduler extends AdempiereServer
if (variable == null
|| (variable != null && variable.length() == 0))
value = null;
else if (variable.startsWith("@SQL=")) {
String defStr = "";
String sql = variable.substring(5); // w/o tag
//sql = Env.parseContext(m_vo.ctx, m_vo.WindowNo, sql, false, true); // replace variables
//hengsin, capture unparseable error to avoid subsequent sql exception
sql = Env.parseContext(m_schedulerctx, 0, sql, false, false); // replace variables
if (sql.equals(""))
log.log(Level.WARNING, "(" + sPara.getColumnName() + ") - Default SQL variable parse failed: " + variable);
else {
PreparedStatement stmt = null;
ResultSet rs = null;
try {
stmt = DB.prepareStatement(sql, null);
rs = stmt.executeQuery();
if (rs.next())
defStr = rs.getString(1);
else {
if (log.isLoggable(Level.INFO))
log.log(Level.INFO, "(" + sPara.getColumnName() + ") - no Result: " + sql);
}
}
catch (SQLException e) {
log.log(Level.WARNING, "(" + sPara.getColumnName() + ") " + sql, e);
}
finally{
DB.close(rs, stmt);
rs = null;
stmt = null;
}
}
if (!Util.isEmpty(defStr))
value = defStr;
} // SQL Statement
else if ( variable.indexOf('@') != -1
&& variable.indexOf('@') != variable.lastIndexOf('@')) // we have a variable / BF [1926032]
{

View File

@ -20,6 +20,7 @@ import java.util.Map.Entry;
import java.util.Properties;
import org.adempiere.util.GridRowCtx;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.Checkbox;
import org.adempiere.webui.component.EditorBox;
@ -361,7 +362,7 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
Grid grid = (Grid) row.getParent().getParent();
org.zkoss.zul.Columns columns = grid.getColumns();
int rowIndex = row.getParent().getChildren().indexOf(row);
int rowIndex = index;
if (paging != null && paging.getPageSize() > 0) {
rowIndex = (paging.getActivePage() * paging.getPageSize()) + rowIndex;
}
@ -391,6 +392,7 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
row.appendChild(cell);
Boolean isActive = null;
int colIndex = -1;
for (int i = 0; i < columnCount; i++) {
if (editors.get(gridPanelFields[i]) == null) {
@ -416,6 +418,15 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
defaultFocusField = editor;
}
if ("IsActive".equals(gridPanelFields[i].getColumnName())) {
isActive = Boolean.FALSE;
if (currentValues[i] != null) {
if ("true".equalsIgnoreCase(currentValues[i].toString())) {
isActive = Boolean.TRUE;
}
}
}
if (!gridPanelFields[i].isDisplayedGrid() || gridPanelFields[i].isToolbarButton()) {
continue;
}
@ -453,6 +464,20 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
row.setStyle("cursor:pointer");
row.addEventListener(Events.ON_CLICK, rowListener);
row.addEventListener(Events.ON_OK, rowListener);
if (isActive == null) {
Object isActiveValue = gridTab.getValue(rowIndex, "IsActive");
if (isActiveValue != null) {
if ("true".equalsIgnoreCase(isActiveValue.toString())) {
isActive = Boolean.TRUE;
} else {
isActive = Boolean.FALSE;
}
}
}
if (isActive != null && !isActive.booleanValue()) {
LayoutUtils.addSclass("grid-inactive-row", row);
}
}
/**
@ -486,6 +511,20 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
}
String script = "jq('#"+row.getUuid()+"').addClass('highlight').siblings().removeClass('highlight')";
Boolean isActive = null;
Object isActiveValue = gridTab.getValue(currentRowIndex, "IsActive");
if (isActiveValue != null) {
if ("true".equalsIgnoreCase(isActiveValue.toString())) {
isActive = Boolean.TRUE;
} else {
isActive = Boolean.FALSE;
}
}
if (isActive != null && !isActive.booleanValue()) {
script = "jq('#"+row.getUuid()+"').addClass('grid-inactive-row').siblings().removeClass('highlight')";
}
Clients.response(new AuScript(script));
}

View File

@ -69,6 +69,8 @@ import org.zkoss.zul.Center;
import org.zkoss.zul.Filedownload;
import org.zkoss.zul.South;
import com.lowagie.text.pdf.PdfReader;
/**
* Payment Print & Export
*
@ -379,7 +381,6 @@ public class WPayPrint extends PayPrint implements IFormController, EventListene
{
if (result)
{
// int lastDocumentNo =
MPaySelectionCheck.confirmPrint (m_checks, m_batch);
// document No not updated
}
@ -419,19 +420,30 @@ public class WPayPrint extends PayPrint implements IFormController, EventListene
if (!getChecks(PaymentRule))
return;
// Update BankAccountDoc
int lastDocumentNo = MPaySelectionCheck.confirmPrint (m_checks, m_batch);
// get document no
int startDocumentNo = ((Number)fDocumentNo.getValue()).intValue();
if (log.isLoggable(Level.CONFIG)) log.config("DocumentNo=" + startDocumentNo);
// for all checks
List<File> pdfList = new ArrayList<File>();
int lastDocumentNo = startDocumentNo;
for (int i = 0; i < m_checks.length; i++)
{
MPaySelectionCheck check = m_checks[i];
// Set new Check Document No
check.setDocumentNo(String.valueOf(lastDocumentNo));
check.saveEx();
// Update BankAccountDoc
MPaySelectionCheck.confirmPrint(m_checks[i], m_batch);
// ReportCtrl will check BankAccountDoc for PrintFormat
ReportEngine re = ReportEngine.get(Env.getCtx(), ReportEngine.CHECK, check.get_ID());
try
{
MPrintFormat format = re.getPrintFormat();
File pdfFile = null;
if (format.getJasperProcess_ID() > 0)
{
ProcessInfo pi = new ProcessInfo("", format.getJasperProcess_ID());
@ -439,13 +451,20 @@ public class WPayPrint extends PayPrint implements IFormController, EventListene
pi.setIsBatch(true);
ServerProcessCtl.process(pi, null);
pdfList.add(pi.getPDFReport());
pdfFile = pi.getPDFReport();
}
else
{
File file = File.createTempFile("WPayPrint", null);
re.getPDF(file);
pdfList.add(file);
pdfFile = File.createTempFile("WPayPrint", null);
re.getPDF(pdfFile);
}
if (pdfFile != null)
{
// increase the check document no by the number of pages of the generated pdf file
PdfReader document = new PdfReader(pdfFile.getAbsolutePath());
lastDocumentNo += document.getNumberOfPages();
pdfList.add(pdfFile);
}
}
catch (Exception e)
@ -471,10 +490,11 @@ public class WPayPrint extends PayPrint implements IFormController, EventListene
}
final SimplePDFViewer chequeViewerRef = chequeViewer;
if (lastDocumentNo != 0)
// Update Check Next Document No
if (startDocumentNo != lastDocumentNo)
{
StringBuilder sb = new StringBuilder();
sb.append("UPDATE C_BankAccountDoc SET CurrentNext=").append(++lastDocumentNo)
sb.append("UPDATE C_BankAccountDoc SET CurrentNext=").append(lastDocumentNo)
.append(" WHERE C_BankAccount_ID=").append(m_C_BankAccount_ID)
.append(" AND PaymentRule='").append(PaymentRule).append("'");
DB.executeUpdate(sb.toString(), null);
@ -561,13 +581,10 @@ public class WPayPrint extends PayPrint implements IFormController, EventListene
return false;
}
// get data
int startDocumentNo = ((Number)fDocumentNo.getValue()).intValue();
if (log.isLoggable(Level.CONFIG)) log.config("C_PaySelection_ID=" + m_C_PaySelection_ID + ", PaymentRule=" + PaymentRule);
if (log.isLoggable(Level.CONFIG)) log.config("C_PaySelection_ID=" + m_C_PaySelection_ID + ", PaymentRule=" + PaymentRule + ", DocumentNo=" + startDocumentNo);
//
// get Slecetions
m_checks = MPaySelectionCheck.get(m_C_PaySelection_ID, PaymentRule, startDocumentNo, null);
// get payment selection checks without check no assignment
m_checks = MPaySelectionCheck.get(m_C_PaySelection_ID, PaymentRule, null);
//
if (m_checks == null || m_checks.length == 0)

View File

@ -71,23 +71,23 @@ public class WProcessParameter implements IFormController {
if (processPara.getColumnName().equals(para.getParameterName())) {
schedulerPara.setAD_Process_Para_ID(processPara.getAD_Process_Para_ID());
if (DisplayType.isNumeric(processPara.getAD_Reference_ID())) {
if (para.getP_Number() != null)
if (para.get_Value(MPInstancePara.COLUMNNAME_P_Number) != null)
schedulerPara.setParameterDefault(para.getP_Number().toString());
if (para.getP_Number_To() != null)
if (processPara.isRange() && para.get_Value(MPInstancePara.COLUMNNAME_P_Number_To) != null)
schedulerPara.setParameterToDefault(para.getP_Number_To().toString());
} else if (DisplayType.isID(processPara.getAD_Reference_ID())) {
if (para.getP_Number() != null)
if (para.get_Value(MPInstancePara.COLUMNNAME_P_Number) != null)
schedulerPara.setParameterDefault(Integer.toString(para.getP_Number().intValue()));
if (para.getP_Number_To() != null)
if (processPara.isRange() && para.get_Value(MPInstancePara.COLUMNNAME_P_Number_To) != null)
schedulerPara.setParameterToDefault(Integer.toString(para.getP_Number_To().intValue()));
} else if (DisplayType.isDate(processPara.getAD_Reference_ID())) {
if (para.getP_Date() != null)
schedulerPara.setParameterDefault(para.getP_Date().toString());
if (para.getP_Date_To() != null)
if (processPara.isRange() && para.getP_Date_To() != null)
schedulerPara.setParameterToDefault(para.getP_Date_To().toString());
} else {
schedulerPara.setParameterDefault(para.getP_String());
if (para.getP_String_To() != null)
if (processPara.isRange() && para.getP_String_To() != null)
schedulerPara.setParameterToDefault(para.getP_String_To());
}
if (!Util.isEmpty(para.getInfo())) {

View File

@ -923,6 +923,20 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
z-index: -1;
}
.z-grid tbody tr.grid-inactive-row td.z-cell {
background-image: none !important;
background-color: #DCDAD4 !important;
}
.z-grid tbody tr.grid-inactive-row td.row-indicator-seld {
background-color: transparent !important;
background-image: url(${c:encodeURL('/theme/default/images/EditRecord16.png')}) !important;
background-position: center;
background-repeat: no-repeat;
background-size: 16px 16px;
cursor: pointer;
}
.z-grid tbody tr.highlight td.z-cell {
background-color: #FFFFCC !important;
background-image: none !important;