Refactor isInvoice to isStandard

This commit is contained in:
Hillel Coren 2017-05-22 11:22:34 +03:00
parent 8227726f50
commit b5ed7d9896
2 changed files with 3 additions and 3 deletions

View File

@ -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) {

View File

@ -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)