diff --git a/app/Nova/Resources/Order/Loan/LoanOrderMobileFieldsForDetail.php b/app/Nova/Resources/Order/Loan/LoanOrderMobileFieldsForDetail.php index bb87a7a..74c9323 100644 --- a/app/Nova/Resources/Order/Loan/LoanOrderMobileFieldsForDetail.php +++ b/app/Nova/Resources/Order/Loan/LoanOrderMobileFieldsForDetail.php @@ -178,22 +178,20 @@ class LoanOrderMobileFieldsForDetail Text::make(__('Guarantor Patronic name'), 'guarantor_patronic_name'), - Number::make(__('Card number'), 'guarantor_card_number'), + Text::make(__('Passport'), fn ($model) => sprintf( + '%s %s', + $model->guarantor_passport_serie, + $model->guarantor_passport_id, + ))->asHtml(), - Text::make(__('Name on card'), 'guarantor_card_name'), - - Select::make(__('Expiration month'), 'guarantor_card_month') - ->displayUsingLabels() - ->searchable() - ->options(DateHelperRepository::monthsAsNumber()), - - Select::make(__('Expiration year'), 'guarantor_card_year') - ->displayUsingLabels() - ->searchable() - ->options(DateHelperRepository::yearsUntil()), - - Text::make(__('Ortaça zähmen haky'), 'guarantor_note') + Text::make(__('Ortaça zähmet haky'), 'guarantor_note') ->canSeeWhen('systemUser', $resource), + + NovaCustomHtml::make(__('Data'), 'card_name') + ->html(view('orders.loan.mobile.card-gurantor-history', [ + 'resource' => $resource, + ])->render()) + ->fillUsing(NovaForm::fillEmpty()), ]), new Panel('2. '.__('Guarantor'), [ @@ -201,21 +199,20 @@ class LoanOrderMobileFieldsForDetail Text::make(__('Guarantor Surname'), 'guarantor_2_surname'), Text::make(__('Guarantor Patronic name'), 'guarantor_2_patronic_name'), - Number::make(__('Card number'), 'guarantor_2_card_number'), - Text::make(__('Name on card'), 'guarantor_2_card_name'), + Text::make(__('Passport'), fn ($model) => sprintf( + '%s %s', + $model->guarantor_2_passport_serie, + $model->guarantor_2_passport_id, + ))->asHtml(), - Select::make(__('Expiration month'), 'guarantor_2_card_month') - ->displayUsingLabels() - ->searchable() - ->options(DateHelperRepository::monthsAsNumber()), - - Select::make(__('Expiration year'), 'guarantor_2_card_year') - ->displayUsingLabels() - ->searchable() - ->options(DateHelperRepository::yearsUntil()), - - Text::make(__('Ortaça zähmen haky'), 'guarantor_2_note') + Text::make(__('Ortaça zähmet haky'), 'guarantor_2_note') ->canSeeWhen('systemUser', $resource), + + NovaCustomHtml::make(__('Data'), 'card_name') + ->html(view('orders.loan.mobile.card-gurantor-2-history', [ + 'resource' => $resource, + ])->render()) + ->fillUsing(NovaForm::fillEmpty()), ]), ]; diff --git a/resources/views/orders/loan/mobile/card-gurantor-2-history.blade.php b/resources/views/orders/loan/mobile/card-gurantor-2-history.blade.php new file mode 100644 index 0000000..583fe3d --- /dev/null +++ b/resources/views/orders/loan/mobile/card-gurantor-2-history.blade.php @@ -0,0 +1,75 @@ +@if ($resource->guarantor_2_card_month) + @php + $months = App\Modules\DateHelper\Repositories\DateHelperRepository::monthsAsNumber(); + $years = App\Modules\DateHelper\Repositories\DateHelperRepository::yearsUntil(); + + $card_month = array_key_exists($resource->guarantor_2_card_month, $months) ? $months[$resource->guarantor_2_card_month] : '-'; + $card_year = array_key_exists($resource->guarantor_2_card_year, $years) ? $years[$resource->guarantor_2_card_year] : '-'; + @endphp + + + +
+
+
{{ $resource->guarantor_2_card_number }}
+
+
{{ $resource->guarantor_2_card_name }}
+
{{ $card_month }}/{{ $card_year }}
+
+
+
+ +
+
+@endif diff --git a/resources/views/orders/loan/mobile/card-gurantor-history.blade.php b/resources/views/orders/loan/mobile/card-gurantor-history.blade.php new file mode 100644 index 0000000..732ed3b --- /dev/null +++ b/resources/views/orders/loan/mobile/card-gurantor-history.blade.php @@ -0,0 +1,73 @@ +@php + $months = App\Modules\DateHelper\Repositories\DateHelperRepository::monthsAsNumber(); + $years = App\Modules\DateHelper\Repositories\DateHelperRepository::yearsUntil(); + + $card_month = array_key_exists($resource->guarantor_card_month, $months) ? $months[$resource->guarantor_card_month] : '-'; + $card_year = array_key_exists($resource->guarantor_card_year, $years) ? $years[$resource->guarantor_card_year] : '-'; +@endphp + + + +
+
+
{{ $resource->guarantor_card_number }}
+
+
{{ $resource->guarantor_card_name }}
+
{{ $card_month }}/{{ $card_year }}
+
+
+
+ +
+