fixed #42
This commit is contained in:
parent
033674666f
commit
f8ce9ffd32
@ -133,7 +133,7 @@ class Items extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($canDelete['invoices'])) {
|
if (isset($canDelete['invoices'])) {
|
||||||
$text[] = '<b>' . $canDelete['invoices'] . '</b> ' . trans_choice('general.items', ($canDelete['invoices'] > 1) ? 2 : 1);
|
$text[] = '<b>' . $canDelete['invoices'] . '</b> ' . trans_choice('general.invoices', ($canDelete['invoices'] > 1) ? 2 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$message = trans('messages.warning.deleted', ['type' => trans_choice('general.items', 1), 'text' => implode(', ', $text)]);
|
$message = trans('messages.warning.deleted', ['type' => trans_choice('general.items', 1), 'text' => implode(', ', $text)]);
|
||||||
|
@ -49,14 +49,14 @@ class Item extends Model
|
|||||||
return $this->belongsTo('App\Models\Setting\Tax');
|
return $this->belongsTo('App\Models\Setting\Tax');
|
||||||
}
|
}
|
||||||
|
|
||||||
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');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -85,11 +85,11 @@ class Item extends Model
|
|||||||
{
|
{
|
||||||
$error = false;
|
$error = false;
|
||||||
|
|
||||||
if ($bills = $this->bills()->count()) {
|
if ($bills = $this->bill_items()->count()) {
|
||||||
$error['bills'] = $bills;
|
$error['bills'] = $bills;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($invoices = $this->invoices()->count()) {
|
if ($invoices = $this->invoice_items()->count()) {
|
||||||
$error['invoices'] = $invoices;
|
$error['invoices'] = $invoices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user