OFBIZ-9123 Add a PriCat component under specialpurpose

1. Add a readme.
2. Replace tabs with spaces.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1770979 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/specialpurpose/pricat/README.md b/specialpurpose/pricat/README.md
new file mode 100644
index 0000000..39a64c2
--- /dev/null
+++ b/specialpurpose/pricat/README.md
@@ -0,0 +1,14 @@
+<img src="http://ofbiz.apache.org/images/logo.png" alt="Apache OFBiz" />

+

+# PriCat component

+PriCat is the abbreviation of Price and Catalog/Category. The PriCat component is to support importing/parsing excel files with price and catalog/category data. The excel files can be checked by version, header column names, currencyId. Each row can be validated by facility(name, Id and ownership), required fields, string or number and etc.

+

+PriCat component contains two webapps: /pricat/ and /pricatdemo/. In production environment, you SHOULD remove or disable the /pricatdemo/.

+

+## more information

+---------------------------------------

+PriCat Demos

+---------------------------------------

+/pricatdemo/control/SamplePricat/: you can use this demo to implement your own excel templates.

+

+/pricatdemo/control/countdownreport and /pricatdemo/control/countupreport: these 2 demos are on html report, you can try this way to display the processing report of rebuilding of lucene index or marchine learning data.
\ No newline at end of file
diff --git a/specialpurpose/pricat/config/PricatUiLabels.xml b/specialpurpose/pricat/config/PricatUiLabels.xml
index 239509f..e952f3c 100644
--- a/specialpurpose/pricat/config/PricatUiLabels.xml
+++ b/specialpurpose/pricat/config/PricatUiLabels.xml
@@ -238,11 +238,11 @@
         <value xml:lang="en">The lable of row {0} colum {1} is [{2}], it does not match [{3}] as expected.</value>
         <value xml:lang="zh">行{0}列{1}的文字是[{2}],与期望的[{3}]不一致。</value>
     </property>
-	<property key="HeaderColNumShortThanRequired">
+    <property key="HeaderColNumShortThanRequired">
         <value xml:lang="en">Table header column number less than the required {0}</value>
         <value xml:lang="zh">表头列数小于要求的{0}列</value>
     </property>
-	<property key="UseHeaderColNum">
+    <property key="UseHeaderColNum">
         <value xml:lang="en">the first {0} column labels will be checked</value>
         <value xml:lang="zh">将检查表头的前{0}列的标签</value>
     </property>
@@ -432,101 +432,101 @@
         <value xml:lang="zh">跳过</value>
     </property>
 
-	<property key="ExcelImportHistoryList">
+    <property key="ExcelImportHistoryList">
         <value xml:lang="en">Excel Import History</value>
         <value xml:lang="zh">Excel导入操作历史记录</value>
     </property>
