当前位置: 首页>>代码示例>>PHP>>正文


PHP InvoiceDesign::availableDesigns方法代码示例

本文整理汇总了PHP中app\models\InvoiceDesign::availableDesigns方法的典型用法代码示例。如果您正苦于以下问题:PHP InvoiceDesign::availableDesigns方法的具体用法?PHP InvoiceDesign::availableDesigns怎么用?PHP InvoiceDesign::availableDesigns使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\InvoiceDesign的用法示例。


在下文中一共展示了InvoiceDesign::availableDesigns方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getViewModel

 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' => Cache::get('countries'), 'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Cache::get('currencies'), 'sizes' => Cache::get('sizes'), 'paymentTerms' => Cache::get('paymentTerms'), 'industries' => Cache::get('industries'), 'invoiceDesigns' => InvoiceDesign::availableDesigns(), 'invoiceLabels' => Auth::user()->account->getInvoiceLabels()];
 }
开发者ID:biggtfish,项目名称:invoiceNinja-1,代码行数:4,代码来源:QuoteController.php

示例2: invoiceHistory

 public function invoiceHistory($publicId)
 {
     $invoice = Invoice::withTrashed()->scope($publicId)->firstOrFail();
     $invoice->load('user', 'invoice_items', 'account.country', 'client.contacts', 'client.country');
     $invoice->invoice_date = Utils::fromSqlDate($invoice->invoice_date);
     $invoice->due_date = Utils::fromSqlDate($invoice->due_date);
     $invoice->is_pro = Auth::user()->isPro();
     $invoice->is_quote = intval($invoice->is_quote);
     $activityTypeId = $invoice->is_quote ? ACTIVITY_TYPE_UPDATE_QUOTE : ACTIVITY_TYPE_UPDATE_INVOICE;
     $activities = Activity::scope(false, $invoice->account_id)->where('activity_type_id', '=', $activityTypeId)->where('invoice_id', '=', $invoice->id)->orderBy('id', 'desc')->get(['id', 'created_at', 'user_id', 'json_backup', 'message']);
     $versionsJson = [];
     $versionsSelect = [];
     $lastId = false;
     foreach ($activities as $activity) {
         $backup = json_decode($activity->json_backup);
         $backup->invoice_date = Utils::fromSqlDate($backup->invoice_date);
         $backup->due_date = Utils::fromSqlDate($backup->due_date);
         $backup->is_pro = Auth::user()->isPro();
         $backup->is_quote = isset($backup->is_quote) && intval($backup->is_quote);
         $backup->account = $invoice->account->toArray();
         $versionsJson[$activity->id] = $backup;
         $key = Utils::timestampToDateTimeString(strtotime($activity->created_at)) . ' - ' . Utils::decodeActivity($activity->message);
         $versionsSelect[$lastId ? $lastId : 0] = $key;
         $lastId = $activity->id;
     }
     $versionsSelect[$lastId] = Utils::timestampToDateTimeString(strtotime($invoice->created_at)) . ' - ' . $invoice->user->getDisplayName();
     $data = ['invoice' => $invoice, 'versionsJson' => json_encode($versionsJson), 'versionsSelect' => $versionsSelect, 'invoiceDesigns' => InvoiceDesign::availableDesigns()];
     return View::make('invoices.history', $data);
 }
开发者ID:ricoa,项目名称:invoice-ninja,代码行数:29,代码来源:InvoiceController.php

