X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fdb%2Fpo_db.inc;h=45810f1da0b9050b430457a06aaf3f0d64cb0370;hb=9a98bb3bc7a94f1a8e47f8dab45a87c8b4212080;hp=adab9ad31f67b534283a7bb6f18303fe8c1262d0;hpb=0eb2322c049b8b386e9cc3337caa3f41151330bf;p=fa-stable.git diff --git a/purchasing/includes/db/po_db.inc b/purchasing/includes/db/po_db.inc index adab9ad3..45810f1d 100644 --- a/purchasing/includes/db/po_db.inc +++ b/purchasing/includes/db/po_db.inc @@ -107,7 +107,6 @@ function update_po(&$po_obj) .db_escape($po_line->price) . ", " .db_escape($po_line->quantity) . ", " .db_escape($po_line->qty_received) . ")"; - db_query($sql, "One of the purchase order detail records could not be updated"); } @@ -124,8 +123,9 @@ function update_po(&$po_obj) function read_po_header($order_no, &$order) { - $sql = "SELECT ".TB_PREF."purch_orders.*, ".TB_PREF."suppliers.supp_name, ".TB_PREF."suppliers.tax_group_id, - ".TB_PREF."suppliers.curr_code, ".TB_PREF."locations.location_name + $sql = "SELECT ".TB_PREF."purch_orders.*, " + .TB_PREF."suppliers.*, " + .TB_PREF."locations.location_name FROM ".TB_PREF."purch_orders, ".TB_PREF."suppliers, ".TB_PREF."locations WHERE ".TB_PREF."purch_orders.supplier_id = ".TB_PREF."suppliers.supplier_id AND ".TB_PREF."locations.loc_code = into_stock_location @@ -140,9 +140,9 @@ function read_po_header($order_no, &$order) $order->trans_type = ST_PURCHORDER; $order->order_no = $order_no; - + $order->set_supplier($myrow["supplier_id"], $myrow["supp_name"], $myrow["curr_code"], - $myrow['tax_group_id'], $myrow["tax_included"]); + $myrow['tax_group_id'], $myrow["tax_included"], @$myrow["tax_algorithm"]); $order->credit = get_current_supp_credit($order->supplier_id); @@ -269,6 +269,8 @@ function get_sql_for_po_search_completed() AND porder.supplier_id = supplier.supplier_id AND location.loc_code = porder.into_stock_location "; + if (isset($_GET['supplier_id'])) + $sql .= "AND supplier.supplier_id=".@$_GET['supplier_id']." "; if (isset($order_number) && $order_number != "") { $sql .= "AND porder.reference LIKE ".db_escape('%'. $order_number . '%');