From b5ed7d9896eb1fe66f356fe104b02cd85ba0689b Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 22 May 2017 11:22:34 +0300 Subject: [PATCH] Refactor isInvoice to isStandard --- app/Http/Controllers/InvoiceApiController.php | 2 +- app/Models/Invoice.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/InvoiceApiController.php b/app/Http/Controllers/InvoiceApiController.php index 5e75f36c7a2e..c8670b055049 100644 --- a/app/Http/Controllers/InvoiceApiController.php +++ b/app/Http/Controllers/InvoiceApiController.php @@ -185,7 +185,7 @@ class InvoiceApiController extends BaseAPIController $invoice = $this->invoiceService->save($data); $payment = false; - if ($invoice->isInvoice()) { + if ($invoice->isStandard()) { if ($isAutoBill) { $payment = $this->paymentService->autoBillInvoice($invoice); } elseif ($isPaid) { diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index ce45c8827bb2..36afcdeed62c 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -430,7 +430,7 @@ class Invoice extends EntityModel implements BalanceAffecting /** * @return bool */ - public function isInvoice() + public function isStandard() { return $this->isType(INVOICE_TYPE_STANDARD) && ! $this->is_recurring; } @@ -611,7 +611,7 @@ class Invoice extends EntityModel implements BalanceAffecting public function canBePaid() { - return floatval($this->balance) != 0 && ! $this->is_deleted && $this->isInvoice(); + return floatval($this->balance) != 0 && ! $this->is_deleted && $this->isStandard(); } public static function calcStatusLabel($status, $class, $entityType, $quoteInvoiceId)