Update with new price management

This commit is contained in:
Ludovic CANDELLIER
2021-03-22 00:47:44 +01:00
parent 083d358fbd
commit 37ffaa938b
64 changed files with 1118 additions and 984 deletions

View File

@@ -17,9 +17,9 @@ class ArticlePrice extends Model
return $this->hasOne('App\Models\Price');
}
public function priceFamilyValue()
public function article_family()
{
return $this->belongsTo('App\Models\PriceFamilyValue');
return $this->belongsTo('App\Models\ArticleFamily');
}
public function scopeByQuantity($query, $quantity)
@@ -27,8 +27,8 @@ class ArticlePrice extends Model
return $query->orderBy('quantity', 'desc')->where('quantity', '<', $quantity)->first();
}
public function scopeByPriceFamilyValue($query, $id)
public function scopeByFamily($query, $id)
{
return $query->where('price_family_value_id', $id);
return $query->where('article_family_value_id', $id);
}
}