Rework Site and top level tables

This commit is contained in:
Deon George
2021-12-17 14:59:55 +11:00
parent b4e569ccc8
commit 99a62828f5
8 changed files with 192 additions and 282 deletions

View File

@@ -6,9 +6,6 @@ use Illuminate\Database\Eloquent\Model;
class Currency extends Model
{
// @todo - temp Until Implemented
protected $fillable = ['rounding'];
protected $table = 'ab_currency';
public $timestamps = FALSE;
const ROUND_HALF_UP = 1;
@@ -16,14 +13,15 @@ class Currency extends Model
const ROUND_HALF_EVEN = 3;
const ROUND_HALF_ODD = 4;
/**
* The accounts in this country
*/
public function countries()
/* RELATIONS */
public function country()
{
return $this->hasMany(Country::class);
return $this->hasOne(Country::class);
}
/* METHODS */
public function round($value,$mode=self::ROUND_HALF_UP)
{
return round($value,$this->rounding,$mode);