33 lines
720 B
PHP
33 lines
720 B
PHP
<?php
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ReceivingOrderItem extends Model
|
|
{
|
|
protected $table = 'receiving_order_items';
|
|
|
|
protected $fillable = [
|
|
'receiving_order_id',
|
|
'sku_code',
|
|
'sku_name',
|
|
'order_quantity',
|
|
'received_quantity',
|
|
];
|
|
|
|
protected $casts = [
|
|
'order_quantity' => 'integer',
|
|
'received_quantity' => 'integer',
|
|
];
|
|
|
|
public function receivingOrder(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ReceivingOrder::class);
|
|
}
|
|
|
|
public function erpSku()
|
|
{
|
|
return $this->belongsTo(ErpSku::class, 'sku_code', 'sku_code');
|
|
}
|
|
} |