Additional fixes in payment/deposit allocations.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 24 May 2010 18:51:59 +0000 (18:51 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 24 May 2010 18:51:59 +0000 (18:51 +0000)
CHANGELOG.txt
includes/ui/allocation_cart.inc
js/payalloc.js

index c1c6c62f0a969ca538e549aa8f53efd765b9a8bd..9e5f2a86bf194035e55c48f44513355db7f70818 100644 (file)
@@ -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
index 058e0b918205d9036b6545fa45f9a8032edfbdda..a75a78e75cabb8d4321a7ffde6399b3ec4ca1c7e 100644 (file)
@@ -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);
index 165732795345a6a951348c7b24b2ed365d00807b..a1cbc09ec3334f9c8cf548a69c42c2473f42d5c5 100644 (file)
@@ -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') {