-	<property key="OnlyYourOwnImportHistoryDisplayed">
+    <property key="OnlyYourOwnImportHistoryDisplayed">
         <value xml:lang="en">(Only current login user's history can be displayed)</value>
         <value xml:lang="zh">(仅能显示当前用户的导入操作历史记录)</value>
     </property>
-	<property key="SerialNumber">
+    <property key="SerialNumber">
         <value xml:lang="en">No.</value>
         <value xml:lang="zh">序号</value>
     </property>
-	<property key="Filename">
+    <property key="Filename">
         <value xml:lang="en">Filename</value>
         <value xml:lang="zh">文件名</value>
     </property>
-	<property key="FromDate">
+    <property key="FromDate">
         <value xml:lang="en">Start Time</value>
         <value xml:lang="zh">开始时间</value>
     </property>
-	<property key="ThruDate">
+    <property key="ThruDate">
         <value xml:lang="en">End Time</value>
         <value xml:lang="zh">结束时间</value>
     </property>
-	<property key="ThruReasonId">
+    <property key="ThruReasonId">
         <value xml:lang="en">End Reason</value>
         <value xml:lang="zh">结束原因</value>
     </property>
-	<property key="ImportStatus">
+    <property key="ImportStatus">
         <value xml:lang="en">Import Status</value>
         <value xml:lang="zh">导入状态</value>
     </property>
-	<property key="Actions">
+    <property key="Actions">
         <value xml:lang="en">Actions</value>
         <value xml:lang="zh">操作</value>
     </property>
-	<property key="ExcelImportTipNoData">
+    <property key="ExcelImportTipNoData">
         <value xml:lang="en">No excel import history data.</value>
         <value xml:lang="zh">没有Excel导入历史记录</value>
     </property>
-	<property key="EXCEL_IMPORTING">
+    <property key="EXCEL_IMPORTING">
         <value xml:lang="en">Importing</value>
         <value xml:lang="zh">正在导入</value>
     </property>
-	<property key="EXCEL_IMPORTED">
+    <property key="EXCEL_IMPORTED">
         <value xml:lang="en">Imported</value>
         <value xml:lang="zh">已导入</value>
     </property>
-	<property key="EXCEL_IMPORT_SUCCESS">
+    <property key="EXCEL_IMPORT_SUCCESS">
         <value xml:lang="en">Success</value>
         <value xml:lang="zh">成功</value>
     </property>
-	<property key="EXCEL_IMPORT_STOPPED">
+    <property key="EXCEL_IMPORT_STOPPED">
         <value xml:lang="en">Stopped by user</value>
         <value xml:lang="zh">用户终止了导入</value>
     </property>
-	<property key="EXCEL_IMPORT_ERROR">
+    <property key="EXCEL_IMPORT_ERROR">
         <value xml:lang="en">Stopped by error</value>
         <value xml:lang="zh">因出错而停止了导入</value>
     </property>
-	<property key="EXCEL_IMPORT_QUEST">
+    <property key="EXCEL_IMPORT_QUEST">
         <value xml:lang="en">Data error found</value>
         <value xml:lang="zh">数据中有错误</value>
     </property>
-	<property key="ViewExcelImportLogContent">
+    <property key="ViewExcelImportLogContent">
         <value xml:lang="en">View log content</value>
         <value xml:lang="zh">浏览日志内容</value>
     </property>
-	<property key="DownloadCommentedExcel">
+    <property key="DownloadCommentedExcel">
         <value xml:lang="en">Download excel</value>
         <value xml:lang="zh">下载Excel</value>
     </property>
-	<property key="ViewExcelImportHistory">
+    <property key="ViewExcelImportHistory">
         <value xml:lang="en">View Import History</value>
         <value xml:lang="zh">导入操作历史记录</value>
     </property>
-	<property key="ViewPricatLog">
+    <property key="ViewPricatLog">
         <value xml:lang="en">View</value>
         <value xml:lang="zh">浏览</value>
     </property>
-	<property key="DownloadCommentedPricat">
+    <property key="DownloadCommentedPricat">
         <value xml:lang="en">Download</value>
         <value xml:lang="zh">下载</value>
     </property>
 
-	<property key="ReasonOK">
+    <property key="ReasonOK">
         <value xml:lang="en">OK</value>
     </property>
-	<property key="ReasonStopped">
+    <property key="ReasonStopped">
         <value xml:lang="en">[S]</value>
     </property>
-	<property key="ReasonError">
+    <property key="ReasonError">
         <value xml:lang="en">[E]</value>
     </property>
-	<property key="ReasonWarning">
+    <property key="ReasonWarning">
         <value xml:lang="en">[W]</value>
     </property>
 </resource>
diff --git a/specialpurpose/pricat/data/PricatData.xml b/specialpurpose/pricat/data/PricatData.xml
index 1fe9314..e75c464 100644
--- a/specialpurpose/pricat/data/PricatData.xml
+++ b/specialpurpose/pricat/data/PricatData.xml
@@ -18,7 +18,7 @@
 under the License.
 -->
 <entity-engine-xml>
-	<!-- Enumeration for thruReasonId of ExcelImportHistory entity -->
+    <!-- Enumeration for thruReasonId of ExcelImportHistory entity -->
     <EnumerationType description="Excel import thru reasons" enumTypeId="EXCEL_IMPORT_THRU" hasTable="N" parentTypeId=""/>
     
     <Enumeration enumId="EXCEL_IMPORT_SUCCESS" enumCode="EXCEL_IMPORT_SUCCESS" description="Excel Imported Successfully" sequenceId="01" enumTypeId="EXCEL_IMPORT_THRU"/>
@@ -26,7 +26,7 @@
     <Enumeration enumId="EXCEL_IMPORT_ERROR" enumCode="EXCEL_IMPORT_ERROR" description="Excel Imported Exits Errorly" sequenceId="03" enumTypeId="EXCEL_IMPORT_THRU"/>
     <Enumeration enumId="EXCEL_IMPORT_QUEST" enumCode="EXCEL_IMPORT_QUEST" description="Excel Imported Has Error Messages" sequenceId="04" enumTypeId="EXCEL_IMPORT_THRU"/>
 
-	<!-- Enumeration for statusId of ExcelImportHistory entity -->
+    <!-- Enumeration for statusId of ExcelImportHistory entity -->
     <EnumerationType description="Excel import status" enumTypeId="EXCEL_IMPORT_STATUS" hasTable="N" parentTypeId=""/>
     
     <Enumeration enumId="EXCEL_IMPORTING" enumCode="EXCEL_IMPORTING" description="Excel is being imported in progress" sequenceId="01" enumTypeId="EXCEL_IMPORT_STATUS"/>
diff --git a/specialpurpose/pricat/entitydef/entitymodel.xml b/specialpurpose/pricat/entitydef/entitymodel.xml
index b861149..fa603a2 100644
--- a/specialpurpose/pricat/entitydef/entitymodel.xml
+++ b/specialpurpose/pricat/entitydef/entitymodel.xml
@@ -21,7 +21,7 @@
     xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
     
     <entity entity-name="ExcelImportHistory"
-            package-name="org.ofbiz.product.catalog"
+            package-name="org.apache.ofbiz.product.catalog"
             title="Excel Import History Entity">
       <field name="userLoginId" type="id-vlong-ne"></field>
       <field name="sequenceNum" type="numeric"></field>
@@ -35,13 +35,13 @@
       <prim-key field="userLoginId"/>
       <prim-key field="sequenceNum"/>
       <relation rel-entity-name="UserLogin" type="one" fk-name="EXCELIMPORT_USERLOGIN">
-      	<key-map field-name="userLoginId"/>
+          <key-map field-name="userLoginId"/>
       </relation>
       <relation rel-entity-name="Enumeration" type="one" fk-name="EXCELIMPORT_STATUS">
-      	<key-map field-name="statusId" rel-field-name="enumId"/>
+          <key-map field-name="statusId" rel-field-name="enumId"/>
       </relation>
       <relation rel-entity-name="Enumeration" type="one" fk-name="EXCELIMPORT_REASON">
-      	<key-map field-name="thruReasonId" rel-field-name="enumId"/>
+          <key-map field-name="thruReasonId" rel-field-name="enumId"/>
       </relation>
     </entity>
     
diff --git a/specialpurpose/pricat/groovyScripts/pricat/FindMyExcelImportLog.groovy b/specialpurpose/pricat/groovyScripts/pricat/FindMyExcelImportLog.groovy
index 8eef097..c03e1c3 100644
--- a/specialpurpose/pricat/groovyScripts/pricat/FindMyExcelImportLog.groovy
+++ b/specialpurpose/pricat/groovyScripts/pricat/FindMyExcelImportLog.groovy
@@ -27,19 +27,19 @@
 sequenceNum = request.getParameter("sequenceNum");

 

 if (sequenceNum == null) {

-	context.logFileContent = "No sequenceNum parameter found.";

-	return; 

+    context.logFileContent = "No sequenceNum parameter found.";

+    return; 

 }

 

 historyEntry = delegator.findOne("ExcelImportHistory", [sequenceNum : Long.valueOf(sequenceNum), userLoginId : userLogin.userLoginId], false);

 if (historyEntry == null) {

-	context.logFileContent = "No import history found.";

-	return;

+    context.logFileContent = "No import history found.";

+    return;

 }

 

 logFile = FileUtil.getFile("runtime/pricat/" + userLogin.userLoginId + "/" + sequenceNum + ".log");

 if (!logFile.exists()) {

-	context.logFileContent = "No log file found.";

+    context.logFileContent = "No log file found.";

 }

 

 FileInputStream fis = new FileInputStream(logFile);

@@ -47,7 +47,7 @@
 BufferedReader br = new BufferedReader(isr);

 logFileContent = "";

 while((s = br.readLine())!=null){

-	logFileContent += s;

+    logFileContent += s;

 }

 context.logFileContent = logFileContent;

 

diff --git a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractHtmlReport.java b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractHtmlReport.java
index 52fc5f6..498bf43 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractHtmlReport.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractHtmlReport.java
@@ -31,17 +31,17 @@
  * 

  */

 public abstract class AbstractHtmlReport extends HtmlReport {

-	

-	public static final String module = AbstractHtmlReport.class.getName();

+    

+    public static final String module = AbstractHtmlReport.class.getName();

 

-	public final static String THREAD_TYPE = "thread_type";

-	

-	public final static String RUN_CREATETABLE_SCRIPT = "runcreatetablescript";

-	

-	public final static String RUN_DROPTABLE_SCRIPT = "rundroptablescript";

-	

-	public final static String FILE_REPORT_OUTPUT = "specialpurpose/pricat/webapp/pricat/ftl/report.ftl";

-	

+    public final static String THREAD_TYPE = "thread_type";

+    

+    public final static String RUN_CREATETABLE_SCRIPT = "runcreatetablescript";

+    

+    public final static String RUN_DROPTABLE_SCRIPT = "rundroptablescript";

+    

+    public final static String FILE_REPORT_OUTPUT = "specialpurpose/pricat/webapp/pricat/ftl/report.ftl";

+    

     /**

      * Constructs a new report using the provided locale for the output language.

      * 

@@ -75,9 +75,9 @@
      */

     public void prepareDisplayReport(HttpServletRequest request, HttpServletResponse response, String name, String dialogUri) throws IOException {

 

-    	if (ReportStringUtil.isNotEmpty(dialogUri)) {

-    		setDialogRealUri(request, dialogUri);

-    	}

+        if (ReportStringUtil.isNotEmpty(dialogUri)) {

+            setDialogRealUri(request, dialogUri);

+        }

         

         String action = getParamAction(request);

         if (action == null) action = "";

@@ -106,39 +106,39 @@
      * @param dialogUri

      */

     public void setDialogRealUri(HttpServletRequest request, String dialogUri) {

-    	request.setAttribute(DIALOG_URI, dialogUri);

+        request.setAttribute(DIALOG_URI, dialogUri);

     }

 

     public static String checkButton(HttpServletRequest request, HttpServletResponse response) {

-    	String action = request.getParameter("action");

-    	if (ReportStringUtil.isNotEmpty(action)) {

-    		if (action.equalsIgnoreCase("ok")) {

-    			request.removeAttribute(SESSION_REPORT_CLASS);

-    			request.removeAttribute(DIALOG_URI);

-    			return "ok";

-    		} else if (action.equalsIgnoreCase("cancel")) {

-    			request.removeAttribute(SESSION_REPORT_CLASS);

-    			request.removeAttribute(DIALOG_URI);

-    			return "cancel";

-    		}

-    	}

-    	action = request.getParameter("ok");

-    	if (ReportStringUtil.isNotEmpty(action)) {

-    		if (action.equalsIgnoreCase("ok")) {

-    			request.removeAttribute(SESSION_REPORT_CLASS);

-    			request.removeAttribute(DIALOG_URI);

-    			return "ok";

-    		}

-    	}

+        String action = request.getParameter("action");

+        if (ReportStringUtil.isNotEmpty(action)) {

+            if (action.equalsIgnoreCase("ok")) {

+                request.removeAttribute(SESSION_REPORT_CLASS);

+                request.removeAttribute(DIALOG_URI);

+                return "ok";

+            } else if (action.equalsIgnoreCase("cancel")) {

+                request.removeAttribute(SESSION_REPORT_CLASS);

+                request.removeAttribute(DIALOG_URI);

+                return "cancel";

+            }

+        }

+        action = request.getParameter("ok");

+        if (ReportStringUtil.isNotEmpty(action)) {

+            if (action.equalsIgnoreCase("ok")) {

+                request.removeAttribute(SESSION_REPORT_CLASS);

+                request.removeAttribute(DIALOG_URI);

+                return "ok";

+            }

+        }

         action = request.getParameter("cancel");

         if (ReportStringUtil.isNotEmpty(action)) {

-        	if (action.equalsIgnoreCase("cancel")) {

-    			request.removeAttribute(SESSION_REPORT_CLASS);

-    			request.removeAttribute(DIALOG_URI);

-        		return "cancel";

-        	}

+            if (action.equalsIgnoreCase("cancel")) {

+                request.removeAttribute(SESSION_REPORT_CLASS);

+                request.removeAttribute(DIALOG_URI);

+                return "cancel";

+            }

         }

         

-    	return "success";

+        return "success";

     }

 }
\ No newline at end of file
diff --git a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReport.java b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReport.java
index 783dddc..b565b8b 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReport.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReport.java
@@ -66,7 +66,7 @@
 

     public String formatRuntime() {

 

-    	long runtime = getRuntime();

+        long runtime = getRuntime();

         long seconds = (runtime / SECONDS) % 60;

         long minutes = (runtime / MINUTES) % 60;

         long hours = (runtime / HOURS) % 24;

@@ -137,7 +137,7 @@
     protected void init(Locale locale) {

         startTime = System.currentTimeMillis();

         this.locale = locale;

-    	errors = new ArrayList<Object>();

+        errors = new ArrayList<Object>();

     }

 

     /**

diff --git a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReportThread.java b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReportThread.java
index fca4b74..31eb597 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReportThread.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReportThread.java
@@ -72,7 +72,7 @@
     

     

     public UUID getUUID() {

-    	return uuid;

+        return uuid;

     }

 

     /**

@@ -211,7 +211,7 @@
     }

     

     protected Locale getLocale() {

-    	return locale;

+        return locale;

     }

 

 }

diff --git a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java
index 708f4ab..95b161d 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java
@@ -50,7 +50,7 @@
  */

 public class HtmlReport extends AbstractReport {

 

-	public static final String module = HtmlReport.class.getName();

+    public static final String module = HtmlReport.class.getName();

 

     /** The delimiter that is used in the resource list request parameter. */

     public static final String DELIMITER_RESOURCES = "|";

@@ -171,7 +171,7 @@
     public static final String FORM_URI = "formuri";

     

     public static final String resource = "PricatUiLabels";

-	

+    

     /** Log file. */

     protected File logFile;

     

@@ -213,43 +213,43 @@
     }

     

     public static HtmlReport getInstance(HttpServletRequest request, HttpServletResponse response) {

-    	HtmlReport wp = (HtmlReport) request.getSession().getAttribute(SESSION_REPORT_CLASS);

-    	if (wp == null) {

-    		wp = new HtmlReport(request, response, true, true);

-    		request.getSession().setAttribute(SESSION_REPORT_CLASS, wp);

-    	}

-    	return wp;

+        HtmlReport wp = (HtmlReport) request.getSession().getAttribute(SESSION_REPORT_CLASS);

+        if (wp == null) {

+            wp = new HtmlReport(request, response, true, true);

+            request.getSession().setAttribute(SESSION_REPORT_CLASS, wp);

+        }

+        return wp;

     }

     

     public static HtmlReport getInstance(HttpServletRequest request, HttpServletResponse response, boolean writeHtml, boolean isTransient) {

-    	HtmlReport wp = (HtmlReport) request.getSession().getAttribute(SESSION_REPORT_CLASS);

-    	if (wp == null) {

-    		wp = new HtmlReport(request, response, writeHtml, isTransient);

-    		request.getSession().setAttribute(SESSION_REPORT_CLASS, wp);

-    	}

-    	return wp;

+        HtmlReport wp = (HtmlReport) request.getSession().getAttribute(SESSION_REPORT_CLASS);

+        if (wp == null) {

+            wp = new HtmlReport(request, response, writeHtml, isTransient);

+            request.getSession().setAttribute(SESSION_REPORT_CLASS, wp);

+        }

+        return wp;

     }

     

     public static HtmlReport getInstance(HttpServletRequest request, HttpServletResponse response, boolean writeHtml, boolean isTransient, String logFileName) {

-    	HtmlReport wp = (HtmlReport) request.getSession().getAttribute(SESSION_REPORT_CLASS);

-    	if (wp == null || UtilValidate.isEmpty(wp.getLogFileName()) || !wp.getLogFileName().equals(logFileName)) {

-    		wp = new HtmlReport(request, response, writeHtml, isTransient);

-    		request.getSession().setAttribute(SESSION_REPORT_CLASS, wp);

-    	}

-    	return wp;

+        HtmlReport wp = (HtmlReport) request.getSession().getAttribute(SESSION_REPORT_CLASS);

+        if (wp == null || UtilValidate.isEmpty(wp.getLogFileName()) || !wp.getLogFileName().equals(logFileName)) {

+            wp = new HtmlReport(request, response, writeHtml, isTransient);

+            request.getSession().setAttribute(SESSION_REPORT_CLASS, wp);

+        }

+        return wp;

     }

     

     public String getParamAction(HttpServletRequest request) {

-		paramAction = request.getParameter("action");

-    	return paramAction != null ? paramAction : "reportbegin";

+        paramAction = request.getParameter("action");

+        return paramAction != null ? paramAction : "reportbegin";

     }

     

     public void setParamAction(String action) {

-    	paramAction = action;

+        paramAction = action;

     }

 

     public void setParamThread(String name) {

-    	paramThread = name;

+        paramThread = name;

     }

 

     public synchronized String getReportUpdate() {

@@ -283,12 +283,12 @@
         indexNext = isTransient ? 0 : indexEnd;

         

         if (isTransient && logFileOutputStream != null && logResult.toString().length() > 0) {

-        	try {

-				logFileOutputStream.write((logResult.toString() + "\n").getBytes());

-				logFileOutputStream.flush();

-			} catch (IOException e) {

-				Debug.logError(e.getMessage(), module);

-			}

+            try {

+                logFileOutputStream.write((logResult.toString() + "\n").getBytes());

+                logFileOutputStream.flush();

+            } catch (IOException e) {

+                Debug.logError(e.getMessage(), module);

+            }

         }

         return result.toString();

     }

@@ -351,44 +351,44 @@
         content.add(buf.toString());

 

         switch (format) {

-        	case FORMAT_HEADLINE:

-        		buf = new StringBuffer();

-        		buf.append("<span class='head'>");

-        		buf.append(value);

-        		buf.append("</span>");

-        		break;

-        	case FORMAT_WARNING:

-        		buf = new StringBuffer();

-        		buf.append("<span class='warn'>");

-        		buf.append(value);

-        		buf.append("</span>");

-        		addWarning(value);

-        		break;

-        	case FORMAT_ERROR:

-        		buf = new StringBuffer();

-        		buf.append("<span class='err'>");

-        		buf.append(value);

-        		buf.append("</span>");

-        		addError(value);

-        		break;

-        	case FORMAT_NOTE:

-        		buf = new StringBuffer();

-        		buf.append("<span class='note'>");

-        		buf.append(value);

-        		buf.append("</span>");

-        		break;

-        	case FORMAT_OK:

-        		buf = new StringBuffer();

-        		buf.append("<span class='ok'>");

-        		buf.append(value);

-        		buf.append("</span>");

-        		break;

-        	case FORMAT_DEFAULT:

-        	default:

-        		buf = new StringBuffer(value);

+            case FORMAT_HEADLINE:

+                buf = new StringBuffer();

+                buf.append("<span class='head'>");

+                buf.append(value);

+                buf.append("</span>");

+                break;

+            case FORMAT_WARNING:

+                buf = new StringBuffer();

+                buf.append("<span class='warn'>");

+                buf.append(value);

+                buf.append("</span>");

+                addWarning(value);

+                break;

+            case FORMAT_ERROR:

+                buf = new StringBuffer();

+                buf.append("<span class='err'>");

+                buf.append(value);

+                buf.append("</span>");

+                addError(value);

+                break;

+            case FORMAT_NOTE:

+                buf = new StringBuffer();

+                buf.append("<span class='note'>");

+                buf.append(value);

+                buf.append("</span>");

+                break;

+            case FORMAT_OK:

+                buf = new StringBuffer();

+                buf.append("<span class='ok'>");

+                buf.append(value);

+                buf.append("</span>");

+                break;

+            case FORMAT_DEFAULT:

+            default:

+                buf = new StringBuffer(value);

         }

         if (value.trim().endsWith(getLineBreak())) {

-        	buf.append("\n");

+            buf.append("\n");

         }

         logContent.add(buf.toString());

     }

@@ -432,7 +432,7 @@
             buf.append(UtilProperties.getMessage(resource, "REPORT_EXCEPTION", getLocale()));

             String exception = ReportEncoder.escapeXml(throwable.getLocalizedMessage());

             if (UtilValidate.isEmpty(exception)) {

-            	exception = ReportEncoder.escapeXml(throwable.getMessage());

+                exception = ReportEncoder.escapeXml(throwable.getMessage());

             }

             if (UtilValidate.isNotEmpty(exception)) {

                 exception = exception.replaceAll("[\r\n]+", LINEBREAK);

@@ -457,7 +457,7 @@
             buf.append(UtilProperties.getMessage(resource, "REPORT_EXCEPTION", getLocale()));

             String exception = ReportEncoder.escapeXml(throwable.getLocalizedMessage());

             if (UtilValidate.isEmpty(exception)) {

-            	exception = ReportEncoder.escapeXml(throwable.getMessage());

+                exception = ReportEncoder.escapeXml(throwable.getMessage());

             }

             if (UtilValidate.isNotEmpty(exception)) {

                 exception = exception.replaceAll("[\r\n]+", LINEBREAK);

@@ -478,11 +478,11 @@
 

     public void printMessageWithParam(String uiLabel, Object param) {

         print(uiLabel, InterfaceReport.FORMAT_NOTE);

-	}

+    }

 

-	public void printMessageWithParam(int m, int n, String uiLabel, Object param) {

+    public void printMessageWithParam(int m, int n, String uiLabel, Object param) {

         print(uiLabel, InterfaceReport.FORMAT_NOTE);

-	}

+    }

 

     /**

      * Builds the start html of the page, including setting of DOCTYPE and 

@@ -571,13 +571,13 @@
         threadGroup.enumerate(threads, true);

         AbstractReportThread thread = null;

         for (int j=0; j<threads.length; j++) {

-        	Thread threadInstance = threads[j];

-        	if (threadInstance instanceof AbstractReportThread) {

-        		if(((AbstractReportThread)threadInstance).getUUID().toString().equals(getParamThread(request))) {

-            		thread = (AbstractReportThread) threadInstance;

-            		break;

-        		}

-        	}

+            Thread threadInstance = threads[j];

+            if (threadInstance instanceof AbstractReportThread) {

+                if(((AbstractReportThread)threadInstance).getUUID().toString().equals(getParamThread(request))) {

+                    thread = (AbstractReportThread) threadInstance;

+                    break;

+                }

+            }

         }

         if (thread != null) {

             return thread.isAlive();

@@ -592,8 +592,8 @@
      * @return the thread parameter value

      */

     public String getParamThread(HttpServletRequest request) {

-    	String thread = request.getParameter("thread");

-    	return ReportStringUtil.isNotEmptyOrWhitespaceOnly(thread) ? thread : (paramThread == null? "" : paramThread);

+        String thread = request.getParameter("thread");

+        return ReportStringUtil.isNotEmptyOrWhitespaceOnly(thread) ? thread : (paramThread == null? "" : paramThread);

     }

 

     /**

@@ -602,8 +602,8 @@
      * @return the threadhasnext parameter value

      */

     public String getParamThreadHasNext(HttpServletRequest request) {

-    	String threadhasnext = request.getParameter("threadhasnext");

-    	return ReportStringUtil.isNotEmptyOrWhitespaceOnly(threadhasnext) ? threadhasnext : "false";

+        String threadhasnext = request.getParameter("threadhasnext");

+        return ReportStringUtil.isNotEmptyOrWhitespaceOnly(threadhasnext) ? threadhasnext : "false";

     }

 

     /**

@@ -792,10 +792,10 @@
      * @return the value of the title parameter

      */

     public String getParamTitle(HttpServletRequest request) {

-    	if (paramTitle == null) {

-    		paramTitle = request.getParameter("title");

-    	}

-    	return paramTitle != null ? paramTitle : "";

+        if (paramTitle == null) {

+            paramTitle = request.getParameter("title");

+        }

+        return paramTitle != null ? paramTitle : "";

     }

 

     /**

@@ -1214,7 +1214,7 @@
      * @return the value of the file parameter

      */

     public String getParamResource(HttpServletRequest request) {

-    	paramResource = request.getParameter("resource");

+        paramResource = request.getParameter("resource");

         if ((paramResource != null) && !"null".equals(paramResource)) {

             return paramResource;

         } else {

@@ -1288,7 +1288,7 @@
      * @param formUri

      */

     public void setFormRealUri(HttpServletRequest request, String formUri) {

-    	request.setAttribute(FORM_URI, formUri);

+        request.setAttribute(FORM_URI, formUri);

     }

 

     /**

@@ -1298,50 +1298,50 @@
      * @return

      */

     public String getFormRealUri(HttpServletRequest request) {

-    	return (String) request.getAttribute(FORM_URI);

+        return (String) request.getAttribute(FORM_URI);

     }

 

-	public void addLogFile(String logFileName) {

-		if (logFile == null || logFileOutputStream == null) {

-			this.logFileName = logFileName;

-			logFile = FileUtil.getFile(logFileName);

-			try {

-				logFileOutputStream = new FileOutputStream(logFile);

-			} catch (FileNotFoundException e) {

-				// do nothing

-			}

-		}

-	}

-	

-	public String closeLogFile() {

-		if (logFileOutputStream != null) {

-			try {

-				logFileOutputStream.flush();

-			} catch (IOException e) {

-				// do nothing

-			} finally {

-				if (logFileOutputStream != null) {

-					try {

-						logFileOutputStream.close();

-					} catch (IOException e) {

-						// do nothing

-						Debug.logError(e, HtmlReport.module);

-					}

-				}

-			}

-		}

-		return logFileName;

-	}

-	

-	public String getLogFileName() {

-		return logFileName;

-	}

-	

-	public long getSequenceNum() {

-		return sequenceNum;

-	}

+    public void addLogFile(String logFileName) {

+        if (logFile == null || logFileOutputStream == null) {

+            this.logFileName = logFileName;

+            logFile = FileUtil.getFile(logFileName);

+            try {

+                logFileOutputStream = new FileOutputStream(logFile);

+            } catch (FileNotFoundException e) {

+                // do nothing

+            }

+        }

+    }

+    

+    public String closeLogFile() {

+        if (logFileOutputStream != null) {

+            try {

+                logFileOutputStream.flush();

+            } catch (IOException e) {

+                // do nothing

+            } finally {

+                if (logFileOutputStream != null) {

+                    try {

+                        logFileOutputStream.close();

+                    } catch (IOException e) {

+                        // do nothing

+                        Debug.logError(e, HtmlReport.module);

+                    }

+                }

+            }

+        }

+        return logFileName;

+    }

+    

+    public String getLogFileName() {

+        return logFileName;

+    }

+    

+    public long getSequenceNum() {

+        return sequenceNum;

+    }

 

-	public void setSequenceNum(long sequenceNum) {

-		this.sequenceNum = sequenceNum;

-	}

+    public void setSequenceNum(long sequenceNum) {

+        this.sequenceNum = sequenceNum;

+    }

 }

diff --git a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/InterfaceReport.java b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/InterfaceReport.java
index 1e7f329..9d97f04 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/InterfaceReport.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/InterfaceReport.java
@@ -211,20 +211,20 @@
      * 

      * @param logFileName

      */

-	void addLogFile(String logFileName);

+    void addLogFile(String logFileName);

 

-	/**

-	 * Close log file if necessary.

-	 * 

-	 */

-	String closeLogFile();

-	

-	/**

-	 * Set log's sequence number.

-	 * @param sequenceNum

-	 */

-	void setSequenceNum(long sequenceNum);

-	

-	long getSequenceNum();

+    /**

+     * Close log file if necessary.

+     * 

+     */

+    String closeLogFile();

+    

+    /**

+     * Set log's sequence number.

+     * @param sequenceNum

+     */

+    void setSequenceNum(long sequenceNum);

+    

+    long getSequenceNum();

 

 }
\ No newline at end of file
diff --git a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/sample/SampleHtmlReport.java b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/sample/SampleHtmlReport.java
index 55dd49b..560f956 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/sample/SampleHtmlReport.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/sample/SampleHtmlReport.java
@@ -29,7 +29,7 @@
  * 
  */
 public class SampleHtmlReport extends AbstractHtmlReport {
-	
+    
     /**
      * Public constructor with report variables.<p>
      * 
@@ -42,35 +42,35 @@
     }
     
     public static SampleHtmlReport getReport(HttpServletRequest request, HttpServletResponse response) {
-    	
-    	SampleHtmlReport wp = (SampleHtmlReport) request.getAttribute(SESSION_REPORT_CLASS);
-    	if (wp == null) {
-    		wp = new SampleHtmlReport(request, response);
-    		request.setAttribute(SESSION_REPORT_CLASS, wp);
-    	}
-    	return wp;
+        
+        SampleHtmlReport wp = (SampleHtmlReport) request.getAttribute(SESSION_REPORT_CLASS);
+        if (wp == null) {
+            wp = new SampleHtmlReport(request, response);
+            request.setAttribute(SESSION_REPORT_CLASS, wp);
+        }
+        return wp;
     }
     
     public InterfaceReportThread initializeThread(HttpServletRequest request, HttpServletResponse response, String name) {
 
-		if (name == null) {
-			name = "";
-		}
+        if (name == null) {
+            name = "";
+        }
         ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();
         int i = threadGroup.activeCount();
         Thread[] threads = new Thread[i];
         threadGroup.enumerate(threads, true);
         InterfaceReportThread thread = null;
         for (int j=0; j<threads.length; j++) {
-        	Thread threadInstance = threads[j];
-        	if (threadInstance instanceof SampleHtmlThread) {
-        		thread = (InterfaceReportThread) threadInstance;
-        		break;
-        	}
+            Thread threadInstance = threads[j];
+            if (threadInstance instanceof SampleHtmlThread) {
+                thread = (InterfaceReportThread) threadInstance;
+                break;
+            }
         }
 
         if (thread == null) {
-        	thread = new SampleHtmlThread(request, response, name.toLowerCase());
+            thread = new SampleHtmlThread(request, response, name.toLowerCase());
         }
         return thread;
     }
diff --git a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/sample/SampleHtmlThread.java b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/sample/SampleHtmlThread.java
index 3415e57..c9a06f3 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/sample/SampleHtmlThread.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/sample/SampleHtmlThread.java
@@ -38,18 +38,18 @@
  */
 public class SampleHtmlThread extends AbstractReportThread {
 
-	public static final String COUNT_DOWN = "countdown";
-	
-	public static final String COUNT_UP = "countup";
-	
-	public static final String CONFIRM = "confirm_action";
-	
-	public static final String[] messageLables = new String[] {"FORMAT_DEFAULT", "FORMAT_WARNING", "FORMAT_HEADLINE", "FORMAT_NOTE", "FORMAT_OK", "FORMAT_ERROR", "FORMAT_THROWABLE"};
-	
-	public static final List<String> messages = Collections.unmodifiableList(Arrays.asList(messageLables));
-	
-	private static final String resource = "PricatUiLabels";
-	
+    public static final String COUNT_DOWN = "countdown";
+    
+    public static final String COUNT_UP = "countup";
+    
+    public static final String CONFIRM = "confirm_action";
+    
+    public static final String[] messageLables = new String[] {"FORMAT_DEFAULT", "FORMAT_WARNING", "FORMAT_HEADLINE", "FORMAT_NOTE", "FORMAT_OK", "FORMAT_ERROR", "FORMAT_THROWABLE"};
+    
+    public static final List<String> messages = Collections.unmodifiableList(Arrays.asList(messageLables));
+    
+    private static final String resource = "PricatUiLabels";
+    
     /**
      * Constructor, creates a new HtmlImportThreat.
      * 
@@ -69,35 +69,35 @@
     public void run() {
         try {
             if (getName().startsWith(COUNT_DOWN)) {
-            	getReport().println(UtilProperties.getMessage(resource, "START_COUNT_DOWN", getLocale()), InterfaceReport.FORMAT_HEADLINE);
-            	Random random = new Random();
-            	int j = 0;
-            	for (int i=1000; i>0; i--) {
-            		sleep(20);
-            		j = random.nextInt(7);
-            		if (j == 6) {
-                		getReport().println(new Throwable(UtilProperties.getMessage(resource, messages.get(j), new Object[] {i}, getLocale())));
-            		} else {
-                		getReport().println(UtilProperties.getMessage(resource, messages.get(j), new Object[] {i}, getLocale()), j);
-            		}
-            	}
-            	getReport().println(UtilProperties.getMessage(resource, "COUNT_COMPLETED", getLocale()), InterfaceReport.FORMAT_HEADLINE);
+                getReport().println(UtilProperties.getMessage(resource, "START_COUNT_DOWN", getLocale()), InterfaceReport.FORMAT_HEADLINE);
+                Random random = new Random();
+                int j = 0;
+                for (int i=1000; i>0; i--) {
+                    sleep(20);
+                    j = random.nextInt(7);
+                    if (j == 6) {
+                        getReport().println(new Throwable(UtilProperties.getMessage(resource, messages.get(j), new Object[] {i}, getLocale())));
+                    } else {
+                        getReport().println(UtilProperties.getMessage(resource, messages.get(j), new Object[] {i}, getLocale()), j);
+                    }
+                }
+                getReport().println(UtilProperties.getMessage(resource, "COUNT_COMPLETED", getLocale()), InterfaceReport.FORMAT_HEADLINE);
             } else if (getName().startsWith(COUNT_UP)) {
-            	getReport().println(UtilProperties.getMessage(resource, "START_COUNT_UP", getLocale()), InterfaceReport.FORMAT_HEADLINE);
-            	Random random = new Random();
-            	int j = 0;
-            	for (int i=1; i<=1000; i++) {
-            		sleep(20);
-            		j = random.nextInt(7);
-            		if (j == 6) {
-                		getReport().println(new Throwable(UtilProperties.getMessage(resource, messages.get(j), new Object[] {i}, getLocale())));
-            		} else {
-                		getReport().println(UtilProperties.getMessage(resource, messages.get(j), new Object[] {i}, getLocale()), j);
-            		}
-            	}
-            	getReport().println(UtilProperties.getMessage(resource, "COUNT_COMPLETED", getLocale()), InterfaceReport.FORMAT_HEADLINE);
-        	} else {
-            	getReport().println(getName(), InterfaceReport.FORMAT_ERROR);
+                getReport().println(UtilProperties.getMessage(resource, "START_COUNT_UP", getLocale()), InterfaceReport.FORMAT_HEADLINE);
+                Random random = new Random();
+                int j = 0;
+                for (int i=1; i<=1000; i++) {
+                    sleep(20);
+                    j = random.nextInt(7);
+                    if (j == 6) {
+                        getReport().println(new Throwable(UtilProperties.getMessage(resource, messages.get(j), new Object[] {i}, getLocale())));
+                    } else {
+                        getReport().println(UtilProperties.getMessage(resource, messages.get(j), new Object[] {i}, getLocale()), j);
+                    }
+                }
+                getReport().println(UtilProperties.getMessage(resource, "COUNT_COMPLETED", getLocale()), InterfaceReport.FORMAT_HEADLINE);
+            } else {
+                getReport().println(getName(), InterfaceReport.FORMAT_ERROR);
             }
         } catch (Exception e) {
             getReport().println(e);
diff --git a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java
index 2badc5c..ac4cbe0 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java
@@ -77,31 +77,31 @@
  * 
  */
 public abstract class AbstractPricatParser implements InterfacePricatParser {
-	
-	public static final String module = AbstractPricatParser.class.getName();
-	
-	protected LocalDispatcher dispatcher;
-	
-	protected Delegator delegator;
-	
-	protected List<FileItem> fileItems;
-	
-	protected File pricatFile;
-	
-	protected String userLoginId;
-	
-	protected GenericValue userLogin;
-	
-	protected String pricatFileVersion;
-	
-	protected String currencyId;
-	
-	protected Map<CellReference, String> errorMessages = new HashMap<CellReference, String>();
-	
-	protected HSSFDataFormatter formatter = new HSSFDataFormatter();
-	
-	protected Map<String, String[]> facilities = new HashMap<String, String[]>();
-	
+    
+    public static final String module = AbstractPricatParser.class.getName();
+    
+    protected LocalDispatcher dispatcher;
+    
+    protected Delegator delegator;
+    
+    protected List<FileItem> fileItems;
+    
+    protected File pricatFile;
+    
+    protected String userLoginId;
+    
+    protected GenericValue userLogin;
+    
+    protected String pricatFileVersion;
+    
+    protected String currencyId;
+    
+    protected Map<CellReference, String> errorMessages = new HashMap<CellReference, String>();
+    
+    protected HSSFDataFormatter formatter = new HSSFDataFormatter();
+    
+    protected Map<String, String[]> facilities = new HashMap<String, String[]>();
+    
     protected HttpSession session;
     
     protected List<EntityCondition> basicCategoryConds;
@@ -119,545 +119,545 @@
     protected long sequenceNum = -1L;
 
     public AbstractPricatParser(LocalDispatcher dispatcher, Delegator delegator, Locale locale, InterfaceReport report, Map<String, String[]> facilities, File pricatFile, GenericValue userLogin) {
-    	this.dispatcher = dispatcher;
-    	this.delegator = delegator;
-    	this.locale = locale;
-    	this.report = report;
-    	this.userLogin = userLogin;
-    	if (UtilValidate.isNotEmpty(userLogin)) {
-    		this.userLoginId = userLogin.getString("userLoginId");
-    	}
-    	this.facilities = facilities;
-    	this.pricatFile = pricatFile;
-		initBasicConds(UtilMisc.toList(userLogin.getString("partyId")));
+        this.dispatcher = dispatcher;
+        this.delegator = delegator;
+        this.locale = locale;
+        this.report = report;
+        this.userLogin = userLogin;
+        if (UtilValidate.isNotEmpty(userLogin)) {
+            this.userLoginId = userLogin.getString("userLoginId");
+        }
+        this.facilities = facilities;
+        this.pricatFile = pricatFile;
+        initBasicConds(UtilMisc.toList(userLogin.getString("partyId")));
     }
     
-	public void writeCommentsToFile(XSSFWorkbook workbook, XSSFSheet sheet) {
-		report.println();
-		report.print(UtilProperties.getMessage(resource, "WriteCommentsBackToExcel", locale), InterfaceReport.FORMAT_NOTE);
-		FileOutputStream fos = null;
-		XSSFCreationHelper factory = workbook.getCreationHelper();
-		XSSFFont boldFont = workbook.createFont();
-		boldFont.setFontName("Arial");
-		boldFont.setBold(true);
-		boldFont.setCharSet(134);
-		boldFont.setFontHeightInPoints((short) 9);
-		XSSFFont plainFont = workbook.createFont();
-		plainFont.setFontName("Arial");
-		plainFont.setCharSet(134);
-		plainFont.setFontHeightInPoints((short) 9);
-		
-		XSSFSheet errorSheet = null;
-		if (errorMessages.keySet().size() > 0) {
-			String errorSheetName = UtilDateTime.nowDateString("yyyy-MM-dd HHmm") + " Errors";
-			errorSheetName = WorkbookUtil.createSafeSheetName(errorSheetName);
-			errorSheet = workbook.createSheet(errorSheetName);
-			workbook.setSheetOrder(errorSheetName, 0);
-			workbook.setActiveSheet(workbook.getSheetIndex(errorSheetName));
-			XSSFDrawing drawingPatriarch = errorSheet.getDrawingPatriarch();
-			if (drawingPatriarch == null) {
-				drawingPatriarch = errorSheet.createDrawingPatriarch();
-			}
-			for (int i = 0; i <= getHeaderRowNo(); i++) {
-				XSSFRow newRow = errorSheet.createRow(i);
-				XSSFRow row = sheet.getRow(i);
-				newRow.setHeight(row.getHeight());
-				copyRow(row, newRow, factory, drawingPatriarch);
-			}
-			
-			// copy merged regions
-			for (int i = 0; i < sheet.getNumMergedRegions(); i++) {
-			    CellRangeAddress mergedRegion = sheet.getMergedRegion(i);
-			    if (mergedRegion.getFirstRow() < getHeaderRowNo()) {
-				    errorSheet.addMergedRegion(mergedRegion);
-			    }
-			}
-			
-			// copy images
-			List<XSSFPictureData> pics = workbook.getAllPictures();
-			List<XSSFShape> shapes = sheet.getDrawingPatriarch().getShapes();
-			for (int i = 0; i < shapes.size(); i++) {
-				XSSFShape shape = shapes.get(i);
-				XSSFAnchor anchor = shape.getAnchor();
-				if (shape instanceof XSSFPicture && anchor instanceof XSSFClientAnchor) {
-					XSSFPicture pic = (XSSFPicture) shape;
-					XSSFClientAnchor clientAnchor = (XSSFClientAnchor) anchor;
-					if (clientAnchor.getRow1() < getHeaderRowNo()) {
-						for (int j = 0; j < pics.size(); j++) {
-							XSSFPictureData picture = pics.get(j);
-							if (picture.getPackagePart().getPartName().equals(pic.getPictureData().getPackagePart().getPartName())) {
-								drawingPatriarch.createPicture(clientAnchor, j);
-							}
-						}
-					}
-				}
-			}
-		}
-		
-		try {
-			// set comments in the original sheet
-			XSSFDrawing patriarch = sheet.getDrawingPatriarch();
-			for (CellReference cell : errorMessages.keySet()) {
-				if (cell != null && errorMessages.get(cell) != null) {
-					XSSFComment comment = sheet.getCellComment(new CellAddress(cell.getRow(), cell.getCol()));
-					boolean isNewComment = false;
-					if (comment == null) {
-						XSSFClientAnchor anchor = factory.createClientAnchor();
-						anchor.setDx1(100);
-						anchor.setDx2(100);
-						anchor.setDy1(100);
-						anchor.setDy2(100);
-					    anchor.setCol1(cell.getCol());
-					    anchor.setCol2(cell.getCol() + 4);
-					    anchor.setRow1(cell.getRow());
-					    anchor.setRow2(cell.getRow() + 4);
-					    anchor.setAnchorType(AnchorType.DONT_MOVE_AND_RESIZE);
+    public void writeCommentsToFile(XSSFWorkbook workbook, XSSFSheet sheet) {
+        report.println();
+        report.print(UtilProperties.getMessage(resource, "WriteCommentsBackToExcel", locale), InterfaceReport.FORMAT_NOTE);
+        FileOutputStream fos = null;
+        XSSFCreationHelper factory = workbook.getCreationHelper();
+        XSSFFont boldFont = workbook.createFont();
+        boldFont.setFontName("Arial");
+        boldFont.setBold(true);
+        boldFont.setCharSet(134);
+        boldFont.setFontHeightInPoints((short) 9);
+        XSSFFont plainFont = workbook.createFont();
+        plainFont.setFontName("Arial");
+        plainFont.setCharSet(134);
+        plainFont.setFontHeightInPoints((short) 9);
+        
+        XSSFSheet errorSheet = null;
+        if (errorMessages.keySet().size() > 0) {
+            String errorSheetName = UtilDateTime.nowDateString("yyyy-MM-dd HHmm") + " Errors";
+            errorSheetName = WorkbookUtil.createSafeSheetName(errorSheetName);
+            errorSheet = workbook.createSheet(errorSheetName);
+            workbook.setSheetOrder(errorSheetName, 0);
+            workbook.setActiveSheet(workbook.getSheetIndex(errorSheetName));
+            XSSFDrawing drawingPatriarch = errorSheet.getDrawingPatriarch();
+            if (drawingPatriarch == null) {
+                drawingPatriarch = errorSheet.createDrawingPatriarch();
+            }
+            for (int i = 0; i <= getHeaderRowNo(); i++) {
+                XSSFRow newRow = errorSheet.createRow(i);
+                XSSFRow row = sheet.getRow(i);
+                newRow.setHeight(row.getHeight());
+                copyRow(row, newRow, factory, drawingPatriarch);
+            }
+            
+            // copy merged regions
+            for (int i = 0; i < sheet.getNumMergedRegions(); i++) {
+                CellRangeAddress mergedRegion = sheet.getMergedRegion(i);
+                if (mergedRegion.getFirstRow() < getHeaderRowNo()) {
+                    errorSheet.addMergedRegion(mergedRegion);
+                }
+            }
+            
+            // copy images
+            List<XSSFPictureData> pics = workbook.getAllPictures();
+            List<XSSFShape> shapes = sheet.getDrawingPatriarch().getShapes();
+            for (int i = 0; i < shapes.size(); i++) {
+                XSSFShape shape = shapes.get(i);
+                XSSFAnchor anchor = shape.getAnchor();
+                if (shape instanceof XSSFPicture && anchor instanceof XSSFClientAnchor) {
+                    XSSFPicture pic = (XSSFPicture) shape;
+                    XSSFClientAnchor clientAnchor = (XSSFClientAnchor) anchor;
+                    if (clientAnchor.getRow1() < getHeaderRowNo()) {
+                        for (int j = 0; j < pics.size(); j++) {
+                            XSSFPictureData picture = pics.get(j);
+                            if (picture.getPackagePart().getPartName().equals(pic.getPictureData().getPackagePart().getPartName())) {
+                                drawingPatriarch.createPicture(clientAnchor, j);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        
+        try {
+            // set comments in the original sheet
+            XSSFDrawing patriarch = sheet.getDrawingPatriarch();
+            for (CellReference cell : errorMessages.keySet()) {
+                if (cell != null && errorMessages.get(cell) != null) {
+                    XSSFComment comment = sheet.getCellComment(new CellAddress(cell.getRow(), cell.getCol()));
+                    boolean isNewComment = false;
+                    if (comment == null) {
+                        XSSFClientAnchor anchor = factory.createClientAnchor();
+                        anchor.setDx1(100);
+                        anchor.setDx2(100);
+                        anchor.setDy1(100);
+                        anchor.setDy2(100);
+                        anchor.setCol1(cell.getCol());
+                        anchor.setCol2(cell.getCol() + 4);
+                        anchor.setRow1(cell.getRow());
+                        anchor.setRow2(cell.getRow() + 4);
+                        anchor.setAnchorType(AnchorType.DONT_MOVE_AND_RESIZE);
 
-					    comment = patriarch.createCellComment(anchor);
-						isNewComment = true;
-					}
-					XSSFRichTextString rts = factory.createRichTextString("OFBiz PriCat:\n");
-					rts.applyFont(boldFont);
-					rts.append(errorMessages.get(cell), plainFont);
-					comment.setString(rts);
-					comment.setAuthor("Apache OFBiz PriCat");
-					if (isNewComment) {
-						sheet.getRow(cell.getRow()).getCell(cell.getCol()).setCellComment(comment);
-				        OFBizPricatUtil.formatCommentShape(sheet, cell);
-					}
-				}
-			}
-			
-			// set comments in the new error sheet
-			XSSFDrawing errorPatriarch = errorSheet.getDrawingPatriarch();
-			int newRowNum = getHeaderRowNo() + 1;
-			Map<Integer, Integer> rowMapping = new HashMap<Integer, Integer>();
-			for (CellReference cell : errorMessages.keySet()) {
-				if (cell != null && errorMessages.get(cell) != null) {
-					XSSFRow row = sheet.getRow(cell.getRow());
-					Integer rowNum = Integer.valueOf(row.getRowNum());
-					int errorRow = newRowNum;
-					if (rowMapping.containsKey(rowNum)) {
-						errorRow = rowMapping.get(rowNum).intValue();
-					} else {
-						XSSFRow newRow = errorSheet.getRow(errorRow);
-						if (newRow == null) {
-							newRow = errorSheet.createRow(errorRow);
-						}
-						rowMapping.put(rowNum, Integer.valueOf(errorRow));
-						newRow.setHeight(row.getHeight());
-						copyRow(row, newRow, factory, errorPatriarch);
-						newRowNum ++;
-					}
-				}
-			}
+                        comment = patriarch.createCellComment(anchor);
+                        isNewComment = true;
+                    }
+                    XSSFRichTextString rts = factory.createRichTextString("OFBiz PriCat:\n");
+                    rts.applyFont(boldFont);
+                    rts.append(errorMessages.get(cell), plainFont);
+                    comment.setString(rts);
+                    comment.setAuthor("Apache OFBiz PriCat");
+                    if (isNewComment) {
+                        sheet.getRow(cell.getRow()).getCell(cell.getCol()).setCellComment(comment);
+                        OFBizPricatUtil.formatCommentShape(sheet, cell);
+                    }
+                }
+            }
+            
+            // set comments in the new error sheet
+            XSSFDrawing errorPatriarch = errorSheet.getDrawingPatriarch();
+            int newRowNum = getHeaderRowNo() + 1;
+            Map<Integer, Integer> rowMapping = new HashMap<Integer, Integer>();
+            for (CellReference cell : errorMessages.keySet()) {
+                if (cell != null && errorMessages.get(cell) != null) {
+                    XSSFRow row = sheet.getRow(cell.getRow());
+                    Integer rowNum = Integer.valueOf(row.getRowNum());
+                    int errorRow = newRowNum;
+                    if (rowMapping.containsKey(rowNum)) {
+                        errorRow = rowMapping.get(rowNum).intValue();
+                    } else {
+                        XSSFRow newRow = errorSheet.getRow(errorRow);
+                        if (newRow == null) {
+                            newRow = errorSheet.createRow(errorRow);
+                        }
+                        rowMapping.put(rowNum, Integer.valueOf(errorRow));
+                        newRow.setHeight(row.getHeight());
+                        copyRow(row, newRow, factory, errorPatriarch);
+                        newRowNum ++;
+                    }
+                }
+            }
 
-			// write to file
-			if (sequenceNum > 0L) {
-				File commentedExcel = FileUtil.getFile(tempFilesFolder + userLoginId + "/" + sequenceNum + ".xlsx");
-				fos = new FileOutputStream(commentedExcel);
-				workbook.write(fos);
-			} else {
-				fos = new FileOutputStream(pricatFile);
-				workbook.write(fos);
-			}
-			fos.flush();
-			fos.close();
-			workbook.close();
-		} catch (FileNotFoundException e) {
-			report.println(e);
-			Debug.logError(e, module);
-		} catch (IOException e) {
-			report.println(e);
-			Debug.logError(e, module);
-		} finally {
-			if (fos != null) {
-				try {
-					fos.close();
-				} catch (IOException e) {
-					Debug.logError(e, module);
-				}
-			}
-			if (workbook != null) {
-				try {
-					workbook.close();
-				} catch (IOException e) {
-					Debug.logError(e, module);
-				}
-			}
-		}
-		report.println(UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
-		report.println();
-	}
+            // write to file
+            if (sequenceNum > 0L) {
+                File commentedExcel = FileUtil.getFile(tempFilesFolder + userLoginId + "/" + sequenceNum + ".xlsx");
+                fos = new FileOutputStream(commentedExcel);
+                workbook.write(fos);
+            } else {
+                fos = new FileOutputStream(pricatFile);
+                workbook.write(fos);
+            }
+            fos.flush();
+            fos.close();
+            workbook.close();
+        } catch (FileNotFoundException e) {
+            report.println(e);
+            Debug.logError(e, module);
+        } catch (IOException e) {
+            report.println(e);
+            Debug.logError(e, module);
+        } finally {
+            if (fos != null) {
+                try {
+                    fos.close();
+                } catch (IOException e) {
+                    Debug.logError(e, module);
+                }
+            }
+            if (workbook != null) {
+                try {
+                    workbook.close();
+                } catch (IOException e) {
+                    Debug.logError(e, module);
+                }
+            }
+        }
+        report.println(UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
+        report.println();
+    }
 
-	private void copyRow(XSSFRow sourceRow, XSSFRow targetRow, XSSFCreationHelper factory, XSSFDrawing patriarch) {
-		for (int j = 0; j < sourceRow.getPhysicalNumberOfCells(); j++) {
-			XSSFCell cell = sourceRow.getCell(j);
-			if (cell != null) {
-				XSSFCell newCell = targetRow.createCell(j);
-				int cellType = cell.getCellType();
-				newCell.setCellType(cellType);
-				switch (cellType) {
-					case XSSFCell.CELL_TYPE_BOOLEAN:
-						newCell.setCellValue(cell.getBooleanCellValue());
-						break;
-					case XSSFCell.CELL_TYPE_ERROR:
-						newCell.setCellErrorValue(cell.getErrorCellValue());
-						break;
-					case XSSFCell.CELL_TYPE_FORMULA:
-						newCell.setCellFormula(cell.getCellFormula());
-						break;
-					case XSSFCell.CELL_TYPE_NUMERIC:
-						newCell.setCellValue(cell.getNumericCellValue());
-						break;
-					case XSSFCell.CELL_TYPE_STRING:
-						newCell.setCellValue(cell.getRichStringCellValue());
-						break;
-					default:
-						newCell.setCellValue(formatter.formatCellValue(cell));
-				}
-				if (cell.getCellComment() != null) {
-					XSSFClientAnchor anchor = factory.createClientAnchor();
-					anchor.setDx1(100);
-					anchor.setDx2(100);
-					anchor.setDy1(100);
-					anchor.setDy2(100);
-				    anchor.setCol1(newCell.getColumnIndex());
-				    anchor.setCol2(newCell.getColumnIndex() + 4);
-				    anchor.setRow1(newCell.getRowIndex());
-				    anchor.setRow2(newCell.getRowIndex() + 4);
-				    anchor.setAnchorType(AnchorType.DONT_MOVE_AND_RESIZE);
+    private void copyRow(XSSFRow sourceRow, XSSFRow targetRow, XSSFCreationHelper factory, XSSFDrawing patriarch) {
+        for (int j = 0; j < sourceRow.getPhysicalNumberOfCells(); j++) {
+            XSSFCell cell = sourceRow.getCell(j);
+            if (cell != null) {
+                XSSFCell newCell = targetRow.createCell(j);
+                int cellType = cell.getCellType();
+                newCell.setCellType(cellType);
+                switch (cellType) {
+                    case XSSFCell.CELL_TYPE_BOOLEAN:
+                        newCell.setCellValue(cell.getBooleanCellValue());
+                        break;
+                    case XSSFCell.CELL_TYPE_ERROR:
+                        newCell.setCellErrorValue(cell.getErrorCellValue());
+                        break;
+                    case XSSFCell.CELL_TYPE_FORMULA:
+                        newCell.setCellFormula(cell.getCellFormula());
+                        break;
+                    case XSSFCell.CELL_TYPE_NUMERIC:
+                        newCell.setCellValue(cell.getNumericCellValue());
+                        break;
+                    case XSSFCell.CELL_TYPE_STRING:
+                        newCell.setCellValue(cell.getRichStringCellValue());
+                        break;
+                    default:
+                        newCell.setCellValue(formatter.formatCellValue(cell));
+                }
+                if (cell.getCellComment() != null) {
+                    XSSFClientAnchor anchor = factory.createClientAnchor();
+                    anchor.setDx1(100);
+                    anchor.setDx2(100);
+                    anchor.setDy1(100);
+                    anchor.setDy2(100);
+                    anchor.setCol1(newCell.getColumnIndex());
+                    anchor.setCol2(newCell.getColumnIndex() + 4);
+                    anchor.setRow1(newCell.getRowIndex());
+                    anchor.setRow2(newCell.getRowIndex() + 4);
+                    anchor.setAnchorType(AnchorType.DONT_MOVE_AND_RESIZE);
 
-				    XSSFComment comment = patriarch.createCellComment(anchor);
-				    comment.setString(cell.getCellComment().getString());
-					newCell.setCellComment(comment);
-				}
-				newCell.setCellStyle(cell.getCellStyle());
-				newCell.getSheet().setColumnWidth(newCell.getColumnIndex(), cell.getSheet().getColumnWidth(cell.getColumnIndex()));
-			}
-		}
-	}
+                    XSSFComment comment = patriarch.createCellComment(anchor);
+                    comment.setString(cell.getCellComment().getString());
+                    newCell.setCellComment(comment);
+                }
+                newCell.setCellStyle(cell.getCellStyle());
+                newCell.getSheet().setColumnWidth(newCell.getColumnIndex(), cell.getSheet().getColumnWidth(cell.getColumnIndex()));
+            }
+        }
+    }
 
-	public void initBasicConds(List<String> orgPartyIds) {
-		basicCategoryConds = new ArrayList<EntityCondition>();
-		basicCategoryConds.add(EntityCondition.makeCondition("isPublic", "N"));
-		//basicCategoryConds.add(EntityCondition.makeCondition("isDefault", "Y"));
-		
-		basicBrandConds = new ArrayList<EntityCondition>();
-		basicBrandConds.add(EntityCondition.makeCondition("isPublic", "N"));
-		basicBrandConds.add(EntityCondition.makeCondition("productFeatureTypeId", "BRAND"));
-		
-		List<EntityCondition> partyIdConds = new ArrayList<EntityCondition>();
-		for (String orgPartyId : orgPartyIds) {
-			partyIdConds.add(EntityCondition.makeCondition("ownerPartyId", orgPartyId));
-		}
-		if (UtilValidate.isNotEmpty(partyIdConds)) {
-			basicCategoryConds.add(EntityCondition.makeCondition(partyIdConds, EntityOperator.OR));
-			basicBrandConds.add(EntityCondition.makeCondition(partyIdConds, EntityOperator.OR));
-		}
-	}
+    public void initBasicConds(List<String> orgPartyIds) {
+        basicCategoryConds = new ArrayList<EntityCondition>();
+        basicCategoryConds.add(EntityCondition.makeCondition("isPublic", "N"));
+        //basicCategoryConds.add(EntityCondition.makeCondition("isDefault", "Y"));
+        
+        basicBrandConds = new ArrayList<EntityCondition>();
+        basicBrandConds.add(EntityCondition.makeCondition("isPublic", "N"));
+        basicBrandConds.add(EntityCondition.makeCondition("productFeatureTypeId", "BRAND"));
+        
+        List<EntityCondition> partyIdConds = new ArrayList<EntityCondition>();
+        for (String orgPartyId : orgPartyIds) {
+            partyIdConds.add(EntityCondition.makeCondition("ownerPartyId", orgPartyId));
+        }
+        if (UtilValidate.isNotEmpty(partyIdConds)) {
+            basicCategoryConds.add(EntityCondition.makeCondition(partyIdConds, EntityOperator.OR));
+            basicBrandConds.add(EntityCondition.makeCondition(partyIdConds, EntityOperator.OR));
+        }
+    }
 
-	public Map<String, Object> updateSkuPrice(String skuId, String ownerPartyId, BigDecimal memberPrice) {
-		return ServiceUtil.returnSuccess();
-	}
+    public Map<String, Object> updateSkuPrice(String skuId, String ownerPartyId, BigDecimal memberPrice) {
+        return ServiceUtil.returnSuccess();
+    }
 
-	public Map<String, Object> updateColorAndDimension(String productId, String ownerPartyId, String color, String dimension) {
-		Map<String, Object> results = ServiceUtil.returnSuccess();
-		results.put("colorId", "sampleColorId");
-		results.put("dimensionId", "sampleDimensionId");
-		return results;
-	}
+    public Map<String, Object> updateColorAndDimension(String productId, String ownerPartyId, String color, String dimension) {
+        Map<String, Object> results = ServiceUtil.returnSuccess();
+        results.put("colorId", "sampleColorId");
+        results.put("dimensionId", "sampleDimensionId");
+        return results;
+    }
 
-	public Map<String, Object> getDimensionIds(String productId, String ownerPartyId, String dimension) {
-		Map<String, Object> results = ServiceUtil.returnSuccess();
-		results.put("dimensionId", "sampleDimensionId");
-		return results;
-	}
+    public Map<String, Object> getDimensionIds(String productId, String ownerPartyId, String dimension) {
+        Map<String, Object> results = ServiceUtil.returnSuccess();
+        results.put("dimensionId", "sampleDimensionId");
+        return results;
+    }
 
-	public Map<String, Object> getColorIds(String productId, String ownerPartyId, String color) {
-		Map<String, Object> results = ServiceUtil.returnSuccess();
-		results.put("foundColor", Boolean.TRUE);
-		results.put("colorId", "sampleColorId");
-		return results;
-	}
+    public Map<String, Object> getColorIds(String productId, String ownerPartyId, String color) {
+        Map<String, Object> results = ServiceUtil.returnSuccess();
+        results.put("foundColor", Boolean.TRUE);
+        results.put("colorId", "sampleColorId");
+        return results;
+    }
 
-	public String getBrandId(String brandName, String ownerPartyId) {
-		return "sampleBrandId";
-	}
+    public String getBrandId(String brandName, String ownerPartyId) {
+        return "sampleBrandId";
+    }
 
-	public boolean isNumOfSheetsOK(XSSFWorkbook workbook) {
-		report.print(UtilProperties.getMessage(resource, "CheckPricatHasSheet", locale), InterfaceReport.FORMAT_NOTE);
-		int sheets = workbook.getNumberOfSheets();
-		if (sheets < 1) {
-			report.println(UtilProperties.getMessage(resource, "PricatTableNoSheet", locale), InterfaceReport.FORMAT_ERROR);
-			return false;
-		} else if (sheets >= 1) {
-			report.println(UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
-			report.println(UtilProperties.getMessage(resource, "PricatTableOnlyParse1stSheet", locale), InterfaceReport.FORMAT_WARNING);
-		}
-		return true;
-	}
+    public boolean isNumOfSheetsOK(XSSFWorkbook workbook) {
+        report.print(UtilProperties.getMessage(resource, "CheckPricatHasSheet", locale), InterfaceReport.FORMAT_NOTE);
+        int sheets = workbook.getNumberOfSheets();
+        if (sheets < 1) {
+            report.println(UtilProperties.getMessage(resource, "PricatTableNoSheet", locale), InterfaceReport.FORMAT_ERROR);
+            return false;
+        } else if (sheets >= 1) {
+            report.println(UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
+            report.println(UtilProperties.getMessage(resource, "PricatTableOnlyParse1stSheet", locale), InterfaceReport.FORMAT_WARNING);
+        }
+        return true;
+    }
 
-	/**
-	 * Get data by version definition.
-	 * 
-	 * @param row
-	 * @param colNames 
-	 * @param size 
-	 * @return
-	 */
-	public List<Object> getCellContents(XSSFRow row, List<Object[]> colNames, int size) {
-		List<Object> results = new ArrayList<Object>();
-		boolean foundError = false;
-		if (isEmptyRow(row, size, true)) {
-			return null;
-		}
-		for (int i = 0; i < size; i++) {
-			XSSFCell cell = null;
-			if (row.getPhysicalNumberOfCells() > i) {
-				cell = row.getCell(i);
-			}
-			if (cell == null) {
-				if (((Boolean) colNames.get(i)[2]).booleanValue()) {
-					report.print(UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale), InterfaceReport.FORMAT_WARNING);
-					errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale));
-					foundError = true;
-					continue;
-				} else {
-					cell = row.createCell(i);
-				}
-			}
-			int cellType = cell.getCellType();
-			String cellValue = formatter.formatCellValue(cell);
-			if (UtilValidate.isNotEmpty(cellValue)) {
-				if (cellType == XSSFCell.CELL_TYPE_FORMULA) {
-					cellValue = BigDecimal.valueOf(cell.getNumericCellValue()).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding).toString();
-					report.print(((i == 0)?"":", ") + cellValue, InterfaceReport.FORMAT_NOTE);
-				} else {
-					report.print(((i == 0)?"":", ") + cellValue, InterfaceReport.FORMAT_NOTE);
-				}
-			} else {
-				report.print(((i == 0)?"":","), InterfaceReport.FORMAT_NOTE);
-			}
-			if (((Boolean) colNames.get(i)[2]).booleanValue() && UtilValidate.isEmpty(cellValue)) {
-				report.print(UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale), InterfaceReport.FORMAT_WARNING);
-				errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale));
-				foundError = true;
-				results.add(null);
-				continue;
-			}
-			if (((Boolean) colNames.get(i)[2]).booleanValue() && cellType != (int) colNames.get(i)[1]) {
-				// String warningMessage = "";
-				if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_STRING) {
-					results.add(cellValue);
-				} else if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_NUMERIC) {
-					if (cell.getCellType() != XSSFCell.CELL_TYPE_STRING) {
-						cell.setCellType(XSSFCell.CELL_TYPE_STRING);
-					}
-					try {
-						results.add(BigDecimal.valueOf(Double.parseDouble(cell.getStringCellValue())).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding));
-					} catch (NumberFormatException e) {
-						results.add(null);
-						errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
-					}
-				}
-			} else {
-				if (UtilValidate.isEmpty(cellValue)) {
-					results.add(null);
-					continue;
-				}
-				if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_STRING) {
-					if (cell.getCellType() == XSSFCell.CELL_TYPE_STRING) {
-						results.add(cell.getStringCellValue());
-					} else {
-						results.add(cellValue);
-					}
-				} else if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_NUMERIC) {
-					if (cell.getCellType() == XSSFCell.CELL_TYPE_STRING) {
-						try {
-							results.add(BigDecimal.valueOf(Double.valueOf(cell.getStringCellValue())));
-						} catch (NumberFormatException e) {
-							results.add(null);
-							errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
-						}
-					} else if (cell.getCellType() == XSSFCell.CELL_TYPE_NUMERIC) {
-						try {
-							results.add(BigDecimal.valueOf(cell.getNumericCellValue()).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding));
-						} catch (NumberFormatException e) {
-							results.add(null);
-							errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
-						}
-					} else {
-						try {
-							results.add(BigDecimal.valueOf(Double.valueOf(cellValue)).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding));
-						} catch (NumberFormatException e) {
-							results.add(null);
-							errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
-						}
-					}
-				}
-			}
-		}
-		if (foundError) {
-			return null;
-		}
-		return results;
-	}
+    /**
+     * Get data by version definition.
+     * 
+     * @param row
+     * @param colNames 
+     * @param size 
+     * @return
+     */
+    public List<Object> getCellContents(XSSFRow row, List<Object[]> colNames, int size) {
+        List<Object> results = new ArrayList<Object>();
+        boolean foundError = false;
+        if (isEmptyRow(row, size, true)) {
+            return null;
+        }
+        for (int i = 0; i < size; i++) {
+            XSSFCell cell = null;
+            if (row.getPhysicalNumberOfCells() > i) {
+                cell = row.getCell(i);
+            }
+            if (cell == null) {
+                if (((Boolean) colNames.get(i)[2]).booleanValue()) {
+                    report.print(UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale), InterfaceReport.FORMAT_WARNING);
+                    errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale));
+                    foundError = true;
+                    continue;
+                } else {
+                    cell = row.createCell(i);
+                }
+            }
+            int cellType = cell.getCellType();
+            String cellValue = formatter.formatCellValue(cell);
+            if (UtilValidate.isNotEmpty(cellValue)) {
+                if (cellType == XSSFCell.CELL_TYPE_FORMULA) {
+                    cellValue = BigDecimal.valueOf(cell.getNumericCellValue()).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding).toString();
+                    report.print(((i == 0)?"":", ") + cellValue, InterfaceReport.FORMAT_NOTE);
+                } else {
+                    report.print(((i == 0)?"":", ") + cellValue, InterfaceReport.FORMAT_NOTE);
+                }
+            } else {
+                report.print(((i == 0)?"":","), InterfaceReport.FORMAT_NOTE);
+            }
+            if (((Boolean) colNames.get(i)[2]).booleanValue() && UtilValidate.isEmpty(cellValue)) {
+                report.print(UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale), InterfaceReport.FORMAT_WARNING);
+                errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale));
+                foundError = true;
+                results.add(null);
+                continue;
+            }
+            if (((Boolean) colNames.get(i)[2]).booleanValue() && cellType != (int) colNames.get(i)[1]) {
+                // String warningMessage = "";
+                if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_STRING) {
+                    results.add(cellValue);
+                } else if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_NUMERIC) {
+                    if (cell.getCellType() != XSSFCell.CELL_TYPE_STRING) {
+                        cell.setCellType(XSSFCell.CELL_TYPE_STRING);
+                    }
+                    try {
+                        results.add(BigDecimal.valueOf(Double.parseDouble(cell.getStringCellValue())).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding));
+                    } catch (NumberFormatException e) {
+                        results.add(null);
+                        errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
+                    }
+                }
+            } else {
+                if (UtilValidate.isEmpty(cellValue)) {
+                    results.add(null);
+                    continue;
+                }
+                if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_STRING) {
+                    if (cell.getCellType() == XSSFCell.CELL_TYPE_STRING) {
+                        results.add(cell.getStringCellValue());
+                    } else {
+                        results.add(cellValue);
+                    }
+                } else if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_NUMERIC) {
+                    if (cell.getCellType() == XSSFCell.CELL_TYPE_STRING) {
+                        try {
+                            results.add(BigDecimal.valueOf(Double.valueOf(cell.getStringCellValue())));
+                        } catch (NumberFormatException e) {
+                            results.add(null);
+                            errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
+                        }
+                    } else if (cell.getCellType() == XSSFCell.CELL_TYPE_NUMERIC) {
+                        try {
+                            results.add(BigDecimal.valueOf(cell.getNumericCellValue()).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding));
+                        } catch (NumberFormatException e) {
+                            results.add(null);
+                            errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
+                        }
+                    } else {
+                        try {
+                            results.add(BigDecimal.valueOf(Double.valueOf(cellValue)).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding));
+                        } catch (NumberFormatException e) {
+                            results.add(null);
+                            errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
+                        }
+                    }
+                }
+            }
+        }
+        if (foundError) {
+            return null;
+        }
+        return results;
+    }
 
