hg merge release-1.0c (forward-porting)
This commit is contained in:
commit
bb789cebb4
|
@ -654,6 +654,19 @@ public class MJournal extends X_GL_Journal implements DocAction
|
|||
if (DOCSTATUS_Drafted.equals(getDocStatus())
|
||||
|| DOCSTATUS_Invalid.equals(getDocStatus()))
|
||||
{
|
||||
// set lines to 0
|
||||
MJournalLine[] lines = getLines(false);
|
||||
for (int i = 0; i < lines.length; i++) {
|
||||
MJournalLine line = lines[i];
|
||||
if (line.getAmtAcctDr().signum() != 0 || line.getAmtAcctCr().signum() != 0) {
|
||||
line.setAmtAcctDr(Env.ZERO);
|
||||
line.setAmtAcctCr(Env.ZERO);
|
||||
line.setAmtSourceDr(Env.ZERO);
|
||||
line.setAmtSourceCr(Env.ZERO);
|
||||
line.setQty(Env.ZERO);
|
||||
line.saveEx(get_TrxName());
|
||||
}
|
||||
}
|
||||
setProcessed(true);
|
||||
setDocAction(DOCACTION_None);
|
||||
ok_to_void = true;
|
||||
|
|
|
@ -196,85 +196,84 @@ public class Scheduler extends AdempiereServer
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
// always notify recipients
|
||||
Integer[] userIDs = m_model.getRecipientAD_User_IDs();
|
||||
if (userIDs.length > 0)
|
||||
{
|
||||
// notify recipients on success
|
||||
Integer[] userIDs = m_model.getRecipientAD_User_IDs();
|
||||
if (userIDs.length > 0)
|
||||
ProcessInfoUtil.setLogFromDB(pi);
|
||||
for (int i = 0; i < userIDs.length; i++)
|
||||
{
|
||||
ProcessInfoUtil.setLogFromDB(pi);
|
||||
for (int i = 0; i < userIDs.length; i++)
|
||||
{
|
||||
MUser user = new MUser(getCtx(), userIDs[i].intValue(), null);
|
||||
boolean email = user.isNotificationEMail();
|
||||
boolean notice = user.isNotificationNote();
|
||||
MUser user = new MUser(getCtx(), userIDs[i].intValue(), null);
|
||||
boolean email = user.isNotificationEMail();
|
||||
boolean notice = user.isNotificationNote();
|
||||
|
||||
File report = null;
|
||||
if (isReport) {
|
||||
// Report
|
||||
ReportEngine re = ReportEngine.get(m_schedulerctx, pi);
|
||||
|
||||
File report = null;
|
||||
if (isReport) {
|
||||
// Report
|
||||
ReportEngine re = ReportEngine.get(m_schedulerctx, pi);
|
||||
|
||||
if(process.getJasperReport() != null
|
||||
|| (re != null && re.getPrintFormat().getJasperProcess_ID() > 0))
|
||||
{
|
||||
// We have a Jasper Print Format
|
||||
// ==============================
|
||||
ProcessInfo jasperpi = new ProcessInfo ("", process.getAD_Process_ID());
|
||||
jasperpi.setIsBatch(true);
|
||||
ServerProcessCtl.process(jasperpi, null);
|
||||
report = jasperpi.getPDFReport();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Standard Print Format (Non-Jasper)
|
||||
// ==================================
|
||||
if (re == null)
|
||||
return "Cannot create Report AD_Process_ID=" + process.getAD_Process_ID()
|
||||
+ " - " + process.getName();
|
||||
report = re.getPDF();
|
||||
}
|
||||
}
|
||||
|
||||
if (notice) {
|
||||
int AD_Message_ID = 441; // ProcessOK
|
||||
if (isReport)
|
||||
AD_Message_ID = 884; // HARDCODED SchedulerResult
|
||||
MNote note = new MNote(getCtx(), AD_Message_ID, userIDs[i].intValue(), null);
|
||||
note.setClientOrg(m_model.getAD_Client_ID(), m_model.getAD_Org_ID());
|
||||
if (isReport) {
|
||||
note.setTextMsg(m_model.getName());
|
||||
note.setDescription(m_model.getDescription());
|
||||
note.setRecord(AD_Table_ID, Record_ID);
|
||||
} else {
|
||||
note.setTextMsg(pi.getSummary());
|
||||
// note.setDescription();
|
||||
note.setRecord(MPInstance.Table_ID, pi.getAD_PInstance_ID());
|
||||
}
|
||||
if (note.save()) {
|
||||
if (isReport) {
|
||||
// Attachment
|
||||
MAttachment attachment = new MAttachment (getCtx(), MNote.Table_ID, note.getAD_Note_ID(), null);
|
||||
attachment.setClientOrg(m_model.getAD_Client_ID(), m_model.getAD_Org_ID());
|
||||
attachment.addEntry(report);
|
||||
attachment.setTextMsg(m_model.getName());
|
||||
attachment.saveEx();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (email)
|
||||
if(process.getJasperReport() != null
|
||||
|| (re != null && re.getPrintFormat().getJasperProcess_ID() > 0))
|
||||
{
|
||||
MClient client = MClient.get(m_model.getCtx(), m_model.getAD_Client_ID());
|
||||
// We have a Jasper Print Format
|
||||
// ==============================
|
||||
ProcessInfo jasperpi = new ProcessInfo ("", process.getAD_Process_ID());
|
||||
jasperpi.setIsBatch(true);
|
||||
ServerProcessCtl.process(jasperpi, null);
|
||||
report = jasperpi.getPDFReport();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Standard Print Format (Non-Jasper)
|
||||
// ==================================
|
||||
if (re == null)
|
||||
return "Cannot create Report AD_Process_ID=" + process.getAD_Process_ID()
|
||||
+ " - " + process.getName();
|
||||
report = re.getPDF();
|
||||
}
|
||||
}
|
||||
|
||||
if (notice) {
|
||||
int AD_Message_ID = 441; // ProcessOK
|
||||
if (isReport)
|
||||
AD_Message_ID = 884; // HARDCODED SchedulerResult
|
||||
MNote note = new MNote(getCtx(), AD_Message_ID, userIDs[i].intValue(), null);
|
||||
note.setClientOrg(m_model.getAD_Client_ID(), m_model.getAD_Org_ID());
|
||||
if (isReport) {
|
||||
note.setTextMsg(m_model.getName());
|
||||
note.setDescription(m_model.getDescription());
|
||||
note.setRecord(AD_Table_ID, Record_ID);
|
||||
} else {
|
||||
note.setTextMsg(pi.getSummary());
|
||||
// note.setDescription();
|
||||
note.setRecord(MPInstance.Table_ID, pi.getAD_PInstance_ID());
|
||||
}
|
||||
if (note.save()) {
|
||||
if (isReport) {
|
||||
client.sendEMail(from, user, m_model.getName(), m_model.getDescription(), report);
|
||||
} else {
|
||||
client.sendEMail(from, user, process.getName(), pi.getSummary() + " " + pi.getLogInfo(), null);
|
||||
// Attachment
|
||||
MAttachment attachment = new MAttachment (getCtx(), MNote.Table_ID, note.getAD_Note_ID(), null);
|
||||
attachment.setClientOrg(m_model.getAD_Client_ID(), m_model.getAD_Org_ID());
|
||||
attachment.addEntry(report);
|
||||
attachment.setTextMsg(m_model.getName());
|
||||
attachment.saveEx();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (email)
|
||||
{
|
||||
MClient client = MClient.get(m_model.getCtx(), m_model.getAD_Client_ID());
|
||||
if (isReport) {
|
||||
client.sendEMail(from, user, m_model.getName(), m_model.getDescription(), report);
|
||||
} else {
|
||||
client.sendEMail(from, user, process.getName(), pi.getSummary() + " " + pi.getLogInfo(), null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return pi.getSummary();
|
||||
} // runProcess
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ public final class ALogin extends CDialog
|
|||
private GridBagLayout connectionLayout = new GridBagLayout();
|
||||
private GridBagLayout defaultPanelLayout = new GridBagLayout();
|
||||
private CLabel languageLabel = new CLabel();
|
||||
private VComboBox languageCombo = new VComboBox(Language.getNames());
|
||||
private VComboBox languageCombo = null;
|
||||
private CLabel compileDate = new CLabel();
|
||||
private CPanel southPanel = new CPanel();
|
||||
private BorderLayout southLayout = new BorderLayout();
|
||||
|
@ -209,6 +209,10 @@ public final class ALogin extends CDialog
|
|||
clientCombo.setName("clientCombo");
|
||||
userTextField.setName("userTextField");
|
||||
passwordField.setName("passwordField");
|
||||
|
||||
Env.getLoginLanguages(); // to fill the s_language array on Language
|
||||
languageCombo = new VComboBox(Language.getNames());
|
||||
|
||||
//red1 - end -
|
||||
titleLabel.setFont(new java.awt.Font("Serif", 2, 10));
|
||||
titleLabel.setForeground(Color.blue);
|
||||
|
|
|
@ -459,13 +459,13 @@ public class WAcctViewerData
|
|||
|
||||
// Groups
|
||||
|
||||
if (group1 && sortBy1.length() > 0)
|
||||
if ((group1 || group2 || group3 || group4) && sortBy1.length() > 0)
|
||||
rm.setGroup(sortBy1);
|
||||
|
||||
if (group2 && sortBy2.length() > 0)
|
||||
if ((group2 || group3 || group4) && sortBy2.length() > 0)
|
||||
rm.setGroup(sortBy2);
|
||||
|
||||
if (group3 && sortBy3.length() > 0)
|
||||
if ((group3 || group4) && sortBy3.length() > 0)
|
||||
rm.setGroup(sortBy3);
|
||||
|
||||
if (group4 && sortBy4.length() > 0)
|
||||
|
|
|
@ -16,10 +16,6 @@
|
|||
*****************************************************************************/
|
||||
package org.apache.ecs;
|
||||
|
||||
import java.text.CharacterIterator;
|
||||
import java.text.StringCharacterIterator;
|
||||
|
||||
|
||||
/**
|
||||
This class is used to create a String element in ECS. A StringElement
|
||||
has no tags wrapped around it, it is an Element without tags.
|
||||
|
@ -30,10 +26,11 @@ import java.text.StringCharacterIterator;
|
|||
*/
|
||||
public class StringElement extends ConcreteElement implements Printable
|
||||
{
|
||||
/**
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -1589031493456017832L;
|
||||
private static final long serialVersionUID = -4270491831650738524L;
|
||||
|
||||
/**
|
||||
Basic constructor
|
||||
*/
|
||||
|
@ -75,41 +72,6 @@ public class StringElement extends ConcreteElement implements Printable
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Tag Text
|
||||
* @param text text
|
||||
* @return Element
|
||||
*/
|
||||
public Element setTagText (String text)
|
||||
{
|
||||
if (text != null && text.length() > 0)
|
||||
{
|
||||
StringCharacterIterator sci = new StringCharacterIterator(text);
|
||||
for (char c = sci.first(); c != CharacterIterator.DONE; c = sci.next())
|
||||
{
|
||||
int ii = c;
|
||||
if (ii > 255)
|
||||
{
|
||||
setFilterState(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.setTagText (text);
|
||||
} // setTagText
|
||||
|
||||
/**
|
||||
* Set Filter State - don't allow reset
|
||||
* @param filter_state state
|
||||
* @return this
|
||||
*/
|
||||
public Element setFilterState (boolean filter_state)
|
||||
{
|
||||
if (!getFilterState())
|
||||
return super.setFilterState (filter_state);
|
||||
return this;
|
||||
} // setFilterState
|
||||
|
||||
/**
|
||||
Adds an Element to the element.
|
||||
@param hashcode name of element for hash table
|
||||
|
|
Loading…
Reference in New Issue