fix bill seeder

This commit is contained in:
omair saleh
2022-02-22 01:15:53 +08:00
parent 38e744742b
commit 51eb0d54be
2 changed files with 3 additions and 2 deletions
@@ -12,7 +12,9 @@ class CalculatesBookingTransferredAmount
{
public function execute(Booking $booking){
return $booking->transactions()->bills()->complete()->sum('original_amount');
return $booking->transactions()->payments()->complete()->whereHas('transactions', function($query){
return $query->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
})->sum('original_amount');
}
}
@@ -109,7 +109,6 @@ class CreateInvoiceTransactionProcessor
}
$payable_amount = $this->calculatesBookingPayableAmount->execute($booking, $booking->fix_currency_id);
dd($payable_amount);
$booking_amount = $booking->fix_amount;
// confirm that booking amount has been fully paid