From 59d4d4b25c9b7f05f96f1e394dad55ae3ea7dad4 Mon Sep 17 00:00:00 2001 From: ilmedova Date: Mon, 21 Nov 2022 14:35:38 +0500 Subject: [PATCH] preview account translated, contract resolution ok --- .../Controllers/API/ContractController.php | 27 +++++-- lang/en/app.php | 17 +++- resources/views/admin/preview.blade.php | 78 +++++++++---------- 3 files changed, 75 insertions(+), 47 deletions(-) diff --git a/app/Http/Controllers/API/ContractController.php b/app/Http/Controllers/API/ContractController.php index 9de247aa..030ec73b 100644 --- a/app/Http/Controllers/API/ContractController.php +++ b/app/Http/Controllers/API/ContractController.php @@ -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'; + } + } diff --git a/lang/en/app.php b/lang/en/app.php index a7053923..15668c85 100755 --- a/lang/en/app.php +++ b/lang/en/app.php @@ -187,6 +187,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' ] ]; diff --git a/resources/views/admin/preview.blade.php b/resources/views/admin/preview.blade.php index c6f2e1cc..211b8620 100644 --- a/resources/views/admin/preview.blade.php +++ b/resources/views/admin/preview.blade.php @@ -11,7 +11,7 @@ @@ -22,98 +22,98 @@
@if ($account->type == 'business')
- -
Entreprenuer
+ +
{{ trans('app.last_updates.enterpreneur') }}
- +
{{ $account->country->name ?? null }}
- +
{{ $account->profile->name ?? null }}
- +
{{ $account->profile->surname ?? null }}
- +
{{ $account->profile->patronomic_name ?? null }}
@if (isset($account->profile->date_of_birth))
- +
{{ Carbon\Carbon::parse($account->profile->date_of_birth)->format('d.m.Y') }}
@endif
- +
{{ $account->profile->birth_place ?? null }}
- +
{{ $account->profile->registration_address ?? null }}
@else
- -
Company
+ +
{{ trans('app.account.company') }}
- +
{{ $account->profile->name ?? null }}
- +
{{ $account->profile->short_name ?? null }}
- +
{{ $account->profile->registration_number ?? null }}
@if (isset($account->profile->registration_date))
- +
{{ Carbon\Carbon::parse($account->profile->registration_date)->format('d.m.Y') }}
@endif
- +
{{ $account->profile->state_registration_agency ?? null }}
- +
{{ $account->profile->registration_place ?? null }}
- +
{{ $account->profile->registration_address ?? null }}
- +
{{ $account->profile->fond_capital ?? null }}
- +
{{ $account->profile->management_types ?? null }}
- +
{{ $account->profile->signers ?? null }}
- +
{{ $account->profile->share_holders ?? null }}
- +
{{ $account->profile->organizational_form ?? null }}
- +
{{ $account->profile->is_agent ?? false }}
@@ -130,7 +130,7 @@   - Applications + {{ trans('app.application.list_title') }} {{ count($account->applications) }} @@ -139,7 +139,7 @@   - Users + {{ trans('app.user.users') }} {{ count($account->clients) }} @@ -149,10 +149,10 @@ - - - - + + + + @@ -161,9 +161,9 @@ @@ -171,7 +171,7 @@ {{ $application->state }}
StatusStateCreated atActions{{ trans('app.ticket.status') }}{{ trans('app.last_updates.state') }}{{ trans('app.application.created_at') }}{{ trans('app.last_updates.actions') }}
@if($application->status) -
Closed
+
{{ trans('app.last_updates.closed') }}
@else -
Open
+
{{ trans('app.last_updates.open') }}
@endif
-
Registered: {{ Carbon\Carbon::parse($application->created_at)->format('M d Y') }} +
{{ trans('app.company.registration_date') }}: {{ Carbon\Carbon::parse($application->created_at)->format('M d Y') }}
@@ -188,15 +188,15 @@
- - - + + + @@ -211,7 +211,7 @@ {{ $client->email }} @endforeach
Full NameEmailRegistered at{{ trans('app.last_updates.fullname') }}{{ trans('app.client.email') }}{{ trans('app.company.registration_date') }}
-
Registered: {{ Carbon\Carbon::parse($client->created_at)->format('M d Y') }} +
{{ trans('app.company.registration_date') }}: {{ Carbon\Carbon::parse($client->created_at)->format('M d Y') }}