49 lines
1020 B
PHP
49 lines
1020 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class QuoteLine extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'quote_id',
|
|
'product_id',
|
|
'packaging_id',
|
|
'packages_qty',
|
|
'units_qty',
|
|
'description',
|
|
'qty_base',
|
|
'unit_price',
|
|
'unit_price_per_package',
|
|
'tva_rate_id',
|
|
'discount_pct',
|
|
'total_ht',
|
|
];
|
|
|
|
public function quote()
|
|
{
|
|
return $this->belongsTo(Quote::class);
|
|
}
|
|
|
|
public function product()
|
|
{
|
|
return $this->belongsTo(Product::class);
|
|
}
|
|
|
|
public function packaging()
|
|
{
|
|
// Assuming ProductPackaging model exists
|
|
return $this->belongsTo(\App\Models\Stock\ProductPackaging::class, 'packaging_id');
|
|
}
|
|
|
|
public function tvaRate()
|
|
{
|
|
// Assuming TvaRate model exists
|
|
return $this->belongsTo(\App\Models\TvaRate::class, 'tva_rate_id');
|
|
}
|
|
}
|