X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fdb%2Fpo_db.inc;h=8a92e8bbddabea53935488f641d97c65bba666c2;hb=6425de92749015d0e7ab29b5fd071a9d70cbb7d5;hp=ba2740e927f1b0dc296bd0bd7c9d20c9a7409ffd;hpb=18fb9ad2356007f48d6e7f31e335cdbd248df110;p=fa-stable.git diff --git a/purchasing/includes/db/po_db.inc b/purchasing/includes/db/po_db.inc index ba2740e9..8a92e8bb 100644 --- a/purchasing/includes/db/po_db.inc +++ b/purchasing/includes/db/po_db.inc @@ -1,5 +1,14 @@ . +***********************************************************************/ //---------------------------------------------------------------------------------------- function delete_po($po) @@ -19,7 +28,7 @@ function add_po(&$po_obj) /*Insert to purchase order header record */ $sql = "INSERT INTO ".TB_PREF."purch_orders (supplier_id, Comments, ord_date, reference, requisition_no, into_stock_location, delivery_address) VALUES("; - $sql .= "' ". $po_obj->supplier_id . "'," . + $sql .= db_escape($po_obj->supplier_id) . "," . db_escape($po_obj->Comments) . ",'" . date2sql($po_obj->orig_order_date) . "', '" . $po_obj->reference . "', " . @@ -47,10 +56,11 @@ function add_po(&$po_obj) } } - references::save_last($po_obj->reference, systypes::po()); + references::save(systypes::po(), $po_obj->order_no, $po_obj->reference); //add_comments(systypes::po(), $po_obj->order_no, $po_obj->orig_order_date, $po_obj->Comments); + add_audit_trail(systypes::po(), $po_obj->order_no, $po_obj->orig_order_date); commit_transaction(); return $po_obj->order_no; @@ -174,6 +184,14 @@ function read_po_items($order_no, &$order, $open_items_only=false) while ($myrow = db_fetch($result)) { + $data = get_purchase_data($order->supplier_id, $myrow['item_code']); + if ($data !== false) + { + if ($data['supplier_description'] != "") + $myrow['description'] = $data['supplier_description']; + //if ($data['suppliers_uom'] != "") + // $myrow['units'] = $data['suppliers_uom']; + } if (is_null($myrow["units"])) { $units = "";