Minor fixes

This commit is contained in:
harshjagad20
2022-03-03 13:25:12 +05:30
parent ea9748ca68
commit 69d8c95557
6 changed files with 36 additions and 15 deletions

View File

@ -47,4 +47,21 @@ class Currency extends Model
{
return $this->hasMany(RecurringInvoice::class);
}
public function checkTransactions()
{
if (
$this->customers()->exists() ||
$this->items()->exists() ||
$this->invoices()->exists() ||
$this->estimates()->exists() ||
$this->expenses()->exists() ||
$this->payments()->exists() ||
$this->recurringInvoices()->exists()
) {
return true;
}
return false;
}
}

View File

@ -27,7 +27,6 @@ class Invoice extends Model implements HasMedia
public const STATUS_DRAFT = 'DRAFT';
public const STATUS_SENT = 'SENT';
public const STATUS_OVERDUE = 'OVERDUE';
public const STATUS_VIEWED = 'VIEWED';
public const STATUS_COMPLETED = 'COMPLETED';