diff --git a/app/Http/routes.php b/app/Http/routes.php
index 89c0cf916758..b4d0d1a0332e 100644
--- a/app/Http/routes.php
+++ b/app/Http/routes.php
@@ -301,7 +301,7 @@ define('NINJA_GATEWAY_ID', GATEWAY_AUTHORIZE_NET);
define('NINJA_GATEWAY_CONFIG', '{"apiLoginId":"626vWcD5","transactionKey":"4bn26TgL9r4Br4qJ","testMode":"","developerMode":""}');
define('NINJA_WEB_URL', 'https://www.invoiceninja.com');
define('NINJA_APP_URL', 'https://app.invoiceninja.com');
-define('NINJA_VERSION', '1.6.1');
+define('NINJA_VERSION', '1.7.0');
define('NINJA_DATE', '2000-01-01');
define('NINJA_FROM_EMAIL', 'maildelivery@invoiceninja.com');
define('RELEASES_URL', 'https://github.com/hillelcoren/invoice-ninja/releases/');
diff --git a/app/Models/Account.php b/app/Models/Account.php
index f944a6abf3ce..482911dcf7ea 100644
--- a/app/Models/Account.php
+++ b/app/Models/Account.php
@@ -99,7 +99,7 @@ class Account extends Eloquent
public function getGatewayByType($type = PAYMENT_TYPE_ANY)
{
foreach ($this->account_gateways as $gateway) {
- if ($type == PAYMENT_TYPE_ANY) {
+ if (!$type || $type == PAYMENT_TYPE_ANY) {
return $gateway;
} elseif ($gateway->isPayPal() && $type == PAYMENT_TYPE_PAYPAL) {
return $gateway;
@@ -352,6 +352,10 @@ class Account extends Eloquent
public function showTokenCheckbox()
{
+ if (!$this->isGatewayConfigured(GATEWAY_STRIPE)) {
+ return false;
+ }
+
return $this->token_billing_type_id == TOKEN_BILLING_OPT_IN
|| $this->token_billing_type_id == TOKEN_BILLING_OPT_OUT;
}
diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php
index c364cb569b9c..83efff8bcd8a 100644
--- a/app/Ninja/Repositories/InvoiceRepository.php
+++ b/app/Ninja/Repositories/InvoiceRepository.php
@@ -346,7 +346,7 @@ class InvoiceRepository
$invoiceItem = InvoiceItem::createNew();
$invoiceItem->product_id = isset($product) ? $product->id : null;
- $invoiceItem->product_key = trim($invoice->is_recurring ? $item->product_key : Utils::processVariables($item['product_key']));
+ $invoiceItem->product_key = trim($invoice->is_recurring ? $item['product_key'] : Utils::processVariables($item['product_key']));
$invoiceItem->notes = trim($invoice->is_recurring ? $item['notes'] : Utils::processVariables($item['notes']));
$invoiceItem->cost = Utils::parseFloat($item['cost']);
$invoiceItem->qty = Utils::parseFloat($item['qty']);
diff --git a/public/favicon.gif b/public/favicon.gif
deleted file mode 100644
index a4188938042f..000000000000
Binary files a/public/favicon.gif and /dev/null differ
diff --git a/public/favicon.ico b/public/favicon.ico
deleted file mode 100644
index 20bc39679617..000000000000
Binary files a/public/favicon.ico and /dev/null differ
diff --git a/public/favicon.png b/public/favicon.png
new file mode 100755
index 000000000000..8032c422badb
Binary files /dev/null and b/public/favicon.png differ
diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php
index c34a53c62667..b458f925d119 100644
--- a/resources/views/header.blade.php
+++ b/resources/views/header.blade.php
@@ -37,7 +37,7 @@
-
+
diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php
index 93a6e3da8f7a..c94c0930dfbd 100644
--- a/resources/views/invoices/edit.blade.php
+++ b/resources/views/invoices/edit.blade.php
@@ -673,10 +673,10 @@
invoice.contact = _.findWhere(invoice.client.contacts, {send_invoice: true});
if (!invoice.terms) {
- invoice.terms = "{{ $account->invoice_terms }}";
+ invoice.terms = "{{ str_replace(["\r\n","\r","\n"], '\n', addslashes($account->invoice_terms)) }}";
}
if (!invoice.invoice_footer) {
- invoice.invoice_footer = "{{ $account->invoice_footer }}";
+ invoice.invoice_footer = "{{ str_replace(["\r\n","\r","\n"], '\n', addslashes($account->invoice_footer)) }}";
}
@if (file_exists($account->getLogoPath()))
diff --git a/resources/views/master.blade.php b/resources/views/master.blade.php
index d174c873917f..1347591e4124 100644
--- a/resources/views/master.blade.php
+++ b/resources/views/master.blade.php
@@ -18,9 +18,9 @@
-
-
-
+
+
+
@@ -91,7 +91,7 @@
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
- ga('create', '{{ $_ENV['ANALYTICS_KEY'] }}');
+ ga('create', '{{ $_ENV['ANALYTICS_KEY'] }}', 'auto');
ga('send', 'pageview');
function trackUrl(url) {