X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fdb%2Fpo_db.inc;h=8a92e8bbddabea53935488f641d97c65bba666c2;hb=6425de92749015d0e7ab29b5fd071a9d70cbb7d5;hp=b8ef5ada4410aad4dfd63f4c2c070ea61edece0e;hpb=83d7715f9571cc167be7d54b7f4807ec19d7aa5c;p=fa-stable.git diff --git a/purchasing/includes/db/po_db.inc b/purchasing/includes/db/po_db.inc index b8ef5ada..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; @@ -64,7 +74,7 @@ function update_po(&$po_obj) /*Update the purchase order header with any changes */ $sql = "UPDATE ".TB_PREF."purch_orders SET Comments=" . db_escape($po_obj->Comments) . ", - requisition_no= " db_escape(. $po_obj->requisition_no). ", + requisition_no= ". db_escape( $po_obj->requisition_no). ", into_stock_location=" . db_escape($po_obj->Location). ", ord_date='" . date2sql($po_obj->orig_order_date) . "', delivery_address=" . db_escape($po_obj->delivery_address); @@ -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 = "";