-	public void setFacilityId(String selectedFacilityId) {
-		this.selectedFacilityId = selectedFacilityId;
-	}
+    public void setFacilityId(String selectedFacilityId) {
+        this.selectedFacilityId = selectedFacilityId;
+    }
 
-	protected boolean isEmptyRow(XSSFRow row, int size, boolean display) {
-		// check whether this row is empty
-		if (UtilValidate.isEmpty(row)) {
-			report.print(UtilProperties.getMessage(resource, "ExcelEmptyRow", locale), InterfaceReport.FORMAT_NOTE);
-			return true;
-		}
-		boolean isEmptyRow = true;
-		int physicalNumberOfCells = row.getPhysicalNumberOfCells();
-		int i = 0;
-		for (; i < size; i++) {
-			XSSFCell cell = null;
-			if (physicalNumberOfCells > i) {
-				cell = row.getCell(i);
-			}
-			if (cell != null && UtilValidate.isNotEmpty(formatter.formatCellValue(cell)) && UtilValidate.isNotEmpty(formatter.formatCellValue(cell).trim())) {
-				isEmptyRow = false;
-				break;
-			}
-		}
-		if (isEmptyRow) {
-			if (display) {
-				report.print(UtilProperties.getMessage(resource, "ExcelEmptyRow", locale), InterfaceReport.FORMAT_NOTE);
-			}
-			return true;
-		} else if (!isEmptyRow && i > size) {
-			if (display) {
-				report.print(UtilProperties.getMessage(resource, "IgnoreDataOutOfRange", locale), InterfaceReport.FORMAT_NOTE);
-			}
-			return true;
-		}
-		return isEmptyRow;
-	}
-	
-	protected abstract int getHeaderRowNo();
-	
+    protected boolean isEmptyRow(XSSFRow row, int size, boolean display) {
+        // check whether this row is empty
+        if (UtilValidate.isEmpty(row)) {
+            report.print(UtilProperties.getMessage(resource, "ExcelEmptyRow", locale), InterfaceReport.FORMAT_NOTE);
+            return true;
+        }
+        boolean isEmptyRow = true;
+        int physicalNumberOfCells = row.getPhysicalNumberOfCells();
+        int i = 0;
+        for (; i < size; i++) {
+            XSSFCell cell = null;
+            if (physicalNumberOfCells > i) {
+                cell = row.getCell(i);
+            }
+            if (cell != null && UtilValidate.isNotEmpty(formatter.formatCellValue(cell)) && UtilValidate.isNotEmpty(formatter.formatCellValue(cell).trim())) {
+                isEmptyRow = false;
+                break;
+            }
+        }
+        if (isEmptyRow) {
+            if (display) {
+                report.print(UtilProperties.getMessage(resource, "ExcelEmptyRow", locale), InterfaceReport.FORMAT_NOTE);
+            }
+            return true;
+        } else if (!isEmptyRow && i > size) {
+            if (display) {
+                report.print(UtilProperties.getMessage(resource, "IgnoreDataOutOfRange", locale), InterfaceReport.FORMAT_NOTE);
+            }
+            return true;
+        }
+        return isEmptyRow;
+    }
+    
+    protected abstract int getHeaderRowNo();
+    
 
-	public synchronized void endExcelImportHistory(String logFileName, String thruReasonId) {
-		Thread currentThread = Thread.currentThread();
-		String threadName = null;
-		if (currentThread instanceof PricatParseExcelHtmlThread) {
-			threadName = ((PricatParseExcelHtmlThread) currentThread).getUUID().toString();
-		}
-		if (UtilValidate.isEmpty(threadName)) {
-			return;
-		}
-		try {
-			GenericValue historyValue = null;
-			if (sequenceNum < 1L) {
-				historyValue = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("ExcelImportHistory", 
-													UtilMisc.toMap("userLoginId", userLoginId, "logFileName", logFileName), UtilMisc.toList("sequenceNum DESC"), false)));
-			} else {
-				historyValue = delegator.findOne("ExcelImportHistory", UtilMisc.toMap("userLoginId", userLoginId, "sequenceNum", (Long) sequenceNum), false);
-			}
-			Timestamp now = UtilDateTime.nowTimestamp();
-			if (UtilValidate.isEmpty(historyValue)) {
-				historyValue = delegator.makeValue("ExcelImportHistory", UtilMisc.toMap("sequenceNum", Long.valueOf(sequenceNum), "userLoginId", userLoginId,
-													"fileName", pricatFile.getName(), "statusId", "EXCEL_IMPORTED", "fromDate", now,  
-													"thruDate", now, "threadName", threadName, "logFileName", logFileName));
-			} else {
-				historyValue.set("statusId", "EXCEL_IMPORTED");
-				historyValue.set("thruDate", now);
-				if (pricatFile != null && pricatFile.exists()) {
-					historyValue.set("fileName", pricatFile.getName());
-				}
-				historyValue.set("thruReasonId", thruReasonId);
-			}
-			delegator.createOrStore(historyValue);
-		} catch (GenericEntityException e) {
-			// do nothing
-		}
-	}
-	
-	public boolean hasErrorMessages() {
-		return !errorMessages.keySet().isEmpty();
-	}
+    public synchronized void endExcelImportHistory(String logFileName, String thruReasonId) {
+        Thread currentThread = Thread.currentThread();
+        String threadName = null;
+        if (currentThread instanceof PricatParseExcelHtmlThread) {
+            threadName = ((PricatParseExcelHtmlThread) currentThread).getUUID().toString();
+        }
+        if (UtilValidate.isEmpty(threadName)) {
+            return;
+        }
+        try {
+            GenericValue historyValue = null;
+            if (sequenceNum < 1L) {
+                historyValue = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("ExcelImportHistory", 
+                                                    UtilMisc.toMap("userLoginId", userLoginId, "logFileName", logFileName), UtilMisc.toList("sequenceNum DESC"), false)));
+            } else {
+                historyValue = delegator.findOne("ExcelImportHistory", UtilMisc.toMap("userLoginId", userLoginId, "sequenceNum", (Long) sequenceNum), false);
+            }
+            Timestamp now = UtilDateTime.nowTimestamp();
+            if (UtilValidate.isEmpty(historyValue)) {
+                historyValue = delegator.makeValue("ExcelImportHistory", UtilMisc.toMap("sequenceNum", Long.valueOf(sequenceNum), "userLoginId", userLoginId,
+                                                    "fileName", pricatFile.getName(), "statusId", "EXCEL_IMPORTED", "fromDate", now,  
+                                                    "thruDate", now, "threadName", threadName, "logFileName", logFileName));
+            } else {
+                historyValue.set("statusId", "EXCEL_IMPORTED");
+                historyValue.set("thruDate", now);
+                if (pricatFile != null && pricatFile.exists()) {
+                    historyValue.set("fileName", pricatFile.getName());
+                }
+                historyValue.set("thruReasonId", thruReasonId);
+            }
+            delegator.createOrStore(historyValue);
+        } catch (GenericEntityException e) {
+            // do nothing
+        }
+    }
+    
+    public boolean hasErrorMessages() {
+        return !errorMessages.keySet().isEmpty();
+    }
 
-	/**
-	 * Check whether a commented file exists.
-	 * 
-	 * @param request
-	 * @param sequenceNum
-	 * @return
-	 */
-	public static boolean isCommentedExcelExists(HttpServletRequest request, Long sequenceNum) {
-	    GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin");
-		if (UtilValidate.isEmpty(sequenceNum) || UtilValidate.isEmpty(userLogin)) {
-			Debug.logError("sequenceNum[" + sequenceNum + "] or userLogin is empty", module);
-			return false;
-		}
-	    String userLoginId = userLogin.getString("userLoginId");
-		Delegator delegator = (Delegator) request.getAttribute("delegator");
-		GenericValue historyValue = null;
-		try {
-			historyValue = delegator.findOne("ExcelImportHistory", UtilMisc.toMap("userLoginId", userLoginId, "sequenceNum", Long.valueOf(sequenceNum)), false);
-		} catch (NumberFormatException e) {
-			Debug.logError(e.getMessage(), module);
-			return false;
-		} catch (GenericEntityException e) {
-			Debug.logError(e.getMessage(), module);
-			return false;
-		}
-		if (UtilValidate.isEmpty(historyValue)) {
-			Debug.logError("No ExcelImportHistory value found by sequenceNum[" + sequenceNum + "] and userLoginId[" + userLoginId + "].", module);
-			return false;
-		}
-		File file = FileUtil.getFile(tempFilesFolder + userLoginId + "/" + sequenceNum + ".xlsx");
-		if (file.exists()) {
-			return true;
-		}
+    /**
+     * Check whether a commented file exists.
+     * 
+     * @param request
+     * @param sequenceNum
+     * @return
+     */
+    public static boolean isCommentedExcelExists(HttpServletRequest request, Long sequenceNum) {
+        GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin");
+        if (UtilValidate.isEmpty(sequenceNum) || UtilValidate.isEmpty(userLogin)) {
+            Debug.logError("sequenceNum[" + sequenceNum + "] or userLogin is empty", module);
+            return false;
+        }
+        String userLoginId = userLogin.getString("userLoginId");
+        Delegator delegator = (Delegator) request.getAttribute("delegator");
+        GenericValue historyValue = null;
+        try {
+            historyValue = delegator.findOne("ExcelImportHistory", UtilMisc.toMap("userLoginId", userLoginId, "sequenceNum", Long.valueOf(sequenceNum)), false);
+        } catch (NumberFormatException e) {
+            Debug.logError(e.getMessage(), module);
+            return false;
+        } catch (GenericEntityException e) {
+            Debug.logError(e.getMessage(), module);
+            return false;
+        }
+        if (UtilValidate.isEmpty(historyValue)) {
+            Debug.logError("No ExcelImportHistory value found by sequenceNum[" + sequenceNum + "] and userLoginId[" + userLoginId + "].", module);
+            return false;
+        }
+        File file = FileUtil.getFile(tempFilesFolder + userLoginId + "/" + sequenceNum + ".xlsx");
+        if (file.exists()) {
+            return true;
+        }
         return false;
-	}
+    }
 
