akaunting 3.0 (the last dance)

This commit is contained in:
Burak Civan
2022-06-01 10:15:55 +03:00
parent cead09f6d4
commit d9c0764572
3812 changed files with 126831 additions and 102949 deletions

View File

@ -101,6 +101,18 @@ class Currency extends Model
return $this->contacts()->whereIn('type', (array) $this->getVendorTypes());
}
/**
* Scope currency by code.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param mixed $code
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeCode($query, $code)
{
return $query->where($this->qualifyColumn('code'), $code);
}
/**
* Get the current precision.
*
@ -172,15 +184,30 @@ class Currency extends Model
}
/**
* Scope currency by code.
* Get the line actions.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param mixed $code
* @return \Illuminate\Database\Eloquent\Builder
* @return array
*/
public function scopeCode($query, $code)
public function getLineActionsAttribute()
{
return $query->where($this->qualifyColumn('code'), $code);
$actions = [];
$actions[] = [
'title' => trans('general.edit'),
'icon' => 'edit',
'url' => route('currencies.edit', $this->id),
'permission' => 'update-settings-currencies',
];
$actions[] = [
'type' => 'delete',
'icon' => 'delete',
'route' => 'currencies.destroy',
'permission' => 'delete-settings-currencies',
'model' => $this,
];
return $actions;
}
/**