change icons, css, add routing to merchandise, add mail templater, fixes

This commit is contained in:
Ludovic CANDELLIER
2023-02-12 23:34:48 +01:00
parent 8313e25f2e
commit f2f4788ce1
71 changed files with 1486 additions and 154 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Repositories\Shop;
use Carbon\Carbon;
use App\Models\Shop\Order;
use Illuminate\Support\Str;
class Orders
{
@@ -70,6 +71,8 @@ class Orders
public static function create($data)
{
OrderStats::increase();
$data['uuid'] = Str::uuid()->toString();
$data['ref'] = self::getNewRef();
return Order::create($data);
}
@@ -111,4 +114,12 @@ class Orders
{
return ['', 'CARTE BANCAIRE', 'CHEQUE', 'VIREMENT BANCAIRE'];
}
public static function getNewRef()
{
$ref = date('ym') . '00000';
$last_ref = Order::orderBy('ref', 'desc')->where('ref', '>', $ref)->first();
return $last_ref ? $last_ref->ref + 1 : $ref + 1;
}
}