43 lines
845 B
PHP
43 lines
845 B
PHP
<?php
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class ReceivingOrder extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'receiving_orders';
|
|
|
|
protected $fillable = [
|
|
'receiving_no',
|
|
'po_id',
|
|
'warehouse_id',
|
|
'total_quantity',
|
|
'received_quantity',
|
|
'status',
|
|
'receiver',
|
|
'remark',
|
|
'is_cloud_warehouse',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_cloud_warehouse' => 'boolean',
|
|
];
|
|
|
|
public function purchaseOrder()
|
|
{
|
|
return $this->belongsTo(PurchaseOrder::class, 'po_id');
|
|
}
|
|
|
|
public function warehouse()
|
|
{
|
|
return $this->belongsTo(Warehouse::class);
|
|
}
|
|
|
|
public function items()
|
|
{
|
|
return $this->hasMany(ReceivingOrderItem::class);
|
|
}
|
|
} |