Merged changes from main trunk 2.2.1-2.2.2
[fa-stable.git] / sales / includes / sales_db.inc
index febf93321ef3d8df5d5f5466eaa90fec3a8b0ef4..483f5672609145054da9fce1094b28bd134b1190 100644 (file)
@@ -186,12 +186,12 @@ 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(array_keys($cart->src_docs));
+               // if this child document has only one parent - update child link
+               $del_no = reset(array_keys($cart->src_docs));
 
-       $sql = 'UPDATE '.TB_PREF.'debtor_trans SET trans_link = ' . $del_no .
-               ' WHERE type=".db_escape($cart->trans_type)." AND trans_no='. $inv_no ;
-       db_query($sql, 'Child document link cannot be updated');
+               $sql = 'UPDATE '.TB_PREF.'debtor_trans SET trans_link = ' . $del_no .
+                       ' WHERE type='.db_escape($cart->trans_type).' AND trans_no='. $inv_no ;
+               db_query($sql, 'Child document link cannot be updated');
 
        }
        if ($cart->trans_type != ST_SALESINVOICE)