Optimize invoice page

This commit is contained in:
Hillel Coren 2016-09-14 10:32:22 +03:00
parent 8f90e4ba43
commit f5a9a66584

View File

@ -269,6 +269,10 @@ class InvoiceController extends BaseController
private static function getViewModel($invoice) private static function getViewModel($invoice)
{ {
$recurringHelp = ''; $recurringHelp = '';
$recurringDueDateHelp = '';
$recurringDueDates = [];
if ($invoice->is_recurring) {
foreach (preg_split("/((\r?\n)|(\r\n?))/", trans('texts.recurring_help')) as $line) { foreach (preg_split("/((\r?\n)|(\r\n?))/", trans('texts.recurring_help')) as $line) {
$parts = explode('=>', $line); $parts = explode('=>', $line);
if (count($parts) > 1) { if (count($parts) > 1) {
@ -279,7 +283,6 @@ class InvoiceController extends BaseController
} }
} }
$recurringDueDateHelp = '';
foreach (preg_split("/((\r?\n)|(\r\n?))/", trans('texts.recurring_due_date_help')) as $line) { foreach (preg_split("/((\r?\n)|(\r\n?))/", trans('texts.recurring_due_date_help')) as $line) {
$parts = explode('=>', $line); $parts = explode('=>', $line);
if (count($parts) > 1) { if (count($parts) > 1) {
@ -326,6 +329,7 @@ class InvoiceController extends BaseController
$recurringDueDates[$str] = ['value' => "1998-02-$dayStr", 'data-num' => $day, 'class' => 'weekly']; $recurringDueDates[$str] = ['value' => "1998-02-$dayStr", 'data-num' => $day, 'class' => 'weekly'];
} }
} }
}
// Tax rate $options // Tax rate $options
$account = Auth::user()->account; $account = Auth::user()->account;