diff --git a/app/Classes/Modules/Bookings/Services/CalculatesBookingPaidAmount.php b/app/Classes/Modules/Bookings/Services/CalculatesBookingPaidAmount.php
index 42ce7589..d3f36916 100644
--- a/app/Classes/Modules/Bookings/Services/CalculatesBookingPaidAmount.php
+++ b/app/Classes/Modules/Bookings/Services/CalculatesBookingPaidAmount.php
@@ -15,4 +15,14 @@ class CalculatesBookingPaidAmount
return $booking->transactions()->payments()->complete()->sum('original_amount');
}
+ public function executeUntilDate(Booking $booking, Carbon $cutOffDate = null){
+ $amount = $booking->transactions()->payments()->complete();
+
+ if($cutOffDate){
+ $amount->where('created_at', '<=', $cutOffDate);
+ }
+
+ return $amount->sum('original_amount');
+ }
+
}
\ No newline at end of file
diff --git a/routes/web.php b/routes/web.php
index be760be6..521d91d1 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -1372,6 +1372,15 @@ Route::get('/maintenance', function () {
});
Route::get('/preview-unfinished-payment-orders', function (Request $request) {
+ $cutOffDate = $request->cut_off_date ?? null;
+
+ if ($cutOffDate) {
+ echo 'Cut Off Date: ' . $cutOffDate;
+ echo '
';
+
+ $cutOffDate = Carbon::parse($cutOffDate);
+ }
+
echo '
| Order Ref | @@ -1382,10 +1391,6 @@ Route::get('/preview-unfinished-payment-orders', function (Request $request) {Order Created Date |
|---|