|
|
|
|
|
|
|
|
$this->em->flush(); |
|
|
$this->em->flush(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function isOrderPaid($orderShop) |
|
|
|
|
|
|
|
|
public function isOrderPaid($order) |
|
|
{ |
|
|
{ |
|
|
if ($this->getTotalOrderPayments($orderShop) >= $this->priceUtils->getTotalWithTaxAndReduction($orderShop)) { |
|
|
|
|
|
|
|
|
if ($this->getTotalOrderPayments($order) >= $this->priceUtils->getTotalWithTaxAndReduction($order)) { |
|
|
return true; |
|
|
return true; |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
$order->changeStatusError[] = 'field.error.orderStatus.noPayment'; |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getTotalOrderPayments($orderShop): float |
|
|
|
|
|
|
|
|
public function getTotalOrderPayments($order): float |
|
|
{ |
|
|
{ |
|
|
$totalAmount = floatval(0); |
|
|
$totalAmount = floatval(0); |
|
|
foreach ($orderShop->getOrderPayments() as $orderPayment) { |
|
|
|
|
|
|
|
|
foreach ($order->getOrderPayments() as $orderPayment) { |
|
|
$totalAmount = $orderPayment->getAmount() + $totalAmount; |
|
|
$totalAmount = $orderPayment->getAmount() + $totalAmount; |
|
|
} |
|
|
} |
|
|
return $totalAmount; |
|
|
return $totalAmount; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function isCartAllowToBeOrder($order){ |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
} |
|
|
} |