Compare commits

..

7 Commits

Author SHA1 Message Date
d2d52b8f1b Merge pull request '20250413' (#151) from development into main
Reviewed-on: #151
2025-04-13 17:01:55 +02:00
9be2de5421 Merge branch 'main' into development 2025-04-13 17:01:48 +02:00
95abaa78a3 Small cleanups 2025-04-13 11:01:04 -04:00
d9ca6ec6ba #150: Invoice PDF name 2025-04-13 10:57:09 -04:00
1e32502759 Fix order form service type create form width 2025-04-13 10:44:48 -04:00
a4f2c3e87f #129: Product count sum
This is some goddamned unholy code bUT IT WORKS
2025-04-13 10:40:15 -04:00
5bdb0a4209 Merge pull request '20250410' (#146) from development into main
Reviewed-on: #146
2025-04-10 18:09:32 +02:00
11 changed files with 71 additions and 45 deletions

View File

@ -1,8 +1,10 @@
# Changelog
**2025-04-11**
**2025-04-13**
- Fixed #132 - Inches / cm toggle for order page (and show unit on pdf)
**2025-04-10**
- Fixed #148 - Change amount label to unit price on order form (also textarea)
- Fixed #147 - Resource lock sidebar settings
- Fixed #134 - Fix Dashboard 'last 30 days'
- Added #129 - Order product count sum
- Fixed #145 - Default order sort is incorrect (newest will always show on top now)
- Fixed #142 - Packing Slip content field should be required

View File

@ -14,6 +14,7 @@
use App\Models\ServiceFile;
use App\Models\ServiceType;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\Field;
use Filament\Forms\Components\Grid;
use Filament\Forms\Components\Group;
use Filament\Forms\Components\Placeholder;
@ -176,58 +177,41 @@ public static function form(Form $form): Form
Cluster::make([
TextInput::make('xs')
->placeholder('xs')
->rules('numeric')
->reactive()
->afterStateUpdated(fn ($state, callable $set, callable $get) => recalculateRowTotal($set, $get)),
->rules('numeric'),
TextInput::make('s')
->placeholder('s')
->rules('numeric')
->reactive()
->afterStateUpdated(fn ($state, callable $set, callable $get) => recalculateRowTotal($set, $get)),
->rules('numeric'),
TextInput::make('m')
->placeholder('m')
->rules('numeric')
->reactive()
->afterStateUpdated(fn ($state, callable $set, callable $get) => recalculateRowTotal($set, $get)),
->rules('numeric'),
TextInput::make('l')
->placeholder('l')
->rules('numeric')
->reactive()
->afterStateUpdated(fn ($state, callable $set, callable $get) => recalculateRowTotal($set, $get)),
->rules('numeric'),
TextInput::make('xl')
->placeholder('xl')
->rules('numeric')
->reactive()
->afterStateUpdated(fn ($state, callable $set, callable $get) => recalculateRowTotal($set, $get)),
->rules('numeric'),
TextInput::make('2xl')
->placeholder('2xl')
->rules('numeric')
->reactive()
->afterStateUpdated(fn ($state, callable $set, callable $get) => recalculateRowTotal($set, $get)),
->rules('numeric'),
TextInput::make('3xl')
->placeholder('3xl')
->rules('numeric')
->reactive()
->afterStateUpdated(fn ($state, callable $set, callable $get) => recalculateRowTotal($set, $get)),
->rules('numeric'),
TextInput::make('osfa')
->placeholder('osfa')
->rules('numeric')
->reactive()
->afterStateUpdated(fn ($state, callable $set, callable $get) => recalculateRowTotal($set, $get)),
->rules('numeric'),
])->label('Sizes'),
TextInput::make('total')
->disabled()
Field::make('total_display')
->dehydrated(false)
->afterStateHydrated(fn (callable $get, callable $set) => recalculateRowTotal($set, $get)),
->label('Total')
->view('forms.components.row-total'),
]),
Repeater::make('services')
@ -251,6 +235,7 @@ public static function form(Form $form): Form
->placeholder('Full name here (example: \'Embroidery\'')
->required(),
])
->createOptionAction(fn ($action) => $action->modalWidth('sm'))
->createOptionUsing(function (array $data): int {
return ServiceType::create($data)->getKey();
}),

View File

