From: Janusz Dobrowolski Date: Mon, 24 May 2010 18:51:59 +0000 (+0000) Subject: Additional fixes in payment/deposit allocations. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=d807eeb7f8c893c00a0bbbc21d8858738551db9f;p=textcart.git Additional fixes in payment/deposit allocations. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c1c6c62..9e5f2a8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -27,8 +27,13 @@ $ config.default.php # [0000230] Incorrect 'On order' quantity of raw materials in the 'Stock Check Sheets' report. $ /reporting/rep303.php +24-May-2010 Janusz Dobrowolski +# Additional fixes in payment/deposit allocations. +$ /includes/ui/allocation_cart.inc + /js/payalloc.js + 22-May-2010 Janusz Dobrowolski -# Fixed html generationfor buttons +# Fixed html generation for buttons $ /includes/ui/ui_input.inc 13-May-2010 Janusz Dobrowolski diff --git a/includes/ui/allocation_cart.inc b/includes/ui/allocation_cart.inc index 058e0b9..a75a78e 100644 --- a/includes/ui/allocation_cart.inc +++ b/includes/ui/allocation_cart.inc @@ -332,7 +332,9 @@ function check_allocations() amount left to be allocated against the transaction under review */ if (input_num('amount' . $counter) > get_post('un_allocated' . $counter)) { - //$_POST['amount' . $counter] = $_POST['un_allocated' . $counter]; + display_error(_("At least one transaction is overallocated.")); + set_focus('amount'.$counter); + return false; } $_SESSION['alloc']->allocs[$counter]->current_allocated = input_num('amount' . $counter); diff --git a/js/payalloc.js b/js/payalloc.js index 1657327..a1cbc09 100644 --- a/js/payalloc.js +++ b/js/payalloc.js @@ -14,7 +14,10 @@ function focus_alloc(i) { } function blur_alloc(i) { - var change = Math.min(get_amount(i.name), get_amount('maxval'+i.name.substr(6), 1)) + 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') {