private static function getViewModel()
 {
     return ['branches' => Branch::where('account_id', '=', Auth::user()->account_id)->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'frequencies' => array(1 => 'Semanal', 2 => 'Cada 2 semanas', 3 => 'Cada 4 semanas', 4 => 'Mensual', 5 => 'Trimestral', 6 => 'Semestral', 7 => 'Anual')];
 }
 private static function getViewModel()
 {
     return ['account' => Auth::user()->account, 'branches' => Branch::where('account_id', '=', Auth::user()->account_id)->where('id', Auth::user()->branch_id)->orderBy('public_id')->get(), 'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'paymentTerms' => PaymentTerm::remember(DEFAULT_QUERY_CACHE)->orderBy('num_days')->get(['name', 'num_days']), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'frequencies' => array(1 => 'Semanal', 2 => 'Cada 2 semanas', 3 => 'Cada 4 semanas', 4 => 'Mensual', 5 => 'Trimestral', 6 => 'Semestral', 7 => 'Anual')];
 }
 private static function getViewModel()
 {
     return ['entityType' => ENTITY_QUOTE, 'account' => Auth::user()->account, 'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'invoiceDesigns' => InvoiceDesign::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'invoiceLabels' => Auth::user()->account->getInvoiceLabels()];
 }
 private static function getViewModel()
 {
     $recurringHelp = '';
     foreach (preg_split("/((\r?\n)|(\r\n?))/", trans('texts.recurring_help')) as $line) {
         $parts = explode("=>", $line);
         if (count($parts) > 1) {
             $line = $parts[0] . ' => ' . Utils::processVariables($parts[0]);
             $recurringHelp .= '<li>' . strip_tags($line) . '</li>';
         } else {
             $recurringHelp .= $line;
         }
     }
     return ['account' => Auth::user()->account, 'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'paymentTerms' => PaymentTerm::remember(DEFAULT_QUERY_CACHE)->orderBy('num_days')->get(['name', 'num_days']), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'invoiceDesigns' => InvoiceDesign::remember(DEFAULT_QUERY_CACHE, 'invoice_designs_cache_' . Auth::user()->maxInvoiceDesignId())->where('id', '<=', Auth::user()->maxInvoiceDesignId())->orderBy('id')->get(), 'frequencies' => array(1 => 'Weekly', 2 => 'Two weeks', 3 => 'Four weeks', 4 => 'Monthly', 5 => 'Three months', 6 => 'Six months', 7 => 'Annually'), 'recurringHelp' => $recurringHelp];
 }
 private static function getViewModel()
 {
     return ['account' => Auth::user()->account, 'branch' => Auth::user()->branch, 'products' => Product::scope()->with('prices')->orderBy('id')->get(), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Currency::orderBy('name')->get(), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'invoiceDesigns' => InvoiceDesign::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'invoiceLabels' => Auth::user()->account->getInvoiceLabels(), 'frequencies' => array(1 => 'Semanal', 2 => 'Cada 2 semanas', 3 => 'Cada 4 semanas', 4 => 'Mensual', 5 => 'Trimestral', 6 => 'Semestral', 7 => 'Anual')];
 }
 private static function getViewModel()
 {
     return ['account' => Auth::user()->account, 'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'paymentTerms' => PaymentTerm::remember(DEFAULT_QUERY_CACHE)->orderBy('num_days')->get(['name', 'num_days']), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'invoiceDesigns' => InvoiceDesign::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'invoiceLabels' => Auth::user()->account->getInvoiceLabels(), 'frequencies' => array(1 => 'Weekly', 2 => 'Two weeks', 3 => 'Four weeks', 4 => 'Monthly', 5 => 'Three months', 6 => 'Six months', 7 => 'Annually')];
 }