Browse Source

Fix if previous percent not defined, we do not try to show previous
percent.

Laurent Destailleur 9 years ago
parent
commit
ff9b2803e7
1 changed files with 2 additions and 3 deletions
  1. 2 3
      htdocs/projet/card.php

+ 2 - 3
htdocs/projet/card.php

@@ -849,10 +849,9 @@ else
                 var defaultpercent = element.attr("defaultpercent");
                 var elemcode = element.attr("elemcode");
                 /* Change percent of default percent of new status is higher */
-                if (parseFloat(jQuery("#opp_percent").val()) != parseFloat(defaultpercent)
-                    )
+                if (parseFloat(jQuery("#opp_percent").val()) != parseFloat(defaultpercent))
                 {
-                    if (! jQuery("#oldopppercent").text()) jQuery("#oldopppercent").text(\' - '.dol_escape_js($langs->trans("PreviousValue")).': \'+jQuery("#opp_percent").val()+\' %\');
+                    if (jQuery("#opp_percent").val() != \'\' && ! jQuery("#oldopppercent").text()) jQuery("#oldopppercent").text(\' - '.dol_escape_js($langs->trans("PreviousValue")).': \'+jQuery("#opp_percent").val()+\' %\');
                     jQuery("#opp_percent").val(defaultpercent);
                     
                 }