[Vtigercrm-commits] [vtiger-commits] r10674 - /vtigercrm/branches/5.0.3/include/js/general.js

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Fri Apr 13 06:34:54 EDT 2007


Author: saraj
Date: Fri Apr 13 04:34:48 2007
New Revision: 10674

Log:
fix for Potential - Probability field not validated on Create view page of potential. Fixes #3272 #3410 --minnie

Modified:
    vtigercrm/branches/5.0.3/include/js/general.js

Modified: vtigercrm/branches/5.0.3/include/js/general.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/general.js (original)
+++ vtigercrm/branches/5.0.3/include/js/general.js Fri Apr 13 04:34:48 2007
@@ -636,14 +636,31 @@
            return false
        } else return true
    } else {
-	
+	   // changes made -- to fix the ticket#3272
 	   var splitval=val.split(".")
-
-                if(splitval[0]>18446744073709551615)
-                {
+	   var arr_len = splitval.length;
+           var len = 0;
+	   if(fldName == "probability" || fldName == "commissionrate")
+           {
+                   if(arr_len > 1)
+                           len = splitval[1].length;
+                   if(isNaN(val))
+                   {
+                        alert(alert_arr.INVALID+fldLabel)
+                        getObj(fldName).focus()
+                        return false
+                   }
+                   else if(splitval[0] > 100 || len > 3)
+                   {
                         alert( fldLabel + alert_arr.EXCEEDS_MAX);
                         return false;
-                }
+                   }
+           }
+	   else if(splitval[0]>18446744073709551615)
+           {
+                   alert( fldLabel + alert_arr.EXCEEDS_MAX);
+                   return false;
+           }
 
 
        if (neg==true)
@@ -683,12 +700,16 @@
 		getObj(fldName).focus()
 		return false
 	} 
-        else if( val < -2147483648 || val > 2147483647)
+        else if((fldName != 'employees') && (val < -2147483648 || val > 2147483647))
         {
                 alert(fldLabel +alert_arr.OUT_OF_RANGE);
                 return false;
         }
-
+	else if((fldName == 'employees') && (val < 0 || val > 2147483647))
+        {
+                alert(fldLabel +alert_arr.OUT_OF_RANGE);
+                return false;
+        }
 	else
 	{
 		return true





More information about the vtigercrm-commits mailing list