Payroll improvement:

Allow to fill the Description field on movement assigning the variable description in the payroll rule.
Integrate fix from 361 - harmless addition to Scriptlet (backward compatible) to allow registering description in payroll.
This commit is contained in:
Carlos Ruiz 2011-02-27 00:53:47 -05:00
parent 37d2ee07f5
commit 11b3d0bcf2
1 changed files with 22 additions and 0 deletions

View File

@ -67,6 +67,9 @@ public class Scriptlet
/** Default Result Variable Name */
public static final String VARIABLE = "result";
/** Default Description Variable Name */
public static final String DESCRIPTION_VARIABLE = "description";
/** Logger */
private static CLogger log = CLogger.getCLogger(Scriptlet.class);
@ -109,6 +112,8 @@ public class Scriptlet
private HashMap<String,Object> m_ctx;
/** Result */
private Object m_result;
/** Description */
private Object m_description;
/*************************************************************************/
@ -120,6 +125,7 @@ public class Scriptlet
public Exception execute()
{
m_result = null;
m_description = null;
if (m_variable == null || m_variable.length() == 0 || m_script == null || m_script.length() == 0)
{
IllegalArgumentException e = new IllegalArgumentException("No variable/script");
@ -150,6 +156,13 @@ public class Scriptlet
e = new IllegalArgumentException("Result Variable not found - " + m_variable);
return e;
}
try
{
m_description = i.get (DESCRIPTION_VARIABLE);
}
catch (Exception e)
{
}
return null;
} // execute
@ -406,6 +419,15 @@ public class Scriptlet
return m_result;
} // getResult
/**************************************************************************
* Get Description
* @return description or null
*/
public Object getDescription()
{
return m_description;
} // getResult
/**
* String Representation incl. Result
* @return Scipt