Deploy / deploy (push) Successful in 16s
Every delivery and batch now writes a signed movement entry instead of directly incrementing/decrementing spice.quantity. The balance is always the sum of all movements. Existing data is backfilled in the migration. Rohstoff edit page shows the full movement history (Lagerbewegungen tab). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
16 lines
295 B
PHP
16 lines
295 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class SpiceStockMovement extends Model
|
|
{
|
|
protected $fillable = ['spice_id', 'amount', 'source_type', 'source_id', 'description'];
|
|
|
|
public function spice()
|
|
{
|
|
return $this->belongsTo(Spice::class);
|
|
}
|
|
}
|