示例3: showSection

 public function showSection($section = ACCOUNT_DETAILS, $subSection = false)
 {
     if ($section == ACCOUNT_DETAILS) {
         $data = ['account' => Account::with('users')->findOrFail(Auth::user()->account_id), 'countries' => Cache::get('countries'), 'sizes' => Cache::get('sizes'), 'industries' => Cache::get('industries'), 'timezones' => Cache::get('timezones'), 'dateFormats' => Cache::get('dateFormats'), 'datetimeFormats' => Cache::get('datetimeFormats'), 'currencies' => Cache::get('currencies'), 'languages' => Cache::get('languages'), 'showUser' => Auth::user()->id === Auth::user()->account->users()->first()->id];
         return View::make('accounts.details', $data);
     } elseif ($section == ACCOUNT_PAYMENTS) {
         $account = Auth::user()->account;
         $account->load('account_gateways');
         $count = count($account->account_gateways);
         if ($count == 0) {
             return Redirect::to('gateways/create');
         } else {
             return View::make('accounts.payments', ['showAdd' => $count < 3]);
         }
     } elseif ($section == ACCOUNT_NOTIFICATIONS) {
         $data = ['account' => Account::with('users')->findOrFail(Auth::user()->account_id)];
         return View::make('accounts.notifications', $data);
     } elseif ($section == ACCOUNT_IMPORT_EXPORT) {
         return View::make('accounts.import_export');
     } elseif ($section == ACCOUNT_ADVANCED_SETTINGS) {
         $account = Auth::user()->account;
         $data = ['account' => $account, 'feature' => $subSection];
         if ($subSection == ACCOUNT_INVOICE_DESIGN) {
             $invoice = new stdClass();
             $client = new stdClass();
             $invoiceItem = new stdClass();
             $client->name = 'Sample Client';
             $client->address1 = '';
             $client->city = '';
             $client->state = '';
             $client->postal_code = '';
             $client->work_phone = '';
             $client->work_email = '';
             $invoice->invoice_number = Auth::user()->account->getNextInvoiceNumber();
             $invoice->invoice_date = date_create()->format('Y-m-d');
             $invoice->account = json_decode(Auth::user()->account->toJson());
             $invoice->amount = $invoice->balance = 100;
             $invoiceItem->cost = 100;
             $invoiceItem->qty = 1;
             $invoiceItem->notes = 'Notes';
             $invoiceItem->product_key = 'Item';
             $invoice->client = $client;
             $invoice->invoice_items = [$invoiceItem];
             $data['invoice'] = $invoice;
             $data['invoiceDesigns'] = InvoiceDesign::availableDesigns();
         } else {
             if ($subSection == ACCOUNT_EMAIL_TEMPLATES) {
                 $data['invoiceEmail'] = $account->getEmailTemplate(ENTITY_INVOICE);
                 $data['quoteEmail'] = $account->getEmailTemplate(ENTITY_QUOTE);
                 $data['paymentEmail'] = $account->getEmailTemplate(ENTITY_PAYMENT);
                 $data['emailFooter'] = $account->getEmailFooter();
             }
         }
         return View::make("accounts.{$subSection}", $data);
     } elseif ($section == ACCOUNT_PRODUCTS) {
         $data = ['account' => Auth::user()->account];
         return View::make('accounts.products', $data);
     }
 }
开发者ID:biggtfish,项目名称:invoiceNinja-1,代码行数:59,代码来源:AccountController.php

