Merge 9941:8232e473b5a8

This commit is contained in:
Heng Sin Low 2013-11-21 17:23:44 +08:00
commit c55e22415c
2 changed files with 42 additions and 21 deletions

View File

@ -485,7 +485,19 @@ public final class ImpFormatRow
if (sb.length() == 0) if (sb.length() == 0)
return "0"; return "0";
BigDecimal bd = new BigDecimal(sb.toString());
BigDecimal bd = null;
try
{
bd = new BigDecimal(sb.toString());
}
catch (NumberFormatException pe)
{
log.log(Level.SEVERE, "ImpFormatRow.parseNumber - " + info, pe);
}
if (bd == null)
bd = BigDecimal.ZERO;
if (m_divideBy100) // assumed two decimal scale if (m_divideBy100) // assumed two decimal scale
bd = bd.divide(Env.ONEHUNDRED, 2, BigDecimal.ROUND_HALF_UP); bd = bd.divide(Env.ONEHUNDRED, 2, BigDecimal.ROUND_HALF_UP);
return bd.toString(); return bd.toString();

View File

@ -64,6 +64,7 @@ import org.zkoss.zul.Hbox;
import org.zkoss.zul.North; import org.zkoss.zul.North;
import org.zkoss.zul.Separator; import org.zkoss.zul.Separator;
import org.zkoss.zul.South; import org.zkoss.zul.South;
import org.zkoss.zul.Vbox;
/** /**
* Fixed length file import * Fixed length file import
@ -113,7 +114,7 @@ public class WFileImport extends ADForm implements EventListener<Event>
private Div previewPanel = new Div(); private Div previewPanel = new Div();
private Hbox northPanel = new Hbox(); private Vbox northPanel = new Vbox();
private Div centerPanel = new Div(); private Div centerPanel = new Div();
@ -173,6 +174,7 @@ public class WFileImport extends ADForm implements EventListener<Event>
fCharset.appendItem(charsets[i].displayName(), charsets[i]); fCharset.appendItem(charsets[i].displayName(), charsets[i]);
bFile.setLabel(Msg.getMsg(Env.getCtx(), "FileImportFile")); bFile.setLabel(Msg.getMsg(Env.getCtx(), "FileImportFile"));
bFile.setSclass("txt-btn");
bFile.setTooltiptext(Msg.getMsg(Env.getCtx(), "FileImportFileInfo")); bFile.setTooltiptext(Msg.getMsg(Env.getCtx(), "FileImportFileInfo"));
bFile.setUpload(AdempiereWebUI.getUploadSetting()); bFile.setUpload(AdempiereWebUI.getUploadSetting());
bFile.addEventListener(Events.ON_UPLOAD, this); bFile.addEventListener(Events.ON_UPLOAD, this);
@ -198,28 +200,33 @@ public class WFileImport extends ADForm implements EventListener<Event>
bPrevious.setLabel("<"); bPrevious.setLabel("<");
bPrevious.addEventListener(Events.ON_CLICK, this); bPrevious.addEventListener(Events.ON_CLICK, this);
northPanel.appendChild(bFile); Hbox hbox = new Hbox();
northPanel.appendChild(fCharset); hbox.setAlign("center");
northPanel.appendChild(info); hbox.appendChild(bFile);
northPanel.appendChild(labelFormat); hbox.appendChild(fCharset);
northPanel.appendChild(pickFormat); hbox.appendChild(info);
northPanel.appendChild(bPrevious); hbox.appendChild(labelFormat);
northPanel.appendChild(record); hbox.appendChild(pickFormat);
northPanel.appendChild(bNext); hbox.appendChild(bPrevious);
hbox.appendChild(record);
hbox.appendChild(bNext);
rawData.setWidth("100%"); rawData.setHflex("1");
rawData.setCols(80);
rawData.setRows(MAX_SHOWN_LINES); rawData.setRows(MAX_SHOWN_LINES);
rawData.setHeight("40%"); rawData.setHeight("100%");
previewPanel.setWidth("100%"); northPanel.setHflex("1");
previewPanel.setHeight("58%"); northPanel.setVflex("0");
northPanel.appendChild(hbox);
northPanel.appendChild(rawData);
northPanel.appendChild(new Separator());
previewPanel.setHflex("1");
previewPanel.setVflex("1");
previewPanel.setStyle("overflow: auto"); previewPanel.setStyle("overflow: auto");
centerPanel.setWidth("100%"); // Elaine 2008/11/07 - fix text area is not expanded in IE7 centerPanel.setHflex("1");
centerPanel.setHeight("100%"); centerPanel.setVflex("1");
centerPanel.appendChild(rawData);
centerPanel.appendChild(new Separator());
centerPanel.appendChild(previewPanel); centerPanel.appendChild(previewPanel);
confirmPanel.addActionListener(Events.ON_CLICK, this); confirmPanel.addActionListener(Events.ON_CLICK, this);
@ -483,6 +490,7 @@ public class WFileImport extends ADForm implements EventListener<Event>
m_labels[i] = new Label(row.getColumnName()); m_labels[i] = new Label(row.getColumnName());
Hbox hbox = new Hbox(); Hbox hbox = new Hbox();
hbox.setAlign("center");
hbox.setWidth("100%"); hbox.setWidth("100%");
hbox.setStyle("padding-bottom: 3px"); hbox.setStyle("padding-bottom: 3px");
Cell cell = new Cell(); Cell cell = new Cell();
@ -501,6 +509,7 @@ public class WFileImport extends ADForm implements EventListener<Event>
m_fields[i] = new Textbox(); m_fields[i] = new Textbox();
m_fields[i].setStyle("margin-left: 2px"); m_fields[i].setStyle("margin-left: 2px");
m_fields[i].setWidth("300px");
cell.appendChild(m_fields[i]); cell.appendChild(m_fields[i]);
hbox.appendChild(cell); hbox.appendChild(cell);