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 ;