From: Joe Hunt Date: Sat, 28 Nov 2020 15:05:29 +0000 (+0100) Subject: Error: no supplier trans found for given params in Supplier Payment. Fixed. X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=e1ba133463ff567e87d812a5d1663fb66b70a072 Error: no supplier trans found for given params in Supplier Payment. Fixed. --- diff --git a/includes/ui/allocation_cart.inc b/includes/ui/allocation_cart.inc index 968bae42..f21fd2ed 100644 --- a/includes/ui/allocation_cart.inc +++ b/includes/ui/allocation_cart.inc @@ -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); diff --git a/purchasing/includes/db/po_db.inc b/purchasing/includes/db/po_db.inc index 115b73f1..23f19a09 100644 --- a/purchasing/includes/db/po_db.inc +++ b/purchasing/includes/db/po_db.inc @@ -160,6 +160,15 @@ function update_po(&$po_obj) //---------------------------------------------------------------------------------------- +function get_po($order_no) { + $sql = "SELECT * FROM ".TB_PREF."purch_orders WHERE order_no = ".db_escape($order_no); + $result = db_query($sql); + + return db_fetch($result); +} + +//---------------------------------------------------------------------------------------- + function read_po_header($order_no, &$order) { $sql = "SELECT po.*, supplier.*, loc.location_name