X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=js%2Fpayalloc.js;h=a1cbc09ec3334f9c8cf548a69c42c2473f42d5c5;hb=49eb73902af0262d1971d4a3971b0e26c276f7be;hp=7bdd991483cac7f689082799c4ae30785006cbf8;hpb=74eabb5769f01203484f13b9736c8a56011b48f4;p=fa-stable.git diff --git a/js/payalloc.js b/js/payalloc.js index 7bdd9914..a1cbc09e 100644 --- a/js/payalloc.js +++ b/js/payalloc.js @@ -14,8 +14,12 @@ function focus_alloc(i) { } function blur_alloc(i) { - var change = get_amount(i.name); - price_format(i.name, change, user.pdec); + var change = get_amount(i.name); + + if (i.name != 'amount' && i.name != 'charge' && i.name != 'discount') + change = Math.min(change, 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');