Merge remote-tracking branch 'origin/master'

# Conflicts:
#	resources/views/admin/preview.blade.php
This commit is contained in:
merdan 2022-11-21 14:44:15 +05:00
commit c2eac4ed4d
3 changed files with 75 additions and 47 deletions

View File

@ -6,6 +6,7 @@
use App\Http\Requests\API\ContractRequest;
use App\Http\Resources\ContractResource;
use App\Models\Contract;
use App\Models\Resolutionbasis;
use Illuminate\Http\Request;
class ContractController extends Controller
@ -20,8 +21,6 @@ public function contract(ContractRequest $request){
}
public function import(Request $request){
foreach($request->all() as $item){
$contract['foreign_ID'] = $item['ID'];
$contract['InputNumber'] = $item['InputNumber'];
@ -33,15 +32,29 @@ public function import(Request $request){
$contract['Remark'] = $item['Remark'];
$record = Contract::where('foreign_ID', $contract['foreign_ID'])->first();
if($record != null){
$record->fill($contract);
$record->save();
}
else{
if($record == null){
Contract::create($contract);
}
}
return 'ok';
}
public function resolutionBasis(Request $request){
foreach($request->all() as $entry){
$resolution = [
'contract_id' => $entry['contract_id'],
'workflow_id' => $entry['workflow_id'],
'department_id' => $entry['department_id'],
'resolution_id' => $entry['resolution_id'],
'resolutionbasis' => $entry['resolutionbasis']
];
$res = Resolutionbasis::where('contract_id', $entry['contract_id'])->first();
if($res == null){
Resolutionbasis::create($resolution);
}
}
return 'ok';
}
}

View File

@ -188,6 +188,21 @@
'preview' => 'Preview',
'accept' => 'Accept',
'accepted_applications' => 'Accepted applications',
'accepted' => 'Accepted'
'accepted' => 'Accepted',
'enterpreneur' => 'Entrepreneur',
'fond_capital' => 'Fond capital',
'management_types' => 'Management types',
'signers' => 'Signers',
'share_holders' => 'Share holders',
'organization_form' => 'Organizational form',
'is_agent' => 'Is agent?',
'state' => 'State',
'actions' => 'Actions',
'closed' => 'Closed',
'open' => 'Open',
'add_new_user' => 'Add new user',
'fullname' => 'Full Name'
]
];

View File

