minor fixes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user