- Add trial balance and general ledger pages to client resource with interactive tables - Implement sales and expenses relation managers for client-specific transactions - Enhance transaction handling with proper tax and withholding calculations - Add date casting to Transaction model and define client relationships - Configure super admin role bypass in AppServiceProvider - Update Filament components and fix JavaScript formatting issues
29 lines
700 B
PHP
29 lines
700 B
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\SaleResource\Pages;
|
|
|
|
use App\Filament\Resources\SaleResource;
|
|
use App\Models\Branch;
|
|
use Filament\Resources\Pages\CreateRecord;
|
|
use Illuminate\Support\Arr;
|
|
|
|
class CreateSale extends CreateRecord
|
|
{
|
|
protected static string $resource = SaleResource::class;
|
|
|
|
protected function mutateFormDataBeforeCreate(array $data): array
|
|
{
|
|
return $this->getFormDataMutation($data);
|
|
}
|
|
|
|
public function getFormDataMutation(array $data): array
|
|
{
|
|
return Arr::except($data, ['client', 'transactions', 'with_discount']);
|
|
}
|
|
|
|
protected function afterCreate(): void
|
|
{
|
|
$branch = Branch::find($this->data['branch_id']);
|
|
}
|
|
}
|