Răsfoiți Sursa

added company pros to the tree

= 4 ani în urmă
părinte
comite
b9fe28988b

+ 24 - 0
app/Http/Controllers/company_pros_Controller.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Auth;
+
+class company_pros_Controller extends Controller
+{
+    public $selfName = 'company_pros_Controller';
+    public $dashboardName = 'dashboard';
+
+	// GET /company_pros
+	public function index(Request $request) {
+		$records = DB::table('company_pro')->get();
+		return response()->view('admin/company_pros/index', compact('records'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+	}
+
+	// GET /company_pros/view/{uid}
+	public function view(Request $request, $uid) {
+		return redirect("/company_pros/view/$uid/SUB_dashboard");
+	}
+}

+ 63 - 0
app/Http/Controllers/company_pros_SINGLE_Controller.php

@@ -0,0 +1,63 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Auth;
+
+class company_pros_SINGLE_Controller extends Controller
+{
+    public $selfName = 'company_pros_SINGLE_Controller';
+    public $dashboardName = 'dashboard';
+
+	// GET /company_pros/view/{uid}/ACTION_deactivate
+	public function ACTION_deactivate(Request $request, $uid) {
+		$record = DB::table('company_pro')->where('uid', $uid)->first();
+		if(!$record) {
+			$record = DB::table('company_pro')->where('id', $uid)->first();
+			if($record) return redirect('/company_pros/view/' . $record->uid . '/ACTION_deactivate');
+		}
+		return response()->view('admin/company_pros_SINGLE/ACTION_deactivate', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+	}
+
+	// GET /company_pros/view/{uid}/ACTION_updateDeactivationMemo
+	public function ACTION_updateDeactivationMemo(Request $request, $uid) {
+		$record = DB::table('company_pro')->where('uid', $uid)->first();
+		if(!$record) {
+			$record = DB::table('company_pro')->where('id', $uid)->first();
+			if($record) return redirect('/company_pros/view/' . $record->uid . '/ACTION_updateDeactivationMemo');
+		}
+		return response()->view('admin/company_pros_SINGLE/ACTION_updateDeactivationMemo', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+	}
+
+	// GET /company_pros/view/{uid}/ACTION_reactivate
+	public function ACTION_reactivate(Request $request, $uid) {
+		$record = DB::table('company_pro')->where('uid', $uid)->first();
+		if(!$record) {
+			$record = DB::table('company_pro')->where('id', $uid)->first();
+			if($record) return redirect('/company_pros/view/' . $record->uid . '/ACTION_reactivate');
+		}
+		return response()->view('admin/company_pros_SINGLE/ACTION_reactivate', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+	}
+
+	// GET /company_pros/view/{uid}/ACTION_updateReactivationMemo
+	public function ACTION_updateReactivationMemo(Request $request, $uid) {
+		$record = DB::table('company_pro')->where('uid', $uid)->first();
+		if(!$record) {
+			$record = DB::table('company_pro')->where('id', $uid)->first();
+			if($record) return redirect('/company_pros/view/' . $record->uid . '/ACTION_updateReactivationMemo');
+		}
+		return response()->view('admin/company_pros_SINGLE/ACTION_updateReactivationMemo', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+	}
+
+	// GET /company_pros/view/{uid}/SUB_dashboard
+	public function SUB_dashboard(Request $request, $uid) {
+		$record = DB::table('company_pro')->where('uid', $uid)->first();
+		if(!$record) {
+			$record = DB::table('company_pro')->where('id', $uid)->first();
+			if($record) return redirect('/company_pros/view/' . $record->uid . '/SUB_dashboard');
+		}
+		return response()->view('admin/company_pros_SINGLE/SUB_dashboard', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+	}
+}

+ 21 - 0
app/Http/Controllers/pros_SINGLE_Controller.php

@@ -511,6 +511,27 @@ class pros_SINGLE_Controller extends Controller
 		return response()->view('admin/pros_SINGLE/SUB_note_templates', compact('record', 'subRecords', 'result_note_templates'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
 	}
 
+    public function SUB_companies(Request $request, $uid) {
+        $record = DB::table('pro')->where('uid', $uid)->first();
+        if(!$record) {
+            $record = DB::table('pro')->where('id', $uid)->first();
+            if($record) return redirect('/pros/view/' . $record->uid . '/companies');
+        }
+        $subRecords = DB::table('company_pro')->where('pro_id', $record->id)->get();
+        $result_companies = DB::select("select id, name from company");
+        return response()->view('admin/pros_SINGLE/SUB_companies', compact('record', 'subRecords', 'result_companies'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+    }
+
+    // GET /pros/view/{uid}/ACTION_add_company_template_pro
+    public function ACTION_add_new_company_pro(Request $request, $uid) {
+        $record = DB::table('pro')->where('uid', $uid)->first();
+        if(!$record) {
+            $record = DB::table('pro')->where('id', $uid)->first();
+            if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_add_new_company_pro');
+        }
+        return response()->view('admin/pros_SINGLE/ACTION_add_new_company_pro', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+    }
+
 	// GET /pros/view/{uid}/SUB_clients
 	public function SUB_clients(Request $request, $uid) {
 		$record = DB::table('pro')->where('uid', $uid)->first();

+ 21 - 0
generatecv/tree.txt

@@ -1139,6 +1139,14 @@ ADMIN
                 add_new:note_template_pro:create
                     proUid:hidden=uid
                     noteTemplateUid:record:note_template:uid,title
+            companies
+                id=company_pro.pro_id=>/company_pros/view/UID
+                !inc:company
+                !qry:companies:select id, name from company
+                !col:company:Company:~companies:name:id,=,$$company_id:all
+                add_new:company_pro:create
+                    proUid:hidden=uid
+                    companyUid:record:company:uid,name
             clients
             pro_access
                 id=pro_pro_access.owner_pro_id=>/pro_access/view/UID
@@ -1531,3 +1539,16 @@ ADMIN
             dashboard
             versions
                 id=product_version.product_id=>/products/view/UID
+    company_pros|company_pro|add|view|icon:tablet-alt
+    company_pros/view/{uid}
+        ACTIONS
+            deactivate
+                memo
+            updateDeactivationMemo
+                memo=deactivation_memo
+            reactivate
+                memo
+            updateReactivationMemo
+                memo=reactivation_memo
+        SUB
+            dashboard

+ 4 - 0
resources/views/admin/company_pros/actions.blade.php

@@ -0,0 +1,4 @@
+<a up-modal=".form-contents" up-preload up-delay="25" up-width="800" up-history="false" href='/company_pros/view/<?= $record->uid ?>/ACTION_deactivate?optimised=1' class='d-block btn btn-sm btn-default mb-3'>Deactivate</a>
+<a up-modal=".form-contents" up-preload up-delay="25" up-width="800" up-history="false" href='/company_pros/view/<?= $record->uid ?>/ACTION_updateDeactivationMemo?optimised=1' class='d-block btn btn-sm btn-default mb-3'>Update Deactivation Memo</a>
+<a up-modal=".form-contents" up-preload up-delay="25" up-width="800" up-history="false" href='/company_pros/view/<?= $record->uid ?>/ACTION_reactivate?optimised=1' class='d-block btn btn-sm btn-default mb-3'>Reactivate</a>
+<a up-modal=".form-contents" up-preload up-delay="25" up-width="800" up-history="false" href='/company_pros/view/<?= $record->uid ?>/ACTION_updateReactivationMemo?optimised=1' class='d-block btn btn-sm btn-default mb-3'>Update Reactivation Memo</a>

+ 52 - 0
resources/views/admin/company_pros/index.blade.php

@@ -0,0 +1,52 @@
+@extends('layouts.pro-logged-in')
+@section('content')
+
+    <h3 class="d-flex my-3 px-3 stag-heading stag-heading-index">
+        <div>Company Pros: List</div>
+        <div class="ml-auto">
+            
+        </div>
+    </h3>
+
+    <div class="table-responsive p-0 bg-white border stag-table stag-table-index">
+        <table class="table table-hover text-nowrap table-striped">
+            <thead>
+            <tr>
+<th>&nbsp;</th>
+<th>Pro Id</th>
+<th>Company Id</th>
+<th>Created At</th>
+<th>Created By Session Id</th>
+<th>Type</th>
+<th>Is Active</th>
+<th>Deactivated At</th>
+<th>Deactivated By Session Id</th>
+<th>Deactivation Memo</th>
+<th>Reactivated At</th>
+<th>Reactivated By Session Id</th>
+<th>Reactivation Memo</th>
+            </tr>
+            </thead>
+            <tbody>
+            @foreach($records as $record)
+                <tr>
+<td><a href="/company_pros/view/<?= $record->uid ?>"><i class="fas fa-share-square"></i></a></td>
+<td><?= $record->pro_id ?></td>
+<td><?= $record->company_id ?></td>
+<td><?= friendly_date_time($record->created_at) ?></td>
+<td><?= $record->created_by_session_id ?></td>
+<td><?= $record->type ?></td>
+<td><?= $record->is_active ?></td>
+<td><?= friendly_date_time($record->deactivated_at) ?></td>
+<td><?= $record->deactivated_by_session_id ?></td>
+<td><?= $record->deactivation_memo ?></td>
+<td><?= friendly_date_time($record->reactivated_at) ?></td>
+<td><?= $record->reactivated_by_session_id ?></td>
+<td><?= $record->reactivation_memo ?></td>
+                </tr>
+            @endforeach
+            </tbody>
+        </table>
+    </div>
+
+@endsection

+ 3 - 0
resources/views/admin/company_pros/info.blade.php

@@ -0,0 +1,3 @@
+<h4 class="d-flex my-3 px-3 stag-heading stag-heading-info">
+    <div>Company Pros: Single [<?= $record->uid ?>]</div>
+</h4>

+ 1 - 0
resources/views/admin/company_pros/subs.blade.php

@@ -0,0 +1 @@
+<a href='/company_pros/view/<?= $record->uid ?>/SUB_dashboard' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_dashboard' ? 'bg-secondary text-white font-weight-bold' : '' }}{{ strpos(request()->route()->getActionMethod(), 'ACTION_') === 0 ? 'bg-secondary text-white font-weight-bold' : '' }}'>Dashboard</a>

+ 20 - 0
resources/views/admin/company_pros/view.blade.php

@@ -0,0 +1,20 @@
+@extends('layouts.pro-logged-in')
+@section('content')
+
+    <div class="card rounded-0">
+        <div class="border-bottom bg-light">@include('admin/company_pros/info')</div>
+        <div class="d-flex align-items-stretch">
+            <div class="inner-side-nav">
+                <div class="border-right h-100">
+                    @include('admin/company_pros/subs')
+                </div>
+            </div>
+            <div class="flex-grow-1 px-3 pb-3 mb-3 inner-content">
+                <div>
+                    @yield('content-inner')
+                </div>
+            </div>
+        </div>
+    </div>
+
+@endsection

+ 41 - 0
resources/views/admin/company_pros_SINGLE/ACTION_deactivate.blade.php

@@ -0,0 +1,41 @@
+@extends('admin.company_pros.view')
+@section('content-inner')
+
+    <div class="form-contents"><div class="failed-form-contents">
+
+    <h4 class="d-flex m-0 p-3 stag-heading stag-heading-modal">
+        <div>Deactivate</div>
+        <div class="ml-auto">
+            <a class="text-secondary" href="#" up-close>
+                <i class="fa fa-times"></i>
+            </a>
+        </div>
+    </h4>
+
+    <form action="/post-to-api"
+          up-target="#main-content" up-history="false" up-fail-target=".failed-form-contents" up-reveal="false"
+          method="post" enctype="multipart/form-data"
+          class="border-top px-3 pt-3 pb-1 custom-submit">
+        @csrf
+
+        @if (session('message'))
+            <div class="alert alert-danger">{{ session('message') }}</div>
+        @endif
+
+        <input type="hidden" name="_uid" value="{{ $record->uid }}">
+        <input type="hidden" name="_api" value="/api/companyPro/deactivate">
+        <input type="hidden" name="_success" value="{{route('company_pros-view', ['uid' => $record->uid])}}">
+        <input type="hidden" name="_return" value="{{route('company_pros_SINGLE-ACTION_deactivate', ['uid' => $record->uid])}}">
+        <div class='form-group mb-3'>
+<label class='control-label'>Memo </label>
+<input class='form-control' type='text' name='memo' value='{{ old('memo') ? old('memo') : '' }}' >
+</div>
+        <div class="form-group mb-3 d-flex justify-content-center">
+            <button class="btn btn-sm btn-primary mr-3 px-5">Submit</button>
+            <a href="{{route('company_pros-view', ['uid' => $record->uid])}}" class="btn btn-sm btn-default px-5" up-close>Cancel</a>
+        </div>
+    </form>
+
+    </div></div>
+
+@endsection

+ 41 - 0
resources/views/admin/company_pros_SINGLE/ACTION_reactivate.blade.php

@@ -0,0 +1,41 @@
+@extends('admin.company_pros.view')
+@section('content-inner')
+
+    <div class="form-contents"><div class="failed-form-contents">
+
+    <h4 class="d-flex m-0 p-3 stag-heading stag-heading-modal">
+        <div>Reactivate</div>
+        <div class="ml-auto">
+            <a class="text-secondary" href="#" up-close>
+                <i class="fa fa-times"></i>
+            </a>
+        </div>
+    </h4>
+
+    <form action="/post-to-api"
+          up-target="#main-content" up-history="false" up-fail-target=".failed-form-contents" up-reveal="false"
+          method="post" enctype="multipart/form-data"
+          class="border-top px-3 pt-3 pb-1 custom-submit">
+        @csrf
+
+        @if (session('message'))
+            <div class="alert alert-danger">{{ session('message') }}</div>
+        @endif
+
+        <input type="hidden" name="_uid" value="{{ $record->uid }}">
+        <input type="hidden" name="_api" value="/api/companyPro/reactivate">
+        <input type="hidden" name="_success" value="{{route('company_pros-view', ['uid' => $record->uid])}}">
+        <input type="hidden" name="_return" value="{{route('company_pros_SINGLE-ACTION_reactivate', ['uid' => $record->uid])}}">
+        <div class='form-group mb-3'>
+<label class='control-label'>Memo </label>
+<input class='form-control' type='text' name='memo' value='{{ old('memo') ? old('memo') : '' }}' >
+</div>
+        <div class="form-group mb-3 d-flex justify-content-center">
+            <button class="btn btn-sm btn-primary mr-3 px-5">Submit</button>
+            <a href="{{route('company_pros-view', ['uid' => $record->uid])}}" class="btn btn-sm btn-default px-5" up-close>Cancel</a>
+        </div>
+    </form>
+
+    </div></div>
+
+@endsection

+ 41 - 0
resources/views/admin/company_pros_SINGLE/ACTION_updateDeactivationMemo.blade.php

@@ -0,0 +1,41 @@
+@extends('admin.company_pros.view')
+@section('content-inner')
+
+    <div class="form-contents"><div class="failed-form-contents">
+
+    <h4 class="d-flex m-0 p-3 stag-heading stag-heading-modal">
+        <div>Update Deactivation Memo</div>
+        <div class="ml-auto">
+            <a class="text-secondary" href="#" up-close>
+                <i class="fa fa-times"></i>
+            </a>
+        </div>
+    </h4>
+
+    <form action="/post-to-api"
+          up-target="#main-content" up-history="false" up-fail-target=".failed-form-contents" up-reveal="false"
+          method="post" enctype="multipart/form-data"
+          class="border-top px-3 pt-3 pb-1 custom-submit">
+        @csrf
+
+        @if (session('message'))
+            <div class="alert alert-danger">{{ session('message') }}</div>
+        @endif
+
+        <input type="hidden" name="_uid" value="{{ $record->uid }}">
+        <input type="hidden" name="_api" value="/api/companyPro/updateDeactivationMemo">
+        <input type="hidden" name="_success" value="{{route('company_pros-view', ['uid' => $record->uid])}}">
+        <input type="hidden" name="_return" value="{{route('company_pros_SINGLE-ACTION_updateDeactivationMemo', ['uid' => $record->uid])}}">
+        <div class='form-group mb-3'>
+<label class='control-label'>Memo </label>
+<input class='form-control' type='text' name='memo' value='{{ old('memo') ? old('memo') : $record->deactivation_memo }}' >
+</div>
+        <div class="form-group mb-3 d-flex justify-content-center">
+            <button class="btn btn-sm btn-primary mr-3 px-5">Submit</button>
+            <a href="{{route('company_pros-view', ['uid' => $record->uid])}}" class="btn btn-sm btn-default px-5" up-close>Cancel</a>
+        </div>
+    </form>
+
+    </div></div>
+
+@endsection

+ 41 - 0
resources/views/admin/company_pros_SINGLE/ACTION_updateReactivationMemo.blade.php

@@ -0,0 +1,41 @@
+@extends('admin.company_pros.view')
+@section('content-inner')
+
+    <div class="form-contents"><div class="failed-form-contents">
+
+    <h4 class="d-flex m-0 p-3 stag-heading stag-heading-modal">
+        <div>Update Reactivation Memo</div>
+        <div class="ml-auto">
+            <a class="text-secondary" href="#" up-close>
+                <i class="fa fa-times"></i>
+            </a>
+        </div>
+    </h4>
+
+    <form action="/post-to-api"
+          up-target="#main-content" up-history="false" up-fail-target=".failed-form-contents" up-reveal="false"
+          method="post" enctype="multipart/form-data"
+          class="border-top px-3 pt-3 pb-1 custom-submit">
+        @csrf
+
+        @if (session('message'))
+            <div class="alert alert-danger">{{ session('message') }}</div>
+        @endif
+
+        <input type="hidden" name="_uid" value="{{ $record->uid }}">
+        <input type="hidden" name="_api" value="/api/companyPro/updateReactivationMemo">
+        <input type="hidden" name="_success" value="{{route('company_pros-view', ['uid' => $record->uid])}}">
+        <input type="hidden" name="_return" value="{{route('company_pros_SINGLE-ACTION_updateReactivationMemo', ['uid' => $record->uid])}}">
+        <div class='form-group mb-3'>
+<label class='control-label'>Memo </label>
+<input class='form-control' type='text' name='memo' value='{{ old('memo') ? old('memo') : $record->reactivation_memo }}' >
+</div>
+        <div class="form-group mb-3 d-flex justify-content-center">
+            <button class="btn btn-sm btn-primary mr-3 px-5">Submit</button>
+            <a href="{{route('company_pros-view', ['uid' => $record->uid])}}" class="btn btn-sm btn-default px-5" up-close>Cancel</a>
+        </div>
+    </form>
+
+    </div></div>
+
+@endsection

+ 41 - 0
resources/views/admin/company_pros_SINGLE/SUB_dashboard.blade.php

@@ -0,0 +1,41 @@
+@extends('admin.company_pros.view')
+@section('content-inner')
+
+    <div class="row mt-3">
+    <div class="col-8">
+
+        <div class="table-responsive p-0 bg-white table-sm stag-table border-top">
+            <table class="table table-hover text-nowrap table-striped border-left border-right border-bottom">
+                <thead>
+                <tr>
+                    <th colspan="2" class="px-2">Record Details</th>
+                </tr>
+                </thead>
+                <tbody>
+                <?php foreach($record as $k => $v): ?>
+                    <?php
+                    if($k === 'id' || $k === 'uid') continue;
+                    $displayValue = $record->$k;
+                    if(substr($k, -3) === '_at') {
+                        $displayValue = friendly_date_time($record->$k);
+                    }
+                    ?>
+                    <tr>
+                        <td class="px-2 text-secondary border-right w-50">{{ ucwords(str_replace("_", " ", $k)) }}</td>
+                        <td class="px-2 font-weight-bold w-50">{{ $displayValue }}</td>
+                    </tr>
+                <?php endforeach; ?>
+                </tbody>
+            </table>
+        </div>
+
+    </div>
+    <div class="col-4">
+        <div class="border-left h-100 pl-3">
+            @include('admin/company_pros/actions')
+        </div>
+    </div>
+</div>
+
+
+@endsection

+ 1 - 0
resources/views/admin/pros/subs.blade.php

@@ -1,6 +1,7 @@
 <a href='/pros/view/<?= $record->uid ?>/SUB_dashboard' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_dashboard' ? 'bg-secondary text-white font-weight-bold' : '' }}{{ strpos(request()->route()->getActionMethod(), 'ACTION_') === 0 ? 'bg-secondary text-white font-weight-bold' : '' }}'>Dashboard</a>
 <a href='/pros/view/<?= $record->uid ?>/SUB_pro_rates' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_pro_rates' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Pro Rates</a>
 <a href='/pros/view/<?= $record->uid ?>/SUB_note_templates' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_note_templates' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Note Templates</a>
+<a href='/pros/view/<?= $record->uid ?>/SUB_companies' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_companies' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Companies</a>
 <a href='/pros/view/<?= $record->uid ?>/SUB_clients' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_clients' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Clients</a>
 <a href='/pros/view/<?= $record->uid ?>/SUB_pro_access' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_pro_access' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Pro Access</a>
 <a href='/pros/view/<?= $record->uid ?>/SUB_mcp_updates' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_mcp_updates' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Mcp Updates</a>

+ 48 - 0
resources/views/admin/pros_SINGLE/ACTION_add_new_company_pro.blade.php

@@ -0,0 +1,48 @@
+@extends('admin.pros.view')
+@section('content-inner')
+
+    <div class="form-contents"><div class="failed-form-contents">
+
+    <h4 class="d-flex m-0 p-3 stag-heading stag-heading-modal">
+        <div>Add New Company Pro</div>
+        <div class="ml-auto">
+            <a class="text-secondary" href="#" up-close>
+                <i class="fa fa-times"></i>
+            </a>
+        </div>
+    </h4>
+
+    <form action="/post-to-api"
+          up-target="#main-content" up-history="false" up-fail-target=".failed-form-contents" up-reveal="false"
+          method="post" enctype="multipart/form-data"
+          class="border-top px-3 pt-3 pb-1 custom-submit">
+        @csrf
+
+        @if (session('message'))
+            <div class="alert alert-danger">{{ session('message') }}</div>
+        @endif
+
+        <input type="hidden" name="_uid" value="{{ $record->uid }}">
+        <input type="hidden" name="_api" value="/api/companyPro/create">
+        <input type="hidden" name="_success" value="{{route('pros_SINGLE-SUB_companies', ['uid' => $record->uid])}}">
+        <input type="hidden" name="_return" value="{{route('pros_SINGLE-ACTION_add_new_company_pro', ['uid' => $record->uid])}}">
+        <input class='form-control' type='hidden' name='proUid' value='{{ old('proUid') ? old('proUid') : $record->uid }}' >
+<div class='form-group mb-3'>
+<label class='control-label'>Company </label>
+<select class='form-control' name='companyUid' value='{{ old('companyUid') ? old('companyUid') : '' }}' >
+<option value=''>-- Select --</option>
+<?php $dbOptions = \Illuminate\Support\Facades\DB::table('company')->get(); ?>
+<?php foreach($dbOptions as $o): ?>
+<option <?= $o->uid === (old('companyUid') ? old('companyUid') : '') ? 'selected' : '' ?> value='<?= $o->uid ?>'><?= $o->name ?> (<?= $o->uid ?>)</option>
+<?php endforeach; ?>
+</select>
+</div>
+        <div class="form-group mb-3 d-flex justify-content-center">
+            <button class="btn btn-sm btn-primary mr-3 px-5">Submit</button>
+            <a href="{{route('pros_SINGLE-SUB_companies', ['uid' => $record->uid])}}" class="btn btn-sm btn-default px-5" up-close>Cancel</a>
+        </div>
+    </form>
+
+    </div></div>
+
+@endsection

+ 34 - 0
resources/views/admin/pros_SINGLE/SUB_companies.blade.php

@@ -0,0 +1,34 @@
+@extends('admin.pros.view')
+@section('content-inner')
+
+    <div class="pb-3">
+
+        <h5 class='my-3 d-flex stag-heading stag-heading-sub'>
+            <div>Companies</div>
+            <div class="ml-auto">
+                <a class="btn btn-primary btn-sm ml-2" up-modal=".form-contents" up-preload up-delay="25" up-width="800" up-history="false" href="{{route('pros_SINGLE-ACTION_add_new_company_pro', ['uid' => $record->uid])}}?optimised=1"><i class='fa fa-plus-circle' aria-hidden='true'></i> Add New</a>
+            </div>
+        </h5>
+
+        <div class="table-responsive p-0 bg-white border stag-table stag-table-sub">
+            <table class="table table-hover text-nowrap">
+                <thead>
+                <tr>
+                    <th>&nbsp;</th>
+<th>Company</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($subRecords as $subRecord)
+                    <tr>
+                        <td><a href="/company_pros/view/{{ $subRecord->uid }}"><i class="fas fa-share-square"></i></a></td>
+<td><?= value_from_rs($result_companies, 'name', [['id', '=', $subRecord->company_id], ], 'all'); ?></td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+
+    </div>
+
+@endsection

+ 7 - 0
resources/views/layouts/generated-links.blade.php

@@ -277,3 +277,10 @@
 		<p>Products</p>
 	</a>
 </li>
+
+<li class='nav-item'>
+	<a href='/company_pros' class='nav-link {{ (isset(request()->route()->getController()->selfName) && strpos(request()->route()->getController()->selfName, 'company_pros') === 0 ? 'active' : '') }} '>
+		<i class='nav-icon fa fa-tablet-alt'></i>
+		<p>Company Pros</p>
+	</a>
+</li>

+ 26 - 4
resources/views/pro/care_months_SINGLE/SUB_bills.blade.php

@@ -37,7 +37,7 @@
 <th>Is Signed By Rme</th>
 <th>Is Signed By Rmm</th>
 <th>Is Submitted</th>
-<th>Marked Cancelled At</th>
+<th>Cancelled At</th>
 <th>Marked Submitted At</th>
 <th>Memo</th>
 <th>Modifier</th>
@@ -64,7 +64,7 @@
 <th>Cm Pro Id</th>
 <th>Hcp Payment Pro Transaction Id</th>
 <th>Hcp Pro Id</th>
-<th>Marked Cancelled By Session Id</th>
+<th>Cancelled By Session Id</th>
 <th>Marked Submitted By Session Id</th>
 <th>Na Payment Pro Transaction Id</th>
 <th>Na Pro Id</th>
@@ -95,6 +95,17 @@
 <th>Rmg Payment Amount</th>
 <th>Rms Payment Pro Transaction Id</th>
 <th>Rmg Payment Pro Transaction Id</th>
+<th>Balance Post Date</th>
+<th>Is Verified</th>
+<th>Marked Verified At</th>
+<th>Marked Verified By Session Id</th>
+<th>Is Cancellation Acknowledged</th>
+<th>Cancellation Acknowledged At</th>
+<th>Cancellation Acknowledged By Session Id</th>
+<th>Cancellation Memo</th>
+<th>Is Cancelled By Administrator</th>
+<th>Total Expected</th>
+<th>Total Paid</th>
                 </tr>
                 </thead>
                 <tbody>
@@ -123,7 +134,7 @@
 <td><?= $subRecord->is_signed_by_rme ?></td>
 <td><?= $subRecord->is_signed_by_rmm ?></td>
 <td><?= $subRecord->is_submitted ?></td>
-<td><?= friendly_date_time($subRecord->marked_cancelled_at) ?></td>
+<td><?= friendly_date_time($subRecord->cancelled_at) ?></td>
 <td><?= friendly_date_time($subRecord->marked_submitted_at) ?></td>
 <td><?= $subRecord->memo ?></td>
 <td><?= $subRecord->modifier ?></td>
@@ -150,7 +161,7 @@
 <td><?= $subRecord->cm_pro_id ?></td>
 <td><?= $subRecord->hcp_payment_pro_transaction_id ?></td>
 <td><?= $subRecord->hcp_pro_id ?></td>
-<td><?= $subRecord->marked_cancelled_by_session_id ?></td>
+<td><?= $subRecord->cancelled_by_session_id ?></td>
 <td><?= $subRecord->marked_submitted_by_session_id ?></td>
 <td><?= $subRecord->na_payment_pro_transaction_id ?></td>
 <td><?= $subRecord->na_pro_id ?></td>
@@ -181,6 +192,17 @@
 <td><?= $subRecord->rmg_payment_amount ?></td>
 <td><?= $subRecord->rms_payment_pro_transaction_id ?></td>
 <td><?= $subRecord->rmg_payment_pro_transaction_id ?></td>
+<td><?= $subRecord->balance_post_date ?></td>
+<td><?= $subRecord->is_verified ?></td>
+<td><?= friendly_date_time($subRecord->marked_verified_at) ?></td>
+<td><?= $subRecord->marked_verified_by_session_id ?></td>
+<td><?= $subRecord->is_cancellation_acknowledged ?></td>
+<td><?= friendly_date_time($subRecord->cancellation_acknowledged_at) ?></td>
+<td><?= $subRecord->cancellation_acknowledged_by_session_id ?></td>
+<td><?= $subRecord->cancellation_memo ?></td>
+<td><?= $subRecord->is_cancelled_by_administrator ?></td>
+<td><?= $subRecord->total_expected ?></td>
+<td><?= $subRecord->total_paid ?></td>
                     </tr>
                 @endforeach
                 </tbody>

+ 26 - 4
resources/views/pro/clients_SINGLE/SUB_bills.blade.php

@@ -37,7 +37,7 @@
 <th>Is Signed By Rme</th>
 <th>Is Signed By Rmm</th>
 <th>Is Submitted</th>
-<th>Marked Cancelled At</th>
+<th>Cancelled At</th>
 <th>Marked Submitted At</th>
 <th>Memo</th>
 <th>Modifier</th>
@@ -64,7 +64,7 @@
 <th>Cm Pro Id</th>
 <th>Hcp Payment Pro Transaction Id</th>
 <th>Hcp Pro Id</th>
-<th>Marked Cancelled By Session Id</th>
+<th>Cancelled By Session Id</th>
 <th>Marked Submitted By Session Id</th>
 <th>Na Payment Pro Transaction Id</th>
 <th>Na Pro Id</th>
@@ -95,6 +95,17 @@
 <th>Rmg Payment Amount</th>
 <th>Rms Payment Pro Transaction Id</th>
 <th>Rmg Payment Pro Transaction Id</th>
+<th>Balance Post Date</th>
+<th>Is Verified</th>
+<th>Marked Verified At</th>
+<th>Marked Verified By Session Id</th>
+<th>Is Cancellation Acknowledged</th>
+<th>Cancellation Acknowledged At</th>
+<th>Cancellation Acknowledged By Session Id</th>
+<th>Cancellation Memo</th>
+<th>Is Cancelled By Administrator</th>
+<th>Total Expected</th>
+<th>Total Paid</th>
                 </tr>
                 </thead>
                 <tbody>
@@ -123,7 +134,7 @@
 <td><?= $subRecord->is_signed_by_rme ?></td>
 <td><?= $subRecord->is_signed_by_rmm ?></td>
 <td><?= $subRecord->is_submitted ?></td>
-<td><?= friendly_date_time($subRecord->marked_cancelled_at) ?></td>
+<td><?= friendly_date_time($subRecord->cancelled_at) ?></td>
 <td><?= friendly_date_time($subRecord->marked_submitted_at) ?></td>
 <td><?= $subRecord->memo ?></td>
 <td><?= $subRecord->modifier ?></td>
@@ -150,7 +161,7 @@
 <td><?= $subRecord->cm_pro_id ?></td>
 <td><?= $subRecord->hcp_payment_pro_transaction_id ?></td>
 <td><?= $subRecord->hcp_pro_id ?></td>
-<td><?= $subRecord->marked_cancelled_by_session_id ?></td>
+<td><?= $subRecord->cancelled_by_session_id ?></td>
 <td><?= $subRecord->marked_submitted_by_session_id ?></td>
 <td><?= $subRecord->na_payment_pro_transaction_id ?></td>
 <td><?= $subRecord->na_pro_id ?></td>
@@ -181,6 +192,17 @@
 <td><?= $subRecord->rmg_payment_amount ?></td>
 <td><?= $subRecord->rms_payment_pro_transaction_id ?></td>
 <td><?= $subRecord->rmg_payment_pro_transaction_id ?></td>
+<td><?= $subRecord->balance_post_date ?></td>
+<td><?= $subRecord->is_verified ?></td>
+<td><?= friendly_date_time($subRecord->marked_verified_at) ?></td>
+<td><?= $subRecord->marked_verified_by_session_id ?></td>
+<td><?= $subRecord->is_cancellation_acknowledged ?></td>
+<td><?= friendly_date_time($subRecord->cancellation_acknowledged_at) ?></td>
+<td><?= $subRecord->cancellation_acknowledged_by_session_id ?></td>
+<td><?= $subRecord->cancellation_memo ?></td>
+<td><?= $subRecord->is_cancelled_by_administrator ?></td>
+<td><?= $subRecord->total_expected ?></td>
+<td><?= $subRecord->total_paid ?></td>
                     </tr>
                 @endforeach
                 </tbody>

+ 26 - 4
resources/views/pro/notes_SINGLE/SUB_bills.blade.php

@@ -37,7 +37,7 @@
 <th>Is Signed By Rme</th>
 <th>Is Signed By Rmm</th>
 <th>Is Submitted</th>
-<th>Marked Cancelled At</th>
+<th>Cancelled At</th>
 <th>Marked Submitted At</th>
 <th>Memo</th>
 <th>Modifier</th>
@@ -64,7 +64,7 @@
 <th>Cm Pro Id</th>
 <th>Hcp Payment Pro Transaction Id</th>
 <th>Hcp Pro Id</th>
-<th>Marked Cancelled By Session Id</th>
+<th>Cancelled By Session Id</th>
 <th>Marked Submitted By Session Id</th>
 <th>Na Payment Pro Transaction Id</th>
 <th>Na Pro Id</th>
@@ -95,6 +95,17 @@
 <th>Rmg Payment Amount</th>
 <th>Rms Payment Pro Transaction Id</th>
 <th>Rmg Payment Pro Transaction Id</th>
+<th>Balance Post Date</th>
+<th>Is Verified</th>
+<th>Marked Verified At</th>
+<th>Marked Verified By Session Id</th>
+<th>Is Cancellation Acknowledged</th>
+<th>Cancellation Acknowledged At</th>
+<th>Cancellation Acknowledged By Session Id</th>
+<th>Cancellation Memo</th>
+<th>Is Cancelled By Administrator</th>
+<th>Total Expected</th>
+<th>Total Paid</th>
                 </tr>
                 </thead>
                 <tbody>
@@ -123,7 +134,7 @@
 <td><?= $subRecord->is_signed_by_rme ?></td>
 <td><?= $subRecord->is_signed_by_rmm ?></td>
 <td><?= $subRecord->is_submitted ?></td>
-<td><?= friendly_date_time($subRecord->marked_cancelled_at) ?></td>
+<td><?= friendly_date_time($subRecord->cancelled_at) ?></td>
 <td><?= friendly_date_time($subRecord->marked_submitted_at) ?></td>
 <td><?= $subRecord->memo ?></td>
 <td><?= $subRecord->modifier ?></td>
@@ -150,7 +161,7 @@
 <td><?= $subRecord->cm_pro_id ?></td>
 <td><?= $subRecord->hcp_payment_pro_transaction_id ?></td>
 <td><?= $subRecord->hcp_pro_id ?></td>
-<td><?= $subRecord->marked_cancelled_by_session_id ?></td>
+<td><?= $subRecord->cancelled_by_session_id ?></td>
 <td><?= $subRecord->marked_submitted_by_session_id ?></td>
 <td><?= $subRecord->na_payment_pro_transaction_id ?></td>
 <td><?= $subRecord->na_pro_id ?></td>
@@ -181,6 +192,17 @@
 <td><?= $subRecord->rmg_payment_amount ?></td>
 <td><?= $subRecord->rms_payment_pro_transaction_id ?></td>
 <td><?= $subRecord->rmg_payment_pro_transaction_id ?></td>
+<td><?= $subRecord->balance_post_date ?></td>
+<td><?= $subRecord->is_verified ?></td>
+<td><?= friendly_date_time($subRecord->marked_verified_at) ?></td>
+<td><?= $subRecord->marked_verified_by_session_id ?></td>
+<td><?= $subRecord->is_cancellation_acknowledged ?></td>
+<td><?= friendly_date_time($subRecord->cancellation_acknowledged_at) ?></td>
+<td><?= $subRecord->cancellation_acknowledged_by_session_id ?></td>
+<td><?= $subRecord->cancellation_memo ?></td>
+<td><?= $subRecord->is_cancelled_by_administrator ?></td>
+<td><?= $subRecord->total_expected ?></td>
+<td><?= $subRecord->total_paid ?></td>
                     </tr>
                 @endforeach
                 </tbody>

+ 22 - 5
routes/generated.php

@@ -412,6 +412,7 @@ Route::prefix('/pros/view/{uid}')->group(function () {
 	Route::get('SUB_dashboard', 'pros_SINGLE_Controller@SUB_dashboard')->name('pros_SINGLE-SUB_dashboard');
 	Route::get('SUB_pro_rates', 'pros_SINGLE_Controller@SUB_pro_rates')->name('pros_SINGLE-SUB_pro_rates');
 	Route::get('SUB_note_templates', 'pros_SINGLE_Controller@SUB_note_templates')->name('pros_SINGLE-SUB_note_templates');
+	Route::get('SUB_companies', 'pros_SINGLE_Controller@SUB_companies')->name('pros_SINGLE-SUB_companies');
 	Route::get('SUB_clients', 'pros_SINGLE_Controller@SUB_clients')->name('pros_SINGLE-SUB_clients');
 	Route::get('SUB_pro_access', 'pros_SINGLE_Controller@SUB_pro_access')->name('pros_SINGLE-SUB_pro_access');
 	Route::get('SUB_mcp_updates', 'pros_SINGLE_Controller@SUB_mcp_updates')->name('pros_SINGLE-SUB_mcp_updates');
@@ -427,6 +428,7 @@ Route::prefix('/pros/view/{uid}')->group(function () {
 	Route::get('SUB_audit_log', 'pros_SINGLE_Controller@SUB_audit_log')->name('pros_SINGLE-SUB_audit_log');
 	Route::get('ACTION_add_new_pro_rate', 'pros_SINGLE_Controller@ACTION_add_new_pro_rate')->name('pros_SINGLE-ACTION_add_new_pro_rate');
 	Route::get('ACTION_add_new_note_template_pro', 'pros_SINGLE_Controller@ACTION_add_new_note_template_pro')->name('pros_SINGLE-ACTION_add_new_note_template_pro');
+	Route::get('ACTION_add_new_company_pro', 'pros_SINGLE_Controller@ACTION_add_new_company_pro')->name('pros_SINGLE-ACTION_add_new_company_pro');
 	Route::get('ACTION_add_new_pro_pro_access', 'pros_SINGLE_Controller@ACTION_add_new_pro_pro_access')->name('pros_SINGLE-ACTION_add_new_pro_pro_access');
 	Route::get('ACTION_add_new_credit_pro_transaction', 'pros_SINGLE_Controller@ACTION_add_new_credit_pro_transaction')->name('pros_SINGLE-ACTION_add_new_credit_pro_transaction');
 	Route::get('ACTION_add_new_debit_pro_transaction', 'pros_SINGLE_Controller@ACTION_add_new_debit_pro_transaction')->name('pros_SINGLE-ACTION_add_new_debit_pro_transaction');
@@ -707,6 +709,13 @@ Route::prefix('/account_clients/view/{uid}')->group(function () {
 	Route::get('SUB_dashboard', 'account_clients_SINGLE_Controller@SUB_dashboard')->name('account_clients_SINGLE-SUB_dashboard');
 });
 
+// --- admin: products --- //
+Route::prefix('/products')->group(function () {
+	Route::get('', 'products_Controller@index')->name('products-index');
+	Route::get('add_new', 'products_Controller@add_new')->name('products-add_new');
+	Route::get('view/{uid}', 'products_Controller@view')->name('products-view');
+});
+
 // --- admin: products_SINGLE --- //
 Route::prefix('/products/view/{uid}')->group(function () {
 	Route::get('ACTION_update', 'products_SINGLE_Controller@ACTION_update')->name('products_SINGLE-ACTION_update');
@@ -718,9 +727,17 @@ Route::prefix('/products/view/{uid}')->group(function () {
 	Route::get('SUB_versions', 'products_SINGLE_Controller@SUB_versions')->name('products_SINGLE-SUB_versions');
 });
 
-// --- admin: products --- //
-Route::prefix('/products')->group(function () {
-	Route::get('', 'products_Controller@index')->name('products-index');
-	Route::get('add_new', 'products_Controller@add_new')->name('products-add_new');
-	Route::get('view/{uid}', 'products_Controller@view')->name('products-view');
+// --- admin: company_pros_SINGLE --- //
+Route::prefix('/company_pros/view/{uid}')->group(function () {
+	Route::get('ACTION_deactivate', 'company_pros_SINGLE_Controller@ACTION_deactivate')->name('company_pros_SINGLE-ACTION_deactivate');
+	Route::get('ACTION_updateDeactivationMemo', 'company_pros_SINGLE_Controller@ACTION_updateDeactivationMemo')->name('company_pros_SINGLE-ACTION_updateDeactivationMemo');
+	Route::get('ACTION_reactivate', 'company_pros_SINGLE_Controller@ACTION_reactivate')->name('company_pros_SINGLE-ACTION_reactivate');
+	Route::get('ACTION_updateReactivationMemo', 'company_pros_SINGLE_Controller@ACTION_updateReactivationMemo')->name('company_pros_SINGLE-ACTION_updateReactivationMemo');
+	Route::get('SUB_dashboard', 'company_pros_SINGLE_Controller@SUB_dashboard')->name('company_pros_SINGLE-SUB_dashboard');
+});
+
+// --- admin: company_pros --- //
+Route::prefix('/company_pros')->group(function () {
+	Route::get('', 'company_pros_Controller@index')->name('company_pros-index');
+	Route::get('view/{uid}', 'company_pros_Controller@view')->name('company_pros-view');
 });