|
|
@@ -4,6 +4,7 @@ namespace Lc\ShopBundle\Services\Order; |
|
|
|
|
|
|
|
use App\Entity\OrderProductReductionCatalog; |
|
|
|
use App\Entity\OrderShop; |
|
|
|
use App\Entity\OrderStatus; |
|
|
|
use Lc\ShopBundle\Context\DocumentInterface; |
|
|
|
use Lc\ShopBundle\Context\MerchantUtilsInterface; |
|
|
|
use Lc\ShopBundle\Context\OrderReductionCreditInterface; |
|
|
@@ -267,6 +268,7 @@ class OrderUtils |
|
|
|
$data['count'] = $this->countQuantities($order); |
|
|
|
$data['total_with_tax'] = $this->priceUtils->getTotalWithTax($order); |
|
|
|
$data['order_products_by_category'] = $this->getOrderProductsByParentCategory($order); |
|
|
|
$data['total_remaining_to_be_paid'] = $this->getTotalRemainingToBePaid($order) ; |
|
|
|
} |
|
|
|
return $data; |
|
|
|
} |
|
|
@@ -405,5 +407,30 @@ class OrderUtils |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public function addPayment($orderShop, $meanPayment, $amount) |
|
|
|
{ |
|
|
|
$this->createOrderPayment([ |
|
|
|
'orderShop' => $orderShop, |
|
|
|
'meanPayment' => $meanPayment, |
|
|
|
'amount' => $amount |
|
|
|
]) ; |
|
|
|
$this->em->refresh($orderShop) ; |
|
|
|
|
|
|
|
if($this->isOrderPaid($orderShop)) { |
|
|
|
$nextStatus = OrderStatus::ALIAS_PAID ; |
|
|
|
} |
|
|
|
else { |
|
|
|
$nextStatus = OrderStatus::ALIAS_PARTIAL_PAYMENT ; |
|
|
|
} |
|
|
|
|
|
|
|
if($orderShop->getOrderStatus()->getAlias() != $nextStatus) { |
|
|
|
$orderShop = $this->changeOrderStatus( |
|
|
|
$nextStatus, |
|
|
|
$orderShop |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
return $orderShop ; |
|
|
|
} |
|
|
|
|
|
|
|
} |