minor fixes

This commit is contained in:
ludo
2023-12-11 21:09:48 +01:00
parent df65516b36
commit e0d8106078
2 changed files with 2 additions and 2 deletions

View File

@@ -78,7 +78,7 @@ class Invoices
public static function getNewRef()
{
$ref = date('ymd').'00000';
$lastRef = Invoice::where($ref, '>', $ref)->orderBy('id', 'desc')->first();
$lastRef = Invoice::where('ref', '>', $ref)->orderBy('id', 'desc')->first();
return $lastRef ? $lastRef->ref + 1 : $ref + 1;
}