-	protected void cleanupLogAndCommentedExcel() {
-		try {
-			report.print(UtilProperties.getMessage(resource, "CLEANUP_LOGANDEXCEL_BEGIN", locale), InterfaceReport.FORMAT_DEFAULT);
-			List<GenericValue> historyValues = delegator.findByAnd("ExcelImportHistory", UtilMisc.toMap("userLoginId", userLoginId), UtilMisc.toList("sequenceNum DESC"), false);
-			if (UtilValidate.isEmpty(historyValues) || historyValues.size() <= HISTORY_MAX_FILENUMBER) {
-				report.print(UtilProperties.getMessage(resource, "HistoryLessThan", new Object[] {String.valueOf(HISTORY_MAX_FILENUMBER)}, locale), InterfaceReport.FORMAT_NOTE);
-				report.println(" ... " + UtilProperties.getMessage(resource, "skipped", locale), InterfaceReport.FORMAT_NOTE);
-			} else {
-				report.print(" ... " + UtilProperties.getMessage(resource, "HistoryEntryToRemove", new Object[] {historyValues.size() - HISTORY_MAX_FILENUMBER}, locale), InterfaceReport.FORMAT_NOTE);
-				List<GenericValue> valuesToRemove = new ArrayList<GenericValue>();
-				for (int i = HISTORY_MAX_FILENUMBER; i < historyValues.size(); i++) {
-					GenericValue historyValue = historyValues.get(i);
-					valuesToRemove.add(historyValue);
-					File excelFile = FileUtil.getFile(tempFilesFolder + userLoginId + "/" + historyValue.getLong("sequenceNum") + ".xlsx");
-					if (excelFile.exists()) {
-						try {
-							excelFile.delete();
-						} catch (SecurityException e) {
-							Debug.logError(e.getMessage(), module);
-							report.print(e.getMessage(), InterfaceReport.FORMAT_ERROR);
-						}
-					}
-					File logFile = FileUtil.getFile(tempFilesFolder + userLoginId + "/" + historyValue.getLong("sequenceNum") + ".log");
-					if (logFile.exists()) {
-						try {
-							logFile.delete();
-						} catch (SecurityException e) {
-							Debug.logError(e.getMessage(), module);
-							report.print(e.getMessage(), InterfaceReport.FORMAT_ERROR);
-						}
-					}
-				}
-				delegator.removeAll(valuesToRemove);
-				report.println(" ... " + UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
-			}
-			report.println();
-		} catch (GenericEntityException e) {
-			Debug.logError(e.getMessage(), module);
-		}
-	}
+    protected void cleanupLogAndCommentedExcel() {
+        try {
+            report.print(UtilProperties.getMessage(resource, "CLEANUP_LOGANDEXCEL_BEGIN", locale), InterfaceReport.FORMAT_DEFAULT);
+            List<GenericValue> historyValues = delegator.findByAnd("ExcelImportHistory", UtilMisc.toMap("userLoginId", userLoginId), UtilMisc.toList("sequenceNum DESC"), false);
+            if (UtilValidate.isEmpty(historyValues) || historyValues.size() <= HISTORY_MAX_FILENUMBER) {
+                report.print(UtilProperties.getMessage(resource, "HistoryLessThan", new Object[] {String.valueOf(HISTORY_MAX_FILENUMBER)}, locale), InterfaceReport.FORMAT_NOTE);
+                report.println(" ... " + UtilProperties.getMessage(resource, "skipped", locale), InterfaceReport.FORMAT_NOTE);
+            } else {
+                report.print(" ... " + UtilProperties.getMessage(resource, "HistoryEntryToRemove", new Object[] {historyValues.size() - HISTORY_MAX_FILENUMBER}, locale), InterfaceReport.FORMAT_NOTE);
+                List<GenericValue> valuesToRemove = new ArrayList<GenericValue>();
+                for (int i = HISTORY_MAX_FILENUMBER; i < historyValues.size(); i++) {
+                    GenericValue historyValue = historyValues.get(i);
+                    valuesToRemove.add(historyValue);
+                    File excelFile = FileUtil.getFile(tempFilesFolder + userLoginId + "/" + historyValue.getLong("sequenceNum") + ".xlsx");
+                    if (excelFile.exists()) {
+                        try {
+                            excelFile.delete();
+                        } catch (SecurityException e) {
+                            Debug.logError(e.getMessage(), module);
+                            report.print(e.getMessage(), InterfaceReport.FORMAT_ERROR);
+                        }
+                    }
+                    File logFile = FileUtil.getFile(tempFilesFolder + userLoginId + "/" + historyValue.getLong("sequenceNum") + ".log");
+                    if (logFile.exists()) {
+                        try {
+                            logFile.delete();
+                        } catch (SecurityException e) {
+                            Debug.logError(e.getMessage(), module);
+                            report.print(e.getMessage(), InterfaceReport.FORMAT_ERROR);
+                        }
+                    }
+                }
+                delegator.removeAll(valuesToRemove);
+                report.println(" ... " + UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
+            }
+            report.println();
+        } catch (GenericEntityException e) {
+            Debug.logError(e.getMessage(), module);
+        }
+    }
 }
diff --git a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/InterfacePricatParser.java b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/InterfacePricatParser.java
index 84ba499..0bfa9e8 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/InterfacePricatParser.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/InterfacePricatParser.java
@@ -36,15 +36,15 @@
  * 
  */
 public interface InterfacePricatParser {
-	
-	public static final String PARSE_EXCEL = "parse_excel";
-	
-	public static final String CONFIRM = "confirm_action";
-	
-	public static final String[] messageLabels = new String[] {"FORMAT_DEFAULT", "FORMAT_WARNING", "FORMAT_HEADLINE", "FORMAT_NOTE", "FORMAT_OK", "FORMAT_ERROR", "FORMAT_THROWABLE"};
-	
-	public static final List<String> messages = Collections.unmodifiableList(Arrays.asList(messageLabels));
-	
+    
+    public static final String PARSE_EXCEL = "parse_excel";
+    
+    public static final String CONFIRM = "confirm_action";
+    
+    public static final String[] messageLabels = new String[] {"FORMAT_DEFAULT", "FORMAT_WARNING", "FORMAT_HEADLINE", "FORMAT_NOTE", "FORMAT_OK", "FORMAT_ERROR", "FORMAT_THROWABLE"};
+    
+    public static final List<String> messages = Collections.unmodifiableList(Arrays.asList(messageLabels));
+    
     public static final String tempFilesFolder = "runtime/pricat/";
     
     public static final String FileDateTimePattern = "yyyyMMddHHmmss";
@@ -69,52 +69,52 @@
     
     public static final int HISTORY_MAX_FILENUMBER = UtilProperties.getPropertyAsInteger("pricat.properties", "pricat.history.max.filenumber", 20);
     
-	abstract void parsePricatExcel();
-	
-	public void writeCommentsToFile(XSSFWorkbook workbook, XSSFSheet sheet);
+    abstract void parsePricatExcel();
+    
+    public void writeCommentsToFile(XSSFWorkbook workbook, XSSFSheet sheet);
 
-	public void initBasicConds(List<String> orgPartyIds);
+    public void initBasicConds(List<String> orgPartyIds);
 
-	public boolean existsCurrencyId(XSSFSheet sheet);
+    public boolean existsCurrencyId(XSSFSheet sheet);
 
-	abstract void parseRowByRow(XSSFSheet sheet);
+    abstract void parseRowByRow(XSSFSheet sheet);
 
-	abstract boolean parseCellContentsAndStore(XSSFRow row, List<Object> cellContents) throws GenericTransactionException;
-	
-	public Map<String, Object> updateSkuPrice(String skuId, String ownerPartyId, BigDecimal memberPrice);
+    abstract boolean parseCellContentsAndStore(XSSFRow row, List<Object> cellContents) throws GenericTransactionException;
+    
+    public Map<String, Object> updateSkuPrice(String skuId, String ownerPartyId, BigDecimal memberPrice);
 
-	abstract String updateSku(XSSFRow row, String productId, String ownerPartyId, String facilityId, String barcode, BigDecimal inventory,
-			String colorId, String color, String dimensionId, String dimension, BigDecimal listPrice, BigDecimal averageCost);
+    abstract String updateSku(XSSFRow row, String productId, String ownerPartyId, String facilityId, String barcode, BigDecimal inventory,
+            String colorId, String color, String dimensionId, String dimension, BigDecimal listPrice, BigDecimal averageCost);
 
-	public Map<String, Object> updateColorAndDimension(String productId, String ownerPartyId, String color, String dimension);
-	
-	public Map<String, Object> getDimensionIds(String productId, String ownerPartyId, String dimension);
-	
-	public Map<String, Object> getColorIds(String productId, String ownerPartyId, String color);
+    public Map<String, Object> updateColorAndDimension(String productId, String ownerPartyId, String color, String dimension);
+    
+    public Map<String, Object> getDimensionIds(String productId, String ownerPartyId, String dimension);
+    
+    public Map<String, Object> getColorIds(String productId, String ownerPartyId, String color);
 
-	abstract String getProductId(XSSFRow row, String brandId, String modelName, String productName, String productCategoryId, String ownerPartyId, BigDecimal listPrice);
+    abstract String getProductId(XSSFRow row, String brandId, String modelName, String productName, String productCategoryId, String ownerPartyId, BigDecimal listPrice);
 
-	public String getBrandId(String brandName, String ownerPartyId);
+    public String getBrandId(String brandName, String ownerPartyId);
 
-	abstract Object getCellContent(List<Object> cellContents, String colName);
+    abstract Object getCellContent(List<Object> cellContents, String colName);
 
-	abstract String getProductCategoryId(List<Object> cellContents, String ownerPartyId);
+    abstract String getProductCategoryId(List<Object> cellContents, String ownerPartyId);
 
-	abstract boolean isFacilityOk(XSSFRow row, String facilityName, String facilityId);
+    abstract boolean isFacilityOk(XSSFRow row, String facilityName, String facilityId);
 
-	abstract List<Object> getCellContents(XSSFRow row, List<Object[]> colNames, int size);
+    abstract List<Object> getCellContents(XSSFRow row, List<Object[]> colNames, int size);
 
-	abstract boolean isTableHeaderMatched(XSSFSheet sheet);
+    abstract boolean isTableHeaderMatched(XSSFSheet sheet);
 
-	abstract boolean isVersionSupported(XSSFSheet sheet);
+    abstract boolean isVersionSupported(XSSFSheet sheet);
 
-	abstract boolean containsDataRows(XSSFSheet sheet);
+    abstract boolean containsDataRows(XSSFSheet sheet);
 
-	public boolean isNumOfSheetsOK(XSSFWorkbook workbook);
+    public boolean isNumOfSheetsOK(XSSFWorkbook workbook);
 
-	abstract void setFacilityId(String selectedFacilityId);
+    abstract void setFacilityId(String selectedFacilityId);
 
-	public void endExcelImportHistory(String logFileName, String thruReasonId);
-	
-	public boolean hasErrorMessages();
+    public void endExcelImportHistory(String logFileName, String thruReasonId);
+    
+    public boolean hasErrorMessages();
 }
diff --git a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatEvents.java b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatEvents.java
index c4e1487..f1ad508 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatEvents.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatEvents.java
@@ -46,148 +46,148 @@
 import org.apache.ofbiz.pricat.PricatParseExcelHtmlThread;

 

 public class PricatEvents {

-	

-	public static final String module = PricatEvents.class.getName();

-	

-	public static final String PricatLatestVersion = UtilProperties.getPropertyValue("pricat", "pricat.latest.version", "V1.1");

-	

-	public static final String PricatFileName = "PricatTemplate_" + PricatLatestVersion + ".xlsx";

-	

-	public static final String PricatPath = "component://pricat/webapp/pricat/downloads/";

-	

+    

+    public static final String module = PricatEvents.class.getName();

+    

+    public static final String PricatLatestVersion = UtilProperties.getPropertyValue("pricat", "pricat.latest.version", "V1.1");

+    

+    public static final String PricatFileName = "PricatTemplate_" + PricatLatestVersion + ".xlsx";

+    

+    public static final String PricatPath = "component://pricat/webapp/pricat/downloads/";

+    

     /**

-	 * Download excel template.

-	 * 

-	 * @param request

-	 * @param response

-	 * @return

-	 * @throws IOException

-	 * @throws JDOMException

-	 */

-	public static String downloadExcelTemplate(HttpServletRequest request, HttpServletResponse response) {

-		String templateType = request.getParameter("templateType");

-		if (UtilValidate.isEmpty(templateType)) {

-			return "error";

-		}

-		try {

-			String path = ComponentLocationResolver.getBaseLocation(PricatPath).toString();

-			String fileName = null;

-			if ("pricatExcelTemplate".equals(templateType)) {

-				fileName = PricatFileName;

-			}

-			if (UtilValidate.isEmpty(fileName)) {

-				return "error";

-			}

-	        Path file = Paths.get(path + fileName);

-	        byte[] bytes = Files.readAllBytes(file);

-	        UtilHttp.streamContentToBrowser(response, bytes, "application/octet-stream", URLEncoder.encode(fileName, "UTF-8"));

-		} catch (MalformedURLException e) {

-			Debug.logError(e.getMessage(), module);

-			return "error";

-		} catch (IOException e) {

-			Debug.logError(e.getMessage(), module);

-			return "error";

-		}

+     * Download excel template.

+     * 

+     * @param request

+     * @param response

+     * @return

+     * @throws IOException

+     * @throws JDOMException

+     */

+    public static String downloadExcelTemplate(HttpServletRequest request, HttpServletResponse response) {

+        String templateType = request.getParameter("templateType");

+        if (UtilValidate.isEmpty(templateType)) {

+            return "error";

+        }

+        try {

+            String path = ComponentLocationResolver.getBaseLocation(PricatPath).toString();

+            String fileName = null;

+            if ("pricatExcelTemplate".equals(templateType)) {

+                fileName = PricatFileName;

+            }

+            if (UtilValidate.isEmpty(fileName)) {

+                return "error";

+            }

+            Path file = Paths.get(path + fileName);

+            byte[] bytes = Files.readAllBytes(file);

+            UtilHttp.streamContentToBrowser(response, bytes, "application/octet-stream", URLEncoder.encode(fileName, "UTF-8"));

+        } catch (MalformedURLException e) {

+            Debug.logError(e.getMessage(), module);

+            return "error";

+        } catch (IOException e) {

+            Debug.logError(e.getMessage(), module);

+            return "error";

+        }

         return "success";

     }

-	

-	/**

-	 * Upload a pricat.

-	 */

-	public static String pricatUpload(HttpServletRequest request, HttpServletResponse response) {

-		boolean isMultiPart = ServletFileUpload.isMultipartContent(request);

-		if (isMultiPart) {

-			return "parse_pricat";

-		} else {

-			String action = request.getParameter("action");

-			if (UtilValidate.isNotEmpty(action) && "downloadPricat".equals(action)) {

-				String sequenceNumString = (String) request.getParameter("sequenceNum");

-				long sequenceNum = -1;

-				if (UtilValidate.isNotEmpty(sequenceNumString)) {

-					try {

-						sequenceNum = Long.valueOf(sequenceNumString);

-					} catch (NumberFormatException e) {

-						// do nothing

-					}

-				}

-				String originalPricatFileName = (String) request.getSession().getAttribute(PricatParseExcelHtmlThread.PRICAT_FILE);

-				String pricatFileName = originalPricatFileName;

-				if (sequenceNum > 0 && AbstractPricatParser.isCommentedExcelExists(request, sequenceNum)) {

-				    GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin");

-				    String userLoginId = userLogin.getString("userLoginId");

-					pricatFileName = InterfacePricatParser.tempFilesFolder + userLoginId + "/" + sequenceNum + ".xlsx";

-				}

-				if (UtilValidate.isNotEmpty(pricatFileName) && UtilValidate.isNotEmpty(originalPricatFileName)) {

-					try {

-				        Path path = Paths.get(pricatFileName);

-				        byte[] bytes = Files.readAllBytes(path);

-				        path = Paths.get(originalPricatFileName);

-				        UtilHttp.streamContentToBrowser(response, bytes, "application/octet-stream", URLEncoder.encode(path.getName(path.getNameCount() - 1).toString(), "UTF-8"));

-					} catch (MalformedURLException e) {

-						Debug.logError(e.getMessage(), module);

-						return "error";

-					} catch (IOException e) {

-						Debug.logError(e.getMessage(), module);

-						return "error";

-					}

-					request.getSession().removeAttribute(PricatParseExcelHtmlThread.PRICAT_FILE);

-					return "download";

-				}

-		    }

-		}

+    

+    /**

+     * Upload a pricat.

+     */

+    public static String pricatUpload(HttpServletRequest request, HttpServletResponse response) {

+        boolean isMultiPart = ServletFileUpload.isMultipartContent(request);

+        if (isMultiPart) {

+            return "parse_pricat";

+        } else {

+            String action = request.getParameter("action");

+            if (UtilValidate.isNotEmpty(action) && "downloadPricat".equals(action)) {

+                String sequenceNumString = (String) request.getParameter("sequenceNum");

+                long sequenceNum = -1;

+                if (UtilValidate.isNotEmpty(sequenceNumString)) {

+                    try {

+                        sequenceNum = Long.valueOf(sequenceNumString);

+                    } catch (NumberFormatException e) {

+                        // do nothing

+                    }

+                }

+                String originalPricatFileName = (String) request.getSession().getAttribute(PricatParseExcelHtmlThread.PRICAT_FILE);

+                String pricatFileName = originalPricatFileName;

+                if (sequenceNum > 0 && AbstractPricatParser.isCommentedExcelExists(request, sequenceNum)) {

+                    GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin");

+                    String userLoginId = userLogin.getString("userLoginId");

+                    pricatFileName = InterfacePricatParser.tempFilesFolder + userLoginId + "/" + sequenceNum + ".xlsx";

+                }

+                if (UtilValidate.isNotEmpty(pricatFileName) && UtilValidate.isNotEmpty(originalPricatFileName)) {

+                    try {

+                        Path path = Paths.get(pricatFileName);

+                        byte[] bytes = Files.readAllBytes(path);

+                        path = Paths.get(originalPricatFileName);

+                        UtilHttp.streamContentToBrowser(response, bytes, "application/octet-stream", URLEncoder.encode(path.getName(path.getNameCount() - 1).toString(), "UTF-8"));

+                    } catch (MalformedURLException e) {

+                        Debug.logError(e.getMessage(), module);

+                        return "error";

+                    } catch (IOException e) {

+                        Debug.logError(e.getMessage(), module);

+                        return "error";

+                    }

+                    request.getSession().removeAttribute(PricatParseExcelHtmlThread.PRICAT_FILE);

+                    return "download";

+                }

+            }

+        }

         return "success";

     }

 

     /**

-	 * Download commented excel file after it's parsed.

-	 * 

-	 * @param request

-	 * @param response

-	 * @return

-	 * @throws IOException

-	 * @throws JDOMException

-	 */

-	public static String downloadCommentedExcel(HttpServletRequest request, HttpServletResponse response) {

-		String sequenceNum = request.getParameter("sequenceNum");

-	    GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin");

-		if (UtilValidate.isEmpty(sequenceNum) || UtilValidate.isEmpty(userLogin)) {

-			Debug.logError("sequenceNum[" + sequenceNum + "] or userLogin is empty", module);

-			return "error";

-		}

-	    String userLoginId = userLogin.getString("userLoginId");

-		Delegator delegator = (Delegator) request.getAttribute("delegator");

-		GenericValue historyValue = null;

-		try {

-			historyValue = delegator.findOne("ExcelImportHistory", UtilMisc.toMap("userLoginId", userLoginId, "sequenceNum", Long.valueOf(sequenceNum)), false);

-		} catch (NumberFormatException e) {

-			Debug.logError(e.getMessage(), module);

-			return "error";

-		} catch (GenericEntityException e) {

-			Debug.logError(e.getMessage(), module);

-			return "error";

-		}

-		if (UtilValidate.isEmpty(historyValue)) {

-			Debug.logError("No ExcelImportHistory value found by sequenceNum[" + sequenceNum + "] and userLoginId[" + userLoginId + "].", module);

-			return "error";

-		}

-		String fileName = historyValue.getString("fileName");

-		if (UtilValidate.isEmpty(fileName)) {

-			fileName = sequenceNum + ".xlsx";

-		}

-		try {

-			File file = FileUtil.getFile(InterfacePricatParser.tempFilesFolder + userLoginId + "/" + sequenceNum + ".xlsx");

-			if (file.exists()) {

-		        Path path = Paths.get(file.getPath());

-		        byte[] bytes = Files.readAllBytes(path);

-		        UtilHttp.streamContentToBrowser(response, bytes, "application/octet-stream", URLEncoder.encode(fileName, "UTF-8"));

-			}

-		} catch (MalformedURLException e) {

-			Debug.logError(e.getMessage(), module);

-			return "error";

-		} catch (IOException e) {

-			Debug.logError(e.getMessage(), module);

-			return "error";

-		}

+     * Download commented excel file after it's parsed.

+     * 

+     * @param request

+     * @param response

+     * @return

+     * @throws IOException

+     * @throws JDOMException

+     */

+    public static String downloadCommentedExcel(HttpServletRequest request, HttpServletResponse response) {

+        String sequenceNum = request.getParameter("sequenceNum");

+        GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin");

+        if (UtilValidate.isEmpty(sequenceNum) || UtilValidate.isEmpty(userLogin)) {

+            Debug.logError("sequenceNum[" + sequenceNum + "] or userLogin is empty", module);

+            return "error";

+        }

+        String userLoginId = userLogin.getString("userLoginId");

+        Delegator delegator = (Delegator) request.getAttribute("delegator");

+        GenericValue historyValue = null;

+        try {

+            historyValue = delegator.findOne("ExcelImportHistory", UtilMisc.toMap("userLoginId", userLoginId, "sequenceNum", Long.valueOf(sequenceNum)), false);

+        } catch (NumberFormatException e) {

+            Debug.logError(e.getMessage(), module);

+            return "error";

+        } catch (GenericEntityException e) {

+            Debug.logError(e.getMessage(), module);

+            return "error";

+        }

+        if (UtilValidate.isEmpty(historyValue)) {

+            Debug.logError("No ExcelImportHistory value found by sequenceNum[" + sequenceNum + "] and userLoginId[" + userLoginId + "].", module);

+            return "error";

+        }

+        String fileName = historyValue.getString("fileName");

+        if (UtilValidate.isEmpty(fileName)) {

+            fileName = sequenceNum + ".xlsx";

+        }

+        try {

+            File file = FileUtil.getFile(InterfacePricatParser.tempFilesFolder + userLoginId + "/" + sequenceNum + ".xlsx");

+            if (file.exists()) {

+                Path path = Paths.get(file.getPath());

+                byte[] bytes = Files.readAllBytes(path);

+                UtilHttp.streamContentToBrowser(response, bytes, "application/octet-stream", URLEncoder.encode(fileName, "UTF-8"));

+            }

+        } catch (MalformedURLException e) {

+            Debug.logError(e.getMessage(), module);

+            return "error";

+        } catch (IOException e) {

+            Debug.logError(e.getMessage(), module);

+            return "error";

+        }

         return "success";

     }

 }

diff --git a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlReport.java b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlReport.java
index 59e5882..0d69c52 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlReport.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlReport.java
@@ -31,9 +31,9 @@
  * 
  */
 public class PricatParseExcelHtmlReport extends AbstractHtmlReport {
-	
-	public static final String PRICAT_REPORT_CLASS = "PRICAT_HTML_REPORT";
-	
+    
+    public static final String PRICAT_REPORT_CLASS = "PRICAT_HTML_REPORT";
+    
     /**
      * Public constructor with report variables.<p>
      * 
@@ -46,31 +46,31 @@
     }
     
     public static PricatParseExcelHtmlReport getReport(HttpServletRequest request, HttpServletResponse response) {
-    	
-    	PricatParseExcelHtmlReport wp = (PricatParseExcelHtmlReport) request.getAttribute(PRICAT_REPORT_CLASS);
-    	if (wp == null) {
-    		wp = new PricatParseExcelHtmlReport(request, response);
-    		request.setAttribute(PRICAT_REPORT_CLASS, wp);
-    	}
-    	return wp;
+        
+        PricatParseExcelHtmlReport wp = (PricatParseExcelHtmlReport) request.getAttribute(PRICAT_REPORT_CLASS);
+        if (wp == null) {
+            wp = new PricatParseExcelHtmlReport(request, response);
+            request.setAttribute(PRICAT_REPORT_CLASS, wp);
+        }
+        return wp;
     }
     
     public InterfaceReportThread initializeThread(HttpServletRequest request, HttpServletResponse response, String name) {
 
-		if (name == null) {
-			name = "";
-		}
+        if (name == null) {
+            name = "";
+        }
         ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();
         int i = threadGroup.activeCount();
         Thread[] threads = new Thread[i];
         threadGroup.enumerate(threads, true);
         InterfaceReportThread thread = null;
         for (int j=0; j<threads.length; j++) {
-        	Thread threadInstance = threads[j];
-        	if (threadInstance instanceof PricatParseExcelHtmlThread) {
-        		thread = (PricatParseExcelHtmlThread) threadInstance;
-        		break;
-        	}
+            Thread threadInstance = threads[j];
+            if (threadInstance instanceof PricatParseExcelHtmlThread) {
+                thread = (PricatParseExcelHtmlThread) threadInstance;
+                break;
+            }
         }
         if (thread == null) {
             thread = new PricatParseExcelHtmlThread(request, response, name);
@@ -80,36 +80,36 @@
     }
 
     public static String checkButton(HttpServletRequest request, HttpServletResponse response) {
-    	String action = request.getParameter("action");
-    	if (ReportStringUtil.isNotEmpty(action)) {
-    		if (action.equalsIgnoreCase("ok")) {
-    			request.removeAttribute(PRICAT_REPORT_CLASS);
-    			request.removeAttribute(DIALOG_URI);
-    			return "ok";
-    		} else if (action.equalsIgnoreCase("cancel")) {
-    			request.removeAttribute(PRICAT_REPORT_CLASS);
-    			request.removeAttribute(DIALOG_URI);
-    			return "cancel";
-    		}
-    	}
-    	action = request.getParameter("ok");
-    	if (ReportStringUtil.isNotEmpty(action)) {
-    		if (action.equalsIgnoreCase("ok")) {
-    			request.removeAttribute(PRICAT_REPORT_CLASS);
-    			request.removeAttribute(DIALOG_URI);
-    			return "ok";
-    		}
-    	}
+        String action = request.getParameter("action");
+        if (ReportStringUtil.isNotEmpty(action)) {
+            if (action.equalsIgnoreCase("ok")) {
+                request.removeAttribute(PRICAT_REPORT_CLASS);
+                request.removeAttribute(DIALOG_URI);
+                return "ok";
+            } else if (action.equalsIgnoreCase("cancel")) {
+                request.removeAttribute(PRICAT_REPORT_CLASS);
+                request.removeAttribute(DIALOG_URI);
+                return "cancel";
+            }
+        }
+        action = request.getParameter("ok");
+        if (ReportStringUtil.isNotEmpty(action)) {
+            if (action.equalsIgnoreCase("ok")) {
+                request.removeAttribute(PRICAT_REPORT_CLASS);
+                request.removeAttribute(DIALOG_URI);
+                return "ok";
+            }
+        }
         action = request.getParameter("cancel");
         if (ReportStringUtil.isNotEmpty(action)) {
-        	if (action.equalsIgnoreCase("cancel")) {
-    			request.removeAttribute(PRICAT_REPORT_CLASS);
-    			request.removeAttribute(DIALOG_URI);
-        		return "cancel";
-        	}
+            if (action.equalsIgnoreCase("cancel")) {
+                request.removeAttribute(PRICAT_REPORT_CLASS);
+                request.removeAttribute(DIALOG_URI);
+                return "cancel";
+            }
         }
         
-    	return "success";
+        return "success";
     }
 
     /**
@@ -119,10 +119,10 @@
      */
     public void prepareDisplayReport(HttpServletRequest request, HttpServletResponse response, String name, String dialogUri) throws IOException {
 
-    	if (ReportStringUtil.isNotEmpty(dialogUri)) {
-    		setDialogRealUri(request, dialogUri);
-    	}
-    	
+        if (ReportStringUtil.isNotEmpty(dialogUri)) {
+            setDialogRealUri(request, dialogUri);
+        }
+        
         String action = getParamAction(request);
         if (action == null) action = "";
         if (action.equals("reportend") || action.equals("cancel")) {
diff --git a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java
index 99147e1..8e40ef6 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java
@@ -64,17 +64,17 @@
  * 
  */
 public class PricatParseExcelHtmlThread extends AbstractReportThread {
-	
-	public static final String module = PricatParseExcelHtmlThread.class.getName();
+    
+    public static final String module = PricatParseExcelHtmlThread.class.getName();
 
-	public static final String PARSE_EXCEL = "parse_excel";
-	
-	public static final String CONFIRM = "confirm_action";
-	
-	public static final String[] messageLabels = new String[] {"FORMAT_DEFAULT", "FORMAT_WARNING", "FORMAT_HEADLINE", "FORMAT_NOTE", "FORMAT_OK", "FORMAT_ERROR", "FORMAT_THROWABLE"};
-	
-	public static final List<String> messages = Collections.unmodifiableList(Arrays.asList(messageLabels));
-	
+    public static final String PARSE_EXCEL = "parse_excel";
+    
+    public static final String CONFIRM = "confirm_action";
+    
+    public static final String[] messageLabels = new String[] {"FORMAT_DEFAULT", "FORMAT_WARNING", "FORMAT_HEADLINE", "FORMAT_NOTE", "FORMAT_OK", "FORMAT_ERROR", "FORMAT_THROWABLE"};
+    
+    public static final List<String> messages = Collections.unmodifiableList(Arrays.asList(messageLabels));
+    
     public static final String FileDateTimePattern = "yyyyMMddHHmmss";
     
     public static final String defaultColorName = "DefaultColor";
@@ -87,20 +87,20 @@
     
     public static final String FACILITY_ID = "facilityId";
     
-	private LocalDispatcher dispatcher;
-	
-	private Delegator delegator;
-	
-	private List<FileItem> fileItems;
-	
-	private File pricatFile;
-	
-	private String userLoginId;
-	
-	private GenericValue userLogin;
-	
-	private Map<String, String[]> facilities = new HashMap<String, String[]>();
-	
+    private LocalDispatcher dispatcher;
+    
+    private Delegator delegator;
+    
+    private List<FileItem> fileItems;
+    
+    private File pricatFile;
+    
+    private String userLoginId;
+    
+    private GenericValue userLogin;
+    
+    private Map<String, String[]> facilities = new HashMap<String, String[]>();
+    
     public static final String resource = "PricatUiLabels";
     
     private HttpSession session;
@@ -114,56 +114,56 @@
     private String selectedFacilityId;
     
     public static final Map<String, String> PricatTypeLabels = UtilMisc.toMap("sample_pricat", "SamplePricatTemplate",
-    		                                                                  "ofbiz_pricat", "OFBizPricatTemplate");
+                                                                              "ofbiz_pricat", "OFBizPricatTemplate");
     
     private InterfacePricatParser pricatParser;
     
     private String thruReasonId = "EXCEL_IMPORT_SUCCESS";
     
-	/**
+    /**
      * Constructor, creates a new html thread.
-	 * 
-	 * @param request
-	 * @param response
-	 * @param name
-	 */
+     * 
+     * @param request
+     * @param response
+     * @param name
+     */
     public PricatParseExcelHtmlThread(HttpServletRequest request, HttpServletResponse response, String name) {
 
         super(request, response, name);
-		dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
-		setDelegator(dispatcher.getDelegator());
-		userLogin = (GenericValue) request.getSession().getAttribute("userLogin");
-		if (UtilValidate.isEmpty(userLogin)) {
-	        initHtmlReport(request, response, true, true);
-			getReport().println(UtilProperties.getMessage(resource, "PricatRequireUserLogin", getLocale()), InterfaceReport.FORMAT_ERROR);
-			return;
-		} else {
-			userLoginId = userLogin.getString("userLoginId");
-			session = request.getSession();
-		}
-		
-		long sequenceNum = addExcelImportHistory();
-    	File userFolder = FileUtil.getFile(InterfacePricatParser.tempFilesFolder + userLoginId + "/");
-    	if (!userFolder.exists()) {
-    		userFolder.mkdirs();
-    	}
-		String logFileName = InterfacePricatParser.tempFilesFolder + userLoginId + "/" + sequenceNum + ".log";
+        dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
+        setDelegator(dispatcher.getDelegator());
+        userLogin = (GenericValue) request.getSession().getAttribute("userLogin");
+        if (UtilValidate.isEmpty(userLogin)) {
+            initHtmlReport(request, response, true, true);
+            getReport().println(UtilProperties.getMessage(resource, "PricatRequireUserLogin", getLocale()), InterfaceReport.FORMAT_ERROR);
+            return;
+        } else {
+            userLoginId = userLogin.getString("userLoginId");
+            session = request.getSession();
+        }
+        
+        long sequenceNum = addExcelImportHistory();
+        File userFolder = FileUtil.getFile(InterfacePricatParser.tempFilesFolder + userLoginId + "/");
+        if (!userFolder.exists()) {
+            userFolder.mkdirs();
+        }
+        String logFileName = InterfacePricatParser.tempFilesFolder + userLoginId + "/" + sequenceNum + ".log";
         initHtmlReport(request, response, true, true, logFileName);
-		if (sequenceNum > 0) {
-			getReport().setSequenceNum(sequenceNum);
-			getReport().addLogFile(logFileName);
-		}
+        if (sequenceNum > 0) {
+            getReport().setSequenceNum(sequenceNum);
+            getReport().addLogFile(logFileName);
+        }
         try {
-        	getReport().print(UtilProperties.getMessage(resource, "StartStoreExcel", getLocale()), InterfaceReport.FORMAT_HEADLINE);
+            getReport().print(UtilProperties.getMessage(resource, "StartStoreExcel", getLocale()), InterfaceReport.FORMAT_HEADLINE);
             ServletFileUpload dfu = new ServletFileUpload(new DiskFileItemFactory(10240, userFolder));
-        	fileItems = UtilGenerics.checkList(dfu.parseRequest(request));
+            fileItems = UtilGenerics.checkList(dfu.parseRequest(request));
         } catch (FileUploadException e) {
             getReport().addError(e);
         }
         if (UtilValidate.isEmpty(fileItems)) {
-        	getReport().println(UtilProperties.getMessage(resource, "NoFileUploaded", getLocale()), InterfaceReport.FORMAT_ERROR);
+            getReport().println(UtilProperties.getMessage(resource, "NoFileUploaded", getLocale()), InterfaceReport.FORMAT_ERROR);
         } else {
-        	getReport().println(UtilProperties.getMessage(resource, "ok", getLocale()), InterfaceReport.FORMAT_OK);
+            getReport().println(UtilProperties.getMessage(resource, "ok", getLocale()), InterfaceReport.FORMAT_OK);
         }
     }
 
@@ -179,85 +179,85 @@
 
         try {
             if (getName().startsWith(PARSE_EXCEL) && UtilValidate.isNotEmpty(fileItems)) {
-    			getReport().println();
-            	getReport().println(UtilProperties.getMessage(resource, "StartParsePricat", getLocale()), InterfaceReport.FORMAT_HEADLINE);
-            	if (prepareParse()) {
-                	if (selectedPricatType.equals(DEFAULT_PRICAT_TYPE)) {
-                		pricatParser = new SamplePricatParser(dispatcher, delegator, getLocale(), getReport(), facilities, pricatFile, userLogin);
-                	}
-                	if (UtilValidate.isEmpty(pricatParser)) {
-                		getReport().println(UtilProperties.getMessage(resource, "NoPricatParserFor", getLocale()), InterfaceReport.FORMAT_ERROR);
-                	} else {
-                    	pricatParser.parsePricatExcel();
-                    	getReport().println(UtilProperties.getMessage(resource, "PricatParseCompleted", getLocale()), InterfaceReport.FORMAT_HEADLINE);
-                	}
-            	}
-        	} else {
-            	getReport().println(getName(), InterfaceReport.FORMAT_ERROR);
-            	Debug.logError(getName(), module);
-            	thruReasonId = "EXCEL_IMPORT_ERROR";
+                getReport().println();
+                getReport().println(UtilProperties.getMessage(resource, "StartParsePricat", getLocale()), InterfaceReport.FORMAT_HEADLINE);
+                if (prepareParse()) {
+                    if (selectedPricatType.equals(DEFAULT_PRICAT_TYPE)) {
+                        pricatParser = new SamplePricatParser(dispatcher, delegator, getLocale(), getReport(), facilities, pricatFile, userLogin);
+                    }
+                    if (UtilValidate.isEmpty(pricatParser)) {
+                        getReport().println(UtilProperties.getMessage(resource, "NoPricatParserFor", getLocale()), InterfaceReport.FORMAT_ERROR);
+                    } else {
+                        pricatParser.parsePricatExcel();
+                        getReport().println(UtilProperties.getMessage(resource, "PricatParseCompleted", getLocale()), InterfaceReport.FORMAT_HEADLINE);
+                    }
+                }
+            } else {
+                getReport().println(getName(), InterfaceReport.FORMAT_ERROR);
+                Debug.logError(getName(), module);
+                thruReasonId = "EXCEL_IMPORT_ERROR";
             }
         } catch (Exception e) {
-        	getReport().println(e);
-        	Debug.logError(e, module);
-        	thruReasonId = "EXCEL_IMPORT_ERROR";
+            getReport().println(e);
+            Debug.logError(e, module);
+            thruReasonId = "EXCEL_IMPORT_ERROR";
         } finally {
-        	// wait 5 seconds to wait page output
-        	try {
-				sleep(5000);
-			} catch (InterruptedException e) {
-			}
-        	// call report update to make sure all messages are output to file
-        	getReport().getReportUpdate();
-        	String logFileName = getReport().closeLogFile();
-        	if (UtilValidate.isNotEmpty(pricatParser)) {
-        		if (thruReasonId.equals("EXCEL_IMPORT_SUCCESS") && pricatParser.hasErrorMessages()) {
-        			thruReasonId = "EXCEL_IMPORT_QUEST";
-        		}
-            	pricatParser.endExcelImportHistory(logFileName, thruReasonId);
-        	}
+            // wait 5 seconds to wait page output
+            try {
+                sleep(5000);
+            } catch (InterruptedException e) {
+            }
+            // call report update to make sure all messages are output to file
+            getReport().getReportUpdate();
+            String logFileName = getReport().closeLogFile();
+            if (UtilValidate.isNotEmpty(pricatParser)) {
+                if (thruReasonId.equals("EXCEL_IMPORT_SUCCESS") && pricatParser.hasErrorMessages()) {
+                    thruReasonId = "EXCEL_IMPORT_QUEST";
+                }
+                pricatParser.endExcelImportHistory(logFileName, thruReasonId);
+            }
         }
     }
 
     private boolean prepareParse() throws IOException {
-		// 1 get facilities belong to current userLogin
-		facilities = getCurrentUserLoginFacilities();
-		if (UtilValidate.isEmpty(facilities)) {
-			getReport().println(UtilProperties.getMessage(resource, "CurrentUserLoginNoFacility", new Object[]{userLoginId}, getLocale()), InterfaceReport.FORMAT_ERROR);
-			return false;
-		} else {
-			getReport().println(" ... " + UtilProperties.getMessage(resource, "ok", getLocale()), InterfaceReport.FORMAT_OK);
-			getReport().println();
-		}
-		
-		// 2. store the pricat excel file
-		if (!storePricatFile()) {
-			return false;
-		}
-		return true;
-	}
+        // 1 get facilities belong to current userLogin
+        facilities = getCurrentUserLoginFacilities();
+        if (UtilValidate.isEmpty(facilities)) {
+            getReport().println(UtilProperties.getMessage(resource, "CurrentUserLoginNoFacility", new Object[]{userLoginId}, getLocale()), InterfaceReport.FORMAT_ERROR);
+            return false;
+        } else {
+            getReport().println(" ... " + UtilProperties.getMessage(resource, "ok", getLocale()), InterfaceReport.FORMAT_OK);
+            getReport().println();
+        }
+        
+        // 2. store the pricat excel file
+        if (!storePricatFile()) {
+            return false;
+        }
+        return true;
+    }
 
-	private boolean storePricatFile() throws IOException {
+    private boolean storePricatFile() throws IOException {
         FileItem fi = null;
         FileItem pricatFi = null;
         byte[] pricatBytes = {};
         // check excelTemplateType
         for (int i = 0; i < fileItems.size(); i++) {
-        	fi = fileItems.get(i);
-        	String fieldName = fi.getFieldName();
-        	if (fi.isFormField() && UtilValidate.isNotEmpty(fieldName)) {
-        		if (fieldName.equals(EXCEL_TEMPLATE_TYPE)) {
-        			selectedPricatType = fi.getString();
-        		}
-        	}
+            fi = fileItems.get(i);
+            String fieldName = fi.getFieldName();
+            if (fi.isFormField() && UtilValidate.isNotEmpty(fieldName)) {
+                if (fieldName.equals(EXCEL_TEMPLATE_TYPE)) {
+                    selectedPricatType = fi.getString();
+                }
+            }
         }
         getReport().print(UtilProperties.getMessage(resource, "ExcelTemplateTypeSelected", getLocale()), InterfaceReport.FORMAT_DEFAULT);
         if (PricatTypeLabels.containsKey(selectedPricatType)) {
             getReport().print(UtilProperties.getMessage(resource, PricatTypeLabels.get(selectedPricatType), getLocale()), InterfaceReport.FORMAT_DEFAULT);
-			getReport().println(" ... " + UtilProperties.getMessage(resource, "ok", getLocale()), InterfaceReport.FORMAT_OK);
+            getReport().println(" ... " + UtilProperties.getMessage(resource, "ok", getLocale()), InterfaceReport.FORMAT_OK);
         } else {
             getReport().println(UtilProperties.getMessage(resource, PricatTypeLabels.get(selectedPricatType), getLocale()), InterfaceReport.FORMAT_ERROR);
-        	return false;
+            return false;
         }
 
         // store the file
@@ -277,83 +277,83 @@
             }
         }
         return true;
-	}
+    }
 
-	private Map<String, String[]> getCurrentUserLoginFacilities() {
-		getReport().println();
-		getReport().println(UtilProperties.getMessage(resource, "GetCurrentUserLoginFacility", getLocale()), InterfaceReport.FORMAT_DEFAULT);
-		Map<String, Object> context = new HashMap<String, Object>();
-		context.put("userLogin", userLogin);
-		context.put("locale", getLocale());
-		try {
-			List<EntityCondition> orgConditions = new LinkedList<EntityCondition>();
-			orgConditions.add(EntityCondition.makeCondition("onePartyIdFrom", EntityOperator.EQUALS, userLogin.getString("partyId")));
-			orgConditions.add(EntityCondition.makeCondition("twoRoleTypeIdFrom", EntityOperator.EQUALS, "INTERNAL_ORGANIZATIO"));
-			orgConditions.add(EntityCondition.makeCondition("twoRoleTypeIdTo", EntityOperator.EQUALS, "EMPLOYEE"));
-			orgConditions.add(EntityCondition.makeCondition("twoRoleTypeIdTo", EntityOperator.EQUALS, "EMPLOYEE"));
-			List<GenericValue> organizations = delegator.findList("PartyRelationshipToFrom", EntityCondition.makeCondition(orgConditions), null, null, null, false);
-			Timestamp now = UtilDateTime.nowTimestamp();
-			organizations = EntityUtil.filterByDate(organizations, now, "twoFromDate", "twoThruDate", true);
-			organizations = EntityUtil.filterByDate(organizations, now, "oneFromDate", "oneThruDate", true);
-			
-			List<EntityCondition> ownerPartyConditions = new LinkedList<EntityCondition>();
-			Set<String> orgPartyIds = new HashSet<String>();
-			for (GenericValue organization : organizations) {
-				String orgPartyId = organization.getString("onePartyIdTo");
-				if (!orgPartyIds.contains(orgPartyId)) {
-					ownerPartyConditions.add(EntityCondition.makeCondition("ownerPartyId", EntityOperator.EQUALS, orgPartyId));
-					orgPartyIds.add(orgPartyId);
-				}
-			}
-			if (UtilValidate.isEmpty(ownerPartyConditions)) {
-				return facilities;
-			}
-			
-			List<GenericValue> facilityValues = delegator.findList("Facility", EntityCondition.makeCondition(ownerPartyConditions, EntityOperator.OR), null, null, null, false);
-			if (UtilValidate.isNotEmpty(facilityValues)) {
-				int i = 1;
-				for (GenericValue facilityValue : facilityValues) {
-					if (UtilValidate.isNotEmpty(facilityValue)) {
-						String facilityId = facilityValue.getString("facilityId");
-						if (!facilities.containsKey(facilityId)) {
-							String facilityName = facilityValue.getString("facilityName");
-							facilities.put(facilityId, new String[] {facilityName, facilityValue.getString("ownerPartyId")});
-							getReport().println(UtilProperties.getMessage(resource, "FacilityFoundForCurrentUserLogin", new Object[]{String.valueOf(i), facilityName, facilityId}, getLocale()), InterfaceReport.FORMAT_NOTE);
-							i++;
-						}
-					}
-				}
-			}
-		}catch (GenericEntityException e) {
-			Debug.logError(e.getMessage(), module);
-		}
-		return facilities;
-	}
+    private Map<String, String[]> getCurrentUserLoginFacilities() {
+        getReport().println();
+        getReport().println(UtilProperties.getMessage(resource, "GetCurrentUserLoginFacility", getLocale()), InterfaceReport.FORMAT_DEFAULT);
+        Map<String, Object> context = new HashMap<String, Object>();
+        context.put("userLogin", userLogin);
+        context.put("locale", getLocale());
+        try {
+            List<EntityCondition> orgConditions = new LinkedList<EntityCondition>();
+            orgConditions.add(EntityCondition.makeCondition("onePartyIdFrom", EntityOperator.EQUALS, userLogin.getString("partyId")));
+            orgConditions.add(EntityCondition.makeCondition("twoRoleTypeIdFrom", EntityOperator.EQUALS, "INTERNAL_ORGANIZATIO"));
+            orgConditions.add(EntityCondition.makeCondition("twoRoleTypeIdTo", EntityOperator.EQUALS, "EMPLOYEE"));
+            orgConditions.add(EntityCondition.makeCondition("twoRoleTypeIdTo", EntityOperator.EQUALS, "EMPLOYEE"));
+            List<GenericValue> organizations = delegator.findList("PartyRelationshipToFrom", EntityCondition.makeCondition(orgConditions), null, null, null, false);
+            Timestamp now = UtilDateTime.nowTimestamp();
+            organizations = EntityUtil.filterByDate(organizations, now, "twoFromDate", "twoThruDate", true);
+            organizations = EntityUtil.filterByDate(organizations, now, "oneFromDate", "oneThruDate", true);
+            
+            List<EntityCondition> ownerPartyConditions = new LinkedList<EntityCondition>();
+            Set<String> orgPartyIds = new HashSet<String>();
+            for (GenericValue organization : organizations) {
+                String orgPartyId = organization.getString("onePartyIdTo");
+                if (!orgPartyIds.contains(orgPartyId)) {
+                    ownerPartyConditions.add(EntityCondition.makeCondition("ownerPartyId", EntityOperator.EQUALS, orgPartyId));
+                    orgPartyIds.add(orgPartyId);
+                }
+            }
+            if (UtilValidate.isEmpty(ownerPartyConditions)) {
+                return facilities;
+            }
+            
+            List<GenericValue> facilityValues = delegator.findList("Facility", EntityCondition.makeCondition(ownerPartyConditions, EntityOperator.OR), null, null, null, false);
+            if (UtilValidate.isNotEmpty(facilityValues)) {
+                int i = 1;
+                for (GenericValue facilityValue : facilityValues) {
+                    if (UtilValidate.isNotEmpty(facilityValue)) {
+                        String facilityId = facilityValue.getString("facilityId");
+                        if (!facilities.containsKey(facilityId)) {
+                            String facilityName = facilityValue.getString("facilityName");
+                            facilities.put(facilityId, new String[] {facilityName, facilityValue.getString("ownerPartyId")});
+                            getReport().println(UtilProperties.getMessage(resource, "FacilityFoundForCurrentUserLogin", new Object[]{String.valueOf(i), facilityName, facilityId}, getLocale()), InterfaceReport.FORMAT_NOTE);
+                            i++;
+                        }
+                    }
+                }
+            }
+        }catch (GenericEntityException e) {
+            Debug.logError(e.getMessage(), module);
+        }
+        return facilities;
+    }
 
-	public Delegator getDelegator() {
-		return delegator;
-	}
+    public Delegator getDelegator() {
+        return delegator;
+    }
 
-	public void setDelegator(Delegator delegator) {
-		this.delegator = delegator;
-	}
+    public void setDelegator(Delegator delegator) {
+        this.delegator = delegator;
+    }
 
-	public synchronized long addExcelImportHistory() {
-		long latestId = 1;
-		try {
-			List<GenericValue> historyValues = delegator.findByAnd("ExcelImportHistory", UtilMisc.toMap("userLoginId", userLoginId), UtilMisc.toList("sequenceNum DESC"), false);
-			GenericValue latestHistoryValue = EntityUtil.getFirst(historyValues);
-			if (UtilValidate.isNotEmpty(latestHistoryValue)) {
-				latestId = latestHistoryValue.getLong("sequenceNum") + 1;
-			}
-			GenericValue newHistoryValue = delegator.makeValue("ExcelImportHistory", UtilMisc.toMap("sequenceNum", latestId, "userLoginId", userLoginId,
-																"fileName", pricatFile == null ? "" : pricatFile.getName(), "statusId", isAlive() ? "EXCEL_IMPORTING" : "EXCEL_IMPORTED", 
-																"fromDate", UtilDateTime.nowTimestamp(), "threadName", getName(), "logFileName", InterfacePricatParser.tempFilesFolder + userLoginId + "/" + latestId + ".log"));
-			newHistoryValue.create();
-		} catch (GenericEntityException e) {
-			Debug.logError(e, module);
-			return -1;
-		}
-		return latestId;
-	}
+    public synchronized long addExcelImportHistory() {
+        long latestId = 1;
+        try {
+            List<GenericValue> historyValues = delegator.findByAnd("ExcelImportHistory", UtilMisc.toMap("userLoginId", userLoginId), UtilMisc.toList("sequenceNum DESC"), false);
+            GenericValue latestHistoryValue = EntityUtil.getFirst(historyValues);
+            if (UtilValidate.isNotEmpty(latestHistoryValue)) {
+                latestId = latestHistoryValue.getLong("sequenceNum") + 1;
+            }
+            GenericValue newHistoryValue = delegator.makeValue("ExcelImportHistory", UtilMisc.toMap("sequenceNum", latestId, "userLoginId", userLoginId,
+                                                                "fileName", pricatFile == null ? "" : pricatFile.getName(), "statusId", isAlive() ? "EXCEL_IMPORTING" : "EXCEL_IMPORTED", 
+                                                                "fromDate", UtilDateTime.nowTimestamp(), "threadName", getName(), "logFileName", InterfacePricatParser.tempFilesFolder + userLoginId + "/" + latestId + ".log"));
+            newHistoryValue.create();
+        } catch (GenericEntityException e) {
+            Debug.logError(e, module);
+            return -1;
+        }
+        return latestId;
+    }
 }
diff --git a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatEvents.java b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatEvents.java
index 45a0b45..fc7b43c 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatEvents.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatEvents.java
@@ -37,48 +37,48 @@
 import org.apache.ofbiz.pricat.PricatEvents;

 

 public class SamplePricatEvents extends PricatEvents {

-	

-	public static final String module = SamplePricatEvents.class.getName();

-	

-	public static final String PricatLatestVersion = UtilProperties.getPropertyValue("pricat", "pricat.latest.version", "V1.1");

-	

-	public static final String DemoPricatFileName = "SamplePricatTemplate_" + PricatLatestVersion + ".xlsx";

-	

-	public static final String DemoPricatPath = "component://pricat/webapp/pricatdemo/downloads/";

-	

+    

+    public static final String module = SamplePricatEvents.class.getName();

+    

+    public static final String PricatLatestVersion = UtilProperties.getPropertyValue("pricat", "pricat.latest.version", "V1.1");

+    

+    public static final String DemoPricatFileName = "SamplePricatTemplate_" + PricatLatestVersion + ".xlsx";

+    

+    public static final String DemoPricatPath = "component://pricat/webapp/pricatdemo/downloads/";

+    

     /**

-	 * Download excel template.

-	 * 

-	 * @param request

-	 * @param response

-	 * @return

-	 * @throws IOException

-	 * @throws JDOMException

-	 */

-	public static String downloadExcelTemplate(HttpServletRequest request, HttpServletResponse response) {

-		String templateType = request.getParameter("templateType");

-		if (UtilValidate.isEmpty(templateType)) {

-			return "error";

-		}

-		try {

-			String path = ComponentLocationResolver.getBaseLocation(DemoPricatPath).toString();

-			String fileName = null;

-			if ("pricatExcelTemplate".equals(templateType)) {

-				fileName = DemoPricatFileName;

-			}

-			if (UtilValidate.isEmpty(fileName)) {

-				return "error";

-			}

-	        Path file = Paths.get(path + fileName);

-	        byte[] bytes = Files.readAllBytes(file);

-	        UtilHttp.streamContentToBrowser(response, bytes, "application/octet-stream", URLEncoder.encode(fileName, "UTF-8"));

-		} catch (MalformedURLException e) {

-			Debug.logError(e.getMessage(), module);

-			return "error";

-		} catch (IOException e) {

-			Debug.logError(e.getMessage(), module);

-			return "error";

-		}

+     * Download excel template.

+     * 

+     * @param request

+     * @param response

+     * @return

+     * @throws IOException

+     * @throws JDOMException

+     */

+    public static String downloadExcelTemplate(HttpServletRequest request, HttpServletResponse response) {

+        String templateType = request.getParameter("templateType");

+        if (UtilValidate.isEmpty(templateType)) {

+            return "error";

+        }

+        try {

+            String path = ComponentLocationResolver.getBaseLocation(DemoPricatPath).toString();

+            String fileName = null;

+            if ("pricatExcelTemplate".equals(templateType)) {

+                fileName = DemoPricatFileName;

+            }

+            if (UtilValidate.isEmpty(fileName)) {

+                return "error";

+            }

+            Path file = Paths.get(path + fileName);

+            byte[] bytes = Files.readAllBytes(file);

+            UtilHttp.streamContentToBrowser(response, bytes, "application/octet-stream", URLEncoder.encode(fileName, "UTF-8"));

+        } catch (MalformedURLException e) {

+            Debug.logError(e.getMessage(), module);

+            return "error";

+        } catch (IOException e) {

+            Debug.logError(e.getMessage(), module);

+            return "error";

+        }

         return "success";

     }

 }

diff --git a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java
index 308b8f9..1a8a009 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java
@@ -54,8 +54,8 @@
  * 
  */
 public class SamplePricatParser extends AbstractPricatParser {
-	
-	public static final String module = SamplePricatParser.class.getName();
+    
+    public static final String module = SamplePricatParser.class.getName();
 
     public static final Map<String, List<Object[]>> ColNamesList = UtilMisc.toMap("V1.1", genExcelHeaderNames("V1.1"));
 
@@ -67,77 +67,77 @@
         super(dispatcher, delegator, locale, report, facilities, pricatFile, userLogin);
     }
 
-	/**
+    /**
      * Parse pricat excel file in xlsx format.
      * 
      */
-	public void parsePricatExcel(boolean writeFile) {
-		XSSFWorkbook workbook = null;
-		try {
-			// 1. read the pricat excel file
+    public void parsePricatExcel(boolean writeFile) {
+        XSSFWorkbook workbook = null;
+        try {
+            // 1. read the pricat excel file
             FileInputStream is = new FileInputStream(pricatFile);
-			
-			// 2. use POI to load this bytes
-        	report.print(UtilProperties.getMessage(resource, "ParsePricatFileStatement", new Object[] { pricatFile.getName() }, locale), InterfaceReport.FORMAT_DEFAULT);
-			try {
-			    workbook = new XSSFWorkbook(is);
-				report.println(UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
-			} catch(IOException e) {
-				report.println(e);
-				report.println(UtilProperties.getMessage(resource, "PricatSuggestion", locale), InterfaceReport.FORMAT_ERROR);
-				return;
-			} catch(POIXMLException e) {
-				report.println(e);
-				report.println(UtilProperties.getMessage(resource, "PricatSuggestion", locale), InterfaceReport.FORMAT_ERROR);
-				return;
-			}
-			
-			// 3. only first sheet will be parsed
-			// 3.1 verify the file has a sheet at least
-			formatter = new HSSFDataFormatter(locale);
-			isNumOfSheetsOK(workbook);
-			
-			// 3.2 verify the version is supported
-			XSSFSheet sheet = workbook.getSheetAt(0);
-			if (!isVersionSupported(sheet)) {
-				return;
-			}
-			
-			// 3.3 get currencyId
-			existsCurrencyId(sheet);
+            
+            // 2. use POI to load this bytes
+            report.print(UtilProperties.getMessage(resource, "ParsePricatFileStatement", new Object[] { pricatFile.getName() }, locale), InterfaceReport.FORMAT_DEFAULT);
+            try {
+                workbook = new XSSFWorkbook(is);
+                report.println(UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
+            } catch(IOException e) {
+                report.println(e);
+                report.println(UtilProperties.getMessage(resource, "PricatSuggestion", locale), InterfaceReport.FORMAT_ERROR);
+                return;
+            } catch(POIXMLException e) {
+                report.println(e);
+                report.println(UtilProperties.getMessage(resource, "PricatSuggestion", locale), InterfaceReport.FORMAT_ERROR);
+                return;
+            }
+            
+            // 3. only first sheet will be parsed
+            // 3.1 verify the file has a sheet at least
+            formatter = new HSSFDataFormatter(locale);
+            isNumOfSheetsOK(workbook);
+            
+            // 3.2 verify the version is supported
+            XSSFSheet sheet = workbook.getSheetAt(0);
+            if (!isVersionSupported(sheet)) {
+                return;
+            }
+            
+            // 3.3 get currencyId
+            existsCurrencyId(sheet);
 
-			// 3.4 verify the table header row is just the same as column names, if not, print error and return
-			if (!isTableHeaderMatched(sheet)) {
-				return;
-			}
-			
-			// 3.5 verify the first table has 6 rows at least
-			containsDataRows(sheet);
-			
-			if (UtilValidate.isNotEmpty(errorMessages)) {
-				report.println(UtilProperties.getMessage(resource, "HeaderContainsError", locale), InterfaceReport.FORMAT_ERROR);
-				return;
-			}
-			
-	        // 4. parse data
-			// 4.1 parse row by row and store the contents into database
-			parseRowByRow(sheet);
-			if (UtilValidate.isNotEmpty(errorMessages)) {
-				report.println(UtilProperties.getMessage(resource, "DataContainsError", locale), InterfaceReport.FORMAT_ERROR);
-				if (writeFile) {
-					sequenceNum = report.getSequenceNum();
-					writeCommentsToFile(workbook, sheet);
-				}
-			}
-			
-			// 5. clean up the log files and commented Excel files
-			cleanupLogAndCommentedExcel();
-		} catch (IOException e) {
-			report.println(e);
-			Debug.logError(e, module);
-		} finally {
+            // 3.4 verify the table header row is just the same as column names, if not, print error and return
+            if (!isTableHeaderMatched(sheet)) {
+                return;
+            }
+            
+            // 3.5 verify the first table has 6 rows at least
+            containsDataRows(sheet);
+            
+            if (UtilValidate.isNotEmpty(errorMessages)) {
+                report.println(UtilProperties.getMessage(resource, "HeaderContainsError", locale), InterfaceReport.FORMAT_ERROR);
+                return;
+            }
+            
+            // 4. parse data
+            // 4.1 parse row by row and store the contents into database
+            parseRowByRow(sheet);
+            if (UtilValidate.isNotEmpty(errorMessages)) {
+                report.println(UtilProperties.getMessage(resource, "DataContainsError", locale), InterfaceReport.FORMAT_ERROR);
+                if (writeFile) {
+                    sequenceNum = report.getSequenceNum();
+                    writeCommentsToFile(workbook, sheet);
+                }
+            }
+            
+            // 5. clean up the log files and commented Excel files
+            cleanupLogAndCommentedExcel();
+        } catch (IOException e) {
+            report.println(e);
+            Debug.logError(e, module);
+        } finally {
             if (UtilValidate.isNotEmpty(fileItems)) {
-    			// remove tmp files
+                // remove tmp files
                 FileItem fi = null;
                 for (int i = 0; i < fileItems.size(); i++) {
                     fi = fileItems.get(i);
@@ -145,521 +145,521 @@
                 }
             }
             if (workbook != null) {
-            	try {
-					workbook.close();
-				} catch (IOException e) {
-					Debug.logError(e, module);
-				}
+                try {
+                    workbook.close();
+                } catch (IOException e) {
+                    Debug.logError(e, module);
+                }
             }
-		}
-	}
+        }
+    }
 
-	public boolean existsCurrencyId(XSSFSheet sheet) {
-		report.print(UtilProperties.getMessage(resource, "StartCheckCurrencyId", locale), InterfaceReport.FORMAT_NOTE);
-		XSSFCell currencyIdCell = sheet.getRow(2).getCell(1);
-		currencyId = currencyIdCell.getStringCellValue().trim().toUpperCase();
-		if (UtilValidate.isEmpty(currencyId)) {
-			String errorMessage = UtilProperties.getMessage(resource, "CurrencyIdRequired", locale);
-			report.println(errorMessage, InterfaceReport.FORMAT_ERROR);
-			errorMessages.put(new CellReference(currencyIdCell), errorMessage);
-			return false;
-		} else {
-			try {
-				GenericValue currencyUom = delegator.findOne("Uom", UtilMisc.toMap("uomId", currencyId), false);
-				if (!"CURRENCY_MEASURE".equals(currencyUom.getString("uomTypeId"))) {
-					String errorMessage = UtilProperties.getMessage(resource, "CurrencyIdNotCurrency", new Object[] {currencyId}, locale);
-					report.println(errorMessage, InterfaceReport.FORMAT_ERROR);
-					errorMessages.put(new CellReference(currencyIdCell), errorMessage);
-					return false;
-				}
-			} catch(GenericEntityException e) {
-				String errorMessage = UtilProperties.getMessage(resource, "CurrencyIdNotFound", new Object[] {currencyId}, locale);
-				report.println(errorMessage, InterfaceReport.FORMAT_ERROR);
-				errorMessages.put(new CellReference(currencyIdCell), errorMessage);
-				return false;
-			}
-			report.print(UtilProperties.getMessage(resource, "CurrencyIdIs", new Object[] {currencyId}, locale), InterfaceReport.FORMAT_NOTE);
-			report.println(" ... " + UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
-		}
-		return true;
-	}
+    public boolean existsCurrencyId(XSSFSheet sheet) {
+        report.print(UtilProperties.getMessage(resource, "StartCheckCurrencyId", locale), InterfaceReport.FORMAT_NOTE);
+        XSSFCell currencyIdCell = sheet.getRow(2).getCell(1);
+        currencyId = currencyIdCell.getStringCellValue().trim().toUpperCase();
+        if (UtilValidate.isEmpty(currencyId)) {
+            String errorMessage = UtilProperties.getMessage(resource, "CurrencyIdRequired", locale);
+            report.println(errorMessage, InterfaceReport.FORMAT_ERROR);
+            errorMessages.put(new CellReference(currencyIdCell), errorMessage);
+            return false;
+        } else {
+            try {
+                GenericValue currencyUom = delegator.findOne("Uom", UtilMisc.toMap("uomId", currencyId), false);
+                if (!"CURRENCY_MEASURE".equals(currencyUom.getString("uomTypeId"))) {
+                    String errorMessage = UtilProperties.getMessage(resource, "CurrencyIdNotCurrency", new Object[] {currencyId}, locale);
+                    report.println(errorMessage, InterfaceReport.FORMAT_ERROR);
+                    errorMessages.put(new CellReference(currencyIdCell), errorMessage);
+                    return false;
+                }
+            } catch(GenericEntityException e) {
+                String errorMessage = UtilProperties.getMessage(resource, "CurrencyIdNotFound", new Object[] {currencyId}, locale);
+                report.println(errorMessage, InterfaceReport.FORMAT_ERROR);
+                errorMessages.put(new CellReference(currencyIdCell), errorMessage);
+                return false;
+            }
+            report.print(UtilProperties.getMessage(resource, "CurrencyIdIs", new Object[] {currencyId}, locale), InterfaceReport.FORMAT_NOTE);
+            report.println(" ... " + UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
+        }
+        return true;
+    }
 
-	public void parseRowByRow(XSSFSheet sheet) {
-		int rows = sheet.getPhysicalNumberOfRows();
-		List<Object[]> colNames = ColNamesList.get(pricatFileVersion);
-		int colNumber = colNames.size();
+    public void parseRowByRow(XSSFSheet sheet) {
+        int rows = sheet.getPhysicalNumberOfRows();
+        List<Object[]> colNames = ColNamesList.get(pricatFileVersion);
+        int colNumber = colNames.size();
 
-		int emptyRowStart = -1;
-		int emptyRowEnd = -1;
-		for (int i = headerRowNo + 1; i < rows; i++) {
-			XSSFRow row = sheet.getRow(i);
-			if (UtilValidate.isEmpty(row) || isEmptyRow(row, colNumber, false)) {
-				if (emptyRowStart == -1) {
-					report.print("(" + (i + 1) + ") ", InterfaceReport.FORMAT_NOTE);
-					emptyRowStart = i;
-				} else {
-					emptyRowEnd = i;
-				}
-				continue;
-			} else {
-				if (emptyRowStart != -1) {
-					if (emptyRowEnd != -1) {
-						report.print(" - (" + (emptyRowEnd + 1) + ") ", InterfaceReport.FORMAT_NOTE);
-					}
-					report.print(UtilProperties.getMessage(resource, "ExcelEmptyRow", locale), InterfaceReport.FORMAT_NOTE);
-					report.println(" ... " + UtilProperties.getMessage(resource, "skipped", locale), InterfaceReport.FORMAT_NOTE);
-					emptyRowStart = -1;
-					emptyRowEnd = -1;
-				}
-			}
-			report.print("(" + (i + 1) + ") ", InterfaceReport.FORMAT_NOTE);
-			List<Object> cellContents = getCellContents(row, colNames, colNumber);
-			try {
-				if (parseCellContentsAndStore(row, cellContents)) {
-					report.println(" ... " + UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
-				} else {
-					report.println(" ... " + UtilProperties.getMessage(resource, "skipped", locale), InterfaceReport.FORMAT_NOTE);
-				}
-			} catch (GenericTransactionException e) {
-				report.println(e);
-			}
-		}
-		if (emptyRowEnd != -1) {
-			report.print(" - (" + (emptyRowEnd + 1) + ") ", InterfaceReport.FORMAT_NOTE);
-			report.print(UtilProperties.getMessage(resource, "ExcelEmptyRow", locale), InterfaceReport.FORMAT_NOTE);
-			report.println(" ... " + UtilProperties.getMessage(resource, "skipped", locale), InterfaceReport.FORMAT_NOTE);
-		}
-	}
+        int emptyRowStart = -1;
+        int emptyRowEnd = -1;
+        for (int i = headerRowNo + 1; i < rows; i++) {
+            XSSFRow row = sheet.getRow(i);
+            if (UtilValidate.isEmpty(row) || isEmptyRow(row, colNumber, false)) {
+                if (emptyRowStart == -1) {
+                    report.print("(" + (i + 1) + ") ", InterfaceReport.FORMAT_NOTE);
+                    emptyRowStart = i;
+                } else {
+                    emptyRowEnd = i;
+                }
+                continue;
+            } else {
+                if (emptyRowStart != -1) {
+                    if (emptyRowEnd != -1) {
+                        report.print(" - (" + (emptyRowEnd + 1) + ") ", InterfaceReport.FORMAT_NOTE);
+                    }
+                    report.print(UtilProperties.getMessage(resource, "ExcelEmptyRow", locale), InterfaceReport.FORMAT_NOTE);
+                    report.println(" ... " + UtilProperties.getMessage(resource, "skipped", locale), InterfaceReport.FORMAT_NOTE);
+                    emptyRowStart = -1;
+                    emptyRowEnd = -1;
+                }
+            }
+            report.print("(" + (i + 1) + ") ", InterfaceReport.FORMAT_NOTE);
+            List<Object> cellContents = getCellContents(row, colNames, colNumber);
+            try {
+                if (parseCellContentsAndStore(row, cellContents)) {
+                    report.println(" ... " + UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
+                } else {
+                    report.println(" ... " + UtilProperties.getMessage(resource, "skipped", locale), InterfaceReport.FORMAT_NOTE);
+                }
+            } catch (GenericTransactionException e) {
+                report.println(e);
+            }
+        }
+        if (emptyRowEnd != -1) {
+            report.print(" - (" + (emptyRowEnd + 1) + ") ", InterfaceReport.FORMAT_NOTE);
+            report.print(UtilProperties.getMessage(resource, "ExcelEmptyRow", locale), InterfaceReport.FORMAT_NOTE);
+            report.println(" ... " + UtilProperties.getMessage(resource, "skipped", locale), InterfaceReport.FORMAT_NOTE);
+        }
+    }
 
-	/**
-	 * Check data according to business logic. If data is ok, store it.
-	 * 
-	 * @param row
-	 * @param cellContents
-	 * @param document
-	 * @return
-	 * @throws GenericTransactionException 
-	 */
-	public boolean parseCellContentsAndStore(XSSFRow row, List<Object> cellContents) throws GenericTransactionException {
-		if (UtilValidate.isEmpty(cellContents)) {
-			return false;
-		}
-		switch(pricatFileVersion) {
-			case "V1.1":
-			default:
-				return parseCellContentsAndStoreV1_X(row, cellContents);
-		}
-	}
-	
-	private boolean parseCellContentsAndStoreV1_X(XSSFRow row, List<Object> cellContents) throws GenericTransactionException {
-		if (UtilValidate.isEmpty(cellContents)) {
-			return false;
-		}
-		// 1. check if facilityId is in the facilities belong to the user, or if the name is correct for the id
-		String facilityName = (String) getCellContent(cellContents, "Facility Name");
-		String facilityId = (String) getCellContent(cellContents, "FacilityId");
-		if (!isFacilityOk(row, facilityName, facilityId)) 
-			return false;
-		
-		// 2. get productCategoryId
-		String ownerPartyId = facilities.get(facilityId)[1];
-		String productCategoryId = getProductCategoryId(cellContents, ownerPartyId);
-		
-		// 3. get productFeatureId of brand
-		String brandName = (String) getCellContent(cellContents, "Brand");
-		String brandId = getBrandId(brandName, ownerPartyId);
-		if (UtilValidate.isEmpty(brandId)) {
-			return false;
-		}
+    /**
+     * Check data according to business logic. If data is ok, store it.
+     * 
+     * @param row
+     * @param cellContents
+     * @param document
+     * @return
+     * @throws GenericTransactionException 
+     */
+    public boolean parseCellContentsAndStore(XSSFRow row, List<Object> cellContents) throws GenericTransactionException {
+        if (UtilValidate.isEmpty(cellContents)) {
+            return false;
+        }
+        switch(pricatFileVersion) {
+            case "V1.1":
+            default:
+                return parseCellContentsAndStoreV1_X(row, cellContents);
+        }
+    }
+    
+    private boolean parseCellContentsAndStoreV1_X(XSSFRow row, List<Object> cellContents) throws GenericTransactionException {
+        if (UtilValidate.isEmpty(cellContents)) {
+            return false;
+        }
+        // 1. check if facilityId is in the facilities belong to the user, or if the name is correct for the id
+        String facilityName = (String) getCellContent(cellContents, "Facility Name");
+        String facilityId = (String) getCellContent(cellContents, "FacilityId");
+        if (!isFacilityOk(row, facilityName, facilityId)) 
+            return false;
+        
+        // 2. get productCategoryId
+        String ownerPartyId = facilities.get(facilityId)[1];
+        String productCategoryId = getProductCategoryId(cellContents, ownerPartyId);
+        
+        // 3. get productFeatureId of brand
+        String brandName = (String) getCellContent(cellContents, "Brand");
+        String brandId = getBrandId(brandName, ownerPartyId);
+        if (UtilValidate.isEmpty(brandId)) {
+            return false;
+        }
 
-		// 4. get productId from brandId, model name
-		String modelName = (String) getCellContent(cellContents, "Style No");
-		String productName = (String) getCellContent(cellContents, "Product Name");
-		BigDecimal listPrice = (BigDecimal) getCellContent(cellContents, "List Price");
-		String productId = getProductId(row, brandId, modelName, productName, productCategoryId, ownerPartyId, listPrice);
-		if (UtilValidate.isEmpty(productId) || UtilValidate.isEmpty(listPrice)) {
-			return false;
-		}
+        // 4. get productId from brandId, model name
+        String modelName = (String) getCellContent(cellContents, "Style No");
+        String productName = (String) getCellContent(cellContents, "Product Name");
+        BigDecimal listPrice = (BigDecimal) getCellContent(cellContents, "List Price");
+        String productId = getProductId(row, brandId, modelName, productName, productCategoryId, ownerPartyId, listPrice);
+        if (UtilValidate.isEmpty(productId) || UtilValidate.isEmpty(listPrice)) {
+            return false;
+        }
 
-		// 5. update color and size if necessary
-		String color = (String) getCellContent(cellContents, "Color");
-		if (UtilValidate.isEmpty(color) || UtilValidate.isEmpty(color.trim())) {
-			color = defaultColorName;
-		}
-		String dimension = (String) getCellContent(cellContents, "Size");
-		if (UtilValidate.isEmpty(dimension) || UtilValidate.isEmpty(dimension.trim())) {
-			dimension = defaultDimensionName;
-		}
-		Map<String, Object> features = updateColorAndDimension(productId, ownerPartyId, color, dimension);
-		if (ServiceUtil.isError(features)) {
-			if (features.containsKey("index") && String.valueOf(features.get("index")).contains("0")) {
-				int cell = headerColNames.indexOf("Color");
-				XSSFCell colorCell = row.getCell(cell);
-				errorMessages.put(new CellReference(colorCell), UtilProperties.getMessage(resource, "PricatColorError", locale));
-			}
-			if (features.containsKey("index") && String.valueOf(features.get("index")).contains("1")) {
-				int cell = headerColNames.indexOf("Size");
-				XSSFCell colorCell = row.getCell(cell);
-				errorMessages.put(new CellReference(colorCell), UtilProperties.getMessage(resource, "PricatDimensionError", locale));
-			}
-			return false;
-		}
-		String colorId = (String) features.get("colorId");
-		String dimensionId = (String) features.get("dimensionId");
-		
-		// 6. update skuIds by productId
-		String barcode = (String) getCellContent(cellContents, "Barcode");
-		BigDecimal inventory = (BigDecimal) getCellContent(cellContents, "Stock Qty");
-		BigDecimal averageCost = (BigDecimal) getCellContent(cellContents, "Average Cost");
-		String skuId = updateSku(row, productId, ownerPartyId, facilityId, barcode, inventory, colorId, color, dimensionId, dimension, listPrice, averageCost);
-		if (UtilValidate.isEmpty(skuId)) {
-			return false;
-		}
-		
-		// 7. store prices
-		BigDecimal memberPrice = (BigDecimal) getCellContent(cellContents, "Member Price");
-		Map<String, Object> results = updateSkuPrice(skuId, ownerPartyId, memberPrice);
-		if (ServiceUtil.isError(results)) {
-			return false;
-		}
-		
-		return true;
-	}
+        // 5. update color and size if necessary
+        String color = (String) getCellContent(cellContents, "Color");
+        if (UtilValidate.isEmpty(color) || UtilValidate.isEmpty(color.trim())) {
+            color = defaultColorName;
+        }
+        String dimension = (String) getCellContent(cellContents, "Size");
+        if (UtilValidate.isEmpty(dimension) || UtilValidate.isEmpty(dimension.trim())) {
+            dimension = defaultDimensionName;
+        }
+        Map<String, Object> features = updateColorAndDimension(productId, ownerPartyId, color, dimension);
+        if (ServiceUtil.isError(features)) {
+            if (features.containsKey("index") && String.valueOf(features.get("index")).contains("0")) {
+                int cell = headerColNames.indexOf("Color");
+                XSSFCell colorCell = row.getCell(cell);
+                errorMessages.put(new CellReference(colorCell), UtilProperties.getMessage(resource, "PricatColorError", locale));
+            }
+            if (features.containsKey("index") && String.valueOf(features.get("index")).contains("1")) {
+                int cell = headerColNames.indexOf("Size");
+                XSSFCell colorCell = row.getCell(cell);
+                errorMessages.put(new CellReference(colorCell), UtilProperties.getMessage(resource, "PricatDimensionError", locale));
+            }
+            return false;
+        }
+        String colorId = (String) features.get("colorId");
+        String dimensionId = (String) features.get("dimensionId");
+        
+        // 6. update skuIds by productId
+        String barcode = (String) getCellContent(cellContents, "Barcode");
+        BigDecimal inventory = (BigDecimal) getCellContent(cellContents, "Stock Qty");
+        BigDecimal averageCost = (BigDecimal) getCellContent(cellContents, "Average Cost");
+        String skuId = updateSku(row, productId, ownerPartyId, facilityId, barcode, inventory, colorId, color, dimensionId, dimension, listPrice, averageCost);
+        if (UtilValidate.isEmpty(skuId)) {
+            return false;
+        }
+        
+        // 7. store prices
+        BigDecimal memberPrice = (BigDecimal) getCellContent(cellContents, "Member Price");
+        Map<String, Object> results = updateSkuPrice(skuId, ownerPartyId, memberPrice);
+        if (ServiceUtil.isError(results)) {
+            return false;
+        }
+        
+        return true;
+    }
 
 
-	public String updateSku(XSSFRow row, String productId, String ownerPartyId, String facilityId, String barcode, BigDecimal inventory,
-			String colorId, String color, String dimensionId, String dimension, BigDecimal listPrice, BigDecimal averageCost) {
-		return "sampleSkuId";
-	}
+    public String updateSku(XSSFRow row, String productId, String ownerPartyId, String facilityId, String barcode, BigDecimal inventory,
+            String colorId, String color, String dimensionId, String dimension, BigDecimal listPrice, BigDecimal averageCost) {
+        return "sampleSkuId";
+    }
 
-	public String getProductId(XSSFRow row, String brandId, String modelName, String productName, String productCategoryId, String ownerPartyId, BigDecimal listPrice) {
-		return "sampleProductId";
-	}
+    public String getProductId(XSSFRow row, String brandId, String modelName, String productName, String productCategoryId, String ownerPartyId, BigDecimal listPrice) {
+        return "sampleProductId";
+    }
 
-	public Object getCellContent(List<Object> cellContents, String colName) {
-		if (UtilValidate.isNotEmpty(headerColNames) && headerColNames.contains(colName)) {
-			return cellContents.get(headerColNames.indexOf(colName));
-		}
-		return null;
-	}
+    public Object getCellContent(List<Object> cellContents, String colName) {
+        if (UtilValidate.isNotEmpty(headerColNames) && headerColNames.contains(colName)) {
+            return cellContents.get(headerColNames.indexOf(colName));
+        }
+        return null;
+    }
 
-	public String getProductCategoryId(List<Object> cellContents, String ownerPartyId) {
-		return "sampleProductCategoryId";
-	}
+    public String getProductCategoryId(List<Object> cellContents, String ownerPartyId) {
+        return "sampleProductCategoryId";
+    }
 
-	public boolean isFacilityOk(XSSFRow row, String facilityName, String facilityId) {
-		if (!facilities.containsKey(facilityId)) {
-			if (UtilValidate.isEmpty(facilityId) && facilities.keySet().size() == 1) {
-				if (UtilValidate.isEmpty(facilityName)) {
-					return true;
-				} else {
-					String theFacilityId = (String) facilities.keySet().toArray()[0];
-					String name = facilities.get(theFacilityId)[0];
-					if (!name.equals(facilityName)) {
-						String errorMessage = UtilProperties.getMessage(resource, "FacilityNameNotMatchId", new Object[]{theFacilityId, name, facilityName}, locale);
-						report.println();
-						report.print(errorMessage, InterfaceReport.FORMAT_ERROR);
-						XSSFCell cell = row.getCell(0);
-						errorMessages.put(new CellReference(cell), errorMessage);
-						return false;
-					}
-				}
-			} else {
-				String errorMessage = UtilProperties.getMessage(resource, "FacilityNotBelongToYou", new Object[]{facilityName, facilityId}, locale);
-				report.println();
-				report.print(errorMessage, InterfaceReport.FORMAT_ERROR);
-				XSSFCell cell = row.getCell(1);
-				errorMessages.put(new CellReference(cell), errorMessage);
-				return false;
-			}
-		} else {
-			String name = facilities.get(facilityId)[0];
-			if (!name.equals(facilityName)) {
-				String errorMessage = UtilProperties.getMessage(resource, "FacilityNameNotMatchId", new Object[]{facilityId, name, facilityName}, locale);
-				report.println();
-				report.print(errorMessage, InterfaceReport.FORMAT_ERROR);
-				XSSFCell cell = row.getCell(0);
-				errorMessages.put(new CellReference(cell), errorMessage);
-				return false;
-			}
-		}
-		return true;
-	}
+    public boolean isFacilityOk(XSSFRow row, String facilityName, String facilityId) {
+        if (!facilities.containsKey(facilityId)) {
+            if (UtilValidate.isEmpty(facilityId) && facilities.keySet().size() == 1) {
+                if (UtilValidate.isEmpty(facilityName)) {
+                    return true;
+                } else {
+                    String theFacilityId = (String) facilities.keySet().toArray()[0];
+                    String name = facilities.get(theFacilityId)[0];
+                    if (!name.equals(facilityName)) {
+                        String errorMessage = UtilProperties.getMessage(resource, "FacilityNameNotMatchId", new Object[]{theFacilityId, name, facilityName}, locale);
+                        report.println();
+                        report.print(errorMessage, InterfaceReport.FORMAT_ERROR);
+                        XSSFCell cell = row.getCell(0);
+                        errorMessages.put(new CellReference(cell), errorMessage);
+                        return false;
+                    }
+                }
+            } else {
+                String errorMessage = UtilProperties.getMessage(resource, "FacilityNotBelongToYou", new Object[]{facilityName, facilityId}, locale);
+                report.println();
+                report.print(errorMessage, InterfaceReport.FORMAT_ERROR);
+                XSSFCell cell = row.getCell(1);
+                errorMessages.put(new CellReference(cell), errorMessage);
+                return false;
+            }
+        } else {
+            String name = facilities.get(facilityId)[0];
+            if (!name.equals(facilityName)) {
+                String errorMessage = UtilProperties.getMessage(resource, "FacilityNameNotMatchId", new Object[]{facilityId, name, facilityName}, locale);
+                report.println();
+                report.print(errorMessage, InterfaceReport.FORMAT_ERROR);
+                XSSFCell cell = row.getCell(0);
+                errorMessages.put(new CellReference(cell), errorMessage);
+                return false;
+            }
+        }
+        return true;
+    }
 
-	public boolean isTableHeaderMatched(XSSFSheet sheet) {
-		List<Object[]> columnNames = ColNamesList.get(pricatFileVersion);
-		short cols = sheet.getRow(headerRowNo).getLastCellNum();
-		report.print(UtilProperties.getMessage(resource, "StartCheckHeaderColNum", new Object[] {pricatFileVersion}, locale), InterfaceReport.FORMAT_NOTE);
-		if (cols != columnNames.size()) {
-			report.print(UtilProperties.getMessage(resource, "HeaderColNumNotMatch", new Object[] {String.valueOf(cols), String.valueOf(columnNames.size())}, locale), InterfaceReport.FORMAT_WARNING);
-			if (cols < columnNames.size()) {
-				report.println(UtilProperties.getMessage(resource, "HeaderColNumShortThanRequired", new Object[] {String.valueOf(columnNames.size())}, locale), InterfaceReport.FORMAT_ERROR);
-				return false;
-			} else {
-				report.println(UtilProperties.getMessage(resource, "UseHeaderColNum", new Object[] {String.valueOf(columnNames.size())}, locale), InterfaceReport.FORMAT_WARNING);
-				cols = (short) columnNames.size();
-			}
-		} else {
-			report.println(UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
-		}
-		
-		report.print(UtilProperties.getMessage(resource, "StartCheckHeaderColLabel", new Object[] {pricatFileVersion}, locale), InterfaceReport.FORMAT_NOTE);
-		boolean foundLabelNotMatch = false;
-		for (int i = 0; i < cols; i++) {
-			String coltext = sheet.getRow(headerRowNo).getCell(i).getStringCellValue().trim();
-			headerColNames.add(coltext);
-			Object[] versionColumn = columnNames.get(i);
-			if (!coltext.equals(versionColumn[0])) {
-				report.println(UtilProperties.getMessage(resource, "HeaderColLabelNotMatch", new Object[] {String.valueOf(headerRowNo + 1), String.valueOf(i + 1), coltext, versionColumn[0]}, locale), InterfaceReport.FORMAT_ERROR);
-				foundLabelNotMatch = true;
-			} else {
-				report.print(" " + coltext, InterfaceReport.FORMAT_NOTE);
-				if (i < cols - 1) {
-					report.print(",", InterfaceReport.FORMAT_NOTE);
-				}
-			}
-		}
-		if (foundLabelNotMatch) {
-			report.println();
-			return false;
-		}
-		report.println(" ... " + UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
-		return true;
-	}
+    public boolean isTableHeaderMatched(XSSFSheet sheet) {
+        List<Object[]> columnNames = ColNamesList.get(pricatFileVersion);
+        short cols = sheet.getRow(headerRowNo).getLastCellNum();
+        report.print(UtilProperties.getMessage(resource, "StartCheckHeaderColNum", new Object[] {pricatFileVersion}, locale), InterfaceReport.FORMAT_NOTE);
+        if (cols != columnNames.size()) {
+            report.print(UtilProperties.getMessage(resource, "HeaderColNumNotMatch", new Object[] {String.valueOf(cols), String.valueOf(columnNames.size())}, locale), InterfaceReport.FORMAT_WARNING);
+            if (cols < columnNames.size()) {
+                report.println(UtilProperties.getMessage(resource, "HeaderColNumShortThanRequired", new Object[] {String.valueOf(columnNames.size())}, locale), InterfaceReport.FORMAT_ERROR);
+                return false;
+            } else {
+                report.println(UtilProperties.getMessage(resource, "UseHeaderColNum", new Object[] {String.valueOf(columnNames.size())}, locale), InterfaceReport.FORMAT_WARNING);
+                cols = (short) columnNames.size();
+            }
+        } else {
+            report.println(UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
+        }
+        
+        report.print(UtilProperties.getMessage(resource, "StartCheckHeaderColLabel", new Object[] {pricatFileVersion}, locale), InterfaceReport.FORMAT_NOTE);
+        boolean foundLabelNotMatch = false;
+        for (int i = 0; i < cols; i++) {
+            String coltext = sheet.getRow(headerRowNo).getCell(i).getStringCellValue().trim();
+            headerColNames.add(coltext);
+            Object[] versionColumn = columnNames.get(i);
+            if (!coltext.equals(versionColumn[0])) {
+                report.println(UtilProperties.getMessage(resource, "HeaderColLabelNotMatch", new Object[] {String.valueOf(headerRowNo + 1), String.valueOf(i + 1), coltext, versionColumn[0]}, locale), InterfaceReport.FORMAT_ERROR);
+                foundLabelNotMatch = true;
+            } else {
+                report.print(" " + coltext, InterfaceReport.FORMAT_NOTE);
+                if (i < cols - 1) {
+                    report.print(",", InterfaceReport.FORMAT_NOTE);
+                }
+            }
+        }
+        if (foundLabelNotMatch) {
+            report.println();
+            return false;
+        }
+        report.println(" ... " + UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
+        return true;
+    }
 
-	public boolean isVersionSupported(XSSFSheet sheet) {
-		report.print(UtilProperties.getMessage(resource, "StartCheckPricatVersion", locale), InterfaceReport.FORMAT_NOTE);
-		pricatFileVersion = sheet.getRow(2).getCell(0).getStringCellValue().trim();
-		if (ColNamesList.containsKey(pricatFileVersion)) {
-			report.print(" " + pricatFileVersion + " ... ", InterfaceReport.FORMAT_NOTE);
-			report.println(UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
-		} else {
-			report.println(UtilProperties.getMessage(resource, "error", locale), InterfaceReport.FORMAT_ERROR);
-			report.println(UtilProperties.getMessage(resource, "PricatVersionNotSupport", new Object[] {pricatFileVersion}, locale), InterfaceReport.FORMAT_ERROR);
-			return false;
-		}
-		return true;
-	}
+    public boolean isVersionSupported(XSSFSheet sheet) {
+        report.print(UtilProperties.getMessage(resource, "StartCheckPricatVersion", locale), InterfaceReport.FORMAT_NOTE);
+        pricatFileVersion = sheet.getRow(2).getCell(0).getStringCellValue().trim();
+        if (ColNamesList.containsKey(pricatFileVersion)) {
+            report.print(" " + pricatFileVersion + " ... ", InterfaceReport.FORMAT_NOTE);
+            report.println(UtilProperties.getMessage(resource, "ok", locale), InterfaceReport.FORMAT_OK);
+        } else {
+            report.println(UtilProperties.getMessage(resource, "error", locale), InterfaceReport.FORMAT_ERROR);
+            report.println(UtilProperties.getMessage(resource, "PricatVersionNotSupport", new Object[] {pricatFileVersion}, locale), InterfaceReport.FORMAT_ERROR);
+            return false;
+        }
+        return true;
+    }
 
-	public boolean containsDataRows(XSSFSheet sheet) {
-		int rows = sheet.getPhysicalNumberOfRows();
-		if (rows > headerRowNo + 1) {
-			report.println(UtilProperties.getMessage(resource, "PricatTableRows", new Object[] {String.valueOf(headerRowNo + 1), String.valueOf(rows - headerRowNo - 1), sheet.getSheetName()}, locale), InterfaceReport.FORMAT_NOTE);
-		} else {
-			report.println(UtilProperties.getMessage(resource, "PricatNoDataRows", new Object[] {sheet.getSheetName()}, locale), InterfaceReport.FORMAT_ERROR);
-			return false;
-		}
-		return true;
-	}
+    public boolean containsDataRows(XSSFSheet sheet) {
+        int rows = sheet.getPhysicalNumberOfRows();
+        if (rows > headerRowNo + 1) {
+            report.println(UtilProperties.getMessage(resource, "PricatTableRows", new Object[] {String.valueOf(headerRowNo + 1), String.valueOf(rows - headerRowNo - 1), sheet.getSheetName()}, locale), InterfaceReport.FORMAT_NOTE);
+        } else {
+            report.println(UtilProperties.getMessage(resource, "PricatNoDataRows", new Object[] {sheet.getSheetName()}, locale), InterfaceReport.FORMAT_ERROR);
+            return false;
+        }
+        return true;
+    }
 
-	/**
-	 * The Object[] have 4 elements, they are:
-	 * 1. Header Label Name.
-	 * 2. Cell data type to return.
-	 * 3. Boolean value to indicate whether the column is required.
-	 * 4. Boolean value to indicate whether the column is a price when cell data type is BigDecimal, this element is optional.
-	 * 
-	 * @param version
-	 * @return List of Object[]
-	 */
-	private static List<Object[]> genExcelHeaderNames(String version){
-		switch (version) {
-			case "V1.1":
-			default:
-				return genExcelHeaderNamesV1_1();
-		}
-	}
+    /**
+     * The Object[] have 4 elements, they are:
+     * 1. Header Label Name.
+     * 2. Cell data type to return.
+     * 3. Boolean value to indicate whether the column is required.
+     * 4. Boolean value to indicate whether the column is a price when cell data type is BigDecimal, this element is optional.
+     * 
+     * @param version
+     * @return List of Object[]
+     */
+    private static List<Object[]> genExcelHeaderNames(String version){
+        switch (version) {
+            case "V1.1":
+            default:
+                return genExcelHeaderNamesV1_1();
+        }
+    }
 
-	/**
-	 * Get V1.1 pricat excel header names and attributes. 
-	 * 
-	 * @return list of Object[]
-	 */
-	private static List<Object[]> genExcelHeaderNamesV1_1() {
-		List<Object[]> listHeaderName = new ArrayList<Object[]>();
-		listHeaderName.add(new Object[] {"Facility Name", 
+    /**
+     * Get V1.1 pricat excel header names and attributes. 
+     * 
+     * @return list of Object[]
+     */
+    private static List<Object[]> genExcelHeaderNamesV1_1() {
+        List<Object[]> listHeaderName = new ArrayList<Object[]>();
+        listHeaderName.add(new Object[] {"Facility Name", 
                                          XSSFCell.CELL_TYPE_STRING,
-				                         Boolean.TRUE});
-		listHeaderName.add(new Object[] {"FacilityId",
+                                         Boolean.TRUE});
+        listHeaderName.add(new Object[] {"FacilityId",
                                          XSSFCell.CELL_TYPE_STRING,
-				                         Boolean.TRUE});
-		listHeaderName.add(new Object[] {"Category L1",
-                                         XSSFCell.CELL_TYPE_STRING,
-				                         Boolean.FALSE});
-		listHeaderName.add(new Object[] {"Category L2",
-                                         XSSFCell.CELL_TYPE_STRING,
-				                         Boolean.FALSE});
-		listHeaderName.add(new Object[] {"Category L3",
-                                         XSSFCell.CELL_TYPE_STRING,
-				                         Boolean.FALSE});
-		listHeaderName.add(new Object[] {"Category L4",
-                                         XSSFCell.CELL_TYPE_STRING,
-				                         Boolean.FALSE});
-		listHeaderName.add(new Object[] {"Brand",
-                                         XSSFCell.CELL_TYPE_STRING,
-				                         Boolean.TRUE});
-		listHeaderName.add(new Object[] {"Style No",
-                                         XSSFCell.CELL_TYPE_STRING,
-				                         Boolean.TRUE});
-		listHeaderName.add(new Object[] {"Product Name",
-                                         XSSFCell.CELL_TYPE_STRING,
-				                         Boolean.TRUE});
-		listHeaderName.add(new Object[] {"Color",
-                                         XSSFCell.CELL_TYPE_STRING,
-				                         Boolean.FALSE});
-		listHeaderName.add(new Object[] {"Size",
-                                         XSSFCell.CELL_TYPE_STRING,
-				                         Boolean.FALSE});
-		listHeaderName.add(new Object[] {"Barcode",
+                                         Boolean.TRUE});
+        listHeaderName.add(new Object[] {"Category L1",
                                          XSSFCell.CELL_TYPE_STRING,
                                          Boolean.FALSE});
-		listHeaderName.add(new Object[] {"Stock Qty",
+        listHeaderName.add(new Object[] {"Category L2",
+                                         XSSFCell.CELL_TYPE_STRING,
+                                         Boolean.FALSE});
+        listHeaderName.add(new Object[] {"Category L3",
+                                         XSSFCell.CELL_TYPE_STRING,
+                                         Boolean.FALSE});
+        listHeaderName.add(new Object[] {"Category L4",
+                                         XSSFCell.CELL_TYPE_STRING,
+                                         Boolean.FALSE});
+        listHeaderName.add(new Object[] {"Brand",
+                                         XSSFCell.CELL_TYPE_STRING,
+                                         Boolean.TRUE});
+        listHeaderName.add(new Object[] {"Style No",
+                                         XSSFCell.CELL_TYPE_STRING,
+                                         Boolean.TRUE});
+        listHeaderName.add(new Object[] {"Product Name",
+                                         XSSFCell.CELL_TYPE_STRING,
+                                         Boolean.TRUE});
+        listHeaderName.add(new Object[] {"Color",
+                                         XSSFCell.CELL_TYPE_STRING,
+                                         Boolean.FALSE});
+        listHeaderName.add(new Object[] {"Size",
+                                         XSSFCell.CELL_TYPE_STRING,
+                                         Boolean.FALSE});
+        listHeaderName.add(new Object[] {"Barcode",
+                                         XSSFCell.CELL_TYPE_STRING,
+                                         Boolean.FALSE});
+        listHeaderName.add(new Object[] {"Stock Qty",
                                          XSSFCell.CELL_TYPE_NUMERIC,
                                          Boolean.TRUE});
-		listHeaderName.add(new Object[] {"Average Cost",
+        listHeaderName.add(new Object[] {"Average Cost",
                                          XSSFCell.CELL_TYPE_NUMERIC,
                                          Boolean.TRUE,
-					                     Boolean.TRUE});
-		listHeaderName.add(new Object[] {"List Price",
-										 XSSFCell.CELL_TYPE_NUMERIC,
-										 Boolean.TRUE,
-										 Boolean.TRUE});
-		listHeaderName.add(new Object[] {"Member Price",
-                                       	 XSSFCell.CELL_TYPE_NUMERIC,
-                                       	 Boolean.FALSE,
-                                       	 Boolean.TRUE});
-		return listHeaderName;
-	}
+                                         Boolean.TRUE});
+        listHeaderName.add(new Object[] {"List Price",
+                                         XSSFCell.CELL_TYPE_NUMERIC,
+                                         Boolean.TRUE,
+                                         Boolean.TRUE});
+        listHeaderName.add(new Object[] {"Member Price",
+                                            XSSFCell.CELL_TYPE_NUMERIC,
+                                            Boolean.FALSE,
+                                            Boolean.TRUE});
+        return listHeaderName;
+    }
 
-	@Override
-	public void parsePricatExcel() {
-		parsePricatExcel(true);
-	}
+    @Override
+    public void parsePricatExcel() {
+        parsePricatExcel(true);
+    }
 
-	/**
-	 * Get data by version definition.
-	 * 
-	 * @param row
-	 * @param colNames 
-	 * @param size 
-	 * @return
-	 */
-	public List<Object> getCellContents(XSSFRow row, List<Object[]> colNames, int size) {
-		List<Object> results = new ArrayList<Object>();
-		boolean foundError = false;
-		if (isEmptyRow(row, size, true)) {
-			return null;
-		}
-		
-		// check and get data
-		for (int i = 0; i < size; i++) {
-			XSSFCell cell = null;
-			if (row.getPhysicalNumberOfCells() > i) {
-				cell = row.getCell(i);
-			}
-			if (cell == null) {
-				if (((Boolean) colNames.get(i)[2]).booleanValue() && (facilities.keySet().size() > 1 || (facilities.keySet().size() == 1 && i >= 2))) {
-					report.print(UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale), InterfaceReport.FORMAT_WARNING);
-					cell = row.createCell(i);
-					errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale));
-					foundError = true;
-					results.add(null);
-					continue;
-				} else {
-					cell = row.createCell(i);
-				}
-			}
-			int cellType = cell.getCellType();
-			String cellValue = formatter.formatCellValue(cell);
-			if (UtilValidate.isNotEmpty(cellValue) && UtilValidate.isNotEmpty(cellValue.trim())) {
-				if (cellType == XSSFCell.CELL_TYPE_FORMULA) {
-					try {
-						cellValue = BigDecimal.valueOf(cell.getNumericCellValue()).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding).toString();
-					} catch (IllegalStateException e) {
-						try {
-							cellValue = cell.getStringCellValue();
-						} catch (IllegalStateException e1) {
-							// do nothing
-						}
-					}
-					report.print(((i == 0)?"":", ") + cellValue, InterfaceReport.FORMAT_NOTE);
-				} else {
-					report.print(((i == 0)?"":", ") + cellValue, InterfaceReport.FORMAT_NOTE);
-				}
-			} else {
-				report.print(((i == 0)?"":","), InterfaceReport.FORMAT_NOTE);
-			}
-			if (((Boolean) colNames.get(i)[2]).booleanValue() && UtilValidate.isEmpty(cellValue) && (facilities.keySet().size() > 1 || (facilities.keySet().size() == 1 && i >= 2))) {
-				report.print(UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale), InterfaceReport.FORMAT_WARNING);
-				errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale));
-				foundError = true;
-				results.add(null);
-				continue;
-			}
-			if (((Boolean) colNames.get(i)[2]).booleanValue() && cellType != (int) colNames.get(i)[1]) {
-				// String warningMessage = "";
-				if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_STRING) {
-					if (UtilValidate.isNotEmpty(cellValue) && UtilValidate.isNotEmpty(cellValue.trim())) {
-						results.add(cellValue);
-					} else {
-						results.add(null);
-					}
-				} else if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_NUMERIC) {
-					if (cell.getCellType() != XSSFCell.CELL_TYPE_STRING) {
-						cell.setCellType(XSSFCell.CELL_TYPE_STRING);
-					}
-					try {
-						results.add(BigDecimal.valueOf(Double.parseDouble(cell.getStringCellValue())).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding));
-					} catch (NumberFormatException e) {
-						results.add(null);
-						errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
-					}
-				}
-			} else {
-				if (UtilValidate.isEmpty(cellValue) || UtilValidate.isEmpty(cellValue.trim())) {
-					results.add(null);
-					continue;
-				}
-				if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_STRING) {
-					if (cell.getCellType() == XSSFCell.CELL_TYPE_STRING) {
-						cellValue = cell.getStringCellValue().trim();
-						results.add(cellValue);
-					} else {
-						results.add(cellValue.trim());
-					}
-				} else if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_NUMERIC) {
-					if (cell.getCellType() == XSSFCell.CELL_TYPE_STRING) {
-						try {
-							results.add(BigDecimal.valueOf(Double.valueOf(cell.getStringCellValue())));
-						} catch (NumberFormatException e) {
-							results.add(null);
-							errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
-						}
-					} else if (cell.getCellType() == XSSFCell.CELL_TYPE_NUMERIC) {
-						try {
-							results.add(BigDecimal.valueOf(cell.getNumericCellValue()).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding));
-						} catch (NumberFormatException e) {
-							results.add(null);
-							errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
-						}
-					} else {
-						try {
-							results.add(BigDecimal.valueOf(Double.valueOf(cellValue)).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding));
-						} catch (NumberFormatException e) {
-							results.add(null);
-							errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
-						}
-					}
-				}
-			}
-		}
-		if (foundError) {
-			return null;
-		}
-		return results;
-	}
+    /**
+     * Get data by version definition.
+     * 
+     * @param row
+     * @param colNames 
+     * @param size 
+     * @return
+     */
+    public List<Object> getCellContents(XSSFRow row, List<Object[]> colNames, int size) {
+        List<Object> results = new ArrayList<Object>();
+        boolean foundError = false;
+        if (isEmptyRow(row, size, true)) {
+            return null;
+        }
+        
+        // check and get data
+        for (int i = 0; i < size; i++) {
+            XSSFCell cell = null;
+            if (row.getPhysicalNumberOfCells() > i) {
+                cell = row.getCell(i);
+            }
+            if (cell == null) {
+                if (((Boolean) colNames.get(i)[2]).booleanValue() && (facilities.keySet().size() > 1 || (facilities.keySet().size() == 1 && i >= 2))) {
+                    report.print(UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale), InterfaceReport.FORMAT_WARNING);
+                    cell = row.createCell(i);
+                    errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale));
+                    foundError = true;
+                    results.add(null);
+                    continue;
+                } else {
+                    cell = row.createCell(i);
+                }
+            }
+            int cellType = cell.getCellType();
+            String cellValue = formatter.formatCellValue(cell);
+            if (UtilValidate.isNotEmpty(cellValue) && UtilValidate.isNotEmpty(cellValue.trim())) {
+                if (cellType == XSSFCell.CELL_TYPE_FORMULA) {
+                    try {
+                        cellValue = BigDecimal.valueOf(cell.getNumericCellValue()).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding).toString();
+                    } catch (IllegalStateException e) {
+                        try {
+                            cellValue = cell.getStringCellValue();
+                        } catch (IllegalStateException e1) {
+                            // do nothing
+                        }
+                    }
+                    report.print(((i == 0)?"":", ") + cellValue, InterfaceReport.FORMAT_NOTE);
+                } else {
+                    report.print(((i == 0)?"":", ") + cellValue, InterfaceReport.FORMAT_NOTE);
+                }
+            } else {
+                report.print(((i == 0)?"":","), InterfaceReport.FORMAT_NOTE);
+            }
+            if (((Boolean) colNames.get(i)[2]).booleanValue() && UtilValidate.isEmpty(cellValue) && (facilities.keySet().size() > 1 || (facilities.keySet().size() == 1 && i >= 2))) {
+                report.print(UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale), InterfaceReport.FORMAT_WARNING);
+                errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale));
+                foundError = true;
+                results.add(null);
+                continue;
+            }
+            if (((Boolean) colNames.get(i)[2]).booleanValue() && cellType != (int) colNames.get(i)[1]) {
+                // String warningMessage = "";
+                if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_STRING) {
+                    if (UtilValidate.isNotEmpty(cellValue) && UtilValidate.isNotEmpty(cellValue.trim())) {
+                        results.add(cellValue);
+                    } else {
+                        results.add(null);
+                    }
+                } else if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_NUMERIC) {
+                    if (cell.getCellType() != XSSFCell.CELL_TYPE_STRING) {
+                        cell.setCellType(XSSFCell.CELL_TYPE_STRING);
+                    }
+                    try {
+                        results.add(BigDecimal.valueOf(Double.parseDouble(cell.getStringCellValue())).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding));
+                    } catch (NumberFormatException e) {
+                        results.add(null);
+                        errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
+                    }
+                }
+            } else {
+                if (UtilValidate.isEmpty(cellValue) || UtilValidate.isEmpty(cellValue.trim())) {
+                    results.add(null);
+                    continue;
+                }
+                if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_STRING) {
+                    if (cell.getCellType() == XSSFCell.CELL_TYPE_STRING) {
+                        cellValue = cell.getStringCellValue().trim();
+                        results.add(cellValue);
+                    } else {
+                        results.add(cellValue.trim());
+                    }
+                } else if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_NUMERIC) {
+                    if (cell.getCellType() == XSSFCell.CELL_TYPE_STRING) {
+                        try {
+                            results.add(BigDecimal.valueOf(Double.valueOf(cell.getStringCellValue())));
+                        } catch (NumberFormatException e) {
+                            results.add(null);
+                            errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
+                        }
+                    } else if (cell.getCellType() == XSSFCell.CELL_TYPE_NUMERIC) {
+                        try {
+                            results.add(BigDecimal.valueOf(cell.getNumericCellValue()).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding));
+                        } catch (NumberFormatException e) {
+                            results.add(null);
+                            errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
+                        }
+                    } else {
+                        try {
+                            results.add(BigDecimal.valueOf(Double.valueOf(cellValue)).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding));
+                        } catch (NumberFormatException e) {
+                            results.add(null);
+                            errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorParseValueToNumeric", locale));
+                        }
+                    }
+                }
+            }
+        }
+        if (foundError) {
+            return null;
+        }
+        return results;
+    }
 
