diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 54475fbb6983..276d9388b183 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -641,11 +641,18 @@ class AccountController extends BaseController ); } - $types = [GATEWAY_TYPE_CREDIT_CARD, GATEWAY_TYPE_BANK_TRANSFER, GATEWAY_TYPE_PAYPAL, GATEWAY_TYPE_BITCOIN, GATEWAY_TYPE_DWOLLA]; + $types = [ + GATEWAY_TYPE_CREDIT_CARD, + GATEWAY_TYPE_BANK_TRANSFER, + GATEWAY_TYPE_PAYPAL, + GATEWAY_TYPE_BITCOIN, + GATEWAY_TYPE_DWOLLA + ]; $options = []; foreach ($types as $type) { if ($account->getGatewayByType($type)) { - $options[$type] = trans("texts.{$type}"); + $alias = GatewayType::getAliasFromId($type); + $options[$alias] = trans("texts.{$alias}"); } } diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index 2dede0e95dab..d86ea881e602 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -725,7 +725,7 @@ class Utils } elseif ($model->first_name || $model->last_name) { return $model->first_name.' '.$model->last_name; } else { - return $model->email; + return $model->email ?: ''; } } diff --git a/database/migrations/2016_02_01_135956_add_source_currency_to_expenses.php b/database/migrations/2016_02_01_135956_add_source_currency_to_expenses.php index a4b1fa62436b..c39a722af01f 100644 --- a/database/migrations/2016_02_01_135956_add_source_currency_to_expenses.php +++ b/database/migrations/2016_02_01_135956_add_source_currency_to_expenses.php @@ -21,7 +21,7 @@ class AddSourceCurrencyToExpenses extends Migration $table->renameColumn('currency_id', 'invoice_currency_id'); } - $table->unsignedInteger('expense_currency_id'); + $table->unsignedInteger('expense_currency_id')->nullable(); }); Schema::table('expenses', function (Blueprint $table) {