performa invoice

This commit is contained in:
omair saleh
2021-11-28 21:29:59 +08:00
parent e4635187bc
commit 079eb628da
@@ -124,7 +124,7 @@ class CreateProformaInvoiceTransactionProcessor
->first();
$totalPayment = $booking->fix_currency_id === 1 ? $booking->transactions()->payments()->complete()->sum('original_amount') :
$booking->transactions()->payments()->selectRaw('sum(amount - service_charge - tax) as sub_total')->get()->sum('sub_total');
$booking->transactions()->payments()->whereNotIn('status', [ApprovalStatus::REJECTED, ApprovalStatus::SUSPENDED])->selectRaw('sum(amount - service_charge - tax) as sub_total')->get()->sum('sub_total');
$booking_currency_average_rate = $this->calculatesBookingPayableAmount->execute($booking, $booking->fix_currency_id) / $totalPayment;
dd($totalPayment);
$total_service_charge = $booking->transactions()