Files
MKM/app/Filament/Resources/SaleResource/Pages/CreateSale.php
Jp 207f4c1609 feat(client): add financial reports and ledger management
- 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
2026-02-09 16:20:55 +08:00

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']);
}
}