Kaynağa Gözat

[Administration] Documents > Factures : gestion des paiements #1219

feature/souke
Guillaume Bourgeois 1 yıl önce
ebeveyn
işleme
52cb79be13
2 değiştirilmiş dosya ile 7 ekleme ve 2 silme
  1. +5
    -2
      common/logic/Order/Order/Repository/OrderRepository.php
  2. +2
    -0
      common/logic/Order/Order/Service/OrderSolver.php

+ 5
- 2
common/logic/Order/Order/Repository/OrderRepository.php Dosyayı Görüntüle

@@ -433,8 +433,11 @@ class OrderRepository extends AbstractRepository

public function isOrderPaid(Order $order): bool
{
if($this->orderSolver->getOrderAmount($order, Order::AMOUNT_PAID)
>= $this->orderSolver->getOrderAmountWithTax($order, Order::AMOUNT_TOTAL)) {
$amountPaid = $this->orderSolver->getOrderAmount($order, Order::AMOUNT_PAID);
$amountTotal = $this->orderSolver->getOrderAmountWithTax($order, Order::AMOUNT_TOTAL);

if(abs($amountPaid - $amountTotal) < 0.00001
|| $amountPaid >= $amountTotal) {
return true;
}


+ 2
- 0
common/logic/Order/Order/Service/OrderSolver.php Dosyayı Görüntüle

@@ -352,6 +352,8 @@ class OrderSolver extends AbstractService implements SolverInterface
$amount = $order->invoice_amount + $this->getOrderTotalVat($order, $type);
}

$amount = round($amount, 2);

return $this->_getAmountGeneric($order, $type, $amount, $format);
}


Yükleniyor…
İptal
Kaydet