Procházet zdrojové kódy

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

feature/souke
Guillaume Bourgeois před 1 rokem
rodič
revize
52cb79be13
2 změnil soubory, kde provedl 7 přidání a 2 odebrání
  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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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);
}


Načítá se…
Zrušit
Uložit