diff --git a/app/Repositories/Shop/Invoices.php b/app/Repositories/Shop/Invoices.php index 176f5293..71f73078 100644 --- a/app/Repositories/Shop/Invoices.php +++ b/app/Repositories/Shop/Invoices.php @@ -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; } diff --git a/app/Repositories/Shop/Orders.php b/app/Repositories/Shop/Orders.php index 359a0ed2..5d45d36e 100644 --- a/app/Repositories/Shop/Orders.php +++ b/app/Repositories/Shop/Orders.php @@ -112,7 +112,7 @@ class Orders public static function getNewRef() { $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; }