[0000071] Ordering from customer on hold was possible after double
[fa-stable.git] / sales / includes / sales_db.inc
index ffefcd20ac128216028ef1b8dd691857c7c01cd6..5c4fffdb763b9d907731d531521448f609101c1e 100644 (file)
@@ -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 = reset($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 ;