Version 20250311 #121
@ -1,5 +1,7 @@
|
||||
# Changelog
|
||||
|
||||
**2025-03-11**
|
||||
- Fixed #107 - Fix dashboard
|
||||
- Fixed #118 - Improved customer form and re-add 'create customer' to order form
|
||||
- Fixed #117 - Draft orders should not show up in order tabs
|
||||
- Fixed #116 - 'Ready for invoice'-badge shows 0 instead of hiding
|
||||
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Admin\Widgets;
|
||||
|
||||
use App\Enums\OrderStatus;
|
||||
use App\Models\Order;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Widgets\TableWidget as BaseWidget;
|
||||
|
||||
class ActiveOrdersTable extends BaseWidget
|
||||
{
|
||||
protected static ?int $sort = 2;
|
||||
|
||||
protected string|int|array $columnSpan = 2;
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->query(
|
||||
Order::query()
|
||||
->where('status', '!=', OrderStatus::SHIPPED)
|
||||
->where('status', '!=', OrderStatus::INVOICED)
|
||||
)
|
||||
->columns([
|
||||
TextColumn::make('customer.company_name'),
|
||||
TextColumn::make('customer_po')
|
||||
->color('code')
|
||||
->weight('bold'),
|
||||
TextColumn::make('status')
|
||||
// ->color(OrderStatus::class)
|
||||
->badge(),
|
||||
])
|
||||
->defaultPaginationPageOption(5);
|
||||
}
|
||||
}
|
@ -35,7 +35,9 @@ protected function getStats(): array
|
||||
private function getActiveOrders(): string
|
||||
{
|
||||
return Order::all()
|
||||
->where('order_status', '!=', OrderStatus::DRAFT)
|
||||
->where('order_status', '!=', OrderStatus::SHIPPED)
|
||||
->where('order_status', '!=', OrderStatus::READY_FOR_INVOICE)
|
||||
->where('order_status', '!=', OrderStatus::INVOICED)
|
||||
->count();
|
||||
}
|
||||
@ -43,6 +45,8 @@ private function getActiveOrders(): string
|
||||
private function getOrdersPast30Days(): string
|
||||
{
|
||||
return Order::all()
|
||||
->where('order_status', '!=', OrderStatus::DRAFT)
|
||||
->where('order_status', '!=', OrderStatus::READY_FOR_INVOICE)
|
||||
->where('order_status', '!=', OrderStatus::SHIPPED)
|
||||
->where('order_status', '!=', OrderStatus::INVOICED)
|
||||
->whereBetween('created_at', [now()->startOfMonth(), now()->endOfMonth()])
|
||||
@ -65,6 +69,8 @@ private function getOrdersInPast30DaysChart(): array
|
||||
private function getDueOrders(): string
|
||||
{
|
||||
return Order::all()
|
||||
->where('order_status', '!=', OrderStatus::DRAFT)
|
||||
->where('order_status', '!=', OrderStatus::READY_FOR_INVOICE)
|
||||
->where('order_status', '!=', OrderStatus::SHIPPED)
|
||||
->where('order_status', '!=', OrderStatus::INVOICED)
|
||||
->where('due_date', '<=', now())
|
||||
|
@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Admin\Widgets;
|
||||
|
||||
use App\Enums\OrderStatus;
|
||||
use App\Models\Order;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Widgets\TableWidget as BaseWidget;
|
||||
|
||||
class RushOrdersTable extends BaseWidget
|
||||
{
|
||||
protected string|int|array $columnSpan = 2;
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->query(
|
||||
Order::query()
|
||||
->where('status', '!=', OrderStatus::SHIPPED)
|
||||
->where('status', '!=', OrderStatus::INVOICED)
|
||||
->where('rush', true)
|
||||
->orderByDesc('due_date')
|
||||
)
|
||||
->columns([
|
||||
TextColumn::make('customer.company_name'),
|
||||
TextColumn::make('customer_po')
|
||||
->color('code')
|
||||
->weight('bold'),
|
||||
TextColumn::make('status')
|
||||
->badge(),
|
||||
])
|
||||
->defaultPaginationPageOption(5);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user