-	protected int getHeaderRowNo() {
-		return headerRowNo;
-	}
+    protected int getHeaderRowNo() {
+        return headerRowNo;
+    }
 }
diff --git a/specialpurpose/pricat/src/main/java/org/apache/poi/xssf/usermodel/OFBizPricatUtil.java b/specialpurpose/pricat/src/main/java/org/apache/poi/xssf/usermodel/OFBizPricatUtil.java
index 5f1dc2c..3d18c6c 100644
--- a/specialpurpose/pricat/src/main/java/org/apache/poi/xssf/usermodel/OFBizPricatUtil.java
+++ b/specialpurpose/pricat/src/main/java/org/apache/poi/xssf/usermodel/OFBizPricatUtil.java
@@ -22,15 +22,15 @@
 import com.microsoft.schemas.vml.CTShape;

 

 public final class OFBizPricatUtil {

-	public static void formatCommentShape(XSSFSheet sheet, CellReference cell) {

+    public static void formatCommentShape(XSSFSheet sheet, CellReference cell) {

         XSSFVMLDrawing vml = sheet.getVMLDrawing(true);

         CTShape ctshape = vml.findCommentShape(cell.getRow(), cell.getCol());

         ctshape.setType("#_x0000_t202");

-	}

+    }

 

-	public static void formatCommentShape(XSSFSheet sheet, int rowNum, short colNum) {

+    public static void formatCommentShape(XSSFSheet sheet, int rowNum, short colNum) {

         XSSFVMLDrawing vml = sheet.getVMLDrawing(true);

         CTShape ctshape = vml.findCommentShape(rowNum, colNum);

         ctshape.setType("#_x0000_t202");

-	}

+    }

 }

