Error: no supplier trans found for given params in Supplier Payment. Fixed.
[fa-stable.git] / includes / ui / allocation_cart.inc
index 968bae42a7131e848976f011359ea7d9883527cc..f21fd2ede4ec459212eee4a34862d0c196540178 100644 (file)
@@ -404,7 +404,10 @@ function check_allocations()
                                return false;
                        }
                } elseif ($_SESSION['alloc']->person_type == PT_SUPPLIER) {
-                       $trans = get_supp_trans($_SESSION['alloc']->allocs[$counter]->type_no, $_SESSION['alloc']->allocs[$counter]->type);
+                       if ($_SESSION['alloc']->allocs[$counter]->type == ST_PURCHORDER)
+                $trans = get_po($_SESSION['alloc']->allocs[$counter]->type_no);
+            else
+                $trans = get_supp_trans($_SESSION['alloc']->allocs[$counter]->type_no, $_SESSION['alloc']->allocs[$counter]->type);                    
                        if ($trans['supplier_id'] != $_SESSION['alloc']->person_id) {
                                display_error(_("Allocated transaction allocated is not related to company selected."));
                                set_focus('amount'.$counter);