diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php
index 2435f70119e8..6fcd6288f326 100644
--- a/app/Http/Controllers/AccountController.php
+++ b/app/Http/Controllers/AccountController.php
@@ -820,6 +820,7 @@ class AccountController extends BaseController
$user->save();
$account->live_preview = Input::get('live_preview') ? true : false;
+ $account->realtime_preview = Input::get('realtime_preview') ? true : false;
// Automatically disable live preview when using a large font
$fonts = Cache::get('fonts')->filter(function ($font) use ($account) {
diff --git a/app/Models/Account.php b/app/Models/Account.php
index 2bfd0916dbca..29956689674e 100644
--- a/app/Models/Account.php
+++ b/app/Models/Account.php
@@ -127,6 +127,7 @@ class Account extends Eloquent
'enable_client_portal_dashboard',
'page_size',
'live_preview',
+ 'realtime_preview',
'invoice_number_padding',
'enable_second_tax_rate',
'auto_bill_on_due_date',
diff --git a/app/Ninja/Transformers/AccountTransformer.php b/app/Ninja/Transformers/AccountTransformer.php
index 6434d990370f..461b4c496689 100644
--- a/app/Ninja/Transformers/AccountTransformer.php
+++ b/app/Ninja/Transformers/AccountTransformer.php
@@ -352,6 +352,7 @@ class AccountTransformer extends EntityTransformer
'enable_client_portal_dashboard' => (bool) $account->enable_client_portal_dashboard,
'page_size' => $account->page_size,
'live_preview' => (bool) $account->live_preview,
+ 'realtime_preview' => (bool) $account->realtime_preview,
'invoice_number_padding' => (int) $account->invoice_number_padding,
'enable_second_tax_rate' => (bool) $account->enable_second_tax_rate,
'auto_bill_on_due_date' => (bool) $account->auto_bill_on_due_date,
diff --git a/database/migrations/2019_04_29_195445_add_realtime_preview_to_accounts.php b/database/migrations/2019_04_29_195445_add_realtime_preview_to_accounts.php
new file mode 100644
index 000000000000..5012c4fe4925
--- /dev/null
+++ b/database/migrations/2019_04_29_195445_add_realtime_preview_to_accounts.php
@@ -0,0 +1,32 @@
+boolean('realtime_preview')->after('live_preview')->default(1);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('accounts', function ($table) {
+ $table->dropColumn('realtime_preview');
+ });
+ }
+}
diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php
index f223fc96cc7c..7c5f7e3b2167 100644
--- a/resources/lang/en/texts.php
+++ b/resources/lang/en/texts.php
@@ -2041,7 +2041,9 @@ $LANG = array(
'update_credit' => 'Update Credit',
'updated_credit' => 'Successfully updated credit',
'edit_credit' => 'Edit Credit',
- 'live_preview_help' => 'Display a live PDF preview on the invoice page.
Disable this to improve performance when editing invoices.',
+ 'realtime_preview' => 'Realtime Preview',
+ 'realtime_preview_help' => 'Realtime refresh PDF preview on the invoice page when editing invoice.
Disable this to improve performance when editing invoices.',
+ 'live_preview_help' => 'Display a live PDF preview on the invoice page.',
'force_pdfjs_help' => 'Replace the built-in PDF viewer in :chrome_link and :firefox_link.
Enable this if your browser is automatically downloading the PDF.',
'force_pdfjs' => 'Prevent Download',
'redirect_url' => 'Redirect URL',
diff --git a/resources/views/accounts/management.blade.php b/resources/views/accounts/management.blade.php
index 9bda2dc1e0e3..fa1cdfb173ff 100644
--- a/resources/views/accounts/management.blade.php
+++ b/resources/views/accounts/management.blade.php
@@ -172,6 +172,7 @@
{!! Former::open('settings/account_management') !!}
{!! Former::populateField('live_preview', intval($account->live_preview)) !!}
+ {!! Former::populateField('realtime_preview', intval($account->realtime_preview)) !!}
{!! Former::populateField('force_pdfjs', intval(Auth::user()->force_pdfjs)) !!}