Merged last changes from stable.
[fa-stable.git] / sales / includes / db / payment_db.inc
index 81ea49ce6ba625f96639eeff9d388ad9612ecc2c..4aa4d4e1ff6f5f89efe5468e2852948955d93664 100644 (file)
@@ -90,7 +90,7 @@ function write_customer_payment($trans_no, $customer_id, $branch_id, $bank_accou
 
        if ($charge != 0)       {
                /* Now Debit bank charge account with charges */
-               $charge_act = get_company_pref('bank_charge_act');
+               $charge_act = get_bank_charge_account($bank_account);
                $total += add_gl_trans(ST_CUSTPAYMENT, $payment_no, $date_,     $charge_act, 0, 0, '', 
                        $charge, $bank['bank_curr_code'], PT_CUSTOMER,  $customer_id);
        }