X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fincludes%2Fsales_db.inc;h=1f5e0f31f7dc93c7e1c126b517566ddcd5769bd4;hb=f9451becdadf75c6e4feb459123f813100acb052;hp=f368b402180d1c1ba544e4e27e6e24ebad6e306b;hpb=c09be0dad6b05131e240349a375af7a4b7bf3444;p=fa-stable.git diff --git a/sales/includes/sales_db.inc b/sales/includes/sales_db.inc index f368b402..1f5e0f31 100644 --- a/sales/includes/sales_db.inc +++ b/sales/includes/sales_db.inc @@ -35,14 +35,14 @@ function add_stock_move_customer($type, $stock_id, $trans_id, $location, $date_, // $amount is in CUSTOMER'S currency function add_gl_trans_customer($type, $type_no, $date_, $account, $dimension, $dimension2, - $amount, $customer_id, $err_msg="") + $amount, $customer_id, $err_msg="", $rate=0) { if ($err_msg == "") $err_msg = "The customer GL transaction could not be inserted"; return add_gl_trans($type, $type_no, $date_, $account, $dimension, $dimension2, "", $amount, get_customer_currency($customer_id), - payment_person_types::customer(), $customer_id, $err_msg); + payment_person_types::customer(), $customer_id, $err_msg, $rate); } //---------------------------------------------------------------------------------------- @@ -54,7 +54,7 @@ function get_price ($stock_id, $currency, $sales_type_id, $factor=null, $date=nu if ($factor === null) { - $myrow = get_sales_type(get_post('sales_type_id')); + $myrow = get_sales_type($sales_type_id); $factor = $myrow['factor']; } @@ -125,7 +125,7 @@ function set_document_parent($cart) if (count($cart->src_docs) == 1) { // if this child document has only one parent - update child link - $del_no = key($cart->src_docs); + $del_no = reset(array_keys($cart->src_docs)); $sql = 'UPDATE '.TB_PREF.'debtor_trans SET trans_link = ' . $del_no . ' WHERE type='.$cart->trans_type.' AND trans_no='. $inv_no ;