diff --git a/specialpurpose/pricat/webapp/pricat/WEB-INF/controller.xml b/specialpurpose/pricat/webapp/pricat/WEB-INF/controller.xml
index 1c837d3..fe9888f 100644
--- a/specialpurpose/pricat/webapp/pricat/WEB-INF/controller.xml
+++ b/specialpurpose/pricat/webapp/pricat/WEB-INF/controller.xml
@@ -43,6 +43,6 @@
         <response name="success" type="view" value="viewExcelImportLog"/>
     </request-map>
     
-	<view-map name="main" type="screen" page="component://pricat/widget/CommonScreens.xml#viewExcelImportHistory"/>
-	<view-map name="viewExcelImportLog" type="screen" page="component://pricat/widget/CommonScreens.xml#viewExcelImportLog"/>
+    <view-map name="main" type="screen" page="component://pricat/widget/CommonScreens.xml#viewExcelImportHistory"/>
+    <view-map name="viewExcelImportLog" type="screen" page="component://pricat/widget/CommonScreens.xml#viewExcelImportLog"/>
 </site-conf>
diff --git a/specialpurpose/pricat/webapp/pricat/ftl/ExcelImportHistoryReport.ftl b/specialpurpose/pricat/webapp/pricat/ftl/ExcelImportHistoryReport.ftl
index 042bfec..74ebf3c 100644
--- a/specialpurpose/pricat/webapp/pricat/ftl/ExcelImportHistoryReport.ftl
+++ b/specialpurpose/pricat/webapp/pricat/ftl/ExcelImportHistoryReport.ftl
@@ -16,94 +16,94 @@
 specific language governing permissions and limitations

 under the License.

 -->