示例4: showSection

 public function showSection($section = ACCOUNT_DETAILS, $subSection = false)
 {
     if ($section == ACCOUNT_DETAILS) {
         $data = ['account' => Account::with('users')->findOrFail(Auth::user()->account_id), 'countries' => Cache::get('countries'), 'sizes' => Cache::get('sizes'), 'industries' => Cache::get('industries'), 'timezones' => Cache::get('timezones'), 'dateFormats' => Cache::get('dateFormats'), 'datetimeFormats' => Cache::get('datetimeFormats'), 'currencies' => Cache::get('currencies'), 'languages' => Cache::get('languages'), 'showUser' => Auth::user()->id === Auth::user()->account->users()->first()->id, 'title' => trans('texts.company_details')];
         return View::make('accounts.details', $data);
     } elseif ($section == ACCOUNT_PAYMENTS) {
         $account = Auth::user()->account;
         $account->load('account_gateways');
         $count = count($account->account_gateways);
         if ($count == 0) {
             return Redirect::to('gateways/create');
         } else {
             return View::make('accounts.payments', ['showAdd' => $count < 3, 'title' => trans('texts.online_payments')]);
         }
     } elseif ($section == ACCOUNT_NOTIFICATIONS) {
         $data = ['account' => Account::with('users')->findOrFail(Auth::user()->account_id), 'title' => trans('texts.notifications')];
         return View::make('accounts.notifications', $data);
     } elseif ($section == ACCOUNT_IMPORT_EXPORT) {
         return View::make('accounts.import_export', ['title' => trans('texts.import_export')]);
     } elseif ($section == ACCOUNT_ADVANCED_SETTINGS) {
         $account = Auth::user()->account->load('country');
         $data = ['account' => $account, 'feature' => $subSection, 'title' => trans('texts.invoice_settings')];
         if ($subSection == ACCOUNT_INVOICE_DESIGN || $subSection == ACCOUNT_CUSTOMIZE_DESIGN) {
             $invoice = new stdClass();
             $client = new stdClass();
             $contact = new stdClass();
             $invoiceItem = new stdClass();
             $client->name = 'Sample Client';
             $client->address1 = '';
             $client->city = '';
             $client->state = '';
             $client->postal_code = '';
             $client->work_phone = '';
             $client->work_email = '';
             $invoice->invoice_number = $account->getNextInvoiceNumber();
             $invoice->invoice_date = date_create()->format('Y-m-d');
             $invoice->account = json_decode($account->toJson());
             $invoice->amount = $invoice->balance = 100;
             $invoice->terms = trim($account->invoice_terms);
             $invoice->invoice_footer = trim($account->invoice_footer);
             $contact->email = 'contact@gmail.com';
             $client->contacts = [$contact];
             $invoiceItem->cost = 100;
             $invoiceItem->qty = 1;
             $invoiceItem->notes = 'Notes';
             $invoiceItem->product_key = 'Item';
             $invoice->client = $client;
             $invoice->invoice_items = [$invoiceItem];
             $data['account'] = $account;
             $data['invoice'] = $invoice;
             $data['invoiceLabels'] = json_decode($account->invoice_labels) ?: [];
             $data['title'] = trans('texts.invoice_design');
             $data['invoiceDesigns'] = InvoiceDesign::availableDesigns($subSection == ACCOUNT_CUSTOMIZE_DESIGN);
             $design = false;
             foreach ($data['invoiceDesigns'] as $item) {
                 if ($item->id == $account->invoice_design_id) {
                     $design = $item->javascript;
                     break;
                 }
             }
             if ($subSection == ACCOUNT_CUSTOMIZE_DESIGN) {
                 $data['customDesign'] = $account->custom_design && !$design ? $account->custom_design : $design;
             }
         } else {
             if ($subSection == ACCOUNT_EMAIL_TEMPLATES) {
                 $data['invoiceEmail'] = $account->getEmailTemplate(ENTITY_INVOICE);
                 $data['quoteEmail'] = $account->getEmailTemplate(ENTITY_QUOTE);
                 $data['paymentEmail'] = $account->getEmailTemplate(ENTITY_PAYMENT);
                 $data['emailFooter'] = $account->getEmailFooter();
                 $data['title'] = trans('texts.email_templates');
             } else {
                 if ($subSection == ACCOUNT_USER_MANAGEMENT) {
                     $data['title'] = trans('texts.users_and_tokens');
                 }
             }
         }
         return View::make("accounts.{$subSection}", $data);
     } elseif ($section == ACCOUNT_PRODUCTS) {
         $data = ['account' => Auth::user()->account, 'title' => trans('texts.product_library')];
         return View::make('accounts.products', $data);
     }
 }
开发者ID:syamantak,项目名称:invoice-ninja,代码行数:82,代码来源:AccountController.php


注:本文中的app\models\InvoiceDesign::availableDesigns方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。