Shipment dashboard changes

This commit is contained in:
divya abdar
2025-12-03 15:36:04 +05:30
parent 3845972c5c
commit 340c2b2132
15 changed files with 2706 additions and 756 deletions

View File

@@ -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;
}
}