Bug [0000046] relate to php #40509 fixed.
[fa-stable.git] / sales / includes / sales_db.inc
index f368b402180d1c1ba544e4e27e6e24ebad6e306b..f1892e32155a47d0ef8ecb5eff3903fe55100b41 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 = key($cart->src_docs);
+       $del_no = reset($cart->src_docs);
 
        $sql = 'UPDATE '.TB_PREF.'debtor_trans SET trans_link = ' . $del_no .
                ' WHERE type='.$cart->trans_type.' AND trans_no='. $inv_no ;