canDelete
This commit is contained in:
@ -44,19 +44,16 @@ class Category extends Model
|
||||
{
|
||||
$error = false;
|
||||
|
||||
$items = $this->items();
|
||||
if ($items->count()) {
|
||||
$error['items'] = $items->count();
|
||||
if ($items = $this->items()->count()) {
|
||||
$error['items'] = $items;
|
||||
}
|
||||
|
||||
$payments = $this->payments();
|
||||
if ($payments->count()) {
|
||||
$error['payments'] = $payments->count();
|
||||
if ($payments = $this->payments()->count()) {
|
||||
$error['payments'] = $payments;
|
||||
}
|
||||
|
||||
$revenues = $this->revenues();
|
||||
if ($revenues->count()) {
|
||||
$error['revenues'] = $revenues->count();
|
||||
if ($revenues = $this->revenues()->count()) {
|
||||
$error['revenues'] = $revenues;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
|
@ -45,19 +45,16 @@ class Tax extends Model
|
||||
{
|
||||
$error = false;
|
||||
|
||||
$items = $this->items();
|
||||
if ($items->count()) {
|
||||
$error['items'] = $items->count();
|
||||
if ($items = $this->items()->count()) {
|
||||
$error['items'] = $items;
|
||||
}
|
||||
|
||||
$bills = $this->bills();
|
||||
if ($bills->count()) {
|
||||
$error['bills'] = $bills->count();
|
||||
if ($bills = $this->bills()->count()) {
|
||||
$error['bills'] = $bills;
|
||||
}
|
||||
|
||||
$invoices = $this->invoices();
|
||||
if ($invoices->count()) {
|
||||
$error['invoices'] = $invoices->count();
|
||||
if ($invoices = $this->invoices()->count()) {
|
||||
$error['invoices'] = $invoices;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
|
Reference in New Issue
Block a user