Handle currency not set

This commit is contained in:
Joshua Dwire 2016-05-11 11:30:45 -04:00
parent fb4806dab7
commit 581ae1baa6

View File

@ -857,7 +857,7 @@ class PaymentService extends BaseService
function ($model) { function ($model) {
$max_refund = number_format($model->amount - $model->refunded, 2); $max_refund = number_format($model->amount - $model->refunded, 2);
$formatted = Utils::formatMoney($max_refund, $model->currency_id, $model->country_id); $formatted = Utils::formatMoney($max_refund, $model->currency_id, $model->country_id);
$symbol = Utils::getFromCache($model->currency_id, 'currencies')->symbol; $symbol = Utils::getFromCache($model->currency_id ? $model->currency_id : 1, 'currencies')->symbol ;
return "javascript:showRefundModal({$model->public_id}, '{$max_refund}', '{$formatted}', '{$symbol}')"; return "javascript:showRefundModal({$model->public_id}, '{$max_refund}', '{$formatted}', '{$symbol}')";
}, },
function ($model) { function ($model) {