diff --git a/app/Filament/Clusters/Loans/Resources/LoanOrderMobiles/Schemas/LoanOrderMobileForm.php b/app/Filament/Clusters/Loans/Resources/LoanOrderMobiles/Schemas/LoanOrderMobileForm.php index cad0037..3a07f4c 100644 --- a/app/Filament/Clusters/Loans/Resources/LoanOrderMobiles/Schemas/LoanOrderMobileForm.php +++ b/app/Filament/Clusters/Loans/Resources/LoanOrderMobiles/Schemas/LoanOrderMobileForm.php @@ -266,27 +266,27 @@ class LoanOrderMobileForm Tab::make(__('Salary card')) ->columns(6) ->schema([ - TextInput::make('number') + TextInput::make('card_number') ->label(__('Card number')) ->mask('9999 9999 9999 9999') ->dehydrateStateUsing(fn ($state) => str_replace(' ', '', $state)) ->columnSpan(2) ->required(), - TextInput::make('name') + TextInput::make('card_name') ->label(__('Card name')) ->maxLength(255) ->columnSpan(2) ->required(), - Select::make('month') + Select::make('card_month') ->label(__('Card month')) ->options(DateHelper::staticNumberMonths()) ->native(false) ->columnSpan(1) ->required(), - Select::make('year') + Select::make('card_year') ->label(__('Card year')) ->options(DateHelper::staticNumberYears()) ->native(false) @@ -380,17 +380,83 @@ class LoanOrderMobileForm ->required() ->columnSpan(1), ]), - Tab::make(__('Guarantor'). '1') - ->columns(4) + Tab::make(__('Guarantor'). ' 1') + ->columns(6) ->schema([ + TextInput::make('guarantor_name') + ->label(__('Guarantor').' '. __('Name')) + ->columnSpan(2) + ->required() + ->maxLength(255), + TextInput::make('guarantor_surname') + ->label(__('Guarantor').' '. __('Surname')) + ->columnSpan(2) + ->required() + ->maxLength(255), + + TextInput::make('guarantor_patronic_name') + ->label(__('Guarantor').' '. __('Patronic name')) + ->columnSpan(2) + ->maxLength(255), + + FusedGroup::make([ + Select::make('guarantor_passport_serie') + ->label(__('Passport serie')) + ->options(TurkmenPassportRepository::values()) + ->native(false) + ->required() + ->columnSpan(1), + + TextInput::make('guarantor_passport_id') + ->label(__('Passport number')) + ->required() + ->columnSpan(1) + ->mask('999999'), + ]) + ->columnSpan(3) + ->label(__('Passport serie and number')) + ->columns(2), + + TextInput::make('guarantor_card_number') + ->label(__('Card number')) + ->mask('9999 9999 9999 9999') + ->dehydrateStateUsing(fn ($state) => str_replace(' ', '', $state)) + ->columnSpan(2) + ->required(), + + TextInput::make('guarantor_card_name') + ->label(__('Card name')) + ->maxLength(255) + ->columnSpan(2) + ->required(), + + Select::make('guarantor_card_month') + ->label(__('Card month')) + ->options(DateHelper::staticNumberMonths()) + ->native(false) + ->columnSpan(1) + ->required(), + + Select::make('guarantor_card_year') + ->label(__('Card year')) + ->options(DateHelper::staticNumberYears()) + ->native(false) + ->columnSpan(1) + ->required(), + + TextInput::make('guarantor_note') + ->label(__('Guarantor').' '. __('Salary')) + ->columnSpan(2) + ->required() + ->maxLength(255), ]), Tab::make(__('Guarantor'). '2') ->columns(4) ->hidden(function (Get $get): bool { $loan_amount = $get('loan_amount'); - return $loan_amount && intval($loan_amount) > 20000; + return ! ($loan_amount && intval($loan_amount) > 20000); }) ->schema([