Since debugger does not work, I temporarily added file_put_contents command to paypaladvanced.php file and saved the value of $postdata into a log file. I found that AMT in POST message is 0, that's why PayPal shows order amount 0.
Further debugging revealed that the value of $order->cart->order_full_price is empty string, which is the reason the following line returns 0
'AMT' => @ round($order->cart->order_full_price, (int)$this->currency->currency_locale),
The value of (int)$this->currency->currency_locale) in my case is 2.
Now the question is why $order->cart->order_full_price is empty?
Thanks.