-<div class="row">	

-	<div class="col-sm-12 m-b-xs text-left p-xs">

-		<label >${uiLabelMap.ExcelImportHistoryList}</label>

-		<span class="tooltip pad-left30 top">${uiLabelMap.OnlyYourOwnImportHistoryDisplayed}</span>

-	</div> 

+<div class="row">

+    <div class="col-sm-12 m-b-xs text-left p-xs">

+        <label >${uiLabelMap.ExcelImportHistoryList}</label>

+        <span class="tooltip pad-left30 top">${uiLabelMap.OnlyYourOwnImportHistoryDisplayed}</span>

+    </div> 

 </div>

 

 <div id="loadBody" style="display:none">

 </div>

 <table id="productlist" name="productlist" class="table table-striped ms-table-primary">

-	<thead>

-		<th></th>

-		<th>${uiLabelMap.SerialNumber}</th>

-		<th>${uiLabelMap.Filename}</th>

-		<th>${uiLabelMap.FromDate}</th>

-		<th>${uiLabelMap.ThruDate}</th>

-		<th>${uiLabelMap.ImportStatus}</th>

-		<th>${uiLabelMap.ThruReasonId}</th>

-		<th>${uiLabelMap.Actions}</th>

-	</thead>

-	<tbody>

-		<#if (data?has_content)>

-			<#list data as historyEntry>

-				<tr name="${historyEntry.sequenceNum!}">

-					<td>

-					<#if historyEntry.statusId?exists && historyEntry.statusId == 'EXCEL_IMPORTING'>

-						<img src="/erptheme/images/blue_anime.gif" alt="${uiLabelMap.EXCE_IMPORTING}" tooltip="${uiLabelMap.EXCE_IMPORTING}">

-					<#elseif historyEntry.statusId?exists && historyEntry.statusId == 'EXCEL_IMPORTED' && historyEntry.thruReasonId?exists && historyEntry.thruReasonId?has_content>

-						<#if historyEntry.thruReasonId == 'EXCEL_IMPORT_SUCCESS'>

-						<button id="excel-import-status" data-tooltip="${uiLabelMap.get(historyEntry.thruReasonId)}"><i class="icon-ok-sign success-color">${uiLabelMap.ReasonOK}</i></button>

-						<#elseif historyEntry.thruReasonId == 'EXCEL_IMPORT_STOPPED'>

-						<button id="excel-import-status" data-tooltip="${uiLabelMap.get(historyEntry.thruReasonId)}"><i class="icon-remove-sign stopped-color">${uiLabelMap.ReasonStopped}</i></button>

-						<#elseif historyEntry.thruReasonId == 'EXCEL_IMPORT_ERROR'>

-						<button id="excel-import-status" data-tooltip="${uiLabelMap.get(historyEntry.thruReasonId)}"><i class="icon-exclamation-sign error-color"></i>${uiLabelMap.ReasonError}</button>

-						<#elseif historyEntry.thruReasonId == 'EXCEL_IMPORT_QUEST'>

-						<button id="excel-import-status" data-tooltip="${uiLabelMap.get(historyEntry.thruReasonId)}"><i class="icon-question-sign question-color"></i>${uiLabelMap.ReasonWarning}</button>

-						</#if>

-					</#if>

-					</td>

-					<td>${historyEntry.sequenceNum!}</td>

-  					<td style="text-align:right;">${historyEntry.fileName!}</td>

-					<td><#if historyEntry.fromDate?exists && historyEntry.fromDate?has_content>${historyEntry.fromDate?string("yyyy-MM-dd HH:mm:ss")}</#if></td>

-					<td><#if historyEntry.thruDate?exists && historyEntry.thruDate?has_content>${historyEntry.thruDate?string("yyyy-MM-dd HH:mm:ss")}</#if></td>

-					<td><#if historyEntry.statusId?exists && historyEntry.statusId?has_content>${uiLabelMap.get(historyEntry.statusId)}</#if></td>

-					<td><#if historyEntry.statusId?exists && historyEntry.statusId == "EXCEL_IMPORTED" && historyEntry.thruReasonId?exists && historyEntry.thruReasonId?has_content>${uiLabelMap.get(historyEntry.thruReasonId)}</#if></td>

-					<td>

-						<#assign buttons = 0 />

-						<#if historyEntry.logFileName?exists && historyEntry.logFileName?has_content>

-							<#if Static["org.apache.ofbiz.base.util.FileUtil"].getFile(historyEntry.logFileName).exists()>

-                    		<button id="excel-import-log" type="button" onclick="viewExcelImportLog(${historyEntry.sequenceNum});" data-tooltip="${uiLabelMap.ViewExcelImportLogContent}">

-					    		<i class="icon-comments icon-blue">${uiLabelMap.ViewPricatLog}</i>

-				    		</button>

-				    		<#assign buttons = buttons + 1 />

-					        </#if>

+    <thead>

+        <th></th>

+        <th>${uiLabelMap.SerialNumber}</th>

+        <th>${uiLabelMap.Filename}</th>

+        <th>${uiLabelMap.FromDate}</th>

+        <th>${uiLabelMap.ThruDate}</th>

+        <th>${uiLabelMap.ImportStatus}</th>

+        <th>${uiLabelMap.ThruReasonId}</th>

+        <th>${uiLabelMap.Actions}</th>

+    </thead>

+    <tbody>

+        <#if (data?has_content)>

+            <#list data as historyEntry>

+                <tr name="${historyEntry.sequenceNum!}">

+                    <td>

+                    <#if historyEntry.statusId?exists && historyEntry.statusId == 'EXCEL_IMPORTING'>

+                        <img src="/erptheme/images/blue_anime.gif" alt="${uiLabelMap.EXCE_IMPORTING}" tooltip="${uiLabelMap.EXCE_IMPORTING}">

+                    <#elseif historyEntry.statusId?exists && historyEntry.statusId == 'EXCEL_IMPORTED' && historyEntry.thruReasonId?exists && historyEntry.thruReasonId?has_content>

+                        <#if historyEntry.thruReasonId == 'EXCEL_IMPORT_SUCCESS'>

+                        <button id="excel-import-status" data-tooltip="${uiLabelMap.get(historyEntry.thruReasonId)}"><i class="icon-ok-sign success-color">${uiLabelMap.ReasonOK}</i></button>

+                        <#elseif historyEntry.thruReasonId == 'EXCEL_IMPORT_STOPPED'>

+                        <button id="excel-import-status" data-tooltip="${uiLabelMap.get(historyEntry.thruReasonId)}"><i class="icon-remove-sign stopped-color">${uiLabelMap.ReasonStopped}</i></button>

+                        <#elseif historyEntry.thruReasonId == 'EXCEL_IMPORT_ERROR'>

+                        <button id="excel-import-status" data-tooltip="${uiLabelMap.get(historyEntry.thruReasonId)}"><i class="icon-exclamation-sign error-color"></i>${uiLabelMap.ReasonError}</button>

+                        <#elseif historyEntry.thruReasonId == 'EXCEL_IMPORT_QUEST'>

+                        <button id="excel-import-status" data-tooltip="${uiLabelMap.get(historyEntry.thruReasonId)}"><i class="icon-question-sign question-color"></i>${uiLabelMap.ReasonWarning}</button>

                         </#if>

-						<#if buttons == 0>

-                    		<#--- <button id="excel-import-empty" type="button"></button> -->

-				    		<#assign buttons = buttons + 1 />

-						</#if>

-						<#if historyEntry.logFileName?exists && historyEntry.logFileName?has_content>

-							<#if Static["org.apache.ofbiz.pricat.AbstractPricatParser"].isCommentedExcelExists(request, historyEntry.sequenceNum)>

-                    		<button id="excel-import-download" type="button" onclick="downloadCommentedExcel(${historyEntry.sequenceNum});" data-tooltip="${uiLabelMap.DownloadCommentedExcel}">

-					    		<i class="icon-download icon-blue">${uiLabelMap.DownloadCommentedPricat}</i>

-				    		</button>

-				    		<#assign buttons = buttons + 1 />

-					        </#if>

-                        </#if>

-						<#if buttons == 1>

-                    		<#--- <button id="excel-import-empty" type="button"></button> -->

-						</#if>

+                    </#if>

                     </td>

-				</tr>

-			</#list>

-		<#else>

-			<tr>

-				<td colspan="10" style="text-align:center;vertical-align:middle;height:60px;">

-					${uiLabelMap.ExcelImportTipNoData}

-				</td>

-			</tr>

-		</#if>

-	</tbody>

+                    <td>${historyEntry.sequenceNum!}</td>

+                      <td style="text-align:right;">${historyEntry.fileName!}</td>

+                    <td><#if historyEntry.fromDate?exists && historyEntry.fromDate?has_content>${historyEntry.fromDate?string("yyyy-MM-dd HH:mm:ss")}</#if></td>

+                    <td><#if historyEntry.thruDate?exists && historyEntry.thruDate?has_content>${historyEntry.thruDate?string("yyyy-MM-dd HH:mm:ss")}</#if></td>

+                    <td><#if historyEntry.statusId?exists && historyEntry.statusId?has_content>${uiLabelMap.get(historyEntry.statusId)}</#if></td>

+                    <td><#if historyEntry.statusId?exists && historyEntry.statusId == "EXCEL_IMPORTED" && historyEntry.thruReasonId?exists && historyEntry.thruReasonId?has_content>${uiLabelMap.get(historyEntry.thruReasonId)}</#if></td>

+                    <td>

+                        <#assign buttons = 0 />

+                        <#if historyEntry.logFileName?exists && historyEntry.logFileName?has_content>

+                            <#if Static["org.apache.ofbiz.base.util.FileUtil"].getFile(historyEntry.logFileName).exists()>

+                            <button id="excel-import-log" type="button" onclick="viewExcelImportLog(${historyEntry.sequenceNum});" data-tooltip="${uiLabelMap.ViewExcelImportLogContent}">

+                                <i class="icon-comments icon-blue">${uiLabelMap.ViewPricatLog}</i>

+                            </button>

+                            <#assign buttons = buttons + 1 />

+                            </#if>

+                        </#if>

+                        <#if buttons == 0>

+                            <#--- <button id="excel-import-empty" type="button"></button> -->

+                            <#assign buttons = buttons + 1 />

+                        </#if>

+                        <#if historyEntry.logFileName?exists && historyEntry.logFileName?has_content>

+                            <#if Static["org.apache.ofbiz.pricat.AbstractPricatParser"].isCommentedExcelExists(request, historyEntry.sequenceNum)>

+                            <button id="excel-import-download" type="button" onclick="downloadCommentedExcel(${historyEntry.sequenceNum});" data-tooltip="${uiLabelMap.DownloadCommentedExcel}">

+                                <i class="icon-download icon-blue">${uiLabelMap.DownloadCommentedPricat}</i>

+                            </button>

+                            <#assign buttons = buttons + 1 />

+                            </#if>

+                        </#if>

+                        <#if buttons == 1>

+                            <#--- <button id="excel-import-empty" type="button"></button> -->

+                        </#if>

+                    </td>

+                </tr>

+            </#list>

+        <#else>

+            <tr>

+                <td colspan="10" style="text-align:center;vertical-align:middle;height:60px;">

+                    ${uiLabelMap.ExcelImportTipNoData}

+                </td>

+            </tr>

+        </#if>

+    </tbody>

 </table>

 <script type="text/javascript" language="JavaScript">

