ζ͜͡Gurthang
ζ͜͡Gurthang
FFilament
Created by ζ͜͡Gurthang on 10/14/2024 in #❓┊help
Sumarize IF.....
THE ANSWER:
TextColumn::make('detalles.total')
->label('Total Detalle')
->getStateUsing(fn ($record) => $record->anulado? 0 : $record->detalles->sum('total'))
->money('ARS')
->summarize([
Sum::make('total')->query(fn (\Illuminate\Database\Query\Builder $query) =>
$query
->join('proformas', 'proformas.id', '=', 'proformas_detalles.proforma_id')
->where('anulado', false))->money('ARS')
]),
TextColumn::make('detalles.total')
->label('Total Detalle')
->getStateUsing(fn ($record) => $record->anulado? 0 : $record->detalles->sum('total'))
->money('ARS')
->summarize([
Sum::make('total')->query(fn (\Illuminate\Database\Query\Builder $query) =>
$query
->join('proformas', 'proformas.id', '=', 'proformas_detalles.proforma_id')
->where('anulado', false))->money('ARS')
]),
4 replies
FFilament
Created by ζ͜͡Gurthang on 10/14/2024 in #❓┊help
Sumarize IF.....
No description
4 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
class EditFormInicio extends Component implements HasForms {

use InteractsWithForms;

public Expediente $expediente;
public $expediente_estado = null;
public $expe_id = null;
public $data = [];

public function mount($expe_id): void {
$this->expe_id = $expe_id;
$this->expediente = Expediente::with('expedienteEstado')->find($this->expe_id);
$this->form->fill($this->expediente->toArray());
}
public function form(Form $form): Form{
return $form
->schema([
TextInput::make('titulo')
->label('Título del Expediente')
->default($this->expediente['titulo'])
->required(),
Select::make('tipo_cod')
->label('Tipo de Expediente')
->options(GeneralList::where('code', 1)->pluck('s_value', 'value')->toArray())
->searchable()
->required(),
])
->columns(2)
->statePath('data');
}

public function getFormStatePath(): ?string{
return null;
}

public function render()
{
return view('livewire.edit-form-inicio');
}
}
class EditFormInicio extends Component implements HasForms {

use InteractsWithForms;

public Expediente $expediente;
public $expediente_estado = null;
public $expe_id = null;
public $data = [];

public function mount($expe_id): void {
$this->expe_id = $expe_id;
$this->expediente = Expediente::with('expedienteEstado')->find($this->expe_id);
$this->form->fill($this->expediente->toArray());
}
public function form(Form $form): Form{
return $form
->schema([
TextInput::make('titulo')
->label('Título del Expediente')
->default($this->expediente['titulo'])
->required(),
Select::make('tipo_cod')
->label('Tipo de Expediente')
->options(GeneralList::where('code', 1)->pluck('s_value', 'value')->toArray())
->searchable()
->required(),
])
->columns(2)
->statePath('data');
}

public function getFormStatePath(): ?string{
return null;
}

public function render()
{
return view('livewire.edit-form-inicio');
}
}
in a Livewire Component
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
I SOLVED IT!! here is the answer!
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
still i cant show the data
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
my form method now look like this
public function form(Form $form): Form{
dump($this->expediente);
return $form
->schema([
Section::make()
->id('inicio')
->schema([
Group::make()
->schema([
TextInput::make('expe_title')
->label('Título del Expediente')->required(),
Select::make('expe_type')
->label('Tipo de Expediente')
->options(GeneralList::where('code', 1)->pluck('s_value', 'value')->toArray())
->searchable()
->required(),
])->columns(2),
])
])->model($this->expediente);
}
public function form(Form $form): Form{
dump($this->expediente);
return $form
->schema([
Section::make()
->id('inicio')
->schema([
Group::make()
->schema([
TextInput::make('expe_title')
->label('Título del Expediente')->required(),
Select::make('expe_type')
->label('Tipo de Expediente')
->options(GeneralList::where('code', 1)->pluck('s_value', 'value')->toArray())
->searchable()
->required(),
])->columns(2),
])
])->model($this->expediente);
}
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
No description
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
i did the livewire components and now i can show the expediente information but....
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
well a step foward....
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
cause i need like X forms
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
yeah i deleted...
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
No description
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
i dont have any form in my RecordFileResource
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
nop that is in my EditRecordFile
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
may be u are rigth but when i did the createRecordFile it worked fine.... so i didnt think of it
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
u mean that i make another livewire component to add the form like i did with the others livewire components?
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
i may be wrong
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
as long as i know the EditRecordFile is a livewire component
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
40 replies
FFilament
Created by ζ͜͡Gurthang on 9/20/2024 in #❓┊help
Form method executing before mount method?
cause i have a view with tabs and in every tab i have diferent tables and forms
40 replies