From: Janusz Dobrowolski Date: Thu, 20 May 2010 15:48:38 +0000 (+0000) Subject: Additional fix for bugfix [0000229]. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=ca7b2b487e782e767af3639a57667e8160f38602;p=textcart.git Additional fix for bugfix [0000229]. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 901f47f..6d01e32 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/js/payalloc.js b/js/payalloc.js index 7bdd991..1657327 100644 --- a/js/payalloc.js +++ b/js/payalloc.js @@ -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');