|
@@ -777,9 +777,9 @@ WHERE
|
|
->count();
|
|
->count();
|
|
|
|
|
|
$reimbursement = [];
|
|
$reimbursement = [];
|
|
- $reimbursement["currentBalance"] = $performer->pro->balance;
|
|
|
|
|
|
+ $reimbursement["currentBalance"] = $this->performer->pro->balance;
|
|
$reimbursement["nextPaymentDate"] = '--';
|
|
$reimbursement["nextPaymentDate"] = '--';
|
|
- $lastPayment = ProTransaction::where('pro_id', $performerProID)->where('plus_or_minus', 'PLUS')->orderBy('created_at', 'DESC')->first();
|
|
|
|
|
|
+ $lastPayment = ProTransaction::where('pro_id', $this->performer->pro->id)->where('plus_or_minus', 'PLUS')->orderBy('created_at', 'DESC')->first();
|
|
if ($lastPayment) {
|
|
if ($lastPayment) {
|
|
$reimbursement["lastPayment"] = $lastPayment->amount;
|
|
$reimbursement["lastPayment"] = $lastPayment->amount;
|
|
$reimbursement["lastPaymentDate"] = $lastPayment->created_at;
|
|
$reimbursement["lastPaymentDate"] = $lastPayment->created_at;
|
|
@@ -1492,10 +1492,22 @@ ORDER BY cm.created_at DESC
|
|
return $clientQuery->where('default_na_pro_id', $myId);
|
|
return $clientQuery->where('default_na_pro_id', $myId);
|
|
})
|
|
})
|
|
->where('is_status_acknowledgement_from_appointment_pro_pending', true)
|
|
->where('is_status_acknowledgement_from_appointment_pro_pending', true)
|
|
- ->where('raw_date', '>=', DB::raw('NOW()'))
|
|
|
|
|
|
+ // ->where('raw_date', '>=', DB::raw('NOW()'))
|
|
->orderBy('raw_date', 'asc')
|
|
->orderBy('raw_date', 'asc')
|
|
->get();
|
|
->get();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public function getAppointmentsPendingStatusChangeAckAsRd() {
|
|
|
|
+ $myId = $this->id;
|
|
|
|
+ return Appointment::whereHas('client', function($clientQuery) use ($myId){
|
|
|
|
+ return $clientQuery->where('rd_pro_id', $myId);
|
|
|
|
+ })
|
|
|
|
+ ->where('is_status_acknowledgement_from_appointment_pro_pending', true)
|
|
|
|
+ // ->where('raw_date', '>=', DB::raw('NOW()'))
|
|
|
|
+ ->orderBy('raw_date', 'asc')
|
|
|
|
+ ->get();
|
|
|
|
+ }
|
|
|
|
+
|
|
public function getAppointmentsPendingDecisionAckAsDna() {
|
|
public function getAppointmentsPendingDecisionAckAsDna() {
|
|
$myId = $this->id;
|
|
$myId = $this->id;
|
|
return Appointment::whereHas('client', function($clientQuery) use ($myId){
|
|
return Appointment::whereHas('client', function($clientQuery) use ($myId){
|
|
@@ -1506,6 +1518,17 @@ ORDER BY cm.created_at DESC
|
|
->orderBy('raw_date', 'asc')
|
|
->orderBy('raw_date', 'asc')
|
|
->get();
|
|
->get();
|
|
}
|
|
}
|
|
|
|
+ public function getAppointmentsPendingDecisionAckAsRd() {
|
|
|
|
+ $myId = $this->id;
|
|
|
|
+ return Appointment::whereHas('client', function($clientQuery) use ($myId){
|
|
|
|
+ return $clientQuery->where('rd_pro_id', $myId);
|
|
|
|
+ })
|
|
|
|
+ ->where('is_decision_acknowledgement_from_appointment_pro_pending', true)
|
|
|
|
+ ->where('raw_date', '>=', DB::raw('NOW()'))
|
|
|
|
+ ->orderBy('raw_date', 'asc')
|
|
|
|
+ ->get();
|
|
|
|
+ }
|
|
|
|
+
|
|
public function getAppointmentsPendingTimeChangeAckAsDna() {
|
|
public function getAppointmentsPendingTimeChangeAckAsDna() {
|
|
$myId = $this->id;
|
|
$myId = $this->id;
|
|
return Appointment::whereHas('client', function($clientQuery) use ($myId){
|
|
return Appointment::whereHas('client', function($clientQuery) use ($myId){
|