當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。