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)