wip
This commit is contained in:
@@ -5,7 +5,6 @@ namespace App\Nova\Resources\Order\Loan;
|
||||
use App\Models\Branch\Branch;
|
||||
use App\Models\Order\Loan\LoanOrder as LoanOrderModel;
|
||||
use App\Models\System\Location\Province;
|
||||
use App\Modules\DateHelper\Repositories\DateHelperRepository;
|
||||
use App\Nova\Filters\RegionFilter;
|
||||
use App\Nova\Filters\StatusFilter;
|
||||
use App\Nova\Resource;
|
||||
@@ -179,15 +178,6 @@ class LoanOrder extends Resource
|
||||
->options(LoanTypeRepo::values())
|
||||
->rules('required')
|
||||
->sortable(),
|
||||
|
||||
Number::make(__('Amount of loan'), 'loan_amount')
|
||||
->hide()
|
||||
->fullWidth()
|
||||
->dependsOn('loan_type', function ($field, $request, $formData) {
|
||||
if ($formData->loan_type === LoanTypeRepo::loanTypeGuarantorId()) {
|
||||
$field->show()->rules('required', 'integer', 'max:40000');
|
||||
}
|
||||
}),
|
||||
]),
|
||||
|
||||
new Panel(__('Location'), [
|
||||
@@ -253,50 +243,6 @@ class LoanOrder extends Resource
|
||||
->rules('required', 'string', new DowranAgaAllowed, 'max:255'),
|
||||
]),
|
||||
|
||||
new Panel(__('Card'), [
|
||||
Number::make(__('Card number'), 'card_number')
|
||||
->size('w-1/4')
|
||||
->hide()
|
||||
->dependsOn('loan_type', function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId()) {
|
||||
$field->show()->rules('required');
|
||||
}
|
||||
}),
|
||||
|
||||
Text::make(__('Name on card'), 'card_name')
|
||||
->size('w-1/4')
|
||||
->hide()
|
||||
->dependsOn('loan_type', function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId()) {
|
||||
$field->show()->rules('required');
|
||||
}
|
||||
}),
|
||||
|
||||
Select::make(__('Expiration month'), 'card_month')
|
||||
->displayUsingLabels()
|
||||
->searchable()
|
||||
->options(DateHelperRepository::monthsAsNumber())
|
||||
->size('w-1/4')
|
||||
->hide()
|
||||
->dependsOn('loan_type', function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId()) {
|
||||
$field->show()->rules('required');
|
||||
}
|
||||
}),
|
||||
|
||||
Select::make(__('Expiration year'), 'card_year')
|
||||
->displayUsingLabels()
|
||||
->searchable()
|
||||
->options(DateHelperRepository::yearsUntil())
|
||||
->size('w-1/4')
|
||||
->hide()
|
||||
->dependsOn('loan_type', function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId()) {
|
||||
$field->show()->rules('required');
|
||||
}
|
||||
}),
|
||||
]),
|
||||
|
||||
new Panel(__('Passport'), [
|
||||
Select::make(__('Passport serie'), 'passport_serie')
|
||||
->displayUsingLabels()
|
||||
@@ -415,157 +361,6 @@ class LoanOrder extends Resource
|
||||
->creationRules('required')
|
||||
->updateRules('nullable'),
|
||||
]),
|
||||
|
||||
new Panel(__('1. Guarantor'), [
|
||||
Text::make(__('Guarantor name'), 'guarantor_name')
|
||||
->fullWidth()
|
||||
->size('w-1/3')
|
||||
->hide()
|
||||
->dependsOn('loan_type', function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId()) {
|
||||
$field->show()->rules('required', 'string', 'max:255');
|
||||
}
|
||||
}),
|
||||
|
||||
Text::make(__('Guarantor Surname'), 'guarantor_surname')
|
||||
->fullWidth()
|
||||
->size('w-1/3')
|
||||
->hide()
|
||||
->dependsOn('loan_type', function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId()) {
|
||||
$field->show()->rules('required', 'string', 'max:255');
|
||||
}
|
||||
}),
|
||||
|
||||
Text::make(__('Guarantor Patronic name'), 'guarantor_patronic_name')
|
||||
->fullWidth()
|
||||
->size('w-1/3')
|
||||
->hide()
|
||||
->dependsOn('loan_type', function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId()) {
|
||||
$field->show()->rules('nullable', 'string', 'max:255');
|
||||
}
|
||||
}),
|
||||
|
||||
Number::make(__('Card number'), 'guarantor_card_number')
|
||||
->size('w-1/2')
|
||||
->hide()
|
||||
->dependsOn('loan_type', function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId()) {
|
||||
$field->show()->rules('required', 'integer', 'digits:16');
|
||||
}
|
||||
}),
|
||||
|
||||
Text::make(__('Name on card'), 'guarantor_card_name')
|
||||
->size('w-1/2')
|
||||
->hide()
|
||||
->dependsOn('loan_type', function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId()) {
|
||||
$field->show()->rules('required', 'string', 'max:255');
|
||||
}
|
||||
}),
|
||||
|
||||
Select::make(__('Expiration month'), 'guarantor_card_month')
|
||||
->displayUsingLabels()
|
||||
->searchable()
|
||||
->options(DateHelperRepository::monthsAsNumber())
|
||||
->size('w-1/2')
|
||||
->hide()
|
||||
->dependsOn('loan_type', function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId()) {
|
||||
$field->show()->rules('required');
|
||||
}
|
||||
}),
|
||||
|
||||
Select::make(__('Expiration year'), 'guarantor_card_year')
|
||||
->displayUsingLabels()
|
||||
->searchable()
|
||||
->options(DateHelperRepository::yearsUntil())
|
||||
->size('w-1/2')
|
||||
->hide()
|
||||
->dependsOn('loan_type', function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId()) {
|
||||
$field->show()->rules('required');
|
||||
}
|
||||
}),
|
||||
]),
|
||||
|
||||
new Panel(__('2. Guarantor'), [
|
||||
Text::make(__('Guarantor name'), 'guarantor_2_name')
|
||||
->fullWidth()
|
||||
->size('w-1/3')
|
||||
->hide()
|
||||
->dependsOn(['loan_type', 'loan_amount'], function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId() && $formData->loan_amount && floatval($formData->loan_amount) > 20000) {
|
||||
$field->show()->rules('required', 'string', 'max:255');
|
||||
}
|
||||
}),
|
||||
|
||||
Text::make(__('Guarantor Surname'), 'guarantor_2_surname')
|
||||
->fullWidth()
|
||||
->size('w-1/3')
|
||||
->hide()
|
||||
->dependsOn(['loan_type', 'loan_amount'], function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId() && $formData->loan_amount && floatval($formData->loan_amount) > 20000) {
|
||||
$field->show()->rules('required', 'string', 'max:255');
|
||||
}
|
||||
}),
|
||||
|
||||
Text::make(__('Guarantor Patronic name'), 'guarantor_2_patronic_name')
|
||||
->fullWidth()
|
||||
->size('w-1/3')
|
||||
->hide()
|
||||
->dependsOn(['loan_type', 'loan_amount'], function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId() && $formData->loan_amount && floatval($formData->loan_amount) > 20000) {
|
||||
$field->show()->rules('nullable', 'string', 'max:255');
|
||||
}
|
||||
}),
|
||||
|
||||
Number::make(__('Card number'), 'guarantor_2_card_number')
|
||||
->size('w-1/2')
|
||||
->hide()
|
||||
->dependsOn(['loan_type', 'loan_amount'], function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId() && $formData->loan_amount && floatval($formData->loan_amount) > 20000) {
|
||||
$field->show()->rules('nullable', 'string', 'max:255');
|
||||
}
|
||||
}),
|
||||
|
||||
Text::make(__('Name on card'), 'guarantor_2_card_name')
|
||||
->size('w-1/2')
|
||||
->hide()
|
||||
->dependsOn(['loan_type', 'loan_amount'], function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId() && $formData->loan_amount && floatval($formData->loan_amount) > 20000) {
|
||||
$field->show()->rules('required', 'string', 'max:255');
|
||||
}
|
||||
}),
|
||||
|
||||
Select::make(__('Expiration month'), 'guarantor_2_card_month')
|
||||
->displayUsingLabels()
|
||||
->searchable()
|
||||
->options(DateHelperRepository::monthsAsNumber())
|
||||
->size('w-1/2')
|
||||
->sortable()
|
||||
->hide()
|
||||
->dependsOn(['loan_type', 'loan_amount'], function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId() && $formData->loan_amount && floatval($formData->loan_amount) > 20000) {
|
||||
$field->show()->rules('required');
|
||||
}
|
||||
}),
|
||||
|
||||
Select::make(__('Expiration year'), 'guarantor_2_card_year')
|
||||
->displayUsingLabels()
|
||||
->searchable()
|
||||
->options(DateHelperRepository::yearsUntil())
|
||||
->size('w-1/2')
|
||||
->sortable()
|
||||
->hide()
|
||||
->dependsOn(['loan_type', 'loan_amount'], function ($field, $request, $formData) {
|
||||
if ($formData->loan_type == LoanTypeRepo::loanTypeGuarantorId() && $formData->loan_amount && floatval($formData->loan_amount) > 20000) {
|
||||
$field->show()->rules('required');
|
||||
}
|
||||
}),
|
||||
]),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user