Merge with development
This commit is contained in:
commit
d6da6ee556
|
@ -109,8 +109,12 @@ public class CommissionCalc extends SvrProcess
|
|||
{
|
||||
if (m_com.isListDetails())
|
||||
{
|
||||
sql.append("SELECT h.C_Currency_ID, (l.LineNetAmt*al.Amount/h.GrandTotal) AS Amt,")
|
||||
.append(" (l.QtyInvoiced*al.Amount/h.GrandTotal) AS Qty,")
|
||||
sql.append("SELECT h.C_Currency_ID, CASE WHEN h.GrandTotal <> 0 ")
|
||||
.append(" THEN (l.LineNetAmt*al.Amount/h.GrandTotal) ")
|
||||
.append(" ELSE 0 END AS Amt,")
|
||||
.append(" CASE WHEN h.GrandTotal <> 0 ")
|
||||
.append(" THEN (l.QtyInvoiced*al.Amount/h.GrandTotal) ")
|
||||
.append(" ELSE 0 END AS Qty,")
|
||||
.append(" NULL, l.C_InvoiceLine_ID, p.DocumentNo||'_'||h.DocumentNo,")
|
||||
.append(" COALESCE(prd.Value,l.Description), h.DateInvoiced ")
|
||||
.append("FROM C_Payment p")
|
||||
|
@ -125,8 +129,11 @@ public class CommissionCalc extends SvrProcess
|
|||
}
|
||||
else
|
||||
{
|
||||
sql.append("SELECT h.C_Currency_ID, SUM(l.LineNetAmt*al.Amount/h.GrandTotal) AS Amt,")
|
||||
.append(" SUM(l.QtyInvoiced*al.Amount/h.GrandTotal) AS Qty,")
|
||||
sql.append("SELECT h.C_Currency_ID, ")
|
||||
.append(" SUM(CASE WHEN h.GrandTotal <> 0 ")
|
||||
.append(" THEN l.LineNetAmt*al.Amount/h.GrandTotal ELSE 0 END) AS Amt,")
|
||||
.append(" SUM(CASE WHEN h.GrandTotal <> 0 ")
|
||||
.append(" THEN l.QtyInvoiced*al.Amount/h.GrandTotal ELSE 0 END) AS Qty,")
|
||||
.append(" NULL, NULL, NULL, NULL, MAX(h.DateInvoiced) ")
|
||||
.append("FROM C_Payment p")
|
||||
.append(" INNER JOIN C_AllocationLine al ON (p.C_Payment_ID=al.C_Payment_ID)")
|
||||
|
|
|
@ -2953,7 +2953,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
|||
|
||||
if (!Util.isEmpty(retValue)) // interrupt on first error
|
||||
{
|
||||
log.severe (retValue);
|
||||
log.config(retValue); // no need to save an AD_Issue error on each callout
|
||||
return retValue;
|
||||
}
|
||||
} // for each callout
|
||||
|
|
|
@ -2312,8 +2312,8 @@ public abstract class PO
|
|||
}
|
||||
}
|
||||
m_newValues = new Object[size];
|
||||
m_createNew = false;
|
||||
}
|
||||
m_createNew = false;
|
||||
if (!newRecord)
|
||||
CacheMgt.get().reset(p_info.getTableName());
|
||||
else if (get_ID() > 0 && success)
|
||||
|
@ -2678,10 +2678,10 @@ public abstract class PO
|
|||
else
|
||||
{
|
||||
if (m_trxName == null)
|
||||
log.log(Level.WARNING, "Update return " + no + " instead of 1"
|
||||
log.saveError("SaveError", "Update return " + no + " instead of 1"
|
||||
+ " - " + p_info.getTableName() + "." + where);
|
||||
else
|
||||
log.log(Level.WARNING, "Update return " + no + " instead of 1"
|
||||
log.saveError("SaveError", "Update return " + no + " instead of 1"
|
||||
+ " - [" + m_trxName + "] - " + p_info.getTableName() + "." + where);
|
||||
}
|
||||
return ok;
|
||||
|
|
|
@ -632,7 +632,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
|
|||
thead thead = new thead();
|
||||
tbody tbody = new tbody();
|
||||
|
||||
Boolean [] colSuppressRepeats = m_layout == null ? LayoutEngine.getColSuppressRepeats(m_printFormat):m_layout.colSuppressRepeats;
|
||||
Boolean [] colSuppressRepeats = m_layout == null || m_layout.colSuppressRepeats == null? LayoutEngine.getColSuppressRepeats(m_printFormat):m_layout.colSuppressRepeats;
|
||||
Object [] preValues = new Object [colSuppressRepeats.length];
|
||||
int printColIndex = -1;
|
||||
// for all rows (-1 = header row)
|
||||
|
@ -778,7 +778,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
|
|||
}
|
||||
//just run with on record
|
||||
if (row == 0)
|
||||
addCssInfo(item, col);
|
||||
addCssInfo(item, printColIndex);
|
||||
|
||||
}
|
||||
else if (obj instanceof PrintData)
|
||||
|
@ -902,7 +902,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
|
|||
delimiter = '\t';
|
||||
try
|
||||
{
|
||||
Boolean [] colSuppressRepeats = m_layout == null ? LayoutEngine.getColSuppressRepeats(m_printFormat):m_layout.colSuppressRepeats;
|
||||
Boolean [] colSuppressRepeats = m_layout == null || m_layout.colSuppressRepeats == null? LayoutEngine.getColSuppressRepeats(m_printFormat):m_layout.colSuppressRepeats;
|
||||
Object [] preValues = new Object [colSuppressRepeats.length];
|
||||
int printColIndex = -1;
|
||||
// for all rows (-1 = header row)
|
||||
|
@ -1234,7 +1234,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
|
|||
public void createXLS(File outFile, Language language)
|
||||
throws Exception
|
||||
{
|
||||
Boolean [] colSuppressRepeats = m_layout == null ? LayoutEngine.getColSuppressRepeats(m_printFormat):m_layout.colSuppressRepeats;
|
||||
Boolean [] colSuppressRepeats = m_layout == null || m_layout.colSuppressRepeats == null? LayoutEngine.getColSuppressRepeats(m_printFormat):m_layout.colSuppressRepeats;
|
||||
PrintDataExcelExporter exp = new PrintDataExcelExporter(getPrintData(), getPrintFormat(), colSuppressRepeats);
|
||||
exp.export(outFile, language);
|
||||
}
|
||||
|
|
|
@ -1606,7 +1606,7 @@ public class LayoutEngine implements Pageable, Printable, Doc
|
|||
int[] columnMaxWidth = new int[columnCount];
|
||||
int[] columnMaxHeight = new int[columnCount];
|
||||
boolean[] fixedWidth = new boolean [columnCount];
|
||||
colSuppressRepeats = new Boolean[columnCount];
|
||||
Boolean [] colSuppressRepeats = new Boolean[columnCount];
|
||||
String[] columnJustification = new String[columnCount];
|
||||
HashMap<Integer,Integer> additionalLines = new HashMap<Integer,Integer>();
|
||||
|
||||
|
@ -1781,6 +1781,9 @@ public class LayoutEngine implements Pageable, Printable, Doc
|
|||
table.layout(0,0,false, MPrintFormatItem.FIELDALIGNMENTTYPE_LeadingLeft);
|
||||
if (m_tableElement == null)
|
||||
m_tableElement = table;
|
||||
|
||||
if (format == m_format)
|
||||
this.colSuppressRepeats = colSuppressRepeats;
|
||||
return table;
|
||||
} // layoutTable
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<cq:advisorNode namePattern="^org\.apache\.xerces$" componentType="osgi.bundle" versionOverride="[2.9.0,2.9.1)"/>
|
||||
<cq:advisorNode namePattern="^org\.apache\.xml\.serializer$" componentType="osgi.bundle" versionOverride="[2.7.1,2.7.2)"/>
|
||||
<cq:advisorNode namePattern="^org\.apache\.felix\.webconsole$" versionOverride="[4.2.2,4.2.2]"/>
|
||||
<cq:advisorNode namePattern="^org\.apache\.felix\.webconsole\.plugins\.ds$" versionOverride="[1.0.0,1.0.0]"/>
|
||||
<cq:advisorNode namePattern="^org\.objectweb(\..+)?" componentType="osgi.bundle" versionOverride="[5.0.1,5.0.1]"/>
|
||||
<cq:advisorNode namePattern="^javax\.jms$" componentType="osgi.bundle" versionOverride="[1.1.0,1.1.1)"/>
|
||||
<cq:advisorNode namePattern="^javax\.ejb$" componentType="osgi.bundle" versionOverride="[3.1.1,3.1.2)"/>
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -11,21 +11,16 @@ import static org.compiere.model.SystemIDs.PROCESS_RPT_FINSTATEMENT;
|
|||
import static org.compiere.model.SystemIDs.PROCESS_RPT_M_INOUT;
|
||||
import static org.compiere.model.SystemIDs.PROCESS_RPT_M_INVENTORY;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.CharArrayWriter;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.ParseException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import net.sf.compilo.report.ReportProcessor;
|
||||
import net.sf.jasperreports.engine.JasperPrint;
|
||||
|
||||
import org.adempiere.util.ProcessUtil;
|
||||
import org.compiere.model.Lookup;
|
||||
import org.compiere.model.MLookup;
|
||||
|
@ -379,6 +374,7 @@ public class Process {
|
|||
// Report
|
||||
if ((process.isReport() || jasperreport))
|
||||
{
|
||||
pi.setReportingProcess(true);
|
||||
r.setIsReport(true);
|
||||
ReportEngine re=null;
|
||||
if (!jasperreport)
|
||||
|
@ -418,11 +414,12 @@ public class Process {
|
|||
}
|
||||
else
|
||||
{
|
||||
JasperPrint jp = getJasperReportPrint( m_cs.getCtx(), pi);
|
||||
ByteArrayOutputStream wr = new ByteArrayOutputStream();
|
||||
net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfStream(jp, wr);
|
||||
file_type ="pdf";
|
||||
r.setData(wr.toByteArray());
|
||||
Trx trx = trxName == null ? Trx.get(Trx.createTrxName("WebPrc"), true) : Trx.get(trxName, true);
|
||||
pi.setPrintPreview (false);
|
||||
pi.setIsBatch(true);
|
||||
ProcessUtil.startJavaProcess(Env.getCtx(), pi, trx, true, null);
|
||||
file_type ="pdf";
|
||||
r.setData(java.nio.file.Files.readAllBytes(pi.getPDFReport().toPath()));
|
||||
r.setReportFormat(file_type);
|
||||
ok = true;
|
||||
}
|
||||
|
@ -674,32 +671,6 @@ public class Process {
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static JasperPrint getJasperReportPrint(Properties ctx, ProcessInfo pi)
|
||||
{
|
||||
try
|
||||
{
|
||||
JasperPrint jasperPrint;
|
||||
|
||||
ReportProcessor rp = new ReportProcessor(ctx, pi);
|
||||
jasperPrint = rp.runReport();
|
||||
|
||||
if(jasperPrint == null)
|
||||
{
|
||||
log.finer("ReportStarter.startProcess Cannot process JasperPrint Object");
|
||||
return null;
|
||||
}
|
||||
else
|
||||
return jasperPrint;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.saveError("ReportStarter.startProcess: Can not run report - ", ex);
|
||||
return null;
|
||||
// return ex.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static public ReportEngine start (ProcessInfo pi)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue