hg merge release-6.2 (merge release6.2 into default)

This commit is contained in:
Carlos Ruiz 2019-05-18 13:05:51 +02:00
commit 76f93c7d94
8 changed files with 52 additions and 37 deletions

View File

@ -21,6 +21,7 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.MSysConfig;
import com.itextpdf.text.FontFactory;
@ -86,7 +87,7 @@ public class Document {
document.close();
} catch (Exception e) {
e.printStackTrace();
throw new AdempiereException(e);
}
}
@ -96,7 +97,7 @@ public class Document {
try {
writePDF(pageable, new FileOutputStream(result));
} catch (Exception e) {
e.printStackTrace();
throw new AdempiereException(e);
}
return result;

View File

@ -594,8 +594,8 @@ public final class MRole extends X_AD_Role
{
StringBuilder sb = new StringBuilder();
sb.append(Msg.translate(ctx, "AD_Role_ID")).append("=").append(getName())
.append(" - ").append(Msg.translate(ctx, "IsCanExport")).append("=").append(isCanExport())
.append(" - ").append(Msg.translate(ctx, "IsCanReport")).append("=").append(isCanReport())
.append(" - ").append(Msg.translate(ctx, "IsCanExport")).append("=").append(Msg.translate(ctx,String.valueOf(isCanExport())))
.append(" - ").append(Msg.translate(ctx, "IsCanReport")).append("=").append(Msg.translate(ctx,String.valueOf(isCanReport())))
.append(Env.NL).append(Env.NL);
//
for (int i = 0; i < m_orgAccess.length; i++)

View File

@ -217,7 +217,7 @@ public class MStatusLine extends X_AD_StatusLine
Format fmt = fmts[idx];
Object obj;
if (fmt instanceof DecimalFormat || fmt instanceof ChoiceFormat) {
obj = rs.getDouble(idx+1);
obj = rs.getBigDecimal(idx+1);
} else if (fmt instanceof SimpleDateFormat) {
obj = rs.getTimestamp(idx+1);
} else {

View File

@ -60,6 +60,7 @@ import javax.print.event.PrintServiceAttributeEvent;
import javax.print.event.PrintServiceAttributeListener;
import javax.xml.transform.stream.StreamResult;
import org.adempiere.exceptions.AdempiereException;
import org.adempiere.pdf.Document;
import org.adempiere.print.export.PrintDataExcelExporter;
import org.apache.ecs.XhtmlDocument;
@ -578,6 +579,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
catch (Exception e)
{
log.log(Level.SEVERE, "(f)", e);
throw new AdempiereException(e);
}
return false;
} // createHTML
@ -674,7 +676,11 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
tbody.setNeedClosingTag(false);
Boolean [] colSuppressRepeats = m_layout == null || m_layout.colSuppressRepeats == null? LayoutEngine.getColSuppressRepeats(m_printFormat):m_layout.colSuppressRepeats;
Object [] preValues = new Object [colSuppressRepeats.length];
Object [] preValues = null;
if (colSuppressRepeats != null){
preValues = new Object [colSuppressRepeats.length];
}
int printColIndex = -1;
// for all rows (-1 = header row)
for (int row = -1; row < m_printData.getRowCount(); row++)
@ -732,7 +738,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
Object obj = m_printData.getNode(Integer.valueOf(item.getAD_Column_ID()));
if (obj == null){
td.addElement("&nbsp;");
if (colSuppressRepeats[printColIndex]){
if (colSuppressRepeats != null && colSuppressRepeats[printColIndex]){
preValues[printColIndex] = null;
}
}
@ -741,7 +747,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
PrintDataElement pde = (PrintDataElement) obj;
String value = pde.getValueDisplay(language); // formatted
if (colSuppressRepeats[printColIndex]){
if (colSuppressRepeats != null && colSuppressRepeats[printColIndex]){
if (value.equals(preValues[printColIndex])){
td.addElement("&nbsp;");
continue;
@ -858,6 +864,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
catch (Exception e)
{
log.log(Level.SEVERE, "(w)", e);
throw new AdempiereException(e);
}
return false;
} // createHTML
@ -916,7 +923,10 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
try
{
Boolean [] colSuppressRepeats = m_layout == null || m_layout.colSuppressRepeats == null? LayoutEngine.getColSuppressRepeats(m_printFormat):m_layout.colSuppressRepeats;
Object [] preValues = new Object [colSuppressRepeats.length];
Object [] preValues = null;
if (colSuppressRepeats != null){
preValues = new Object [colSuppressRepeats.length];
}
int printColIndex = -1;
// for all rows (-1 = header row)
for (int row = -1; row < m_printData.getRowCount(); row++)
@ -948,7 +958,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
Object obj = m_printData.getNode(Integer.valueOf(item.getAD_Column_ID()));
String data = "";
if (obj == null){
if (colSuppressRepeats[printColIndex]){
if (colSuppressRepeats != null && colSuppressRepeats[printColIndex]){
preValues[printColIndex] = null;
}
}
@ -960,7 +970,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
else
data = pde.getValueDisplay(language); // formatted
if (colSuppressRepeats[printColIndex]){
if (colSuppressRepeats != null && colSuppressRepeats[printColIndex]){
if (data.equals(preValues[printColIndex])){
continue;
}else{
@ -1149,7 +1159,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
catch (Exception e)
{
log.log(Level.SEVERE, "PDF", e);
return false;
throw new AdempiereException(e);
}
File file2 = new File(fileName);

View File

@ -250,6 +250,7 @@ public class LayoutEngine implements Pageable, Printable, Doc
public void setPrintFormat (MPrintFormat format, boolean doLayout)
{
m_format = format;
this.colSuppressRepeats = null;
// Initial & Default Settings
m_printCtx = new Properties(format.getCtx());
@ -1980,6 +1981,8 @@ public class LayoutEngine implements Pageable, Printable, Doc
}
public static Boolean [] getColSuppressRepeats (MPrintFormat format){
if (format.isForm())
return null;
List<Boolean> colSuppressRepeats = new ArrayList<>();
for (int c = 0; c < format.getItemCount(); c++)
{

View File

@ -34,6 +34,7 @@ import org.compiere.model.X_AD_Package_Imp_Backup;
import org.compiere.model.X_AD_Package_Imp_Detail;
import org.compiere.process.SvrProcess;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
/**
@ -193,15 +194,15 @@ public class PackRollProcess extends SvrProcess {
int v_AD_Reference_ID = backup.getAD_Reference_ID();
// Update columns that are Strings adjusting
// for single quotes
if (v_AD_Reference_ID == 10
|| v_AD_Reference_ID == 14
|| v_AD_Reference_ID == 34
|| v_AD_Reference_ID == 17
if (v_AD_Reference_ID == DisplayType.String
|| v_AD_Reference_ID == DisplayType.Text
|| v_AD_Reference_ID == DisplayType.Memo
|| v_AD_Reference_ID == DisplayType.List
// Carlos Ruiz globalqss, special
// treatment for EntityType
// it's a Table reference but must
// be treated as String
|| (v_AD_Reference_ID == 18 && columnName
|| (v_AD_Reference_ID == DisplayType.Table && columnName
.equalsIgnoreCase("EntityType"))) {
if (backup.getColValue().toString().equals("null")) {
;// Ignore null values
@ -216,8 +217,8 @@ public class PackRollProcess extends SvrProcess {
parameters = new Object[]{backup.getColValue()};
}
// Update true/false columns
} else if (v_AD_Reference_ID == 20
|| v_AD_Reference_ID == 28) {
} else if (v_AD_Reference_ID == DisplayType.YesNo
|| v_AD_Reference_ID == DisplayType.Button) {
sqlC = new StringBuffer("UPDATE "
+ tableName
@ -231,15 +232,15 @@ public class PackRollProcess extends SvrProcess {
}
// Update columns that are Strings adjusting
// for single quotes
else if (v_AD_Reference_ID == 13
|| v_AD_Reference_ID == 18
|| v_AD_Reference_ID == 19
|| v_AD_Reference_ID == 21
|| v_AD_Reference_ID == 25
|| v_AD_Reference_ID == 27
|| v_AD_Reference_ID == 30
|| v_AD_Reference_ID == 31
|| v_AD_Reference_ID == 35)
else if (v_AD_Reference_ID == DisplayType.ID
|| v_AD_Reference_ID == DisplayType.Table
|| v_AD_Reference_ID == DisplayType.TableDir
|| v_AD_Reference_ID == DisplayType.Location
|| v_AD_Reference_ID == DisplayType.Account
|| v_AD_Reference_ID == DisplayType.Color
|| v_AD_Reference_ID == DisplayType.Search
|| v_AD_Reference_ID == DisplayType.Locator
|| v_AD_Reference_ID == DisplayType.PAttribute)
{
sqlC = new StringBuffer("UPDATE "
@ -252,10 +253,10 @@ public class PackRollProcess extends SvrProcess {
parameters = new Object[]{backup.getColValue()};
}
// Update columns that are numbers
else if (v_AD_Reference_ID == 11
|| v_AD_Reference_ID == 12
|| v_AD_Reference_ID == 22
|| v_AD_Reference_ID == 29)
else if (v_AD_Reference_ID == DisplayType.Integer
|| v_AD_Reference_ID == DisplayType.Amount
|| v_AD_Reference_ID == DisplayType.Number
|| v_AD_Reference_ID == DisplayType.Quantity)
{
sqlC = new StringBuffer("UPDATE "
+ tableName
@ -267,8 +268,8 @@ public class PackRollProcess extends SvrProcess {
parameters = new Object[]{backup.getColValue()};
}
// Update columns that are dates
else if (v_AD_Reference_ID == 15
|| v_AD_Reference_ID == 16)
else if (v_AD_Reference_ID == DisplayType.Date
|| v_AD_Reference_ID == DisplayType.DateTime)
{
Timestamp ts = null;
try {

View File

@ -575,7 +575,7 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
freportType.appendItem("PDF", "PDF");
freportType.appendItem("Excel", "XLS");
}
freportType.setSelectedIndex(0);
freportType.setSelectedIndex(-1);
String where = "AD_Process_ID = ? AND AD_User_ID = ? AND Name IS NULL ";
@ -597,7 +597,7 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
if (freportType != null && instance != null) {
if (instance.getReportType() == null)
freportType.setValue("HTML");
freportType.setSelectedIndex(-1);
else
freportType.setValue(instance.getReportType());
}

View File

@ -288,7 +288,7 @@ public class WListItemRenderer implements ListitemRenderer<Object>, EventListene
}
else
{
listcell.setLabel(format.format(((Number)field).doubleValue()));
listcell.setLabel(format.format(field));
ZkCssHelper.appendStyle(listcell, "text-align: right");
}
}