fix myr fixed invoice bug

This commit is contained in:
omair saleh
2021-08-12 13:52:09 +08:00
parent 2c0b936ea2
commit 80bc4eb0fd
3 changed files with 12 additions and 12 deletions
@@ -108,16 +108,16 @@ class CreateInvoiceTransactionProcessor
return;
}
$payment_amount = $this->calculatesBookingPaidAmount->execute($booking, $booking->fix_currency_id);
$payable_amount = $this->calculatesBookingPayableAmount->execute($booking, $booking->fix_currency_id);
$booking_amount = $booking->fix_amount;
// confirm that booking amount has been fully paid
if (!(abs(((float) $booking_amount - (float) $payment_amount)/(float) $payment_amount) < 0.009)) {
if ((float) $booking_amount > $payable_amount) {
return;
}
// confirm that all payments has been transferred
if($this->calculatesBookingTransferredAmount->execute($booking) !== $this->calculatesBookingPayableAmount->execute($booking)){
if($this->calculatesBookingTransferredAmount->execute($booking) !== $this->calculatesBookingPaidAmount->execute($booking)){
return;
}
@@ -157,7 +157,7 @@ class CreateInvoiceTransactionProcessor
$transaction->receiver,
$transaction->recipient_bank_account_id,
$transaction->payment_method,
$payment_amount,
$payable_amount,
$booking_amount,
$transaction->currency_id,
$transaction->original_currency_id,
@@ -218,7 +218,7 @@ class CreateInvoiceTransactionProcessor
$transaction->receiver,
$transaction->recipient_bank_account_id,
$transaction->payment_method,
$payment_amount,
$payable_amount,
$booking_amount,
$transaction->currency_id,
$transaction->original_currency_id,