minor fixes
This commit is contained in:
@@ -78,7 +78,7 @@ class Invoices
|
|||||||
public static function getNewRef()
|
public static function getNewRef()
|
||||||
{
|
{
|
||||||
$ref = date('ymd').'00000';
|
$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;
|
return $lastRef ? $lastRef->ref + 1 : $ref + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ class Orders
|
|||||||
public static function getNewRef()
|
public static function getNewRef()
|
||||||
{
|
{
|
||||||
$ref = date('ymd').'00000';
|
$ref = date('ymd').'00000';
|
||||||
$lastRef = Order::where($ref, '>', $ref)->orderBy('id', 'desc')->first();
|
$lastRef = Order::where('ref', '>', $ref)->orderBy('id', 'desc')->first();
|
||||||
|
|
||||||
return $lastRef ? $lastRef->ref + 1 : $ref + 1;
|
return $lastRef ? $lastRef->ref + 1 : $ref + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user