Rewritten sales shipping cost taxation, improved shipping cost handling in sales...
[fa-stable.git] / sales / includes / db / sales_credit_db.inc
index 37e0157711bf425f835a233ea8dd2898c9ade65d..998a6a204a2828b35441ad8a2ac488b2ba6f599e 100644 (file)
@@ -138,8 +138,10 @@ function write_credit_note(&$credit_note, $write_off_acc)
                        $credit_note->customer_id);
        }
 
+       $freight = get_item($credit_note->ship_via);
+
        if ($credit_note->freight_cost != 0) {
-               $total += add_gl_trans_customer(ST_CUSTCREDIT, $credit_no, $credit_date, $company_data["freight_act"], 0, 0,
+               $total += add_gl_trans_customer(ST_CUSTCREDIT, $credit_no, $credit_date, $freight["freight_act"], 0, 0,
                        $credit_note->get_tax_free_shipping(), $credit_note->customer_id);
        }