Fixes issue 0017846: Multicurrency - finacc_txn_convert_rate numeric field in the DB is showing more than 6 characters
authorAdrián Romero <adrianromero@openbravo.com>
Fri, 22 Jul 2011 09:48:20 +0200
changeset 13248 56151e1a260f
parent 13247 a89603e59074
child 13249 34f013b87007
Fixes issue 0017846: Multicurrency - finacc_txn_convert_rate numeric field in the DB is showing more than 6 characters
Moved var declarations to the begining of the function to follow style guide
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Thu Jul 21 15:35:12 2011 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Fri Jul 22 09:48:20 2011 +0200
@@ -760,6 +760,9 @@
   
   processColumnValue: function(columnName, columnValue, editValues){
   	// Modifications in this method should go also in setColumnValuesInEditValues because both almost do the same
+    var typeInstance;
+    var assignValue;
+    var assignClassicValue;
     var isDate, i, valueMap = {}, oldValue, field = this.getFieldFromColumnName(columnName), entries = columnValue.entries;
     // not a field on the form, probably a datasource field
     var prop = this.view.getPropertyFromDBColumnName(columnName);
@@ -793,8 +796,6 @@
     
     // Adjust to formatting if exists value and classicValue. 
     oldValue = this.getValue(field.name);
-    var assignValue;
-    var assignClassicValue;
     if (field.typeInstance && field.typeInstance.parseInput && field.typeInstance.editFormatter) {
     	assignValue = field.typeInstance.parseInput(field.typeInstance.editFormatter(columnValue.value));
     	assignClassicValue = field.typeInstance.editFormatter(field.typeInstance.parseInput(columnValue.classicValue));
@@ -862,7 +863,7 @@
     }
     
     // store the textualvalue so that it is correctly send back to the server
-    var typeInstance = SimpleType.getType(field.type);
+    typeInstance = SimpleType.getType(field.type);
     if (columnValue.classicValue && typeInstance.decSeparator) {
       this.setTextualValue(field.name, assignClassicValue, typeInstance);
     }
@@ -870,6 +871,9 @@
   
   setColumnValuesInEditValues: function(columnName, columnValue, editValues){
   	// Modifications in this method should go also in processColumnValue because both almost do the same
+  	var assignClassicValue;
+  	var typeInstance;
+
     // no editvalues even anymore, go away
     if (!editValues) {
       return;
@@ -928,10 +932,10 @@
     // store the textualvalue so that it is correctly send back to the server
     if (field) {
       // Adjust to formatting if exists value and classicValue.
-      var assignClassicValue = (field.typeInstance && field.typeInstance.parseInput && field.typeInstance.editFormatter)
+      assignClassicValue = (field.typeInstance && field.typeInstance.parseInput && field.typeInstance.editFormatter)
         ? field.typeInstance.editFormatter(field.typeInstance.parseInput(columnValue.classicValue))
         : columnValue.classicValue;
-      var typeInstance = SimpleType.getType(field.type);
+      typeInstance = SimpleType.getType(field.type);
       if (columnValue.classicValue && typeInstance.decSeparator) {
         this.setTextualValue(field.name, assignClassicValue, typeInstance, editValues);
       }