function get_supplier_details_to_order(&$order, $supplier_id)
{
- $sql = "SELECT curr_code, supp_name, tax_group_id, supp.tax_included,
+ $sql = "SELECT curr_code, supp_name, tax_group_id, supp.tax_included, dimension_id, dimension2_id,
supp.credit_limit - Sum(IFNULL(IF(trans.type=".ST_SUPPCREDIT.", -1, 1)
* (ov_amount + ov_gst + ov_discount),0)) as cur_credit,
terms.terms, terms.days_before_due, terms.day_in_following_month
$_POST['supplier_id'] = $supplier_id;
$_POST['supplier_name'] = $myrow["supp_name"];
$_POST['curr_code'] = $myrow["curr_code"];
+ $_POST['dimension'] = $myrow["dimension_id"];
+ $_POST['dimension2'] = $myrow["dimension2_id"];
$order->set_supplier($supplier_id, $myrow["supp_name"], $myrow["curr_code"],
$myrow["tax_group_id"], $myrow["tax_included"]);
db_query($sql, "One of the purchase order detail records could not be updated");
}
- reallocate_payments($po_obj->order_no, ST_PURCHORDER, $po_obj->orig_order_date, $po_obj->get_trans_total(), $po_obj->prepayments);
+ reallocate_payments($po_obj->order_no, ST_PURCHORDER, $po_obj->orig_order_date, $po_obj->get_trans_total(), $po_obj->prepayments, $po_obj->supplier_id);
add_audit_trail($po_obj->trans_type, $po_obj->order_no, Today(), _("Updated."));
hook_db_postwrite($po_obj, ST_PURCHORDER);
$order->credit = get_current_supp_credit($order->supplier_id);
$order->orig_order_date = sql2date($myrow["ord_date"]);
- $order->Comments = nl2br($myrow["comments"]);
+ $order->Comments = $myrow["comments"];
$order->Location = $myrow["into_stock_location"];
$order->supp_ref = $myrow["requisition_no"];
$order->reference = $myrow["reference"];
$order->delivery_address = $myrow["delivery_address"];
$order->alloc = $myrow["alloc"];
$order->prep_amount = $myrow["prep_amount"];
- $order->prepayments = get_payments_for($order_no, ST_PURCHORDER);
+ $order->prepayments = get_payments_for($order_no, ST_PURCHORDER, $myrow["supplier_id"]);
return true;
}