Bug [0000046] relate to php #40509 fixed.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 5 Sep 2008 17:24:21 +0000 (17:24 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 5 Sep 2008 17:24:21 +0000 (17:24 +0000)
sales/includes/db/sales_credit_db.inc
sales/includes/sales_db.inc

index e5041a20a04f1b6460366cc4d594eaf8bd6505b8..2b37e60ccce2811553623a3854df08e4bd8fee4c 100644 (file)
@@ -6,7 +6,7 @@
 //
 function write_credit_note($credit_note, $write_off_acc)
 {
-       $credit_invoice = count($credit_note->src_docs) ? key($credit_note->src_docs) : 0;
+       $credit_invoice = count($credit_note->src_docs) ? reset($credit_note->src_docs) : 0;
 
 
        $credit_date = $credit_note->document_date;
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 ;