Shipment dashboard changes
This commit is contained in:
@@ -11,12 +11,27 @@ class ShipmentItem extends Model
|
||||
|
||||
protected $fillable = [
|
||||
'shipment_id',
|
||||
'order_id',
|
||||
'order_ctn',
|
||||
'order_qty',
|
||||
'order_ttl_qty',
|
||||
'order_ttl_amount',
|
||||
'order_ttl_kg',
|
||||
'order_id',
|
||||
|
||||
// OLD fields (keep them if old data exists)
|
||||
'order_ctn',
|
||||
'order_qty',
|
||||
'order_ttl_qty',
|
||||
'order_ttl_amount',
|
||||
'order_ttl_kg',
|
||||
|
||||
// NEW fields (added for correct shipments)
|
||||
'ctn',
|
||||
'qty',
|
||||
'ttl_qty',
|
||||
|
||||
'cbm',
|
||||
'ttl_cbm',
|
||||
|
||||
'kg',
|
||||
'ttl_kg',
|
||||
|
||||
'ttl_amount',
|
||||
];
|
||||
|
||||
// ---------------------------
|
||||
@@ -36,11 +51,11 @@ class ShipmentItem extends Model
|
||||
// Helper: return order data with fallback to snapshot
|
||||
public function getDisplayQty()
|
||||
{
|
||||
return $this->order->qty ?? $this->order_qty;
|
||||
return $this->qty;
|
||||
}
|
||||
|
||||
public function getDisplayAmount()
|
||||
{
|
||||
return $this->order->ttl_amount ?? $this->order_ttl_amount;
|
||||
return $this->ttl_amount;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user