fixed #51
This commit is contained in:
parent
0a980e7602
commit
ae52ce5a43
@ -3,9 +3,6 @@
|
||||
namespace App\Models\Setting;
|
||||
|
||||
use App\Models\Model;
|
||||
use App\Models\Item\Item;
|
||||
use App\Models\Expense\Bill;
|
||||
use App\Models\Income\Invoice;
|
||||
|
||||
class Tax extends Model
|
||||
{
|
||||
@ -31,14 +28,14 @@ class Tax extends Model
|
||||
return $this->hasMany('App\Models\Item\Item');
|
||||
}
|
||||
|
||||
public function bills()
|
||||
public function bill_items()
|
||||
{
|
||||
return $this->hasMany('App\Models\Expense\Bill');
|
||||
return $this->hasMany('App\Models\Expense\BillItem');
|
||||
}
|
||||
|
||||
public function invoices()
|
||||
public function invoice_items()
|
||||
{
|
||||
return $this->hasMany('App\Models\Income\Invoice');
|
||||
return $this->hasMany('App\Models\Income\InvoiceItem');
|
||||
}
|
||||
|
||||
public function canDelete()
|
||||
@ -49,11 +46,11 @@ class Tax extends Model
|
||||
$error['items'] = $items;
|
||||
}
|
||||
|
||||
if ($bills = $this->bills()->count()) {
|
||||
if ($bills = $this->bill_items()->count()) {
|
||||
$error['bills'] = $bills;
|
||||
}
|
||||
|
||||
if ($invoices = $this->invoices()->count()) {
|
||||
if ($invoices = $this->invoice_items()->count()) {
|
||||
$error['invoices'] = $invoices;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user