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


PHP Invoice::whereAccountId方法代码示例

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


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

示例1: fire

 public function fire()
 {
     $this->info(date('Y-m-d') . ' ChargeRenewalInvoices...');
     $ninjaAccount = $this->accountRepo->getNinjaAccount();
     $invoices = Invoice::whereAccountId($ninjaAccount->id)->whereDueDate(date('Y-m-d'))->where('balance', '>', 0)->with('client')->orderBy('id')->get();
     $this->info(count($invoices) . ' invoices found');
     foreach ($invoices as $invoice) {
         // check if account has switched to free since the invoice was created
         $account = Account::find($invoice->client->public_id);
         if (!$account) {
             continue;
         }
         $company = $account->company;
         if (!$company->plan || $company->plan == PLAN_FREE) {
             continue;
         }
         try {
             $this->info("Charging invoice {$invoice->invoice_number}");
             $this->paymentService->autoBillInvoice($invoice);
         } catch (Exception $exception) {
             $this->info('Error: ' . $exception->getMessage());
         }
     }
     $this->info('Done');
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:25,代码来源:ChargeRenewalInvoices.php

示例2: fire

 public function fire()
 {
     $this->info(date('Y-m-d') . ' ChargeRenewalInvoices...');
     $account = $this->accountRepo->getNinjaAccount();
     $invoices = Invoice::whereAccountId($account->id)->whereDueDate(date('Y-m-d'))->with('client')->orderBy('id')->get();
     $this->info(count($invoices) . ' invoices found');
     foreach ($invoices as $invoice) {
         $this->info("Charging invoice {$invoice->invoice_number}");
         $this->paymentService->autoBillInvoice($invoice);
     }
     $this->info('Done');
 }
开发者ID:hannenijhuis,项目名称:invoiceninja,代码行数:12,代码来源:ChargeRenewalInvoices.php

示例3: findNeedingReminding

 public function findNeedingReminding($account)
 {
     $dates = [];
     for ($i = 1; $i <= 3; $i++) {
         $field = "enable_reminder{$i}";
         if (!$account->{$field}) {
             continue;
         }
         $field = "num_days_reminder{$i}";
         $dates[] = "due_date = '" . date('Y-m-d', strtotime("- {$account->{$field}} days")) . "'";
     }
     $sql = implode(' OR ', $dates);
     $invoices = Invoice::whereAccountId($account->id)->where('balance', '>', 0)->whereRaw('(' . $sql . ')')->get();
     return $invoices;
 }
开发者ID:nafrente,项目名称:invoice-ninja,代码行数:15,代码来源:InvoiceRepository.php

示例4: findNeedingReminding

 public function findNeedingReminding($account)
 {
     $dates = [];
     for ($i = 1; $i <= 3; $i++) {
         if ($date = $account->getReminderDate($i)) {
             $field = $account->{"field_reminder{$i}"} == REMINDER_FIELD_DUE_DATE ? 'due_date' : 'invoice_date';
             $dates[] = "{$field} = '{$date}'";
         }
     }
     $sql = implode(' OR ', $dates);
     $invoices = Invoice::whereAccountId($account->id)->where('balance', '>', 0)->whereRaw('(' . $sql . ')')->get();
     return $invoices;
 }
开发者ID:j-beere,项目名称:invoiceninja,代码行数:13,代码来源:InvoiceRepository.php


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