Additional fix for bugfix [0000229].
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 20 May 2010 15:48:38 +0000 (15:48 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 20 May 2010 15:48:38 +0000 (15:48 +0000)
CHANGELOG.txt
js/payalloc.js

index 901f47fe241837277166b59d6546dc585afd580b..6d01e32ab640f3ef84ce73c361de612e4f3d20d3 100644 (file)
@@ -19,6 +19,9 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+# [0000229] Payment overallocation is now forbidden (addendum)
+$ /js/payalloc.js
+
 12-May-2010 Janusz Dobrowolski
 # [0000226] Fixed diagnostic checks for javascript cached files, improved readability
 $ /admin/system_diagnostics.php
index 7bdd991483cac7f689082799c4ae30785006cbf8..165732795345a6a951348c7b24b2ed365d00807b 100644 (file)
@@ -14,8 +14,9 @@ function focus_alloc(i) {
 }
 
 function blur_alloc(i) {
-       var change = get_amount(i.name);
-               price_format(i.name, change, user.pdec);                
+       var change = Math.min(get_amount(i.name), get_amount('maxval'+i.name.substr(6), 1))
+
+               price_format(i.name, change, user.pdec);
                if (i.name != 'amount' && i.name != 'charge') {
                        if (change<0) change = 0;
                        change = change-i.getAttribute('_last');