-	function viewExcelImportLog(sequenceNum) {

+    function viewExcelImportLog(sequenceNum) {

         document.location = "<@ofbizUrl>viewExcelImportLog</@ofbizUrl>?sequenceNum=" + sequenceNum;

     }

 

-	function downloadCommentedExcel(sequenceNum) {

+    function downloadCommentedExcel(sequenceNum) {

         document.location = "<@ofbizUrl>downloadCommentedExcel</@ofbizUrl>?sequenceNum=" + sequenceNum;

     }

 </script>
\ No newline at end of file
diff --git a/specialpurpose/pricat/webapp/pricat/ftl/pricatreport.ftl b/specialpurpose/pricat/webapp/pricat/ftl/pricatreport.ftl
index d539bcf..010d765 100644
--- a/specialpurpose/pricat/webapp/pricat/ftl/pricatreport.ftl
+++ b/specialpurpose/pricat/webapp/pricat/ftl/pricatreport.ftl
@@ -19,111 +19,111 @@
 <#assign report = Static["org.apache.ofbiz.htmlreport.HtmlReport"].getInstance(request, response)>
 <#assign resourceParam = "resource"
          borderStyle = "2px inset ThreeDHighlight"
-	     borderSimpleStyle = "2px solid ThreeDFace">
+         borderSimpleStyle = "2px solid ThreeDFace">
 <#if report.isMultiOperation(request)?string("true", "false") == "true">
-	<#assign resourceParam = null>
+    <#assign resourceParam = null>
 </#if>
 <#assign action = report.getParamAction(request)>
 <#-- start of switch statement -->
 <#switch action>
-	<#case "reportupdate">
+    <#case "reportupdate">
 <#-- ACTION: get report update -->
-		<#assign htmlStart = report.htmlStart(false)>
-		${StringUtil.wrapString(htmlStart)}
+        <#assign htmlStart = report.htmlStart(false)>
+        ${StringUtil.wrapString(htmlStart)}
 
 <script language='JavaScript'>
 <!--
 
 function a(message) {
-	parent.append(message);
+    parent.append(message);
 }
 
 function aH(message) {
-	parent.appendHead(message);
+    parent.appendHead(message);
 }
 
 function aW(message) {
-	parent.appendWarning(message);
+    parent.appendWarning(message);
 }
 
 function aE(message) {
-	parent.appendError(message);
+    parent.appendError(message);
 }
 
 function aN(message) {
-	parent.appendNote(message);
+    parent.appendNote(message);
 }
 
 function aO(message) {
-	parent.appendOk(message);
+    parent.appendOk(message);
 }
 
 function aT(message) {
-	parent.appendThrowable(message);
+    parent.appendThrowable(message);
 }
 
 function aB() {
-	parent.appendBr();
+    parent.appendBr();
 }
 
 var active = null;
 
 function init() {
-	if (active != null) {
-		clearTimeout(active);
-	}
-	<#assign alive = report.isAlive(request)?string("true", "false")>
+    if (active != null) {
+        clearTimeout(active);
+    }
+    <#assign alive = report.isAlive(request)?string("true", "false")>
   var alive=${alive};
     
   parent.flushArray();
 
 ${StringUtil.wrapString(report.getReportUpdate())}
-	
+    
   parent.update();
-	if (alive) {
-    	active = setTimeout("reload('reportupdate');", 2000);
+    if (alive) {
+        active = setTimeout("reload('reportupdate');", 2000);
   } else {
-   	var hasNext = "${report.getParamThreadHasNext(request)}";
-   	if (hasNext == "true") {
-   			if (!${report.hasError()?string("true", "false")} || parent.isContinueChecked()) {
-   				// all actions ok or continue checked, continue automatically
-   				continueReport();
-   			} else {
-   				// wait for user interaction
-   				setTimeout('parent.stop();', 10);
-   			}// end hasError
-   	} else {
-   			  setTimeout('parent.stop();', 10);
-   	}// end hasNext
+       var hasNext = "${report.getParamThreadHasNext(request)}";
+       if (hasNext == "true") {
+               if (!${report.hasError()?string("true", "false")} || parent.isContinueChecked()) {
+                   // all actions ok or continue checked, continue automatically
+                   continueReport();
+               } else {
+                   // wait for user interaction
+                   setTimeout('parent.stop();', 10);
+               }// end hasError
+       } else {
+                 setTimeout('parent.stop();', 10);
+       }// end hasNext
   }// end alive
 }
 
 function reload(actionParam) {
     <#assign resName = report.getResourceList(request).get(0)>
-	var resName = "${resName}";
-	if (resName != "") {
-		resName = "&resource=" + encodeURIComponent(resName);
-	}
-	<#assign dialogUri = report.getDialogRealUri(request)
-	         thread = report.getParamThread(request)
-	         threadhasnext = report.getParamThreadHasNext(request)>
-	location.href="${StringUtil.wrapString(dialogUri)}?action=" + actionParam + "&thread=${thread}&threadhasnext=${threadhasnext}" + resName;
+    var resName = "${resName}";
+    if (resName != "") {
+        resName = "&resource=" + encodeURIComponent(resName);
+    }
+    <#assign dialogUri = report.getDialogRealUri(request)
+             thread = report.getParamThread(request)
+             threadhasnext = report.getParamThreadHasNext(request)>
+    location.href="${StringUtil.wrapString(dialogUri)}?action=" + actionParam + "&thread=${thread}&threadhasnext=${threadhasnext}" + resName;
 }
 
 
 
 function continueReport() {
-	if (!parent.buttonsInitialized) {
-		parent.initButtons();
-	}
-	parent.disableButtons("buttonrowok");
-	parent.displayButtonRowOk();
-	parent.hasError = false;
-	parent.lastError = "";	
-	setTimeout("reload('reportend');", 2000);
-	if (parent.document.main.threadhasnext) {
-		parent.document.main.threadhasnext.value = "false";
-	}
+    if (!parent.buttonsInitialized) {
+        parent.initButtons();
+    }
+    parent.disableButtons("buttonrowok");
+    parent.displayButtonRowOk();
+    parent.hasError = false;
+    parent.lastError = "";    
+    setTimeout("reload('reportend');", 2000);
+    if (parent.document.main.threadhasnext) {
+        parent.document.main.threadhasnext.value = "false";
+    }
 }
 
 // -->
@@ -133,11 +133,11 @@
     ${StringUtil.wrapString(report.bodyEnd())}
     ${StringUtil.wrapString(report.htmlEnd())}
 
-		<#break>
-	<#-- ACTION: report begin -->
-	<#case "reportbegin">
-	<#default>
-		${report.setParamAction("reportend")}
+        <#break>
+    <#-- ACTION: report begin -->
+    <#case "reportbegin">
+    <#default>
+        ${report.setParamAction("reportend")}
 
 ${StringUtil.wrapString(report.htmlStart())}
 
@@ -180,46 +180,46 @@
 var buttonsInitialized = false;
 
 function append(message) {
-	reportOutputFormats.push(FORMAT_DEFAULT);
-	reportOutputMessages.push(message);
+    reportOutputFormats.push(FORMAT_DEFAULT);
+    reportOutputMessages.push(message);
 }
 
 function appendHead(message) {
-	reportOutputFormats.push(FORMAT_HEADLINE);
-	reportOutputMessages.push(message);
-	lastHeadline = "" + message;
+    reportOutputFormats.push(FORMAT_HEADLINE);
+    reportOutputMessages.push(message);
+    lastHeadline = "" + message;
 }
 
 function appendWarning(message) {
-	reportOutputFormats.push(FORMAT_WARNING);
-	reportOutputMessages.push(message);
+    reportOutputFormats.push(FORMAT_WARNING);
+    reportOutputMessages.push(message);
 }
 
 function appendError(message) {
-	reportOutputFormats.push(FORMAT_ERROR);
-	reportOutputMessages.push(message);
-	hasError = true;
-	lastError = message;
+    reportOutputFormats.push(FORMAT_ERROR);
+    reportOutputMessages.push(message);
+    hasError = true;
+    lastError = message;
 }
 
 function appendNote(message) {
-	reportOutputFormats.push(FORMAT_NOTE);
-	reportOutputMessages.push(message);
+    reportOutputFormats.push(FORMAT_NOTE);
+    reportOutputMessages.push(message);
 }
 
 function appendOk(message) {
-	reportOutputFormats.push(FORMAT_OK);
-	reportOutputMessages.push(message);
+    reportOutputFormats.push(FORMAT_OK);
+    reportOutputMessages.push(message);
 }
 
 function appendThrowable(message) {
-	reportOutputFormats.push(FORMAT_THROWABLE);
-	reportOutputMessages.push(message);
+    reportOutputFormats.push(FORMAT_THROWABLE);
+    reportOutputMessages.push(message);
 }
 
 function appendBr() {
-	reportOutputFormats.push(FORMAT_NEWLINE);
-	reportOutputMessages.push("");
+    reportOutputFormats.push(FORMAT_NEWLINE);
+    reportOutputMessages.push("");
 }
 
 var cssStyle =
@@ -250,54 +250,54 @@
     "<td valign='middle'>";
     
 var pageEndSimple = 
-	"</td></tr>\n" +
-	"</table></div>\n" +
-	"</body>\n</html>";    
+    "</td></tr>\n" +
+    "</table></div>\n" +
+    "</body>\n</html>";    
 
 var pageStartExtended =
     "<html>\n<head>\n" +
     "<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=UTF-8'>\n"+ 
-	cssStyle +
+    cssStyle +
     "</head>\n" +
     "<body style='overflow: auto;'>\n" +  
     "<div class='main'>\n";
     
 var pageEndExtended = 
-	"</div>\n" +
-	"</body>\n" +
-	"</html>\n";                                
+    "</div>\n" +
+    "</body>\n" +
+    "</html>\n";                                
 
 function start() {
 
-	isRunning = true;
+    isRunning = true;
 
-	initButtons();
+    initButtons();
 }
 
 function stop() {
-	isRunning = false;
-	
-	if (document.main.threadhasnext) {
-		document.main.threadhasnext.value = "false";
-	}
-	enableButtons("buttonrowcontinue");
-	enableButtons("buttonrowok");
-	
-	updateReport();	
+    isRunning = false;
+    
+    if (document.main.threadhasnext) {
+        document.main.threadhasnext.value = "false";
+    }
+    enableButtons("buttonrowcontinue");
+    enableButtons("buttonrowok");
+    
+    updateReport();    
 }
 
 // flush the arrays with the report formats and messages
-function flushArray() {	
+function flushArray() {    
     reportOutputFormats = new Array();
-	reportOutputMessages = new Array();	
+    reportOutputMessages = new Array();    
 }
 
 // updates the report, builds the HTML string from the JavaScript input
 function update() {
 
-	var size = 512000; 
+    var size = 512000; 
 
-	// resize the HTML string
+    // resize the HTML string
     if (htmlText.length > size) {
         htmlText = htmlText.substring(htmlText.length - size, htmlText.length);
         var pos = htmlText.indexOf("\n"); 
@@ -305,21 +305,21 @@
             // cut output at the first linebreak to have a "nice" start
             htmlText = htmlText.substring(pos, htmlText.length);      
         }
-    }    	
-	
-	// append the HTML of the extended report format to the HTML string
+    }        
+    
+    // append the HTML of the extended report format to the HTML string
     htmlText += getContentExtended();
-		
-	// write the HTML output to the iframe
-	updateReport();
+        
+    // write the HTML output to the iframe
+    updateReport();
 }
 
 // writes the HTML output to the iframe
 // this function gets also invoked when the report output format is toggled
 function updateReport() {
 
-   	pageBody = pageStartExtended + htmlText + pageEndExtended;
-   	document.getElementById("report").style.border = "${borderStyle}";
+       pageBody = pageStartExtended + htmlText + pageEndExtended;
+       document.getElementById("report").style.border = "${borderStyle}";
     report.document.open();    
     report.document.write(pageBody);
     report.document.close();
@@ -329,122 +329,122 @@
 
 // builds the HTML string from the JavaScript input
 function getContentExtended() {
-	var htmlStr = "";
-	var i = 0;
-	for (i=0;i<reportOutputFormats.length && i<reportOutputMessages.length;i++) {
-		switch (reportOutputFormats[i]) {
-			case FORMAT_WARNING :
-				htmlStr += "<span class='warn'>";
-				htmlStr += reportOutputMessages[i];
-				htmlStr += "</span>";
-				break;
-			case FORMAT_ERROR :
-				htmlStr += "<span class='err'>";
-				htmlStr += reportOutputMessages[i];
-				htmlStr += "</span>";
-				break;
-			case FORMAT_HEADLINE :
-				htmlStr += "<span class='head'>";
-				htmlStr += reportOutputMessages[i];
-				htmlStr += "</span>";			
-				break;
-			case FORMAT_NOTE :
-				htmlStr += "<span class='note'>";
-				htmlStr += reportOutputMessages[i];
-				htmlStr += "</span>";			
-				break;
-			case FORMAT_OK :
-				htmlStr += "<span class='ok'>";
-				htmlStr += reportOutputMessages[i];
-				htmlStr += "</span>";			
-				break;	
-			case FORMAT_NEWLINE :
-				htmlStr += "\n";
-				break;	
-			case FORMAT_THROWABLE :
-				htmlStr += "<span class='throw'>";
-				htmlStr += reportOutputMessages[i];
-				htmlStr += "</span>";			
-				break;
-			case FORMAT_DEFAULT :			
-			default :
-				htmlStr += "<span>";
-				htmlStr += reportOutputMessages[i];			
-				htmlStr += "</span>";							
-		}
-	}
-	
-	return htmlStr;
+    var htmlStr = "";
+    var i = 0;
+    for (i=0;i<reportOutputFormats.length && i<reportOutputMessages.length;i++) {
+        switch (reportOutputFormats[i]) {
+            case FORMAT_WARNING :
+                htmlStr += "<span class='warn'>";
+                htmlStr += reportOutputMessages[i];
+                htmlStr += "</span>";
+                break;
+            case FORMAT_ERROR :
+                htmlStr += "<span class='err'>";
+                htmlStr += reportOutputMessages[i];
+                htmlStr += "</span>";
+                break;
+            case FORMAT_HEADLINE :
+                htmlStr += "<span class='head'>";
+                htmlStr += reportOutputMessages[i];
+                htmlStr += "</span>";            
+                break;
+            case FORMAT_NOTE :
+                htmlStr += "<span class='note'>";
+                htmlStr += reportOutputMessages[i];
+                htmlStr += "</span>";            
+                break;
+            case FORMAT_OK :
+                htmlStr += "<span class='ok'>";
+                htmlStr += reportOutputMessages[i];
+                htmlStr += "</span>";            
+                break;    
+            case FORMAT_NEWLINE :
+                htmlStr += "\n";
+                break;    
+            case FORMAT_THROWABLE :
+                htmlStr += "<span class='throw'>";
+                htmlStr += reportOutputMessages[i];
+                htmlStr += "</span>";            
+                break;
+            case FORMAT_DEFAULT :            
+            default :
+                htmlStr += "<span>";
+                htmlStr += reportOutputMessages[i];            
+                htmlStr += "</span>";                            
+        }
+    }
+    
+    return htmlStr;
 }
 
 function doScroll() {
-	var pos = 1000000;
+    var pos = 1000000;
     report.window.scrollTo(0, pos);
 }
 
 function isContinueChecked() {
-	if (document.main.continuereport && document.main.continuereport.checked == true) {
-		return true;
-	} else {
-		return false;
-	}
+    if (document.main.continuereport && document.main.continuereport.checked == true) {
+        return true;
+    } else {
+        return false;
+    }
 }
 
 function displayButtonRowContinue() {
-	displayButtonRow("buttonrowcontinue", true);
-	displayButtonRow("checkcontinue", true);
-	displayButtonRow("buttonrowok", false);
+    displayButtonRow("buttonrowcontinue", true);
+    displayButtonRow("checkcontinue", true);
+    displayButtonRow("buttonrowok", false);
 }
 
 function displayButtonRowOk() {
-	displayButtonRow("buttonrowcontinue", false);
-	toggleButton("continuereport", true);
-	displayButtonRow("buttonrowok", true);
+    displayButtonRow("buttonrowcontinue", false);
+    toggleButton("continuereport", true);
+    displayButtonRow("buttonrowok", true);
 }
 
 function displayButtonRow(rowId, show) {
-	if (show) {
-		document.getElementById(rowId).className = "show";
-	} else {
-		document.getElementById(rowId).className = "hide";
-	}
+    if (show) {
+        document.getElementById(rowId).className = "show";
+    } else {
+        document.getElementById(rowId).className = "hide";
+    }
 }
 
 function enableButtons(rowId) {
-	if (rowId == "buttonrowcontinue") {
-		toggleButton("contok", false);
-		toggleButton("contcancel", false);
-	} else {
-		toggleButton("okclose", false);
-	}
+    if (rowId == "buttonrowcontinue") {
+        toggleButton("contok", false);
+        toggleButton("contcancel", false);
+    } else {
+        toggleButton("okclose", false);
+    }
 }
 
 function disableButtons(rowId) {
-	if (rowId == "buttonrowcontinue") {
-		toggleButton("contok", true);
-		toggleButton("contcancel", true);
-	} else {
-		toggleButton("okclose", true);
-		toggleButton("okcancel", true);
-	}
+    if (rowId == "buttonrowcontinue") {
+        toggleButton("contok", true);
+        toggleButton("contcancel", true);
+    } else {
+        toggleButton("okclose", true);
+        toggleButton("okcancel", true);
+    }
 }
 
 function toggleButton(buttonId, disableButton) {
-	if (document.getElementById(buttonId))  {
-		document.getElementById(buttonId).disabled = disableButton;
-	}
+    if (document.getElementById(buttonId))  {
+        document.getElementById(buttonId).disabled = disableButton;
+    }
 }
 
 function initButtons() {
-	if (document.main.threadhasnext && document.main.threadhasnext.value == "true"
-			&& document.main.reportcontinuekey && document.main.reportcontinuekey.value != "") {
-		displayButtonRowContinue();
-	} else {
-		displayButtonRowOk();
-	}
-	disableButtons("buttonrowcontinue");
-	disableButtons("buttonrowok");
-	buttonsInitialized = true;
+    if (document.main.threadhasnext && document.main.threadhasnext.value == "true"
+            && document.main.reportcontinuekey && document.main.reportcontinuekey.value != "") {
+        displayButtonRowContinue();
+    } else {
+        displayButtonRowOk();
+    }
+    disableButtons("buttonrowcontinue");
+    disableButtons("buttonrowok");
+    buttonsInitialized = true;
 }
 
 function submitActionRefresh(para1, para2, para3) {
@@ -491,7 +491,7 @@
 
 <table border="0" cellpadding="0" cellspacing="0" width="100%" height="400">
 <tr>
-	<td><iframe name="report" id="report" src="about:blank" frameborder="0" style="width:99.8%; height:400px; padding: 0; margin: 0; border: ${borderStyle};"></iframe></td>
+    <td><iframe name="report" id="report" src="about:blank" frameborder="0" style="width:99.8%; height:400px; padding: 0; margin: 0; border: ${borderStyle};"></iframe></td>
 </tr>
 </table>
 
diff --git a/specialpurpose/pricat/webapp/pricat/ftl/report.ftl b/specialpurpose/pricat/webapp/pricat/ftl/report.ftl
index bb6c30c..8e8a45d 100644
--- a/specialpurpose/pricat/webapp/pricat/ftl/report.ftl
+++ b/specialpurpose/pricat/webapp/pricat/ftl/report.ftl
@@ -19,111 +19,111 @@
 <#assign report = Static["org.apache.ofbiz.htmlreport.HtmlReport"].getInstance(request, response)>
 <#assign resourceParam = "resource"
          borderStyle = "2px inset ThreeDHighlight"
-	     borderSimpleStyle = "2px solid ThreeDFace">
+         borderSimpleStyle = "2px solid ThreeDFace">
 <#if report.isMultiOperation(request)?string("true", "false") == "true">
-	<#assign resourceParam = null>
+    <#assign resourceParam = null>
 </#if>
 <#assign action = report.getParamAction(request)>
 <#-- start of switch statement -->
 <#switch action>
-	<#case "reportupdate">
+    <#case "reportupdate">
 <#-- ACTION: get report update -->
-		<#assign htmlStart = report.htmlStart(false)>
-		${StringUtil.wrapString(htmlStart)}
+        <#assign htmlStart = report.htmlStart(false)>
+        ${StringUtil.wrapString(htmlStart)}
 
 <script language='JavaScript'>
 <!--
 
 function a(message) {
-	parent.append(message);
+    parent.append(message);
 }
 
 function aH(message) {
-	parent.appendHead(message);
+    parent.appendHead(message);
 }
 
 function aW(message) {
-	parent.appendWarning(message);
+    parent.appendWarning(message);
 }
 
 function aE(message) {
-	parent.appendError(message);
+    parent.appendError(message);
 }
 
 function aN(message) {
-	parent.appendNote(message);
+    parent.appendNote(message);
 }
 
 function aO(message) {
-	parent.appendOk(message);
+    parent.appendOk(message);
 }
 
 function aT(message) {
-	parent.appendThrowable(message);
+    parent.appendThrowable(message);
 }
 
 function aB() {
-	parent.appendBr();
+    parent.appendBr();
 }
 
 var active = null;
 
 function init() {
-	if (active != null) {
-		clearTimeout(active);
-	}
-	<#assign alive = report.isAlive(request)?string("true", "false")>
+    if (active != null) {
+        clearTimeout(active);
+    }
+    <#assign alive = report.isAlive(request)?string("true", "false")>
   var alive=${alive};
     
   parent.flushArray();
 
 ${StringUtil.wrapString(report.getReportUpdate())}
-	
+    
   parent.update();
-	if (alive) {
-    	active = setTimeout("reload('reportupdate');", 2000);
+    if (alive) {
+        active = setTimeout("reload('reportupdate');", 2000);
   } else {
-   	var hasNext = "${report.getParamThreadHasNext(request)}";
-   	if (hasNext == "true") {
-   			if (!${report.hasError()?string("true", "false")} || parent.isContinueChecked()) {
-   				// all actions ok or continue checked, continue automatically
-   				continueReport();
-   			} else {
-   				// wait for user interaction
-   				setTimeout('parent.stop();', 10);
-   			}// end hasError
-   	} else {
-   			  setTimeout('parent.stop();', 10);
-   	}// end hasNext
+       var hasNext = "${report.getParamThreadHasNext(request)}";
+       if (hasNext == "true") {
+               if (!${report.hasError()?string("true", "false")} || parent.isContinueChecked()) {
+                   // all actions ok or continue checked, continue automatically
+                   continueReport();
+               } else {
+                   // wait for user interaction
+                   setTimeout('parent.stop();', 10);
+               }// end hasError
+       } else {
+                 setTimeout('parent.stop();', 10);
+       }// end hasNext
   }// end alive
 }
 
 function reload(actionParam) {
     <#assign resName = report.getResourceList(request).get(0)>
-	var resName = "${resName}";
-	if (resName != "") {
-		resName = "&resource=" + encodeURIComponent(resName);
-	}
-	<#assign dialogUri = report.getDialogRealUri(request)
-	         thread = report.getParamThread(request)
-	         threadhasnext = report.getParamThreadHasNext(request)>
-	location.href="${StringUtil.wrapString(dialogUri)}?&action=" + actionParam + "&thread=${thread}&threadhasnext=${threadhasnext}" + resName;
+    var resName = "${resName}";
+    if (resName != "") {
+        resName = "&resource=" + encodeURIComponent(resName);
+    }
+    <#assign dialogUri = report.getDialogRealUri(request)
+             thread = report.getParamThread(request)
+             threadhasnext = report.getParamThreadHasNext(request)>
+    location.href="${StringUtil.wrapString(dialogUri)}?&action=" + actionParam + "&thread=${thread}&threadhasnext=${threadhasnext}" + resName;
 }
 
 
 
 function continueReport() {
-	if (!parent.buttonsInitialized) {
-		parent.initButtons();
-	}
-	parent.disableButtons("buttonrowok");
-	parent.displayButtonRowOk();
-	parent.hasError = false;
-	parent.lastError = "";	
-	setTimeout("reload('reportend');", 2000);
-	if (parent.document.main.threadhasnext) {
-		parent.document.main.threadhasnext.value = "false";
-	}
+    if (!parent.buttonsInitialized) {
+        parent.initButtons();
+    }
+    parent.disableButtons("buttonrowok");
+    parent.displayButtonRowOk();
+    parent.hasError = false;
+    parent.lastError = "";    
+    setTimeout("reload('reportend');", 2000);
+    if (parent.document.main.threadhasnext) {
+        parent.document.main.threadhasnext.value = "false";
+    }
 }
 
 // -->
@@ -133,11 +133,11 @@
     ${StringUtil.wrapString(report.bodyEnd())}
     ${StringUtil.wrapString(report.htmlEnd())}
 
-		<#break>
-	<#-- ACTION: report begin -->
-	<#case "reportbegin">
-	<#default>
-		${report.setParamAction("reportend")}
+        <#break>
+    <#-- ACTION: report begin -->
+    <#case "reportbegin">
+    <#default>
+        ${report.setParamAction("reportend")}
 
 ${StringUtil.wrapString(report.htmlStart())}
 
@@ -180,46 +180,46 @@
 var buttonsInitialized = false;
 
 function append(message) {
-	reportOutputFormats.push(FORMAT_DEFAULT);
-	reportOutputMessages.push(message);
+    reportOutputFormats.push(FORMAT_DEFAULT);
+    reportOutputMessages.push(message);
 }
 
 function appendHead(message) {
-	reportOutputFormats.push(FORMAT_HEADLINE);
-	reportOutputMessages.push(message);
-	lastHeadline = "" + message;
+    reportOutputFormats.push(FORMAT_HEADLINE);
+    reportOutputMessages.push(message);
+    lastHeadline = "" + message;
 }
 
 function appendWarning(message) {
-	reportOutputFormats.push(FORMAT_WARNING);
-	reportOutputMessages.push(message);
+    reportOutputFormats.push(FORMAT_WARNING);
+    reportOutputMessages.push(message);
 }
 
 function appendError(message) {
-	reportOutputFormats.push(FORMAT_ERROR);
-	reportOutputMessages.push(message);
-	hasError = true;
-	lastError = message;
+    reportOutputFormats.push(FORMAT_ERROR);
+    reportOutputMessages.push(message);
+    hasError = true;
+    lastError = message;
 }
 
 function appendNote(message) {
-	reportOutputFormats.push(FORMAT_NOTE);
-	reportOutputMessages.push(message);
+    reportOutputFormats.push(FORMAT_NOTE);
+    reportOutputMessages.push(message);
 }
 
 function appendOk(message) {
-	reportOutputFormats.push(FORMAT_OK);
-	reportOutputMessages.push(message);
+    reportOutputFormats.push(FORMAT_OK);
+    reportOutputMessages.push(message);
 }
 
 function appendThrowable(message) {
-	reportOutputFormats.push(FORMAT_THROWABLE);
-	reportOutputMessages.push(message);
+    reportOutputFormats.push(FORMAT_THROWABLE);
+    reportOutputMessages.push(message);
 }
 
 function appendBr() {
-	reportOutputFormats.push(FORMAT_NEWLINE);
-	reportOutputMessages.push("");
+    reportOutputFormats.push(FORMAT_NEWLINE);
+    reportOutputMessages.push("");
 }
 
 var cssStyle =
@@ -250,54 +250,54 @@
     "<td valign='middle'>";
     
 var pageEndSimple = 
-	"</td></tr>\n" +
-	"</table></div>\n" +
-	"</body>\n</html>";    
+    "</td></tr>\n" +
+    "</table></div>\n" +
+    "</body>\n</html>";    
 
 var pageStartExtended =
     "<html>\n<head>\n" +
     "<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=UTF-8'>\n"+ 
-	cssStyle +
+    cssStyle +
     "</head>\n" +
     "<body style='overflow: auto;'>\n" +  
     "<div class='main'>\n";
     
 var pageEndExtended = 
-	"</div>\n" +
-	"</body>\n" +
-	"</html>\n";                                
+    "</div>\n" +
+    "</body>\n" +
+    "</html>\n";                                
 
 function start() {
 
-	isRunning = true;
+    isRunning = true;
 
-	initButtons();
+    initButtons();
 }
 
 function stop() {
-	isRunning = false;
-	
-	if (document.main.threadhasnext) {
-		document.main.threadhasnext.value = "false";
-	}
-	enableButtons("buttonrowcontinue");
-	enableButtons("buttonrowok");
-	
-	updateReport();	
+    isRunning = false;
+    
+    if (document.main.threadhasnext) {
+        document.main.threadhasnext.value = "false";
+    }
+    enableButtons("buttonrowcontinue");
+    enableButtons("buttonrowok");
+    
+    updateReport();    
 }
 
 // flush the arrays with the report formats and messages
-function flushArray() {	
+function flushArray() {    
     reportOutputFormats = new Array();
-	reportOutputMessages = new Array();	
+    reportOutputMessages = new Array();    
 }
 
 // updates the report, builds the HTML string from the JavaScript input
 function update() {
 
-	var size = 512000; 
+    var size = 512000; 
 
-	// resize the HTML string
+    // resize the HTML string
     if (htmlText.length > size) {
         htmlText = htmlText.substring(htmlText.length - size, htmlText.length);
         var pos = htmlText.indexOf("\n"); 
@@ -305,21 +305,21 @@
             // cut output at the first linebreak to have a "nice" start
             htmlText = htmlText.substring(pos, htmlText.length);      
         }
-    }    	
-	
-	// append the HTML of the extended report format to the HTML string
+    }        
+    
+    // append the HTML of the extended report format to the HTML string
     htmlText += getContentExtended();
-		
-	// write the HTML output to the iframe
-	updateReport();
+        
+    // write the HTML output to the iframe
+    updateReport();
 }
 
 // writes the HTML output to the iframe
 // this function gets also invoked when the report output format is toggled
 function updateReport() {
 
-   	pageBody = pageStartExtended + htmlText + pageEndExtended;
-   	document.getElementById("report").style.border = "${borderStyle}";
+       pageBody = pageStartExtended + htmlText + pageEndExtended;
+       document.getElementById("report").style.border = "${borderStyle}";
     report.document.open();    
     report.document.write(pageBody);
     report.document.close();
@@ -329,122 +329,122 @@
 
 // builds the HTML string from the JavaScript input
 function getContentExtended() {
-	var htmlStr = "";
-	var i = 0;
-	for (i=0;i<reportOutputFormats.length && i<reportOutputMessages.length;i++) {
-		switch (reportOutputFormats[i]) {
-			case FORMAT_WARNING :
-				htmlStr += "<span class='warn'>";
-				htmlStr += reportOutputMessages[i];
-				htmlStr += "</span>";
-				break;
-			case FORMAT_ERROR :
-				htmlStr += "<span class='err'>";
-				htmlStr += reportOutputMessages[i];
-				htmlStr += "</span>";
-				break;
-			case FORMAT_HEADLINE :
-				htmlStr += "<span class='head'>";
-				htmlStr += reportOutputMessages[i];
-				htmlStr += "</span>";			
-				break;
-			case FORMAT_NOTE :
-				htmlStr += "<span class='note'>";
-				htmlStr += reportOutputMessages[i];
-				htmlStr += "</span>";			
-				break;
-			case FORMAT_OK :
-				htmlStr += "<span class='ok'>";
-				htmlStr += reportOutputMessages[i];
-				htmlStr += "</span>";			
-				break;	
-			case FORMAT_NEWLINE :
-				htmlStr += "\n";
-				break;	
-			case FORMAT_THROWABLE :
-				htmlStr += "<span class='throw'>";
-				htmlStr += reportOutputMessages[i];
-				htmlStr += "</span>";			
-				break;
-			case FORMAT_DEFAULT :			
-			default :
-				htmlStr += "<span>";
-				htmlStr += reportOutputMessages[i];			
-				htmlStr += "</span>";							
-		}
-	}
-	
-	return htmlStr;
+    var htmlStr = "";
+    var i = 0;
+    for (i=0;i<reportOutputFormats.length && i<reportOutputMessages.length;i++) {
+        switch (reportOutputFormats[i]) {
+            case FORMAT_WARNING :
+                htmlStr += "<span class='warn'>";
+                htmlStr += reportOutputMessages[i];
+                htmlStr += "</span>";
+                break;
+            case FORMAT_ERROR :
+                htmlStr += "<span class='err'>";
+                htmlStr += reportOutputMessages[i];
+                htmlStr += "</span>";
+                break;
+            case FORMAT_HEADLINE :
+                htmlStr += "<span class='head'>";
+                htmlStr += reportOutputMessages[i];
+                htmlStr += "</span>";            
+                break;
+            case FORMAT_NOTE :
+                htmlStr += "<span class='note'>";
+                htmlStr += reportOutputMessages[i];
+                htmlStr += "</span>";            
+                break;
+            case FORMAT_OK :
+                htmlStr += "<span class='ok'>";
+                htmlStr += reportOutputMessages[i];
+                htmlStr += "</span>";            
+                break;    
+            case FORMAT_NEWLINE :
+                htmlStr += "\n";
+                break;    
+            case FORMAT_THROWABLE :
+                htmlStr += "<span class='throw'>";
+                htmlStr += reportOutputMessages[i];
+                htmlStr += "</span>";            
+                break;
+            case FORMAT_DEFAULT :            
+            default :
+                htmlStr += "<span>";
+                htmlStr += reportOutputMessages[i];            
+                htmlStr += "</span>";                            
+        }
+    }
+    
+    return htmlStr;
 }
 
 function doScroll() {
-	var pos = 1000000;
+    var pos = 1000000;
     report.window.scrollTo(0, pos);
 }
 
 function isContinueChecked() {
-	if (document.main.continuereport && document.main.continuereport.checked == true) {
-		return true;
-	} else {
-		return false;
-	}
+    if (document.main.continuereport && document.main.continuereport.checked == true) {
+        return true;
+    } else {
+        return false;
+    }
 }
 
 function displayButtonRowContinue() {
-	displayButtonRow("buttonrowcontinue", true);
-	displayButtonRow("checkcontinue", true);
-	displayButtonRow("buttonrowok", false);
+    displayButtonRow("buttonrowcontinue", true);
+    displayButtonRow("checkcontinue", true);
+    displayButtonRow("buttonrowok", false);
 }
 
 function displayButtonRowOk() {
-	displayButtonRow("buttonrowcontinue", false);
-	toggleButton("continuereport", true);
-	displayButtonRow("buttonrowok", true);
+    displayButtonRow("buttonrowcontinue", false);
+    toggleButton("continuereport", true);
+    displayButtonRow("buttonrowok", true);
 }
 
 function displayButtonRow(rowId, show) {
-	if (show) {
-		document.getElementById(rowId).className = "show";
-	} else {
-		document.getElementById(rowId).className = "hide";
-	}
+    if (show) {
+        document.getElementById(rowId).className = "show";
+    } else {
+        document.getElementById(rowId).className = "hide";
+    }
 }
 
 function enableButtons(rowId) {
-	if (rowId == "buttonrowcontinue") {
-		toggleButton("contok", false);
-		toggleButton("contcancel", false);
-	} else {
-		toggleButton("okclose", false);
-	}
+    if (rowId == "buttonrowcontinue") {
+        toggleButton("contok", false);
+        toggleButton("contcancel", false);
+    } else {
+        toggleButton("okclose", false);
+    }
 }
 
 function disableButtons(rowId) {
-	if (rowId == "buttonrowcontinue") {
-		toggleButton("contok", true);
-		toggleButton("contcancel", true);
-	} else {
-		toggleButton("okclose", true);
-		toggleButton("okcancel", true);
-	}
+    if (rowId == "buttonrowcontinue") {
+        toggleButton("contok", true);
+        toggleButton("contcancel", true);
+    } else {
+        toggleButton("okclose", true);
+        toggleButton("okcancel", true);
+    }
 }
 
 function toggleButton(buttonId, disableButton) {
-	if (document.getElementById(buttonId))  {
-		document.getElementById(buttonId).disabled = disableButton;
-	}
+    if (document.getElementById(buttonId))  {
+        document.getElementById(buttonId).disabled = disableButton;
+    }
 }
 
 function initButtons() {
-	if (document.main.threadhasnext && document.main.threadhasnext.value == "true"
-			&& document.main.reportcontinuekey && document.main.reportcontinuekey.value != "") {
-		displayButtonRowContinue();
-	} else {
-		displayButtonRowOk();
-	}
-	disableButtons("buttonrowcontinue");
-	disableButtons("buttonrowok");
-	buttonsInitialized = true;
+    if (document.main.threadhasnext && document.main.threadhasnext.value == "true"
+            && document.main.reportcontinuekey && document.main.reportcontinuekey.value != "") {
+        displayButtonRowContinue();
+    } else {
+        displayButtonRowOk();
+    }
+    disableButtons("buttonrowcontinue");
+    disableButtons("buttonrowok");
+    buttonsInitialized = true;
 }
 
 function submitActionRefresh(para1, para2, para3) {
@@ -472,7 +472,7 @@
 
 <table border="0" cellpadding="0" cellspacing="0" width="100%" height="400">
 <tr>
-	<td><iframe name="report" id="report" src="about:blank" frameborder="0" style="width:99.8%; height:400px; padding: 0; margin: 0; border: ${borderStyle};"></iframe></td>
+    <td><iframe name="report" id="report" src="about:blank" frameborder="0" style="width:99.8%; height:400px; padding: 0; margin: 0; border: ${borderStyle};"></iframe></td>
 </tr>
 </table>
 
diff --git a/specialpurpose/pricat/webapp/pricat/ftl/viewExcelImportHistory.ftl b/specialpurpose/pricat/webapp/pricat/ftl/viewExcelImportHistory.ftl
index 70839a2..834fac1 100644
--- a/specialpurpose/pricat/webapp/pricat/ftl/viewExcelImportHistory.ftl
+++ b/specialpurpose/pricat/webapp/pricat/ftl/viewExcelImportHistory.ftl
@@ -17,15 +17,15 @@
 under the License.

 -->

 <div id="wrapper">

-	<div id="page-wrapper" class="gray-bg">

-		<div class="row">

-			<div class="col-lg-12">

-				<div class="ibox float-e-margins">

-					<div class="ibox-content text-left p-md">

-						<#include "component://pricat/webapp/pricat/ftl/ExcelImportHistoryReport.ftl"/>

-					</div>

-				</div>

-			</div>

-		</div>

-	</div>

+    <div id="page-wrapper" class="gray-bg">

+        <div class="row">

+            <div class="col-lg-12">

+                <div class="ibox float-e-margins">

+                    <div class="ibox-content text-left p-md">

+                        <#include "component://pricat/webapp/pricat/ftl/ExcelImportHistoryReport.ftl"/>

+                    </div>

+                </div>

+            </div>

+        </div>

+    </div>

 </div>
\ No newline at end of file
diff --git a/specialpurpose/pricat/webapp/pricat/ftl/viewExcelImportLog.ftl b/specialpurpose/pricat/webapp/pricat/ftl/viewExcelImportLog.ftl
index 256f6c9..d98fe72 100644
--- a/specialpurpose/pricat/webapp/pricat/ftl/viewExcelImportLog.ftl
+++ b/specialpurpose/pricat/webapp/pricat/ftl/viewExcelImportLog.ftl
@@ -17,23 +17,23 @@
 under the License.

 -->

 <div id="wrapper">

-	<div id="page-wrapper" class="gray-bg">

-		<div class="row">

-			<div class="col-lg-12">

-				<div class="ibox float-e-margins">

-					<div id="htmlreport" class="ibox-content text-left p-md">

-						

-					</div>

-				</div>

-			</div>

-		</div>

-	</div>

+    <div id="page-wrapper" class="gray-bg">

+        <div class="row">

+            <div class="col-lg-12">

+                <div class="ibox float-e-margins">

+                    <div id="htmlreport" class="ibox-content text-left p-md">

+                        

+                    </div>

+                </div>

+            </div>

+        </div>

+    </div>

 </div>

 

 <script language='JavaScript'>

 <!--

 jQuery(document).ready( function() {

-	jQuery("#htmlreport").html("${StringUtil.wrapString(logFileContent!)}");

+    jQuery("#htmlreport").html("${StringUtil.wrapString(logFileContent!)}");

 });

 //-->

 </script>

diff --git a/specialpurpose/pricat/webapp/pricat/includes/pricat.css b/specialpurpose/pricat/webapp/pricat/includes/pricat.css
index 06feb2f..fd23112 100644
--- a/specialpurpose/pricat/webapp/pricat/includes/pricat.css
+++ b/specialpurpose/pricat/webapp/pricat/includes/pricat.css
@@ -18,135 +18,135 @@
  */
  
 .main input {
-	margin-right: 7px;
+    margin-right: 7px;
 }
 
 /* headline of dialog window */
 .dialoghead {
-	background-color: ActiveCaption;
-	margin-bottom: 8px;
-	padding: 2px;
-	color: CaptionText;
-	font-size: 12px;
-	font-weight: bold;
-	white-space: nowrap;	
+    background-color: ActiveCaption;
+    margin-bottom: 8px;
+    padding: 2px;
+    color: CaptionText;
+    font-size: 12px;
+    font-weight: bold;
+    white-space: nowrap;    
 }
 
 
 /* outer table of complete dialog window */
 table.dialog {
     margin: 20px auto;
-	width: 85%;
-	border-left: 1px solid ThreeDLightShadow;
-	border-top: 1px solid ThreeDLightShadow;
-	border-right: 1px solid ThreedDarkShadow;
-	border-bottom: 1px solid ThreedDarkShadow;
+    width: 85%;
+    border-left: 1px solid ThreeDLightShadow;
+    border-top: 1px solid ThreeDLightShadow;
+    border-right: 1px solid ThreedDarkShadow;
+    border-bottom: 1px solid ThreedDarkShadow;
 }
 
 /* inner table of complete dialog window */
 table.dialogbox {
-	width: 100%;
-	background-color: ThreeDFace;
-	background-color: ThreeDFace;
-	border-left: 1px solid ThreeDHighlight;
-	border-top: 1px solid ThreeDHighlight;
-	border-right: 1px solid ThreeDShadow;
-	border-bottom: 1px solid ThreeDShadow;
-	padding-top: 1px;	
-	
+    width: 100%;
+    background-color: ThreeDFace;
+    background-color: ThreeDFace;
+    border-left: 1px solid ThreeDHighlight;
+    border-top: 1px solid ThreeDHighlight;
+    border-right: 1px solid ThreeDShadow;
+    border-bottom: 1px solid ThreeDShadow;
+    padding-top: 1px;    
+    
 }
 
 body.dialog {
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-	font-size: 11px;
-	padding: 0;
-	margin: 0;
-	
+    font-family: Verdana, Arial, Helvetica, sans-serif;
+    font-size: 11px;
+    padding: 0;
+    margin: 0;
+    
 }
 
 /* Button - Image button in image style */
 img.button {
-	height: 20px;
-	width: 20px;
-	border: 0px none;
-	vertical-align: middle;
+    height: 20px;
+    width: 20px;
+    border: 0px none;
+    vertical-align: middle;
 }
 
 /* Button - Link (href) style */
 a.button {
-	color: ButtonText;
-	text-decoration: none;
-	cursor: pointer;
+    color: ButtonText;
+    text-decoration: none;
+    cursor: pointer;
 }
 
 /* Button - Normal style (inactive) */
 span.norm {
-	display: block;
-	border: 1px solid ThreeDFace;
+    display: block;
+    border: 1px solid ThreeDFace;
 }
 
 /* Button - Hover style */
 span.over {
-	display: block;
-	border-top: 1px solid ThreeDHighlight;
-	border-left: 1px solid ThreeDHighlight;
-	border-bottom: 1px solid ThreeDShadow;
-	border-right: 1px solid ThreeDShadow;
+    display: block;
+    border-top: 1px solid ThreeDHighlight;
+    border-left: 1px solid ThreeDHighlight;
+    border-bottom: 1px solid ThreeDShadow;
+    border-right: 1px solid ThreeDShadow;
 }
 
 /* Button - Push style */
 span.push {
-	display: block;
-	border-top: 1px solid ThreeDShadow;
-	border-left: 1px solid ThreeDShadow;
-	border-bottom: 1px solid ThreeDHighlight;
-	border-right: 1px solid ThreeDHighlight;
+    display: block;
+    border-top: 1px solid ThreeDShadow;
+    border-left: 1px solid ThreeDShadow;
+    border-bottom: 1px solid ThreeDHighlight;
+    border-right: 1px solid ThreeDHighlight;
 }
 
 /* Button - Disabled style */
 span.disabled {
-	display: block;
-	border: 1px solid ThreeDFace;
-	color: GrayText;
+    display: block;
+    border: 1px solid ThreeDFace;
+    color: GrayText;
 }
 
 /* Button - Separator */
 span.separator {
-	display: block;
-	height: 18px;
-	width: 0px;
-	border-top: 0px;
-	border-left: 1px solid ThreeDShadow;
-	border-bottom: 0px;
-	border-right: 1px solid ThreeDHighlight;
+    display: block;
+    height: 18px;
+    width: 0px;
+    border-top: 0px;
+    border-left: 1px solid ThreeDShadow;
+    border-bottom: 0px;
+    border-right: 1px solid ThreeDHighlight;
 }
 
 /* final button row of dialog window */
 .dialogbuttons {
-	padding: 3px 8px 5px;
-	text-align: center;
-	
+    padding: 3px 8px 5px;
+    text-align: center;
+    
 }
 
 .dialogcontent {
-	border-left: 1px solid ThreeDHighlight;
-	border-top: 1px solid ThreeDHighlight;
-	border-right: 2px solid ThreeDShadow;
-	border-bottom: 2px solid ThreeDShadow;
-	margin: 8px;
-	padding: 15px;
+    border-left: 1px solid ThreeDHighlight;
+    border-top: 1px solid ThreeDHighlight;
+    border-right: 2px solid ThreeDShadow;
+    border-bottom: 2px solid ThreeDShadow;
+    margin: 8px;
+    padding: 15px;
 }
 
 /* Submit and other buttons */
 input.dialogbutton {
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-	font-size: 11px;
-	background-color: ButtonFace;
-	width: 100px;
-	height: 20px;
-	padding: 0 5px;
-	margin-left: 12px;
-	overflow: visible;
+    font-family: Verdana, Arial, Helvetica, sans-serif;
+    font-size: 11px;
+    background-color: ButtonFace;
+    width: 100px;
+    height: 20px;
+    padding: 0 5px;
+    margin-left: 12px;
+    overflow: visible;
 }
 
 /* empty dummy style */
@@ -154,20 +154,20 @@
 
 /* element without margin and padding */
 .nomargin {
-	padding: 0;
-	margin: 0;
+    padding: 0;
+    margin: 0;
 }
 
 /* hide a block */
 .hide {
-	display: none;
-	visibility: hidden;
+    display: none;
+    visibility: hidden;
 }
 
 /* show a block */
 .show {
-	display: inline;
-	visibility: visible;
+    display: inline;
+    visibility: visible;
 }
 
 .help { 
@@ -219,32 +219,32 @@
 }
 
 .ms-table-primary thead{
-	background-color: #eeeeee;
+    background-color: #eeeeee;
 }
 .ms-table-primary tr.ms-table-header,
 tr.ms-table-header span{
-	font-weight: bold;
+    font-weight: bold;
 }
 .ms-table-primary{
-	width: 100%;
-	border:0;
-	margin:0;
-	border-collapse:collapse;
+    width: 100%;
+    border:0;
+    margin:0;
+    border-collapse:collapse;
 }
 .ms-table-primary td,th{
-	padding:0;
-	text-align: center;
-	vertical-align: middle !important;
+    padding:0;
+    text-align: center;
+    vertical-align: middle !important;
 }
 .ms-table-primary .text-left{
-	padding:0;
-	text-align: left;
-	vertical-align: middle !important;
+    padding:0;
+    text-align: left;
+    vertical-align: middle !important;
 }
 .ms-table-primary .text-right{
-	padding:0;
-	text-align: right;
-	vertical-align: middle !important;
+    padding:0;
+    text-align: right;
+    vertical-align: middle !important;
 }
 
 .p-xs {
diff --git a/specialpurpose/pricat/webapp/pricatdemo/ftl/SamplePricat.ftl b/specialpurpose/pricat/webapp/pricatdemo/ftl/SamplePricat.ftl
index f04a33f..108cc53 100644
--- a/specialpurpose/pricat/webapp/pricatdemo/ftl/SamplePricat.ftl
+++ b/specialpurpose/pricat/webapp/pricatdemo/ftl/SamplePricat.ftl
@@ -25,7 +25,7 @@
   </div>
   <div class="screenlet-body">
   <form method="post" enctype="multipart/form-data" action="<@ofbizUrl>pricatUpload</@ofbizUrl>">
-	<input type="hidden" name="action" value="store_excel" />
+    <input type="hidden" name="action" value="store_excel" />
     <input type="file" size="60" name="filename"/><br />
     ${uiLabelMap.ExcelTemplateType}:
     <select name="excelTemplateType" id="excelTemplateType">
diff --git a/specialpurpose/pricat/widget/CommonScreens.xml b/specialpurpose/pricat/widget/CommonScreens.xml
index c618484..75076ac 100644
--- a/specialpurpose/pricat/widget/CommonScreens.xml
+++ b/specialpurpose/pricat/widget/CommonScreens.xml
@@ -47,7 +47,7 @@
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                 <set field="titleProperty" value="ViewExcelImportHistory"/>
 
-				<script location="component://pricat/groovyScripts/pricat/FindMyExcelImport.groovy"/>
+                <script location="component://pricat/groovyScripts/pricat/FindMyExcelImport.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator">
@@ -66,7 +66,7 @@
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                 <set field="titleProperty" value="ViewExcelImportLogContent"/>
 
-				<script location="component://pricat/groovyScripts/pricat/FindMyExcelImportLog.groovy"/>
+                <script location="component://pricat/groovyScripts/pricat/FindMyExcelImportLog.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator">
diff --git a/specialpurpose/pricat/widget/SampleScreens.xml b/specialpurpose/pricat/widget/SampleScreens.xml
index 00606eb..5999743 100644
--- a/specialpurpose/pricat/widget/SampleScreens.xml
+++ b/specialpurpose/pricat/widget/SampleScreens.xml
@@ -47,15 +47,15 @@
             <widgets>
                 <decorator-screen name="main-decorator">
                     <decorator-section name="body">
-						<section>
-						    <widgets>
-							    <platform-specific>
-								    <html>
+                        <section>
+                            <widgets>
+                                <platform-specific>
+                                    <html>
                                         <html-template location="component://pricat/webapp/pricatdemo/ftl/main.ftl"/>
-								    </html>
-							    </platform-specific>
+                                    </html>
+                                </platform-specific>
                             </widgets>
-						</section>
+                        </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -70,15 +70,15 @@
             <widgets>
                 <decorator-screen name="main-decorator">
                     <decorator-section name="body">
-						<section>
-						    <widgets>
-							    <platform-specific>
-								    <html>
+                        <section>
+                            <widgets>
+                                <platform-specific>
+                                    <html>
                                         <html-template location="component://pricat/webapp/pricatdemo/ftl/countdownreport.ftl"/>
-								    </html>
-							    </platform-specific>
+                                    </html>
+                                </platform-specific>
                             </widgets>
-						</section>
+                        </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -93,15 +93,15 @@
             <widgets>
                 <decorator-screen name="main-decorator">
                     <decorator-section name="body">
-						<section>
-						    <widgets>
-							    <platform-specific>
-								    <html>
+                        <section>
+                            <widgets>
+                                <platform-specific>
+                                    <html>
                                         <html-template location="component://pricat/webapp/pricatdemo/ftl/countupreport.ftl"/>
-								    </html>
-							    </platform-specific>
+                                    </html>
+                                </platform-specific>
                             </widgets>
-						</section>
+                        </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>