@ -10,7 +10,6 @@
use Filament\Actions;
use Filament\Resources\Components\Tab;
use Filament\Resources\Pages\ListRecords;
use Filament\Support\Enums\MaxWidth;
class ListOrders extends ListRecords
{

View File

@ -11,7 +11,7 @@ class InvoiceController extends Controller
public function pdf(int $id)
{
$invoice = Invoice::find($id);
$url = strtolower('invoice-'.$invoice->internal_id.'.pdf');
$url = strtolower($invoice->internal_id.'_'.$invoice->customer->company_name.'.pdf');
Pdf::view('pdf.invoice', ['invoice' => $invoice])
->withBrowsershot(function (Browsershot $browsershot) {

View File

@ -26,7 +26,6 @@ class ProductService extends Model
'amount',
'amount_price',
'notes',
'size_unit',
];
protected $appends = [

View File

@ -25,7 +25,7 @@
| or any other location as required by the application or its packages.
*/
'version' => '20250411',
'version' => '20250413',
/*
|--------------------------------------------------------------------------

View File

@ -15,7 +15,6 @@ public function up(): void
$table->foreignId('service_file_id')->nullable();
$table->foreignId('service_type_id')->nullable();
// $table->string('service_type')->nullable();
$table->string('placement')->nullable();
$table->string('amount')->nullable();
$table->string('amount_price')->nullable();

View File

@ -16,7 +16,6 @@ public function up(): void
$table->decimal('height')->nullable();
$table->string('unit')->default('inch');
$table->integer('setup_number')->nullable();
// $table->string('notes')->nullable();
$table->softDeletes();
$table->timestamps();
});

View File

@ -217,7 +217,7 @@ class="absolute inset-0 rotate-180 transition"
<div
x-show="! isCollapsed"
class="fi-fo-repeater-item-content px-4 py-2"
class="fi-fo-repeater-item-content px-4 py-3"
>
{{ $item }}
</div>

View File

@ -0,0 +1,43 @@
@php
$statePath = $getStatePath(); // e.g., data.order_products.UUID.total_display
$rowPath = \Illuminate\Support\Str::beforeLast($statePath, '.total_display');
$xsPath = "{$rowPath}.xs";
$sPath = "{$rowPath}.s";
$mPath = "{$rowPath}.m";
$lPath = "{$rowPath}.l";
$xlPath = "{$rowPath}.xl";
$xxlPath = "{$rowPath}.2xl";
$xxxlPath = "{$rowPath}.3xl";
$osfaPath = "{$rowPath}.osfa";
@endphp
<div
x-data="{
xs: @entangle($xsPath),
s: @entangle($sPath),
m: @entangle($mPath),
l: @entangle($lPath),
xl: @entangle($xlPath),
_2xl: @entangle($xxlPath),
_3xl: @entangle($xxxlPath),
osfa: @entangle($osfaPath),
}"
>
<!-- Filament TextInput to show the computed total -->
<input
type="text"
x-bind:value="(
(parseFloat(xs || 0)) +
(parseFloat(s || 0)) +
(parseFloat(m || 0)) +
(parseFloat(l || 0)) +
(parseFloat(xl || 0)) +
(parseFloat(_2xl || 0)) +
(parseFloat(_3xl || 0)) +
(parseFloat(osfa || 0))
).toFixed(0)"
class="fi-input block w-full border-none py-1.5 text-base text-gray-950 transition duration-75 placeholder:text-gray-400 focus:ring-0 disabled:text-gray-500 disabled:[-webkit-text-fill-color:theme(colors.gray.500)] disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.400)] dark:text-white dark:placeholder:text-gray-500 dark:disabled:text-gray-400 dark:disabled:[-webkit-text-fill-color:theme(colors.gray.400)] dark:disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.500)] sm:text-sm sm:leading-6 bg-white/0 ps-3 pe-3"
readonly
/>
</div>

View File

@ -156,8 +156,8 @@
@foreach($order->orderProducts as $product)
<tr>
<td><code style="font-size: 0.9rem;">{{$product->sku}}</code></td>
<td class="text-uppercase">{{$product->product_name}}</td>
<td class="text-uppercase">{{$product->color}}</td>
<td class="text-uppercase">{{$product->product_name ?? ''}}</td>
<td class="text-uppercase">{{$product->color ?? ''}}</td>
<td style="width: 40px;">{{$product->productSizes()->get()->where('size', 'xs')->first()->amount ?? ''}}</td>
<td style="width: 40px;">{{$product->productSizes()->get()->where('size', 's')->first()->amount ?? ''}}</td>
<td style="width: 40px;">{{$product->productSizes()->get()->where('size', 'm')->first()->amount ?? ''}}</td>
@ -176,7 +176,7 @@
</div>
<div class="row mt-3 text-end" style="font-size: 12px">
<div class="col">
TOTAL QUANTITY: {{$order->totalProductQuantity}}
TOTAL QUANTITY: {{$order->totalProductQuantity ?? ''}}
</div>
</div>
@ -199,7 +199,7 @@
<tr>
<td>
<div class="text-uppercase fw-bold">
{{$service->placement}}
{{$service->placement ?? ''}}
</div>
<br>
<div class="text-uppercase">
@ -221,13 +221,13 @@
{{$service->serviceFile->width}}
</td>
<td>
{{$service->serviceFile->height}}
{{$service->serviceFile->height ?? ''}}
</td>
<td>
{{$service->serviceFile->size_unit}}
{{$service->serviceFile->size_unit ?? ''}}
</td>
<td>
{{$service->amount}}
{{$service->amount ?? ''}}
</td>
</tr>