|
@@ -2,6 +2,8 @@
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
+use DateTime;
|
|
|
+
|
|
|
use App\Models\Client;
|
|
|
use App\Models\Bill;
|
|
|
use App\Models\Note;
|
|
@@ -64,6 +66,23 @@ class HomeController extends Controller
|
|
|
$reimbursement["lastPaymentDate"] = '--';
|
|
|
}
|
|
|
|
|
|
+ //if today is < 15th, next payment is 15th, else nextPayment is
|
|
|
+ $today = strtotime(date('Y-m-d'));
|
|
|
+ $todayDate = date('j', $today);
|
|
|
+
|
|
|
+ $todayMonth = date('m', $today);
|
|
|
+ $todayYear = date('Y', $today);
|
|
|
+ if($todayDate < 15){
|
|
|
+ $nextPaymentDate = new DateTime();
|
|
|
+ $nextPaymentDate->setDate($todayYear, $todayMonth, 15);
|
|
|
+ $reimbursement['nextPaymentDate'] = $nextPaymentDate->format('m/d/Y');
|
|
|
+ }else{
|
|
|
+ $nextPaymentDate = new \DateTime();
|
|
|
+ $lastDayOfMonth = date('t', $today);
|
|
|
+ $nextPaymentDate->setDate($todayYear, $todayMonth, $lastDayOfMonth);
|
|
|
+ $reimbursement['nextPaymentDate'] = $nextPaymentDate->format('m/d/Y');;
|
|
|
+ }
|
|
|
+
|
|
|
$clientsWithAppointments = Client::where("mcp_pro_id", $performerProID)
|
|
|
->whereNotNull('next_mcp_appointment')->get();
|
|
|
|