From 543e6c598af4d951ebab4a01dd06a828c1411c1d Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 27 Mar 2017 13:10:04 +0300 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20show=20recurring=20start=20date?= =?UTF-8?q?=20change=20warning=20for=20new=20invoices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/invoices/edit.blade.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index 45420bf334de..0f06b155d87b 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -1337,17 +1337,19 @@ } function onSaveClick() { - if (model.invoice().is_recurring()) { - if (model.invoice().start_date() != model.invoice().start_date_orig()) { - var text = "{!! trans("texts.original_start_date") !!}: " + model.invoice().start_date_orig() + '\n' - + "{!! trans("texts.new_start_date") !!}: " + model.invoice().start_date(); - var title = "{!! trans("texts.warn_start_date_changed") !!}"; - sweetConfirm(function() { - submitAction(''); - }, text, title); - return; - } - } + @if ($invoice->id) + if (model.invoice().is_recurring()) { + if (model.invoice().start_date() != model.invoice().start_date_orig()) { + var text = "{!! trans("texts.original_start_date") !!}: " + model.invoice().start_date_orig() + '\n' + + "{!! trans("texts.new_start_date") !!}: " + model.invoice().start_date(); + var title = "{!! trans("texts.warn_start_date_changed") !!}"; + sweetConfirm(function() { + submitAction(''); + }, text, title); + return; + } + } + @endif @if (!empty($autoBillChangeWarning)) var text = "{!! trans('texts.warn_change_auto_bill') !!}";