diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index aab0f39..9f113d6 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -251,7 +251,7 @@ class Invoice extends Model static::creating(function (self $model) { $model->ref = \sprintf( '%s_%s_%s', - Carbon::now()->isoFormat('YYYY'), + Carbon::now()->isoFormat('YYYY-MM'), Str::padLeft((Invoice::whereYear('created_at', Carbon::now()->isoFormat('YYYY')) ->whereMonth('created_at', Carbon::now()->isoFormat('MM')) ->count() + 1) ?: 1, 4, '0'),