|
@@ -3,7 +3,9 @@
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
use App\Models\AppSession;
|
|
|
+use App\Models\Bill;
|
|
|
use App\Models\Client;
|
|
|
+use App\Models\Note;
|
|
|
use App\Models\ProTransaction;
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
@@ -55,6 +57,55 @@ class PracticeManagementController extends Controller
|
|
|
return view('app.practice-management.contract');
|
|
|
}
|
|
|
|
|
|
+ public function notes(Request $request, $filter = '')
|
|
|
+ {
|
|
|
+ $proID = $this->performer()->pro->id;
|
|
|
+ $query = Note::where('hcp_pro_id', $proID);
|
|
|
+ switch ($filter) {
|
|
|
+ case 'not-yet-signed':
|
|
|
+ $query = $query->where('is_signed_by_hcp', false);
|
|
|
+ break;
|
|
|
+
|
|
|
+ // more cases can be added as needed
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $notes = $query->orderBy('created_at', 'desc')->get();
|
|
|
+ return view('app.practice-management.notes', compact('notes', 'filter'));
|
|
|
+ }
|
|
|
+
|
|
|
+ public function bills(Request $request, $filter = '')
|
|
|
+ {
|
|
|
+ $proID = $this->performer()->pro->id;
|
|
|
+ $query = Bill::where('is_cancelled', false);
|
|
|
+ switch ($filter) {
|
|
|
+ case 'not-yet-signed':
|
|
|
+ $query = $query
|
|
|
+ ->where(function ($q) use($proID) {
|
|
|
+ $q->where(function ($q2) use ($proID) {
|
|
|
+ $q2->where('hcp_pro_id', $proID)->where('is_signed_by_hcp', false);
|
|
|
+ })
|
|
|
+ ->orWhere(function ($q2) use ($proID) {
|
|
|
+ $q2->where('cm_pro_id', $proID)->where('is_signed_by_cm', false);
|
|
|
+ })
|
|
|
+ ->orWhere(function ($q2) use ($proID) {
|
|
|
+ $q2->where('rme_pro_id', $proID)->where('is_signed_by_rme', false);
|
|
|
+ })
|
|
|
+ ->orWhere(function ($q2) use ($proID) {
|
|
|
+ $q2->where('rmm_pro_id', $proID)->where('is_signed_by_rmm', false);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ break;
|
|
|
+
|
|
|
+ // more cases can be added as needed
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $bills = $query->orderBy('created_at', 'desc')->get();
|
|
|
+ return view('app.practice-management.bills', compact('bills', 'filter'));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// video call page (RHS)
|
|
|
// generic call handle (no uid)
|
|
|
// specific call handle (uid of client)
|