@ -11,7 +11,7 @@
<nav aria-label="breadcrumb" class="d-none d-lg-block">
<ol class="breadcrumb m-0 mb-3">
<li class="breadcrumb-item"><a href="#">Admin</a></li>
<li class="breadcrumb-item"><a href="#">Account</a></li>
<li class="breadcrumb-item"><a href="#">{{ trans('app.ticket.account') }}</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ $account->id }}</li>
</ol>
</nav>
@ -22,98 +22,98 @@
<div class="card-body">
@if ($account->type == 'business')
<div class="form-group">
<label for="company"><small>Profile type</small></label>
<h6><strong>Entreprenuer</strong></h6>
<label for="company"><small>{{ trans('app.application.profile_type') }}</small></label>
<h6><strong>{{ trans('app.last_updates.enterpreneur') }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Country</small></label>
<label for="company"><small>{{ trans('app.account.country') }}</small></label>
<h6><strong>{{ $account->country->name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Name</small></label>
<label for="company"><small>{{ trans('app.account.name') }}</small></label>
<h6><strong>{{ $account->profile->name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Surname</small></label>
<label for="company"><small>{{ trans('app.business.surname') }}</small></label>
<h6><strong>{{ $account->profile->surname ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Patronomic</small></label>
<label for="company"><small>{{ trans('app.business.patronomic_name') }}</small></label>
<h6><strong>{{ $account->profile->patronomic_name ?? null }}</strong></h6>
</div>
@if (isset($account->profile->date_of_birth))
<div class="form-group">
<label for="company"><small>Date of birth</small></label>
<label for="company"><small>{{ trans('app.business.date_of_birth') }}</small></label>
<h6><strong>{{ Carbon\Carbon::parse($account->profile->date_of_birth)->format('d.m.Y') }}</strong></h6>
</div>
@endif
<div class="form-group">
<label for="company"><small>Birthplace</small></label>
<label for="company"><small>{{ trans('app.business.birth_place') }}</small></label>
<h6><strong>{{ $account->profile->birth_place ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration address</small></label>
<label for="company"><small>{{ trans('app.company.registration_address') }}</small></label>
<h6><strong>{{ $account->profile->registration_address ?? null }}</strong></h6>
</div>
@else
<div class="form-group">
<label for="company"><small>Profile type</small></label>
<h6><strong>Company</strong></h6>
<label for="company"><small>{{ trans('app.application.profile_type') }}</small></label>
<h6><strong>{{ trans('app.account.company') }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Name</small></label>
<label for="company"><small>{{ trans('app.account.name') }}</small></label>
<h6><strong>{{ $account->profile->name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Short name</small></label>
<label for="company"><small>{{ trans('app.company.short_name') }}</small></label>
<h6><strong>{{ $account->profile->short_name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration number</small></label>
<label for="company"><small>{{ trans('app.company.registration_number') }}</small></label>
<h6><strong>{{ $account->profile->registration_number ?? null }}</strong></h6>
</div>
@if (isset($account->profile->registration_date))
<div class="form-group">
<label for="company"><small>Registration date</small></label>
<label for="company"><small>{{ trans('app.company.registration_date') }}</small></label>
<h6><strong>{{ Carbon\Carbon::parse($account->profile->registration_date)->format('d.m.Y') }}</strong></h6>
</div>
@endif
<div class="form-group">
<label for="company"><small>Registration agency</small></label>
<label for="company"><small>{{ trans('app.company.state_registration_agency') }}</small></label>
<h6><strong>{{ $account->profile->state_registration_agency ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration place</small></label>
<label for="company"><small>{{ trans('app.company.registration_place') }}</small></label>
<h6><strong>{{ $account->profile->registration_place ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration address</small></label>
<label for="company"><small>{{ trans('app.company.registration_address') }}</small></label>
<h6><strong>{{ $account->profile->registration_address ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Fond capital</small></label>
<label for="company"><small>{{ trans('app.last_updates.fond_capital') }}</small></label>
<h6><strong>{{ $account->profile->fond_capital ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Management types</small></label>
<label for="company"><small>{{ trans('app.last_updates.management_types') }}</small></label>
<h6><strong>{{ $account->profile->management_types ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Signers</small></label>
<label for="company"><small>{{ trans('app.last_updates.signers') }}</small></label>
<h6><strong>{{ $account->profile->signers ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Share holders</small></label>
<label for="company"><small>{{ trans('app.last_updates.share_holders') }}</small></label>
<h6><strong>{{ $account->profile->share_holders ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Organizational form</small></label>
<label for="company"><small>{{ trans('app.last_updates.organization_form') }}</small></label>
<h6><strong>{{ $account->profile->organizational_form ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Is agent?</small></label>
<label for="company"><small>{{ trans('app.last_updates.is_agent') }}</small></label>
<h6><strong>{{ $account->profile->is_agent ?? false }}</strong></h6>
</div>
@ -130,7 +130,7 @@
<svg style="width: 18px" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" />
</svg>&nbsp;
Applications
{{ trans('app.application.list_title') }}
<span class="badge badge-pill badge-secondary">{{ count($account->applications) }}</span>
</a>
</li>
@ -139,7 +139,7 @@
<svg style="width: 18px" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z" />
</svg>&nbsp;
Users
{{ trans('app.user.users') }}
<span class="badge badge-pill badge-secondary">{{ count($account->clients) }}</span>
</a>
</li>
@ -149,10 +149,10 @@
<table class="table table-responsive-sm table-striped mb-0">
<thead class="thead-light">
<tr>
<th>Status</th>
<th>State</th>
<th>Created at</th>
<th>Actions</th>
<th>{{ trans('app.ticket.status') }}</th>
<th>{{ trans('app.last_updates.state') }}</th>
<th>{{ trans('app.application.created_at') }}</th>
<th>{{ trans('app.last_updates.actions') }}</th>
</tr>
</thead>
<tbody>
@ -161,9 +161,9 @@
<td>
<div>
@if($application->status)
<div>Closed</div>
<div>{{ trans('app.last_updates.closed') }}</div>
@else
<div>Open</div>
<div>{{ trans('app.last_updates.open') }}</div>
@endif
</div>
</td>
@ -171,7 +171,7 @@
{{ $application->state }}
</td>
<td>
<div class="small text-muted"></div><strong>Registered: {{ Carbon\Carbon::parse($application->created_at)->format('M d Y') }}</strong>
<div class="small text-muted"></div><strong>{{ trans('app.company.registration_date') }}: {{ Carbon\Carbon::parse($application->created_at)->format('M d Y') }}</strong>
</td>
<td>
<a class="nav-link p-0" href="{{backpack_url('preview-application')}}/{{ $application->id }}">
@ -188,15 +188,15 @@
<div class="tab-pane" id="users" role="tabpanel">
<div class="mb-3">
<a href="{{backpack_url('create-account-client')}}/{{ $account->id }}" class="btn btn-primary">
Add new user
{{ trans('app.last_updates.add_new_user') }}
</a>
</div>
<table class="table table-responsive-sm table-striped mb-0">
<thead class="thead-light">
<tr>
<th>Full Name</th>
<th>Email</th>
<th>Registered at</th>
<th>{{ trans('app.last_updates.fullname') }}</th>
<th>{{ trans('app.client.email') }}</th>
<th>{{ trans('app.company.registration_date') }}</th>
</tr>
</thead>
<tbody>
@ -211,7 +211,7 @@
{{ $client->email }}
</td>
<td>
<div class="small text-muted"></div><strong>Registered: {{ Carbon\Carbon::parse($client->created_at)->format('M d Y') }}</strong>
<div class="small text-muted"></div><strong>{{ trans('app.company.registration_date') }}: {{ Carbon\Carbon::parse($client->created_at)->format('M d Y') }}</strong>
</td>
</tr>
@endforeach