1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-17 16:42:48 +01:00

Fix for gateway type in buy now buttons

This commit is contained in:
Hillel Coren 2016-12-04 11:47:58 +02:00
parent 531b707945
commit f739976de2
3 changed files with 11 additions and 4 deletions

View File

@ -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}");
}
}

View File

@ -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 ?: '';
}
}

View File

@ -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) {